Saving/Restoring Register Data Using A Load Instruction - Epson S1C17 Series Manual

Cmos 16-bit single chip microcontroller
Hide thumbs Also See for S1C17 Series:
Table of Contents

Advertisement

2 REGISTERS

2.4.4 Saving/Restoring Register Data Using a Load Instruction

The S1C17 Core provides load instructions to save and restore register data to/from the stack instead of push/pop
instructions.
Saving register data into the stack
Example: ld.a
-[%sp],%r0
(1) SP = SP - 4
(2) R0 → [SP]
SP
Restoring register data from the stack
Example: ld.a
%r0,[%sp]+
(1) [SP] → R0
(2) SP = SP + 4
SP
In addition to the instructions shown above, some other load instructions have been provided for operating the
stack. Refer to Chapter 7, "Details of Instructions," for more information on those instructions.
2-6
0xffffff
7
0
SP = SP - 4
0x000000
Figure 2.4.4.1 SP and Stack (5)
0xffffff
7
0
SP = SP + 4
0x00
R0[23:16]
R0[15:8]
R0[7:0]
0x000000
Figure 2.4.4.2 SP and Stack (6)
Seiko Epson Corporation
0xffffff
7
0
0x00
R0[23:16]
R0[15:8]
R0[7:0]
0x000000
0xffffff
7
0
0x00
R0[23:16]
R0[15:8]
R0[7:0]
0x000000
S1C17 CORE MANUAL
(REV. 1.2)

Advertisement

Table of Contents
loading

Table of Contents