CRE Programmer's Guide
String and Memory Block Functions
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
8-40
Memory_Swap
Memory_Swap
The Memory_Swap functions exchange one block of memory with a second block of 
memory. These functions are not available in the native CRE library. 
buf1
is a pointer to the first block of memory.
buf2
is a pointer to the second block of memory.
num_bytes
specifies the number of bytes to exchange.
Considerations
The Memory_Swap procedures are declared as procedures, not as functions. They do 
not return a value.  
Example
STRING .up[0:9] := "0123456789";
STRING .down[0:9] := "9876543210";
CALL RTL_Memory_Swap_( up, down, 10 );
PROC RTL_Memory_Swap_( buf1, buf2, num_bytes );
 STRING .buf1; ! in/out
 STRING .buf2; ! in/out
 INT num_bytes; ! in TNS 
only
PROC RTL_Memory_SwapX_( buf1, buf2, num_bytes );
 STRING .EXT buf1; ! in/out
 STRING .EXT buf2; ! in/out
 INT(32) num_bytes; ! in TNS 
only










