home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 1: Collection A
/
17Bit_Collection_A.iso
/
files
/
290.dms
/
290.adf
/
quickrif.source
/
copy.asm
< prev
next >
Wrap
Assembly Source File
|
1989-01-31
|
810b
|
46 lines
; :ts=10
;copy_structure(source, dest, count)
; copy a WORD-alligned structure as fast as possible
public _copy_structure
_copy_structure
;grab the parameters
move.l 4(sp),a0
move.l 8(sp),a1
move.w 14(sp),d0
move.w d0,d1
lsr.w #5,d1 ;going to move 32 bytes at a time at first...
bra zl32
l32 move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
zl32 dbra d1,l32
and.w #31,d0
lsr.w #1,d1 ;the rest goes 2 bytes at a time
bra zl2
l2 move.w (a0)+,(a1)+
zl2 dbra d0,l2
rts
;copy_chars(s, d, count)
; copy character at a time - not WORD alligned
public _copy_chars
_copy_chars
move.l 4(sp),a0
move.l 8(sp),a1
move.l 12(sp),d0
bra zcch
cch move.b (a0)+,(a1)+
zcch dbra d0,cch
rts