in the byte following the opcode. Using H:X in this way, this addressing mode is limited
to the first 256 addresses in memory. Tables can be located anywhere in the address map
when H:X is used as the base address, and the byte following the opcode is the offset.
10.3.6.4 Indexed, 8-Bit Offset with Post Increment (IX1+)
Indexed, 8-bit offset with post-increment instructions are three-byte instructions that
access the operands with variable addresses, then increment H:X. The CPU adds the
unsigned bytes in the H:X register to the byte immediately following the opcode. The
sum is the effective address. This addressing mode is generally used for table searches.
This addressing mode is used for CBEQ instruction.
10.3.6.5 Indexed, 16-Bit Offset (IX2)
Indexed, 16-bit offset instructions are three-byte instructions that can access data with
variable addresses at any location in memory. The CPU adds the unsigned contents of
H:X to the 16-bit unsigned word formed by the two bytes following the opcode. The sum
is the effective address of the operand. The first byte after the opcode is the most
significant byte of the 16-bit offset; the second byte is the least significant byte of the 16-
bit offset. As with direct and extended addressing, most assemblers determine the shortest
form of indexed addressing.
Indexed, 16-bit offset instructions are useful in selecting the k-th element in an n-element
table. The table can begin anywhere and can extend as far as the address map allows. The
k value would typically be in H:X, and the address of the beginning of the table would be
in the bytes following the opcode.
10.3.6.6 SP-Relative, 8-Bit Offset (SP1)
Stack pointer, 8-bit offset instructions are three-byte instructions that address operands in
much the same way as indexed 8-bit offset instructions, except that the 8-bit offset is
added to the value of the stack pointer instead of the index register.
The stack pointer, 8-bit offset addressing mode permits easy addressing of data on the
stack. The CPU adds the unsigned byte in the 16-bit stack pointer (SP) register to the
unsigned byte following the opcode. The sum is the effective address of the operand. If
interrupts are disabled, this addressing mode allows the stack pointer to be used as a
second "index" register.
Chapter 10 Central processor unit
MC9S08PA4 Reference Manual, Rev. 5, 08/2017
NXP Semiconductors
205
Summary of Contents for MC9S08PA4
Page 1: ...MC9S08PA4 Reference Manual Supports MC9S08PA4 Document Number MC9S08PA4RM Rev 5 08 2017 ...
Page 2: ...MC9S08PA4 Reference Manual Rev 5 08 2017 2 NXP Semiconductors ...
Page 22: ...MC9S08PA4 Reference Manual Rev 5 08 2017 22 NXP Semiconductors ...
Page 28: ...System clock distribution MC9S08PA4 Reference Manual Rev 5 08 2017 28 NXP Semiconductors ...
Page 150: ...Port data registers MC9S08PA4 Reference Manual Rev 5 08 2017 150 NXP Semiconductors ...
Page 196: ...Human machine interfaces HMI MC9S08PA4 Reference Manual Rev 5 08 2017 196 NXP Semiconductors ...
Page 224: ...Instruction Set Summary MC9S08PA4 Reference Manual Rev 5 08 2017 224 NXP Semiconductors ...
Page 232: ...Functional Description MC9S08PA4 Reference Manual Rev 5 08 2017 232 NXP Semiconductors ...
Page 258: ...FTM Interrupts MC9S08PA4 Reference Manual Rev 5 08 2017 258 NXP Semiconductors ...
Page 294: ...Functional description MC9S08PA4 Reference Manual Rev 5 08 2017 294 NXP Semiconductors ...
Page 398: ...Resets MC9S08PA4 Reference Manual Rev 5 08 2017 398 NXP Semiconductors ...
Page 400: ...MC9S08PA4 Reference Manual Rev 5 08 2017 400 NXP Semiconductors ...