User manual

ST Assembler-Linker ST7 and STM8 addressing modes
Doc ID 11392 Rev 4 15/89
An indirect addressing mode means that the data byte(s) required to do the operation is
found by its memory address which is located in memory (pointer).
The pointer address follows the op-code. A short pointer is one byte long. A long pointer is
two bytes long.
This last group consists of memory indirect variants:
Short pointer to short data,
for ST7 only [shortpointer .b]
Short pointer to long data [shortpointer .w]
Short pointer to short data X or Y indexed,
for ST7 only ([shortpointer .b],X) ([shortpointer .b],Y)
Short pointer to long data X or Y indexed ([shortpointer .w],X) ([shortpointer .w],Y)
For STM8 devices only:
long pointer to long data [longpointer .w]
long pointer to long data X indexed ([longpointer .w], X)
long pointer to extended data X or Y indexed ([longpointer .e],X)([longpointer .e],Y)
Pointer addresses must always be in:
page 0 (its address must be less than $100) for the ST7
section 0 (its address must be less than $10000) for the STM8
Examples:
To distinguish between short and long indirect addressing mode, the suffix.w indicates
that you want to work in long indirect mode (this is also true for indexed addressing
mode).
Short indirect means that pointed data are short (one byte long)
Long indirect means pointed data are long (two bytes long)
Implicitly, if nothing is specified,
for the ST7, short indirect addressing mode is assumed, you can also use .b to
specify short indirect addressing mode (as with the indexed addressing mode).
Use .w to specify long indirect addressing mode.
for the STM8, long indirect addressing is assumed, you could use .w but it is not
necessary. With the STM8 ldf instruction, you must use .e to specify extended
indirect addressing mode.
ld A,[80] short pointer to short (ST7) or long (ST8) data
ld A,[80.b] short pointer to short data (ST7 only)
ld A,[80.w] short pointer to long data
ld A,[$1000.w] long pointer to long data (STM8 only)
ldf A,([$1000.e],X)long pointer to 24-bit data (STM8 only)
lab12 equ 80
ld A,([lab12],X) short pointer to short (ST7) or long (ST8) data X-indexed
ld A,([lab12.b],X) short pointer to short data X-indexed (ST7 only)
ld A,([lab12.w],Y) short pointer to long data Y-indexed