Propeller Manual

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