home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
ida35bc.zip
/
MEMCPY.IDC
< prev
next >
Wrap
Text File
|
1996-01-29
|
1KB
|
41 lines
//
// This file demonstrates how to copy blocks of memory
// using IDC. To use it, press F2 and select this file.
// Once loaded and compiled all IDC functions stay in memory
// so afterwards you can copy blocks simply pressing Shift-F2
// and entering something like:
//
// memcpy(0x30000,0x20000,0x100);
//
// This construction copies 0x100 bytes from 0x20000 to 0x30000.
//
// Also, you can delete main() function below.
// When you try to execute this file, you'll get an error:
// can find function 'main', don't pay attention.
// You will get memcpy() function in the memory.
// In this case you should create a segment youself (if nesessary).
//
//------------------------------------------------------------------------
static memcpy(to,from,size) {
auto i;
for ( i=0; i < size; i=i+1 ) {
PatchByte( to, Byte(from) );
from = from + 1;
to = to + 1;
}
}
//------------------------------------------------------------------------
static main(void) {
auto from,to,size;
from = 0x10000;
to = 0x20000;
size = 0x5;
if ( SegCreate(to,to+size,to>>4,0,1,2) )
memcpy(to,from,size);
}