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 .sar2
|
|
|
|
|
|
|
|
.sar2:
|
1987-06-09 10:22:50 +00:00
|
|
|
! bx, descriptor address
|
1985-02-07 15:33:13 +00:00
|
|
|
! ax, index
|
1987-06-09 10:22:50 +00:00
|
|
|
pop cx
|
|
|
|
pop dx ! base address
|
|
|
|
push cx
|
|
|
|
xchg di,dx ! di = base address, dx is saved di
|
|
|
|
sub ax,(bx)
|
|
|
|
mov cx,4(bx)
|
|
|
|
push dx
|
1985-02-07 15:33:13 +00:00
|
|
|
imul cx
|
1987-06-09 10:22:50 +00:00
|
|
|
pop dx
|
1985-02-07 15:33:13 +00:00
|
|
|
add di,ax
|
|
|
|
sar cx,1
|
|
|
|
jnb 1f
|
1987-06-09 10:22:50 +00:00
|
|
|
pop bx
|
1985-02-07 15:33:13 +00:00
|
|
|
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-09 10:22:50 +00:00
|
|
|
pop bx
|
|
|
|
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 si,ax
|
|
|
|
mov di,dx
|
1985-02-07 15:33:13 +00:00
|
|
|
jmp bx
|