source:
trunk/minix/lib/i86/em/em_sar2.s@
10
| Last change on this file since 10 was 9, checked in by , 14 years ago | |
|---|---|
| File size: 419 bytes | |
| Line | |
|---|---|
| 1 | .define .sar2 |
| 2 | .text |
| 3 | |
| 4 | .sar2: |
| 5 | ! bx, descriptor address |
| 6 | ! ax, index |
| 7 | pop cx |
| 8 | pop dx ! base address |
| 9 | push cx |
| 10 | xchg di,dx ! di = base address, dx is saved di |
| 11 | sub ax,(bx) |
| 12 | mov cx,4(bx) |
| 13 | push dx |
| 14 | imul cx |
| 15 | pop dx |
| 16 | add di,ax |
| 17 | sar cx,#1 |
| 18 | jnb 1f |
| 19 | pop bx |
| 20 | pop ax |
| 21 | stosb |
| 22 | mov di,dx |
| 23 | jmp (bx) |
| 24 | 1: |
| 25 | pop bx |
| 26 | mov ax,si |
| 27 | mov si,sp |
| 28 | rep |
| 29 | mov |
| 30 | mov sp,si |
| 31 | mov si,ax |
| 32 | mov di,dx |
| 33 | jmp (bx) |
Note:
See TracBrowser
for help on using the repository browser.