source:
trunk/minix/lib/i86/em/em_exg.s@
9
| Last change on this file since 9 was 9, checked in by , 14 years ago | |
|---|---|
| File size: 200 bytes | |
| Line | |
|---|---|
| 1 | .define .exg |
| 2 | |
| 3 | ! #bytes in cx |
| 4 | .text |
| 5 | .exg: |
| 6 | push di |
| 7 | mov sp,di |
| 8 | add di,#4 |
| 9 | mov bx,di |
| 10 | add bx,cx |
| 11 | sar cx,#1 |
| 12 | 1: |
| 13 | mov ax,(bx) |
| 14 | xchg ax,(di) |
| 15 | mov (bx),ax |
| 16 | add di,#2 |
| 17 | add bx,#2 |
| 18 | loop 1b |
| 19 | 2: |
| 20 | pop di |
| 21 | ret |
Note:
See TracBrowser
for help on using the repository browser.