ack/mach/m65oo2/libem/exg.s

23 lines
251 B
ArmAsm
Raw Normal View History

2024-02-22 15:13:52 +00:00
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .exg
! #bytes in cx
.sect .text
.exg:
push di
mov di,sp
add di,4
mov bx,di
add bx,cx
sar cx,1
1:
mov ax,(bx)
xchg ax,(di)
mov (bx),ax
add di,2
add bx,2
loop 1b
2:
pop di
ret