Last change
on this file since 0170798 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Imported original source code.
|
-
Property mode
set to
100755
|
File size:
1.0 KB
|
Rev | Line | |
---|
[3ae31e9] | 1 | * ------------------------------------------------------------------------------
|
---|
| 2 | * blkmove.s -- block move function
|
---|
| 3 | * Version 1 -- 1987-08-28 -- D.N. Lynx Crowe
|
---|
| 4 | *
|
---|
| 5 | * void
|
---|
| 6 | * blkmove(to, from, n)
|
---|
| 7 | * char *to, *from;
|
---|
| 8 | * short n;
|
---|
| 9 | *
|
---|
| 10 | * Copies 'n' bytes from address 'from' to address 'to'.
|
---|
| 11 | * Treats overlaps of from and to areas intelligently.
|
---|
| 12 | * ------------------------------------------------------------------------------
|
---|
| 13 | .text
|
---|
| 14 | *
|
---|
| 15 | .xdef _blkmove
|
---|
| 16 | *
|
---|
| 17 | _blkmove: link a6,#$FFFC
|
---|
| 18 | move.l 8(a6),d0
|
---|
| 19 | cmp.l 12(a6),d0
|
---|
| 20 | bcc blkm3
|
---|
| 21 | *
|
---|
| 22 | bra blkm2
|
---|
| 23 | *
|
---|
| 24 | blkm1: movea.l 8(a6),a0
|
---|
| 25 | movea.l 12(a6),a1
|
---|
| 26 | move.b (a1),(a0)
|
---|
| 27 | addq.l #1,8(a6)
|
---|
| 28 | addq.l #1,12(a6)
|
---|
| 29 | *
|
---|
| 30 | blkm2: move.w 16(a6),d0
|
---|
| 31 | subq.w #1,16(a6)
|
---|
| 32 | tst.w d0
|
---|
| 33 | bne blkm1
|
---|
| 34 | *
|
---|
| 35 | bra blkm6
|
---|
| 36 | *
|
---|
| 37 | blkm3: move.w 16(a6),d0
|
---|
| 38 | ext.l d0
|
---|
| 39 | add.l d0,8(a6)
|
---|
| 40 | add.l d0,12(a6)
|
---|
| 41 | bra blkm5
|
---|
| 42 | *
|
---|
| 43 | blkm4: subq.l #1,8(a6)
|
---|
| 44 | subq.l #1,12(a6)
|
---|
| 45 | movea.l 8(a6),a0
|
---|
| 46 | movea.l 12(a6),a1
|
---|
| 47 | move.b (a1),(a0)
|
---|
| 48 | *
|
---|
| 49 | blkm5: move.w 16(a6),d0
|
---|
| 50 | subq.w #1,16(a6)
|
---|
| 51 | tst.w d0
|
---|
| 52 | bne blkm4
|
---|
| 53 | *
|
---|
| 54 | blkm6: unlk a6
|
---|
| 55 | rts
|
---|
| 56 | *
|
---|
| 57 | .end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.