AMX Target Guide Computer Accessories User Manual


 
AMX 68000 Target Guide
K
A
DAK
B-13
cjcfmcopy cjcfmcopy
cjcfmset cjcfmset
Purpose Copy a Block of Memory
Set (Fill) a Block of Memory
These procedures are provided for AMX portability. They are not
replacements for C library procedures
memcpy or memset.
Used by
n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure
Setup Prototype is in file
CJZZZTF.H.
#include "CJZZZ.H"
void CJ_CCPP cjcfmcopy(int *sourcep, int *destp,
unsigned int size);
void CJ_CCPP cjcfmset(int *mempntr,
unsigned int size, int pattern);
Description sourcep is a pointer to the integer aligned block of memory which is to be
copied to the destination.
destp is a pointer to the integer aligned block of memory which is the
destination of the block being copied.
mempntr is a pointer to the integer aligned block of memory which is to be
filled with pattern.
size is the number of integers to be copied or set. The number of bytes
copied or set will therefore be size * sizeof(int).
Interrupts o Disabled o Enabled o Restored
Returns Nothing
Restrictions The source and destination blocks must not overlap unless destp is lower
in memory than
sourcep.
ISPs and Timer Procedures should not fill or copy large blocks of
memory. Failure to observe this restriction may impose serious
performance penalties on your application.
Example #include "CJZZZ.H"
#define BLOCKSIZE 1024
static int srcarray[BLOCKSIZE];
static int dstarray[BLOCKSIZE];
void CJ_CCPP blocksetcopy(int pattern) {
cjcfmset(srcarray, sizeof(srcarray), pattern);
cjcfmcopy(srcarray, dstarray, sizeof(srcarray));
}