57
CHAPTER 3 CPU ARCHITECTURE
Preliminary User’s Manual U14581EJ3V0UM00
(3) Stack pointer (SP)
This is a 16-bit register to hold the start address of the memory stack area. Only the internal high-speed RAM
area can be set as the stack area.
Figure 3-9. Stack Pointer Configuration
SP
15
0
SP15 SP14 SP13 SP12 SP11 SP10 SP9 SP8 SP7 SP6 SP5 SP4 SP3 SP2 SP1 SP0
The SP is decremented prior to write (save) to the stack memory and is incremented after read (restore) from
the stack memory.
Each stack operation saves/restores data as shown in Figures 3-10 and 3-11.
Caution
Since RESET input makes SP contents undefined, be sure to initialize the SP before
instruction execution.
Figure 3-10. Data to Be Saved to Stack Memory
Interrupt and
BRK instruction
PSW
PC15 to PC8
PC15 to PC8
PC7 to PC0
Register pair, low
SP SP _ 2
SP _ 2
Register pair, high
CALL, CALLF, and
CALLT instructions
PUSH rp instruction
SP _ 1
SP
SP SP _ 2
SP _ 2
SP _ 1
SP
PC7 to PC0
SP _ 3
SP _ 2
SP _ 1
SP
SP SP _ 3
Figure 3-11. Data to Be Reset from Stack Memory
RETI and RETB
instructions
PSW
PC15 to PC8
PC15 to PC8
PC7 to PC0
Register pair, low
SP SP + 2
SP
Register pair, high
RET instruction
POP rp instruction
SP + 1
PC7 to PC0
SP SP + 2
SP
SP + 1
SP + 2
SP
SP + 1
SP SP + 3
Summary of Contents for mPD780851
Page 2: ...2 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 8: ...8 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 12: ...12 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 26: ...26 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 46: ...46 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 74: ...74 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 90: ...90 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 100: ...100 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 136: ...136 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 142: ...142 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 186: ...186 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 222: ...222 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 230: ...230 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 240: ...240 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 262: ...262 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 296: ...296 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 304: ...304 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...
Page 314: ...314 Preliminary User s Manual U14581EJ3V0UM00 MEMO ...