Propeller Manual

Table Of Contents
2: Spin Language Reference – BYTE
BYTE
Designator: Declare byte-sized symbol, byte aligned/sized data, or read/write a byte of main
memory.
VAR
BYTE Symbol [Count]
DAT
Symbol BYTE Data [Count]
((PUB PRI))
BYTE [BaseAddress] [Offset]
((PUB PRI))
Symbol.BYTE [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 byte-sized elements for
Symbol (Syntax 1), or the number of byte-sized entries of Data (Syntax 2) to store in
a data table.
Data is a constant expression or comma-separated list of constant expressions.
Quoted strings of characters are also allowed; they are treated as a comma-separated
list of characters.
BaseAddress is an expression describing the 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 is the actual address to operate on.
Offset is an optional expression indicating the offset from BaseAddress to operate on,
or the offset from byte 0 of Symbol.
Explanation
BYTE is one of three multi-purpose declarations (BYTE, WORD, and LONG) that declare or operate
on memory.
BYTE can be used to:
1) declare a byte-sized (8-bit) symbol or a multi-byte symbolic array in a
VAR block, or
2) declare byte-aligned, and possibly byte-sized, data in a
DAT block, or
3) read or write a byte of main memory at a base address with an optional offset, or
4) access a byte within a word-sized or long-sized variable.
Propeller Manual v1.1 · Page 51