1987-01-08 10:13:48 +00:00
|
|
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
1985-02-07 15:33:13 +00:00
|
|
|
.define .exg
|
|
|
|
|
|
|
|
! #bytes in cx
|
1987-01-08 10:13:48 +00:00
|
|
|
.sect .text
|
1985-02-07 15:33:13 +00:00
|
|
|
.exg:
|
1987-06-09 10:22:50 +00:00
|
|
|
push di
|
1989-05-16 16:02:46 +00:00
|
|
|
mov di,sp
|
1987-06-09 10:22:50 +00:00
|
|
|
add di,4
|
|
|
|
mov bx,di
|
|
|
|
add bx,cx
|
1985-02-07 15:33:13 +00:00
|
|
|
sar cx,1
|
1987-06-09 10:22:50 +00:00
|
|
|
1:
|
|
|
|
mov ax,(bx)
|
|
|
|
xchg ax,(di)
|
|
|
|
mov (bx),ax
|
1989-05-16 16:02:46 +00:00
|
|
|
add di,2
|
|
|
|
add bx,2
|
1987-06-09 10:22:50 +00:00
|
|
|
loop 1b
|
|
|
|
2:
|
|
|
|
pop di
|
|
|
|
ret
|