Fills a block of memory with a given value
MEMFILL source, bytes, value
The first address of the source variable that will be filled. This can be a normal numeric variable or an array like ar(1)
The number of bytes to fill.
The range is from 1-65535.
There is not check for 0 bytes to copy. When using a variable make sure that it is not zero, since the effect will be that &HFFFF bytes will be filled.
This is a byte or numeric constant with the ASCII value to use for the memory filling. To clear an array, use 0.
MEMFILL intended use is to clear an array or to fill an array quickly.
To clear an array use a value of 0.
CALLS _MEM_FILL in mcs.lib
$regfile = "m1280def.dat"
$crystal = 8000000
$hwstack = 64
$swstack = 64
$framesize = 64
$baud = 19200
Config Base = 0 'array start at 0
Dim Ar(100) As Byte , X As Byte
Print "MEMFILL test"
'fill array/memory with ASCII A
Memfill Ar(1) , 10 , 65 'skip the first entry so it remains 0
Print X ; "->" ; Ar(x)
Loop Until X = 10