Name
FillMem -- fill a memory block (V2.0)
Synopsis
FillMem(id, val, size[, offset, type])
Function
This function can be used to fill the whole memory block or a part of it with a specified value. id specifies the memory block to use, val is the value to use for filling and size specifies the size in bytes for the filling operation. You can use the optional argument offset to fine-tune the filling operation by specifying an offset in the memory block here (in bytes). type specifies the type of the value and can be #BYTE (1 byte), #SHORT (2 bytes) or #INTEGER (4 bytes).

If you use #SHORT or #INTEGER as the filling type, the size argument must be a multiple of 2 or 4 respectively. Also, offset, if specified, must be a multiple of 2 or 4 respectively.

Inputs
id
memory block to use
val
value to fill block with
size
size of the filling operation in bytes; must be a multiple of 2 or 4 if type is #SHORT or #INTEGER
offset
optional: offset in the block where the filling should start (defaults to 0 which means the beginning of the block); must be a multiple of 2 or 4 if type is #SHORT or #INTEGER
type
optional: type of val; currently supported are #BYTE, #SHORT and #INTEGER (defaults to #BYTE)
Example
AllocMem(1, 65536)
FillMem(1, 0, 65536)
Allocate a block of 64kb and initialize it to 0.

Show TOC