8000 minix/lib/i86/em/em_sar2.s at v3.1.6 · devinblood/minix · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div class="prc-PageLayout-Sidebar-iciWg" data-component="SplitPageLayout.Sidebar" data-resizable="true" style="--spacing:var(--spacing-normal);--pane-min-width:450px;--pane-max-width:768px;--pane-width-custom:544px;--pane-width-size:var(--pane-width-custom);--pane-width:544px">

Latest commit

 

History

History
33 lines (32 loc) · 419 Bytes

em_sar2.s

File metadata and controls

33 lines (32 loc) · 419 Bytes
.define .sar2
.text
.sar2:
! bx, descriptor address
! 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
imul cx
pop dx
add di,ax
sar cx,#1
jnb 1f
pop bx
pop ax
stosb
mov di,dx
jmp (bx)
1:
pop bx
mov ax,si
mov si,sp
rep
mov
mov sp,si
mov si,ax
mov di,dx
jmp (bx)
0