Advance Information MC68HC908MR16/MC68HC908MR32 — Rev. 4.0
74 Central Processor Unit (CPU) MOTOROLA
Central Processor Unit (CPU)
6.4.3 Stack Pointer
The stack pointer (SP) is a 16-bit register that contains the address of
the next location on the stack. During a reset, the stack pointer is preset
to $00FF. The reset stack pointer (RSP) instruction sets the least
significant byte to $FF and does not affect the most significant byte. Th e
stack pointer decrements as data is pushed onto the stack and
increments as data is pulled from the stack.
In the stack pointer 8-bit offset and 16-bit offset addressing modes, the
stack pointer can function as an index register to access data on the
stack. The CPU uses the contents of the stack pointer to determine th e
conditional address of the op erand.
NOTE: The location of the stack is arbitrary and may be relocated anywhere i n
RAM. Moving the SP out of page zero ($0000–$00FF) frees direct
address (page zero) space. For correct operation, the stack pointer must
point only to RAM locations.
Bit
151413121110987654321
Bit
0
Read:
Write:
Reset:0000000011111111
Figure 6-4. Stack Pointer (SP)