home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
system
/
copymemquicker
/
source.lha
/
source
/
CopyMemQuicker.asm
< prev
next >
Wrap
Assembly Source File
|
1992-02-11
|
2KB
|
115 lines
nolist
**********************************************************************
* CopyMemQuicker 2.2 - (C) 1991, 1992 Arthur Hagen *
* Parts of code: (C) 1985-1991 Commodore Business Machines Ltd. *
* Posted to the Public Domain *
**********************************************************************
include 'exec/execbase.i'
include 'exec/memory.i'
public _QuickMem
list
_QuickMem
movea.l (4).w,a6 ; ExecBase
lea dosname(pc),a1
jsr _LVOOldOpenLibrary#(a6) ; Any version will do
movea.l d0,a5
exg.l a5,a6
jsr _LVOOutput#(a6)
exg.l a5,a6
move.l d0,d5
moveq #title_end-title,d3
lea title(pc),a0
bsr.s wrt
movea.l _LVOCopyMem#+2(a6),a3
cmpi.l #'*Art',-(a3)
beq.s isquicker
moveq #0,d4
moveq #0,d6
moveq #0,d7
move.b AttnFlags+1(a6),d0
btst #AFB_68020,d0
bne.s has020
btst #AFB_68010,d0
bne.s has010
move.w #CopyLen00#,d4
move.w #Quicker00#,d6
move.w #Quickest00#,d7
lea Start00#(pc),a2
bra.s allocit
has010 move.w #CopyLen10#,d4
move.w #Quicker10#,d6
move.w #Quickest10#,d7
lea Start10#(pc),a2
bra.s allocit
has020 move.w #CopyLen20#,d4
move.w #Quicker20#,d6
move.w #Quickest20#,d7
lea Start20#(pc),a2
allocit move.l d4,d0
addq.w #6,d0
addq.w #6,d0
moveq #MEMF_PUBLIC,d1
jsr _LVOAllocMem#(a6)
tst.l d0
beq.s nomem
move.l d0,a3
lea 12(a3),a4
movea.l a2,a0
movea.l a4,a1
move.l d4,d0
bsr.s Start00
move.l d7,d0
add.l a4,d0
bsr.s setcmq
move.l d0,(a3)+
move.l d6,d0
add.l a4,d0
bsr.s setcm
move.l d0,(a3)+
move.l #'*Art',(a3)
quit movea.l a5,a1
jmp _LVOCloseLibrary#(a6) ; faster than jsr + rts
nomem moveq #memerr_end-memerr,d3
lea memerr(pc),a0
pea quit(pc) ; faster than 'bsr.s wrt' + 'bra.s quit'
wrt move.l a0,d2
move.l d5,d1
exg.l a5,a6
jsr _LVOWrite#(a6)
exg.l a5,a6
rts
isquicker
moveq #already_end-already,d3
lea already(pc),a0
bsr.s wrt
move.l -(a3),d0
bsr.s setcm
move.l -(a3),d0
pea quit(pc) ; faster than 'bsr.s setcmq' + 'bra.s quit'
setcmq lea (_LVOCopyMemQuick#).w,a0
bra.s setit
setcm lea (_LVOCopyMem#).w,a0
setit movea.l a6,a1
jmp _LVOSetFunction#(a6)
************************************************************
version dc.b '$VER: '
title dc.b 'CopyMemQuicker 2.2 (11 Feb 1992)',$0A,$0D
dc.b 'Copyright ',$A9,' 1992 Arthur Hagen.',$0A
title_end
already dc.b 'Restoring vectors.',$0A
already_end
memerr dc.b 'No memory!',$0A
memerr_end
dosname dc.b 'dos.library',0
even