1987-01-08 10:13:48 +00:00
|
|
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
|
|
|
.sect .text
|
1985-02-07 15:33:13 +00:00
|
|
|
.define .loi
|
|
|
|
|
|
|
|
! #bytes in cx
|
1987-06-09 10:22:50 +00:00
|
|
|
! address in bx
|
|
|
|
! save si/di. they might be register variables
|
1985-02-07 15:33:13 +00:00
|
|
|
.loi:
|
1987-06-09 10:22:50 +00:00
|
|
|
pop ax
|
|
|
|
mov dx,si
|
|
|
|
mov si,bx
|
|
|
|
mov bx,ax
|
|
|
|
mov ax,cx
|
1985-02-07 15:33:13 +00:00
|
|
|
sar cx,1
|
|
|
|
jnb 1f
|
|
|
|
xorb ah,ah
|
|
|
|
lodsb
|
1987-06-09 10:22:50 +00:00
|
|
|
mov si,dx
|
1985-02-07 15:33:13 +00:00
|
|
|
push ax
|
|
|
|
jmp bx
|
|
|
|
1:
|
1987-06-09 10:22:50 +00:00
|
|
|
sub sp,ax
|
|
|
|
mov ax,di
|
1985-02-07 15:33:13 +00:00
|
|
|
mov di,sp
|
|
|
|
rep movs
|
1987-06-09 10:22:50 +00:00
|
|
|
mov si,dx
|
|
|
|
mov di,ax
|
1985-02-07 15:33:13 +00:00
|
|
|
jmp bx
|