Sp Operation During Execution Of Pop-Related Instructions; Sp Operation During Execution Of A Call Instruction - Epson S1C33 Series Core Manual

Cmos 32-bit single chip microcomputer
Hide thumbs Also See for S1C33 Series:
Table of Contents

Advertisement

2 REGISTERS

2.4.3 SP Operation during Execution of Pop-Related Instructions

In a pop-related instruction, first data is restored from the address indicated by the SP into the register.
[SP] → rs
Next, the SP is incremented by 4 to move the pointer to a higher address location.
SP = SP + 4
Example: popn
%r2
SP

2.4.4 SP Operation during Execution of a Call Instruction

A subroutine call instruction, call, uses one word (32 bits) of the stack. The call instruction pushes the content
of the PC (return address) onto the stack before branching to a subroutine. The pushed address is restored into the
PC by the ret instruction, and the program is returned to the address next to that of the call instruction.
SP operation by the call instruction
(1) SP = SP - 4
(2) PC → [SP]
SP
SP operation by the ret instruction
(1) [SP] → PC
(2) SP = SP + 4
SP
8
0xFFFFFFFF
31
0
SP = SP + 12
r2
r1
r0
0x00000000
Figure 2.4.3.1 SP and Stack (2)
0xFFFFFFFF
31
0
0x00000000
Figure 2.4.4.1 SP and Stack (3)
0xFFFFFFFF
31
0
PC[31:0]
0x00000000
Figure 2.4.4.2 SP and Stack (4)
EPSON
0xFFFFFFFF
31
r2
r1
r0
0x00000000
0xFFFFFFFF
31
SP = SP - 4
PC[31:0]
0x00000000
0xFFFFFFFF
31
SP = SP + 4
PC[31:0]
0x00000000
S1C33 FAMILY C33 PE CORE MANUAL
0
0
0

Advertisement

Table of Contents
loading

Table of Contents