minix/lib/i86/em/em_exg.s
2009-11-09 10:26:00 +00:00

21 lines
200 B
ArmAsm

.define .exg
! #bytes in cx
.text
.exg:
push di
mov sp,di
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