Propeller Manual

Table Of Contents
2: Spin Language Reference – WORD
WORD
Designator: Declare word-sized symbol, word aligned/sized data, or read/write a word of
main memory.
VAR
WORD Symbol [Count ]
DAT
Symbol WORD Data [Count]
((PUB PRI))
WORD [BaseAddress] [Offset ]
((PUB PRI))
Symbol.WORD [Offset ]
Symbol is the desired name for the variable (Syntax 1) or data block (Syntax 2) or is
the existing name of the variable (Syntax 4).
Count is an optional expression indicating the number of word-sized elements for
Symbol (Syntax 1), or the number of word-sized entries of Data (Syntax 2) to store in
a data table.
Data is a constant expression or comma-separated list of constant expressions.
BaseAddress is an expression describing the word-aligned address of main memory to
read or write. If Offset is omitted, BaseAddress is the actual address to operate on. If
Offset is specified, BaseAddress + Offset * 2 is the actual address to operate on.
Offset is an optional expression indicating the offset from BaseAddress to operate on,
or the offset from word 0 of Symbol. Offset is in units of words.
Explanation
WORD is one of three multi-purpose declarations (BYTE, WORD, and LONG) that declare or operate
on memory.
WORD can be used to:
1) declare a word-sized (16-bit) symbol or a multi-word symbolic array in a
VAR block, or
2) declare word-aligned, and/or word-sized, data in a
DAT block, or
3) read or write a word of main memory at a base address with an optional offset, or
4) access a word within a long-sized variable.
Propeller Manual v1.1 · Page 227