ack/mach/i86/libem/sar2.s

34 lines
469 B
ArmAsm
Raw Permalink Normal View History

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:
! bx, descriptor address
1985-02-07 15:33:13 +00:00
! ax, index
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
pop dx
1985-02-07 15:33:13 +00:00
add di,ax
sar cx,1
jnb 1f
pop bx
1985-02-07 15:33:13 +00:00
pop ax
stosb
mov di,dx
1985-02-07 15:33:13 +00:00
jmp bx
1:
pop bx
mov ax,si
1985-02-07 15:33:13 +00:00
mov si,sp
rep movs
mov sp,si
mov si,ax
mov di,dx
1985-02-07 15:33:13 +00:00
jmp bx