Renesas R8C/Tiny Series Software Manual page 140

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

Advertisement

Chapter 3
Functions
STCTX
[ Syntax ]
STCTX
abs16,abs20
[ Operation ]
[ Function ]
• This instruction saves task context to 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 subtracted
from the stack pointer (SP). For this SP correction value, set the number of bytes to be transferred.
• Information on transferred registers is configured as shown below. Logical 1 indicates a register to be
transferred and logical 0 indicates a register that is not to be transferred.
• The table data is configured as shown below. The address indicated by abs20 is the base address of
the table. The data stored at an address twice the content of abs16 away from the base address
indicates register information, and the next address contains the stack pointer correction value.
Base address
abs20
of table
Direction in
which address
increases
[ Flag Change ]
U
I
O B
Flag
Change
[ Description Example ]
STCTX
Ram,Rom_TBL
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
STore ConTeXt
MSB
FB SB A1 A0 R3 R2 R1 R0
Transferred sequentially beginning with FB
Register information for task with task number 0. (See above diagram.)
SP correction value for task with task number 0. (See above diagram.)
Register information for task with task number 1. (See above diagram.)
SP correction value for task with task number 1. (See above diagram.)
Register information for task with task number n
SP correction value for task with task number n
*1
n=0 to 255
S
Z
D
C
LDCTX
page 122 of 263
Save context
[ Instruction Code/Number of Cycles ]
LSB
3.2
STCTX
Page: 233
*1
. (See above diagram.)
*1
. (See above diagram.)
Functions
abs16 x 2

Advertisement

Table of Contents
loading

Table of Contents