procedure AtoB(a: byte; var b: byte);
begin asm
PUSH AX { store AX }
MOV DI, [BP+4] { store offset of b in DI }
MOV ES, [BP+2] { store segment of b in ES }
MOV AX, [BP+8] { store a in AX }
MOV [DI], AX { assign AX to a }
POP AX { restore AX }
end end;
Here is a fixed version, without redundant opera-
tions and with single-byte write:
procedure AtoB(a: byte; var b: byte);
begin asm
MOV ES, [BP+2] { store segment of b in ES }
MOV DI, [BP+4] { store offset of b in DI }
MOV AX, [BP+8] { store a in AX }
MOV [DI], AL { assign AX to a }
end end;
Sysop: | digital man |
---|---|
Location: | Riverside County, California |
Users: | 1,019 |
Nodes: | 17 (0 / 17) |
Uptime: | 136:33:48 |
Calls: | 503,098 |
Calls today: | 7 |
Files: | 213,261 |
D/L today: |
3,409 files (3,613M bytes) |
Messages: | 439,500 |
Posted today: | 1 |