2
REGISTERS
8
EPSON
S1C33 FAMILY C33 PE CORE MANUAL
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
31
0
0xFFFFFFFF
0x00000000
SP = SP + 12
31
0
0xFFFFFFFF
r2
r1
r0
r2
r1
r0
0x00000000
Figure
2
.
4
.
3
.
1
SP and Stack (
2
)
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
31
0
0xFFFFFFFF
0x00000000
SP = SP - 4
31
0
0xFFFFFFFF
PC[31:0]
0x00000000
Figure
2
.
4
.
4
.
1
SP and Stack (
3
)
SP operation by the
ret
instruction
(
1
) [SP]
→
PC
(
2
) SP = SP +
4
SP
31
0
0xFFFFFFFF
0x00000000
SP = SP + 4
31
0
0xFFFFFFFF
PC[31:0]
PC[31:0]
0x00000000
Figure
2
.
4
.
4
.
2
SP and Stack (
4
)
Содержание S1C33 Series
Страница 1: ...CMOS 32 BIT SINGLE CHIP MICROCOMPUTER Core Manual S1C33 Family C33 PE ...
Страница 4: ......