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: | altere |
|---|---|
| Location: | Houston, TX |
| Users: | 71 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 07:56:57 |
| Calls: | 1,638 |
| Calls today: | 3 |
| Files: | 8,774 |
| D/L today: |
2 files (24K bytes) |
| Messages: | 309,521 |