source: buchla-68k/lib700/blkmove.s@ 0170798

Last change on this file since 0170798 was 4f508e6, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Converted assembly language files.

  • Property mode set to 100644
File size: 994 bytes
Line 
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,#-4
18 move.l 8(a6),d0
19 cmp.l 12(a6),d0
20 bcc blkm3
21
22 bra blkm2
23
24blkm1: 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
30blkm2: move.w 16(a6),d0
31 subq.w #1,16(a6)
32 tst.w d0
33 bne blkm1
34
35 bra blkm6
36
37blkm3: 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
43blkm4: 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
49blkm5: move.w 16(a6),d0
50 subq.w #1,16(a6)
51 tst.w d0
52 bne blkm4
53
54blkm6: unlk a6
55 rts
56
57 .end
Note: See TracBrowser for help on using the repository browser.