Renesas R8C/Tiny Series Software Manual page 103

16-bit single-chip microcomputer
Hide thumbs Also See for R8C/Tiny Series:
Table of Contents

Advertisement

Chapter 3
Functions
LDCTX
[ Syntax ]
LDCTX
abs16,abs20
[ Function ]
• This instruction restores task context from the stack area.
• Set the RAM address that contains the task number in abs16 and the start address of table data in abs20.
• The required register information is specified from table data by the task number and the data in the stack area
is transferred to each register according to the specified register information. Then the SP correction value is
added to the stack pointer (SP). For this SP correction value, set the number of bytes you want to the trans-
ferred.
• Information on transferred registers is configured as shown below. Logic 1 indicates a register to be
transferred and logic 0 indicates a register that is not transferred.
• The table data is comprised as shown below.The address indicated by abs20 is the base address of
the table. The data stored at an address apart from the base address as much as twice the content of
abs16 indicates register information, and the next address contains the stack pointer correction value.
Base address
abs20
of table
D i r e c t i o n i n
which address
increases
[ Flag Change ]
Flag
U
I
O
Change
[ Description Example ]
LDCTX
Ram,Rom_TBL
[ Related Instructions ]
Restore context
LoaD ConTeXt
MSB
FB SB A1 A0 R3 R2 R1 R0
Transferred sequentially
beginning with R0
Register information for the task whose task number = 0. (See the above diagram.)
SP correction value for the task whose task number = 0. (See the above diagram.)
Register information for the task whose task number = 1. (See the above diagram.)
SP correction value for the task whose task number = 1. (See the above diagram.)
Register information for the task whose task number = n
SP correction value for the task whose task number = n
*1
n=0 to 255
B
S
Z
D
C
STCTX
[ Instruction Code/Number of Cycles ]
LSB
*1
. (See the above diagram.)
*1
. (See the above diagram.)
86
3.2 Functions
LDCTX
Page=189
abs16 2

Advertisement

Table of Contents
loading

Table of Contents