Central Processor Unit
3.6 Stack Pointer
The stack pointer (SP) contains the address of the next free location on the stack. During an MCU reset or the reset stack pointer (RSP) instruction, the stack pointer is set to location $00FF. The stack pointer is then decremented as data is pushed onto the stack and incremented as data is pulled from the stack.
When accessing memory, the seven most significant bits are permanently set to 0000011. These seven bits are appended to the six least significant register bits to produce an address within the range of $00FF to $00C0. Subroutines and interrupts may use up to 64 (decimal) locations. If 64 locations are exceeded, the stack pointer wraps around and loses the previously stored information. A subroutine call occupies two locations on the stack; an interrupt uses five locations.
13 |
|
|
|
|
| 7 |
| 0 |
|
|
|
|
|
|
|
|
|
0 | 0 | 0 | 0 | 0 | 1 |
| 1 | SP |
|
|
|
|
|
|
|
|
|
3.7 Program Counter
The program counter (PC) is a
13 | 0 |
PC
NOTE: The HC05 CPU core is capable of addressing a
General Release Specification |
| MC68HC05RC16 — Rev. 3.0 |
|
|
|
36 | Central Processor Unit | MOTOROLA |