home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ANews 1
/
AnewsCD01.iso
/
Indispensables
/
Compression
/
xad
/
Developer
/
Sources
/
test
/
TestCopyMem.c
next >
Wrap
C/C++ Source or Header
|
1999-08-09
|
1KB
|
57 lines
#include <proto/xadmaster.h>
#include <proto/exec.h>
#include <proto/dos.h>
struct xadMasterBase *xadMasterBase;
void main(void)
{
if((xadMasterBase = (struct xadMasterBase *)
OpenLibrary("xadmaster.library", 1)))
{
UBYTE buf[40];
LONG i;
for(i = 0; i < 40; ++i)
buf[i] = i;
Printf("Bufferposition = %08lx (long aligned: %s)\n", buf, (((LONG)buf)&3) ? "NO" : "YES");
xadCopyMem(buf, buf+10, 30);
Printf("CopyMemLong forward (0->10, size 30)\n");
for(i = 0; i < 40; ++i)
{
Printf("%02ld ", buf[i]); buf[i] = i;
}
Printf("\n");
xadCopyMem(buf+10, buf, 30);
Printf("CopyMemLong backward (10->0, size 30)\n");
for(i = 0; i < 40; ++i)
{
Printf("%02ld ", buf[i]); buf[i] = i;
}
Printf("\n");
xadCopyMem(buf, buf+10, 29);
Printf("CopyMemLong byte (0->10, size 29)\n");
for(i = 0; i < 40; ++i)
{
Printf("%02ld ", buf[i]); buf[i] = i;
}
Printf("\n");
xadCopyMem(buf+10, buf, 29);
Printf("CopyMemLong backward (10->0, size 29)\n");
for(i = 0; i < 40; ++i)
{
Printf("%02ld ", buf[i]); buf[i] = i;
}
Printf("\n");
CloseLibrary((struct Library *) xadMasterBase);
}
else
Printf("Could not open library\n");
}