10.7.5 Stack Pointer

This register holds the Stack Pointer (SP) that points to the top of the stack. After being reset, the SP points to the highest internal SRAM address.

Only the number of bits required to address the available SRAM is implemented for each device. Unused bits will always read as ‘0’.

The SPL and SPH register pair represents the 16-bit value SP. The low byte [7:0] (suffix L) is accessible at the original offset. This high byte [15:8] (suffix H) can be accessed at offset + 0x01.

To prevent corruption when updating the SP from software, a write to SPL will automatically disable interrupts for the following four instructions or until the next I/O memory write, whichever comes first.

Name: SP
Offset: 0xD
Reset: 0x7FFF
Property: -

Bit 15141312111098 
 SPH[7:0] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 01111111 
Bit 76543210 
 SPL[7:0] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 11111111 

Bits 15:8 – SPH[7:0] Stack Pointer High Byte

These bits hold the MSB of the 16-bit register SP.

Bits 7:0 – SPL[7:0] Stack Pointer Low Byte

These bits hold the LSB of the 16-bit register SP.