122
Chapter 3 Functions
3.2 Functions
STore ConTeXt
Save context
STCTX
Ram,Rom_TBL
[ Related Instructions ]
LDCTX
[ Flag Change ]
STCTX
STCTX
[ Syntax ]
STCTX
abs16,abs20
[ Description Example ]
[ Operation ]
U
I
O
B
S
Z
D
C
[ Instruction Code/Number of Cycles ]
Page=233
Flag
Change
[ 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
to the stack pointer (SP). For this SP correction value, set the number of bytes you want to the transferred.
• 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.
Transferred sequentially beginning with FB
FB SB A1 A0 R3 R2 R1 R0
MSB
LSB
abs20
Base address
of table
D i r e c t i o n i n
which address
increases
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
*1
. (See the above diagram.)
SP correction value for the task whose task number = n
*1
. (See the above diagram.)
abs16 x 2
*1
n=0 to 255
• 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.
Содержание R8C/Tiny Series
Страница 50: ...Chapter 3 Functions 3 1 Guide to This Chapter 3 2 Functions...
Страница 151: ...134 Chapter 3 Functions 3 2 Functions Blank for page layout...
Страница 152: ...Chapter 4 Instruction Code Number of Cycles 4 1 Guide to This Chapter 4 2 Instruction Code Number of Cycles...
Страница 278: ...Chapter 6 Calculation Number of Cycles 6 1 Instruction queue buffer...
Страница 287: ...Glossary 1 Glossary Technical terms used in this software manual are explained below They are good in this manual only...
Страница 291: ...Symbol 1 Table of symbols Symbols used in this software manual are explained below They are good in this manual only...
Страница 295: ...REVISION HISTORY R8C Tiny Series SOFTWARE MANUAL Rev Date Description Page Summary B 1 1 00 Jun 19 03 First Edition...
Страница 297: ...R8C Tiny Series Software Manual 2 6 2 Ote machi Chiyoda ku Tokyo 100 0004 Japan...