MSM80C154S/83C154S/85C154HVS
60
4.2.3 Stack
The stack data save (storage) area is in the internal data memory (RAM), and is specified by
stack pointer (SP 81H).
Although 07H data is automatically set in the stack pointer when the CPU is reset, any desired
data can be set by software to enable the data memory to be used as stack from any address.
Two bytes of data memory are used when the stack is used by interrupt or CALL instruction,
and a single byte of data memory is used when the PUSH instruction is used. The status
where an interrupt is generated and the program counter contents are saved in the stack
when the stack pointer contents are 7FH, and the status where accumulator contents are
pushed during interrupt routine and are subsequently saved in the stack are shown in Table
4-2. The stack status up to completion of interrupt processing upon execution of POP and
RETI instructions is also included.
Table 4-2 Stack storage layout
Stack processing
Stack
pointer
RAM data bit
76543210
Before execution 7FH D7 D6 D5 D4 D3 D2 D1 D0
Interrupt process 80H PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0
(push PC) 81H PC15 PC14 PC13 PC12 PC11 PC10 PC9 PC8
PUSH process (ACC) 82H A7 A6 A5 A4 A3 A2 A1 A0
POP process (ACC) 82H A7 A6 A5 A4 A3 A2 A1 A0
RETI process (pop PC)
81H
PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC080H
PC15 PC14 PC13 PC12 PC11 PC10 PC9 PC8
After execution 7FH D7 D6 D5 D4 D3 D2 D1 D0