Stack; Components; Stack Pointer (Sp) - NEC PD17062 Datasheet

Mos integrated circuit 4-bit single-chip microcontroller containing pll frequency synthesizer and image display controller
Table of Contents

Advertisement

4. STACK

The stack is a register used to save an address returned by a program or the contents of the system register,
described later, when a subroutine call occurs or an interrupt is accepted.

4.1 COMPONENTS

The stack consists of a stack pointer (SP), which is a 4-bit binary counter, six 13-bit address stack registers
(ASRs), and two 3-bit interrupt stack registers.

4.2 STACK POINTER (SP)

The stack pointer is located at address 01H in the register file, and specifies an address stack register. The
contents of the stack pointer are decremented by 1 whenever a push operation (CALL, MOVT, or PUSH
instruction or interrupt acceptance) is performed, or incremented by 1 whenever a pop operation (RET, RETSK,
RETI, MOVT, or POP instruction) is performed.
The high-order bit of the stack pointer is always set to 0. The stack pointer can indicate any of eight different
values, 0H to 7H. However, 6H and 7H are not assigned to the stack.
26
Fig. 4-1 Structure of Stack Pointer
MSB
0
(SPb
)
(SPb
2
Table 4-1 Behavior of Stack Pointer
Instruction
CALL addr
CALL @AR
MOVT DBF, @AR
PUSH AR
Interrupt acceptance
RET
RETSK
MOVT DBF, @AR
POP AR
RETI
LSB
)
(SPb
)
1
0
Stack pointer value
SP – 1
SP + 1
PD17062

Advertisement

Table of Contents
loading

Table of Contents