CRE Programmer's Guide

String and Memory Block Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
8-39
Memory_Set
Memory_Set
The Memory_Set functions initialize a block of memory to a specified character. These
functions are not available in the native CRE library.
buf
is a pointer to the block to initialize.
char
specifies the initialization character. Only bits <8:15> of char are used for the
initialization value.
num_bytes
specifies the number of bytes to initialize.
Return Value
The Memory_Set functions return the address of the block of memory, @buf.
Considerations
A concatenated move is faster than Memory_Set.
char must be a single character constant or a STRING variable.
Example
STRING .EXT buf := 4D '<<' 17;
INT ch := 0;
! set first 64k bytes of extended segment to 0.
CALL RTL_Memory_SetX_(buf, ch, 65536D);
INT PROC RTL_Memory_Set_( buf, char, num_bytes );
STRING .buf; ! out
INT char; ! in
INT num_bytes; ! in TNS
only
INT(32) PROC RTL_Memory_SetX_( buf, char, num_bytes );
STRING .EXT buf; ! out
INT char; ! in
INT(32) num_bytes; ! in TNS
only