![NEC mPD17120 Subseries User Manual Download Page 52](http://html.mh-extra.com/html/nec/mpd17120-subseries/mpd17120-subseries_user-manual_249259052.webp)
CHAPTER 6 STACK
37
Table 6-1. Operation of the Stack Pointer
Instruction
Stack Pointer Value
Counter of Interrupt Stack Register
CALL addr
CALL @AR
MOVT DBF, @AR
–1
Not changed
(1st instruction cycle)
PUSH AR
Interrupt receipt
–1
–1
RET
RETSK
MOVT DBF, @AR
+1
Not changed
(2nd instruction cycle)
POP AR
RETI
+1
+1
As mentioned above, the stack pointer is a 3-bit counter and therefore can conceivably store any of the eight values
from 0H to 7H. Since there are only five address stack registers, however, a stack pointer value that is greater than
five
will cause an internal reset signal to be generated
(to prevent a software crash).
Since the stack pointer is located in the register file, it can be read and written to directly by using the PEEK and
POKE instructions to manipulate the register file. When this is done, the stack pointer value will change but the values
in the address stack register will not be affected.
6.6 STACK OPERATION DURING SUBROUTINES, TABLE REFERENCES, AND INTERRUPTS
Stack operation during execution of each command is explained in
6.6.1
to
6.6.3
.
6.6.1 Stack Operation during Subroutine Calls (CALL) and Returns (RET, RETSK)
Table 6-2 shows operation of the stack pointer (SP), address stack register, and the program counter (PC) during
execution of subroutine calls and returns.
Summary of Contents for mPD17120 Subseries
Page 15: ... x MEMO ...
Page 23: ... MEMO 8 ...
Page 45: ... MEMO 30 ...
Page 49: ... MEMO 34 ...
Page 55: ... MEMO 40 ...
Page 93: ... MEMO 78 ...
Page 99: ... MEMO 84 ...
Page 102: ...CHAPTER 11 ARITHMETIC AND LOGIC UNIT 87 MEMO ...
Page 119: ... MEMO 104 ...
Page 175: ... MEMO 160 ...
Page 199: ... MEMO 184 ...
Page 265: ... MEMO 250 ...
Page 281: ...266 MEMO ...
Page 285: ... MEMO 270 ...
Page 289: ... MEMO 274 ...