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,054 |
Nodes: | 15 (0 / 15) |
Uptime: | 54:00:16 |
Calls: | 500,777 |
Calls today: | 9 |
Files: | 109,358 |
D/L today: |
51,211 files (8,302M bytes) |
Messages: | 465,995 |
Posted today: | 3 |