81/317
4 - Architecture of the ST7 core
where
THERE
and
HERE
are labels respectively designating the destination of the jump, and the
address of the instruction that follows the jump instruction. Here again, if the difference yields
a number that exceeds the range of a one-byte value, the assembler generates an error mes-
sage.
Indirect short mode
In this mode, the address that follows the opcode is that of a memory byte called a pointer that
contains the address of the data to read or write. This allows the effective address to be
formed by the result of a previous calculation. For example, if the pointer at address
23h
con-
tains
79h
, and the byte at address
79h
contains 0, the instruction
LD A,[23]
A is loaded with the value stored at the short address pointed
to by the specified memory address in page zero.
loads the accumulator with the contents of address
79h
(and not
23h
) that is zero. The coding
of the instruction is (in hexadecimal)
92 B6 10
where the first byte is the
PIX
prefix. This instruction takes three bytes of memory.
Indirect long mode
This mode is similar to the indirect short mode, but the effective address contained in memory
is a 16-bit word. This allows the whole address range to be accessed. The pointer must still be
placed at an address below
100h
.
For example, if the pointer at addresses
23h
and
24h
contains
7954h
, and the byte at address
7954h
contains 0, the instruction
LD A,[23.w]
A is loaded with the value stored at the extended address pointed
to by the specified memory address anywhere in memory.
loads the accumulator with the contents of address 7954h (and not 23h) that is zero. The
coding of the instruction is (in hexadecimal):
92 C6 10
where the first byte is the
PIX
prefix. This instruction takes three bytes of memory. Please note
the «
.w
» that indicates that the long indirect mode must be used.
The indirect short mode is similar to the indexed mode, except that it is not necessary to load
the index register with the address of the operand; it may be used directly where it resides in
memory.