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
|
1989-01-18 10:51:57 +00:00
|
|
|
.define .los
|
1985-02-07 15:33:13 +00:00
|
|
|
|
|
|
|
! #bytes in cx
|
1987-06-09 10:22:50 +00:00
|
|
|
! address in bx
|
|
|
|
! save si/di. they might be register variables
|
1989-01-18 10:51:57 +00:00
|
|
|
.los:
|
1987-06-09 10:22:50 +00:00
|
|
|
mov dx,si
|
|
|
|
mov si,bx
|
1989-01-18 10:51:57 +00:00
|
|
|
pop bx
|
1987-06-09 10:22:50 +00:00
|
|
|
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
|
1989-01-18 10:51:57 +00:00
|
|
|
jmp 1f
|
|
|
|
|
|
|
|
.loi:
|
|
|
|
! only called with size > 4
|
|
|
|
mov dx,si
|
|
|
|
mov si,bx
|
|
|
|
pop bx
|
|
|
|
sub sp,cx
|
|
|
|
sar cx,1
|
|
|
|
1:
|
1987-06-09 10:22:50 +00:00
|
|
|
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
|