Propeller Manual

Table Of Contents
2: Spin Language Reference – BYTEFILL
Propeller Manual v1.1 · Page 57
BYTEFILL
Command: Fill bytes of main memory with a value.
((PUB PRI))
BYTEFILL (StartAddress, Value, Count )
StartAddress is an expression indicating the location of the first byte of memory to fill
with Value.
Value is an expression indicating the value to fill bytes with.
Count is an expression indicating the number of bytes to fill, starting with
StartAddress.
Explanation
BYTEFILL is one of three commands (BYTEFILL, WORDFILL, and LONGFILL) used to fill blocks of
main memory with a specific value.
BYTEFILL fills Count bytes of main memory with Value,
starting at location StartAddress.
Using BYTEFILL
BYTEFILL is a great way to clear large blocks of byte-sized memory. For example:
VAR
byte Buff[100]
PUB Main
bytefill(@Buff, 0, 100) 'Clear Buff to 0
The first line of the Main method, above, clears the entire 100-byte Buff array to all zeros.
BYTEFILL is faster at this task than a dedicated REPEAT loop is. T