home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
files
/
utility
/
clearmem
/
read_me
< prev
Wrap
Text File
|
1988-08-19
|
2KB
|
48 lines
From dillon@CORY.BERKELEY.EDU (Matt Dillon) Mon Aug 15 23:43:00 1988
Path: caen.engin.umich.edu!mailrus!ncar!ames!pasteur!ucbvax!CORY.BERKELEY.EDU!dillon
From: dillon@CORY.BERKELEY.EDU (Matt Dillon)
Newsgroups: comp.sys.atari.st
Subject: ASSEMBLY MOVE/CLEAR/SET/COMPARE ROUTINES (was Clearing memory chain)
Message-ID: <8808160343.AA10248@cory.Berkeley.EDU>
Date: 16 Aug 88 03:43 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Lines: 291
>I think this problem could be solved quite simply by using one of the reserved
>fields in the GEMDOS executable program header. One of these fields could be
>used for telling the OS that it does not have to clear the TPA beforeexecuting
Half of this conversation is silly. Since when is clearing memory
slow? A properly written memory-set/clear function will use, say, 12 or 13
registers filled with the pattern and then loop on movem.l instruction.
Needless to say, this is *fast*. Very fast, in fact.
And before some of the less sophisticated start blabbering about
special cases, following is some *GENERAL* 68K code for clearing, moving,
and comparing memory.
All routines work on arbitrary boundries, and optimize according to
the block size and alignment, all the way to using multiple-register moves
to accomplish the goal. bmov() will do either an ascending or decending
copy accordingly, allowing for overlapped moves.
SPECIAL NOTES:
-All calls take 32 bit quantities for any pointers or integers. Note
-especially that the BSET() function takes a long for the fill
character even though only a char is used. Simply modify the code
to fill your needs.
-This assembles under the Aztec assembler. Some modifications may
be required to work on other assemblers. However, the code is
COMPLETELY self contained.
-Code is set up for being called from C, with arguments pushed on
the stack in reverse argument (i.e. first arg is 4(sp), second is
8(sp), and third is 12(sp) on entry to the call)
-D0/D1/A0/A1 are all assumed to be scratch and are not saved.
-Matt