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

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

Converted assembly language files.

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