HMS8132E/HMS81032TL
Nov. 2001 Ver 2.00
17
Figure 8-3 Stack Operation
Program Counter:
The Program Counter is a 16-bit wide which consists of
two 8-bit registers, PCH and PCL. This counter indicates
the address of the next instruction to be executed. In reset
state, the program counter has reset routine address
(PC
H
:0FF
H
, PC
L
:0FE
H
).
Program Status Word:
The Program Status Word (PSW) contains several bits that
reflect the current state of the CPU. The PSW is described
in Figure 8-4. It contains the Negative flag, the Overflow
flag, the Break flag the Half Carry (for BCD operation),
the Interrupt enable flag, the Zero flag, and the Carry flag.
[Carry flag C]
This flag stores any carry or borrow from the ALU of CPU
after an arithmetic operation and is also changed by the
Shift Instruction or Rotate Instruction.
SP
01
H
Stack Address (100
H
~ 1FF
H
)
15
0
8
7
Hardware fixed
Caution:
The Stack Pointer must be initialized by software be-
cause its value is undefined after RESET.
Example: To initialize the SP
LDX
#0FFH
TXSP
; SP
←
FF
H
At execution of
a CALL/TCALL/PCALL
PCL
PCH
01FF
SP after
execution
SP before
execution
01FD
01FE
01FD
01FC
01FF
Push
down
At acceptance
of interrupt
PCL
PCH
01FF
01FC
01FE
01FD
01FC
01FF
Push
down
PSW
At execution
of RET instruction
PCL
PCH
01FF
01FF
01FE
01FD
01FC
01FD
Pop
up
At execution
of RETI instruction
PCL
PCH
01FF
01FF
01FE
01FD
01FC
01FC
Pop
up
PSW
0100H
01FFH
Stack
depth
At execution
of PUSH instruction
A
01FF
01FE
01FE
01FD
01FC
01FF
Push
down
SP after
execution
SP before
execution
PUSH A (X,Y,PSW)
At execution
of POP instruction
A
01FF
01FF
01FE
01FD
01FC
01FE
Pop
up
POP A (X,Y,PSW)
Содержание HMS81004E
Страница 4: ...HMS81032E HMS81032TL NOV 2001 Ver 2 00...
Страница 84: ...HMS81032E HMS81032TL 80 Nov 2001 Ver 2 00...
Страница 85: ...APPENDIX...