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
|
|
|
|
|
|
|
|
! #bytes in cx
|
1987-06-09 10:22:50 +00:00
|
|
|
! address in bx
|
|
|
|
! save di/si. they might be register variables
|
1985-02-07 15:33:13 +00:00
|
|
|
.sti:
|
1987-06-09 10:22:50 +00:00
|
|
|
mov dx,di ! save di
|
|
|
|
pop ax ! return address
|
|
|
|
mov di,bx
|
|
|
|
mov bx,ax
|
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
|
|
|
|
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
|