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