M$FILL
The M$FILL library routine fills a previously allocated memory region with a specific value.
The memory region is usually allocated with the M$ALLOC library routine. However, programs compiled with -cp option may operate also on a memory regions allocated by external C functions or by a Format 7 SET statement.
 
Syntax:
 CALL "M$FILL" USING destination 
                     value 
                     length
Parameters:
destination
USAGE HANDLE
Specifies the handle to the destination memory region.
 
Note - for compatibility reasons this item may also be defined as USAGE POINTER. In this case the program must be compiled either with -ca or -cp options. With -ca POINTER is translated to HANDLE. With -cp POINTER is a real pointer that can be shared with external C routines.
value
PIC X
Specifies the value to be copied to destination.
length
any numeric data item or numeric literal
Specifies the number of bytes to be copied.
Examples:
Example - Allocate 8 bytes of memory, fill the memory area with all "A" characters
*> define mem1 usage handle
call "m$alloc" using 8, mem1
call "m$fill" using mem1, "A"8