Академический Документы
Профессиональный Документы
Культура Документы
R8C/Tiny Series
16
Software Manual
Rev. 2.00
Revision date: Oct 17, 2005
www.renesas.com
Renesas Technology Corp. puts the maximum effort into making semiconductor products
better and more reliable, but there is always the possibility that trouble may occur with
them. Trouble with semiconductors may lead to personal injury, fire or property damage.
Remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap.
2.
3.
4.
5.
6.
7.
8.
These materials are intended as a reference to assist our customers in the selection of the
Renesas Technology Corp. product best suited to the customer's application; they do not
convey any license under any intellectual property rights, or any other rights, belonging to
Renesas Technology Corp. or a third party.
Renesas Technology Corp. assumes no responsibility for any damage, or infringement of
any third-party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials.
All information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these
materials, and are subject to change by Renesas Technology Corp. without notice due to
product improvements or other reasons. It is therefore recommended that customers contact Renesas Technology Corp. or an authorized Renesas Technology Corp. product distributor for the latest product information before purchasing a product listed herein.
The information described here may contain technical inaccuracies or typographical errors.
Renesas Technology Corp. assumes no responsibility for any damage, liability, or other
loss rising from these inaccuracies or errors.
Please also pay attention to information published by Renesas Technology Corp. by various means, including the Renesas Technology Corp. Semiconductor home page (http://
www.renesas.com).
When using any or all of the information contained in these materials, including product
data, diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information
and products. Renesas Technology Corp. assumes no responsibility for any damage, liability or other loss resulting from the information contained herein.
Renesas Technology Corp. semiconductors are not designed or manufactured for use in a
device or system that is used under circumstances in which human life is potentially at
stake. Please contact Renesas Technology Corp. or an authorized Renesas Technology
Corp. product distributor when considering the use of a product contained herein for any
specific purposes, such as apparatus or systems for transportation, vehicular, medical,
aerospace, nuclear, or undersea repeater use.
The prior written approval of Renesas Technology Corp. is necessary to reprint or reproduce in whole or in part these materials.
If these products or technologies are subject to the Japanese export control restrictions,
they must be exported under a license from the Japanese government and cannot be imported into a country other than the approved destination.
Any diversion or reexport contrary to the export control laws and regulations of Japan and/
or the country of destination is prohibited.
Please contact Renesas Technology Corp. for further details on these materials or the
products contained therein.
A Q&A table, symbols, a glossary, and an index are appended at the end of this manual.
Contents
Hardware overview
Data Sheet
Hardware Manual
Software Manual
Application Note
RENESAS TECHNICAL
UPDATE
NOTES:
1. Before using this material, please visit the our website to verify that this is the most updated
document available.
Table of Contents
Chapter 1
Overview ___________________________________________________
A-1
Chapter 2
Chapter 3
Functions ___________________________________________________
Chapter 4
Chapter 5
Interrupts ___________________________________________________
A-2
Chapter 6
A-3
ABS
ADC
ADCF
ADD
ADJNZ
AND
BAND
BCLR
BMCnd
BMEQ/Z
BMGE
BMGEU/C
BMGT
BMGTU
BMLE
BMLEU
BMLT
BMLTU/NC
BMN
BMNE/NZ
BMNO
BMO
BMPZ
BNAND
BNOR
BNOT
BNTST
BNXOR
BOR
BRK
BSET
BTST
BTSTC
BTSTS
BXOR
CMP
DADC
DADD
DEC
DIV
Mnemonic
DIVU
68
DIVX
DSBB
DSUB
ENTER
EXITD
EXTS
FCLR
FSET
INC
INT
INTO
JCnd
JEQ/Z
JGE
JGEU/C
JGT
JGTU
JLE
JLEU
JLT
JLTU/NC
JN
JNE/NZ
JNO
JO
JPZ
JMP
JMPI
JSR
JSRI
LDC
LDCTX
LDE
LDINTB
LDIPL
MOV
MOVA
69
70
71
72
73
74
75
76
77
78
79
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
81
82
83
84
85
86
87
88
89
90
92
Quick Reference-1
MOVDir
MOVHH
MOVHL
MOVLH
MOVLL
MUL
MULU
NEG
NOP
NOT
OR
POP
POPC
POPM
PUSH
PUSHA
PUSHC
PUSHM
REIT
RMPA
ROLC
RORC
Quick Reference-2
Mnemonic
Transfer
MOV
MOVA
MOVDir
POP
POPM
PUSH
PUSHA
PUSHM
LDE
STE
STNZ
STZ
STZX
XCHG
BAND
BCLR
BMCnd
BNAND
BNOR
BNOT
BNTST
BNXOR
BOR
BSET
BTST
BTSTC
BTSTS
BXOR
ROLC
RORC
ROT
SHA
SHL
ABS
ADC
ADCF
ADD
CMP
DADC
Bit
manipulation
Shift
Arithmetic
Description
Transfer
Transfer effective address
Transfer 4-bit data
Restore register/memory
Restore multiple registers
Save register/memory/immediate data
Save effective address
Save multiple registers
Transfer from extended data area
Transfer to extended data area
Conditional transfer
Conditional transfer
Conditional transfer
Exchange
Logically AND bits
Clear bit
Conditional bit transfer
Logically AND inverted bits
Logically OR inverted bits
Invert bit
Test inverted bit
Exclusive OR inverted bits
Logically OR bits
Set bit
Test bit
Test bit and clear
Test bit and set
Exclusive OR bits
Rotate left with carry
Rotate right with carry
Rotate
Shift arithmetic
Shift logical
Absolute value
Add with carry
Add carry flag
Add without carry
Compare
Decimal add with carry
Quick Reference-3
Function
Mnemonic
Arithmetic
DADD
DEC
DIV
DIVU
DIVX
DSBB
DSUB
EXTS
INC
MUL
MULU
NEG
RMPA
SBB
SUB
AND
NOT
OR
TST
XOR
ADJNZ
SBJNZ
JCnd
JMP
JMPI
JSR
JSRI
RTS
SMOVB
SMOVF
SSTR
BRK
ENTER
EXITD
FCLR
FSET
INT
INTO
LDC
LDCTX
LDINTB
Complement of two
Calculate sum-of-products
Subtract with borrow
Subtract without borrow
Logical AND
Invert all bits
Logical OR
Test
Exclusive OR
Add and conditional jump
Subtract and conditional jump
Jump on condition
Unconditional jump
Jump indirect
Subroutine call
Indirect subroutine call
Return from subroutine
Transfer string backward
Transfer string forward
Store string
Debug interrupt
Build stack frame
Deallocate stack frame
Clear flag register bit
Set flag register bit
Interrupt by INT instruction
Interrupt on overflow
Transfer to control register
Restore context
Transfer to INTB register
Logical
Jump
String
Other
Quick Reference-4
167
169
170
171
172
173
175
178
180
203
205
96
109
114
127
45
98
99
129
133
44
115
80
81
82
83
84
113
118
119
120
56
72
73
75
76
78
79
85
86
88
207
218
222
236
147
208
209
239
243
146
224
182
184
185
187
188
221
230
231
231
157
177
178
179
180
181
182
189
189
192
Mnemonic
Other
LDIPL
NOP
POPC
PUSHC
REIT
STC
STCTX
UND
WAIT
Description
Quick Reference-5
193
207
213
216
216
232
233
241
241
#IMM
#IMM20
#IMM16
#IMM8
abs16
dsp:16[SB]
dsp:16[An]
dsp:8[SB/FB]
[An]
An
R1H/R3
R1L/R2
R0H/R1
R0L/R0
dsp:8[An]
Addressing Mode
Mnemonic
ABS
39
138
ADC
40
138
ADCF
41
140
ADD*1
42
140
ADJNZ*1
44
146
AND
45
147
CMP
62
161
DADC
64
165
DADD
65
167
DEC
66
169
DIV
67
170
DIVU
68
171
DIVX
69
172
DSBB
70
173
DSUB
71
175
ENTER
72
177
74
178
77
180
INT
78
181
JMPI*1
82
185
JSRI*1
83
187
LDC*1
85
189
LDE*1
87
191
LDINTB
88
192
LDIPL
89
193
*2
EXTS
INC
*3
*4
Quick Reference-6
#IMM
#IMM20
#IMM16
#IMM8
abs16
dsp:16[SB]
dsp:16[An]
dsp:8[SB/FB]
[An]
An
R1H/R3
R1L/R2
R0H/R1
R0L/R0
dsp:8[An]
Addressing Mode
Mnemonic
MOV*1
90
193
MOVA
92
200
MOVDir
93
201
MUL
94
203
MULU
95
205
NEG
96
207
NOT
98
208
OR
99
209
POP
101
211
POPM*1
103
213
PUSH
104
214
PUSHA
105
216
PUSHM*1
107
217
ROLC
110
218
RORC
111
219
ROT
112
220
SBB
114
222
SBJNZ*1
115
224
SHA*1
116
225
SHL*1
117
228
STC*1
121
232
STCTX*1
122
233
STE*1
123
233
STNZ
124
235
STZ
125
235
Quick Reference-7
#IMM
#IMM20
#IMM16
#IMM8
abs16
dsp:16[SB]
dsp:16[An]
dsp:8[SB/FB]
dsp:8[An]
An
R1H/R3
R1L/R2
R0H/R1
R0L/R0
[An]
Addressing Mode
Mnemonic
STZX
126
236
SUB
127
236
TST
129
239
XCHG
132
242
XOR
133
243
Quick Reference-8
PC
INTBL/INTBH
FLG
ISP/USP
SB/FB
label
dsp:8[SP]
[A1A0]
R2R0/R3R1
abs20
dsp:20[A1]
dsp:20[A0]
A1A0
Addressing Mode
Mnemonic
ADD*1
42
140
ADJNZ*1
44
146
JCnd
80
182
JMP
81
184
82
185
JSR
83
187
JSRI*1
84
188
LDC*1
85
189
LDCTX
86
189
LDE*1
87
191
88
192
MOV*1
90
193
POPC
102
213
POPM*1
103
213
PUSHC
106
216
PUSHM*1
107
217
115
224
SHA*1
116
225
SHL*1
117
228
121
232
122
233
123
233
JMPI
*1
*2
LDINTB
SBJNZ
*1
STC*1
STCTX
*1
STE*1
Quick Reference-9
U/I/O/B/S/Z/D/C
bit,base:11
bit,base:16
bit,base:16[SB]
base:16[An]
bit,base:8[SB/FB]
[An]
bit,An
bit,Rn
base:8[An]
Addressing Mode
Mnemonic
BAND
47
150
BCLR
48
150
BMCnd
49
152
BNAND
50
153
BNOR
21
154
BNOT
52
154
BNTST
53
155
BNXOR
54
156
BOR
55
156
BSET
57
157
BTST
58
158
BTSTC
59
159
BTSTS
60
160
BXOR
61
160
FCLR
75
179
FSET
76
180
Quick Reference-10
Quick Reference-11
Chapter 1
Overview
1.1 Features of R8C/Tiny Series
1.2 Address Space
1.3 Register Configuration
1.4 Flag Register (FLG)
1.5 Register Banks
1.6 Internal State after Reset is Cleared
1.7 Data Types
1.8 Data Arrangement
1.9 Instruction Formats
1.10 Vector Tables
Chapter 1 Overview
page 2 of 263
Chapter 1 Overview
00000 16
SFR area
002FF 16
00400 16
Internal RAM area
Extention area
FFFFF16
page 3 of 263
Chapter 1 Overview
b15
b8 b7
b0
R2
R3
Data register*
R2
R3
A0
Address register*
A1
FB
b19
b15
INTBL
INTBH
b0
PC
Program counter
b15
b0
USP
ISP
SB
b15
b0
Flag register
FLG
b15
b8
IPL
b7
b0
U I O B S Z D C
Carry flag
Debug flag
Zero flag
Sign flag
Register bank select flag
Overflow flag
Interrupt enable flag
Stack pointer select flag
Reserved area
Processor interrupt priority level
Reserved area
1.3.1 Data Registers (R0, R0H, R0L, R1, R1H, R1L, R2, and R3)
The data registers (R0, R1, R2, and R3) each consist of 16 bits and are used primarily for transfers and
arithmetic/logic operations.
Registers R0 and R1 can be divided into separate high-order (R0H, R1H) and low-order (R0L, R1L)
parts for use as 8-bit data registers. For some instructions, moreover, R2 and R0 or R3 and R1 can be
combined to configure a 32-bit data register (R2R0 or R3R1).
page 4 of 263
Chapter 1 Overview
1.3.6 User Stack Pointer (USP) and Interrupt Stack Pointer (ISP)
There are two types of stack pointers: a user stack pointer (USP) and an interrupt stack pointer (ISP).
Each consists of 16 bits.
The stack pointer (USP/ISP) to be used can be switched with the stack pointer select flag (U flag).
The stack pointer select flag (U flag) is bit 7 of the flag register (FLG).
page 5 of 263
Chapter 1 Overview
page 6 of 263
Chapter 1 Overview
b0
IPL
Carry flag
Debug flag
Zero flag
Sign flag
Register bank select flag
Overflow flag
Interrupt enable flag
Stack pointer select flag
Reserved area
Processor interrupt priority level
Reserved area
page 7 of 263
Chapter 1 Overview
b15
b8b7
b0
b15
b8b7
b0
R0
R0
R1
R1
R2
R3
R2
R3
A0
A0
A1
A1
FB
FB
page 8 of 263
Chapter 1 Overview
page 9 of 263
Chapter 1 Overview
1.7.1 Integer
An integer can be signed or unsigned. A negative value of a signed integer is represented by twos
complement.
b7
b0
S
b7
b0
b0
S
b15
b0
S
b31
page 10 of 263
b0
b0
Chapter 1 Overview
1.7.2 Decimal
The decimal data type is used by the DADC, DADD, DSBB, and DSUB instructions.
b7
Pack format
b0
(2 digits)
Pack format
(4 digits)
page 11 of 263
b15
b0
Chapter 1 Overview
1.7.3 Bits
Register bits
Figure 1.7.3 shows register bit specification.
Register bits can be specified by register directly (bit, Rn or bit, An). Use bit, Rn to specify a bit in a
data register (Rn); use bit, An to specify a bit in an address register (An).
The bits in each register are assigned bit numbers from 0 to 15, from LSB to MSB. Therefore, bit, Rn
and bit, An can be used to specify a bit number from 0 to 15.
Rn
b15
b0
bit,Rn
(bit: 0 to 15, n: 0 to 3)
An
b15
b0
bit,An
(bit: 0 to 15, n: 0 to 1)
Memory bits
Figure 1.7.4 shows the addressing modes used for memory bit specification. Table 1.7.1 lists the address range in which bits can be specified in each addressing mode. Be sure to observe the address
range in Table 1.7.1 when specifying memory bits.
Addressing modes
bit,base:8
bit,base:16
bit,base:16
Absolute addressing
SB-based relative
addressing
bit,base:8[SB]
bit,base:11[SB]
bit,base:16[SB]
FB-based relative
addressing
Address register-based indirect
addressing
Address register-based relative
addressing
bit,base:8[FB]
[An]
base:8[An]
base:16[An]
Specification range
Lower Limit (Address) Upper Limit (Address)
0000016
01FFF16
[SB]
[SB]+0001F16
[SB]
[SB]+000FF16
[SB]
[SB]+01FFF16
[FB]0001016
[FB]+0000F16
0000016
01FFF16
base:8
base:8+01FFF16
base:16
base:16+01FFF16
page 12 of 263
Remarks
The access range is 0000016 to 0FFFF16.
The access range is 0000016 to 0FFFF16.
The access range is 0000016 to 0FFFF16.
The access range is 0000016 to 0FFFF16.
The access range is 0000016 to 020FE16.
The access range is 0000016 to 0FFFF16.
Chapter 1 Overview
Address
b7
b0
n-1
n
n+1
n{1
n+1
b7
nn
b0b7
n|1
n1
b0b7
0
b0
b7
b0
Bit map
Memory map
Address 0000A16
BSET
2,AH
b7
b2
b0
b15
b10 b8b7
Address 0000916
BSET
10,9H
b0
Address 0000816
BSET
18,8H
b23
b18 b16b15
b8b7
b87
b82 b80b79
b72
b0
Address 0000016
BSET
82,0H
b7
page 13 of 263
b0
Chapter 1 Overview
page 14 of 263
Chapter 1 Overview
1.7.4 String
String data consists of a given length of consecutive byte (8-bit) or word (16-bit) data.
This data type can be used in three string instructions: character string backward transfer (SMOVB
instruction), character string forward transfer (SMOVF instruction), and specified area initialize (SSTR
instruction).
b7
b0
b15
b0
b7
b0
b15
b0
b7
b0
page 15 of 263
b15
b0
Chapter 1 Overview
b3
b0
b0
b0
b0
page 16 of 263
LSB
Chapter 1 Overview
b7
b0
N
N+1
N+2
N+3
b7
DATA
N
N+1
N+2
N+3
N
N+1
N+2
N+3
b0
DATA(L)
DATA(H)
b0
b7
DATA(L)
DATA(M)
DATA(H)
N
N+1
N+2
N+3
b0
DATA(LL)
DATA(LH)
DATA(HL)
DATA(HH)
Long Word (32-bit) data
MOV.B
N,R0H
b7
N
N+1
N+2
N+3
b0
DATA
b15
b0
DATA
H
R0
MOV.W
N,R0
b7
N
N+1
N+2
N+3
b0
DATA(L)
DATA(H)
b15
R0
Word (16-bit) data
page 17 of 263
b0
DATA(H)
H
DATA(L)
L
Chapter 1 Overview
page 18 of 263
Chapter 1 Overview
FFFDC16
0FFDC16
Interrupt
vector table
0FFFF 16
FFFE016
Undefined instruction
Overflow
FFFE416
BRK instruction
FFFE816
Address match
FFFEC16
FFFF016
FFFF416
page 19 of 263
Single step
Oscillation stop detection/
watchdog timer
FFFF816
(Reserved)
(Reserved)
FFFFC16
Reset
Chapter 1 Overview
b19
INTB
b0
IntBase
IntBase+4
IntBase+8
31
32
33
IntBase+252
63
page 20 of 263
Software interrupt
numbers
Chapter 2
Addressing Modes
2.1 Addressing Modes
2.2 Guide to This Chapter
2.3 General Instruction Addressing
2.4 Special Instruction Addressing
2.5 Bit Instruction Addressing
page 22 of 263
The value indicated by the displacement (dsp) plus the content of the
address register (A0/A1)added
dsp:16[A0] without the sign bitsis the effective
dsp:16[A1] address for the operation.
dsp:8[A0]
dsp:8[A1]
(3)
dsp
A0 / A1
address
(4)
(1) Name
The name of the addressing mode.
(2) Symbol
The symbol representing the addressing mode.
(3) Description
A description of the addressing operation and the effective address range.
page 23 of 263
Memory
Register
#IMM
#IMM8
#IMM16
b7
b0
b15
b8 b7
b0
b15
b8 b7
b0
#IMM8
#IMM16
#IMM20
b19
#IMM20
Register direct
R0L
R0H
R1L
R1H
Register
b0
R0L / R1L
b15
b8
R0H / R1H
R0
R1
R2
R0 / R1 / R2 / b15
R3 / A0 / A1
b8 b7
b0
R3
A0
A1
Absolute
Memory
abs16
[A0]
[A1]
page 24 of 263
Register
A0 / A1
address
Memory
dsp:8[A0]
Memory
dsp
Register
A0 / A1
address
SB relative
The address indicated by the content
Memory
Register
SB
address
address
dsp
FB relative
Memory
dsp
Register
FB
address
address
dsp
page 25 of 263
Memory
If the dsp value is negative
dsp
Register
page 26 of 263
SP
address
dsp
abs20
Memory
abs20
Register
A0
Memory
dsp
address
Memory
dsp
Register
A0 / A1
This addressing mode can be used with
the LDE, STE, JMPI, and JSRI instructions.
address
PC
dsp: 20[A0]
LDE, STE, JMPI, and JSRI
instructions
dsp: 20[A1]
JMPI and JSRI instructions
32-bit address register indirect
[A1A0]
A1
Register
page 27 of 263
A0
b31
b16 b15
b0
address-H
address-L
Memory
address
R2R0
R3R1
A1A0
b16 b15
R2R0 b31
R3R1
b0
R2R0 b31
R3R1
A1A0
b16 b15
b0
PC
INTBL
INTBH
ISP
SP
SB
FB
FLG
Register
b0
b15
INTBL
b15
b4 b3
b0
INTBH
b15
b0
b15
b0
b15
b0
b15
b0
b15
b0
ISP
USP
SB
FB
FLG
page 28 of 263
label
Memory
Base address
dsp
label
+0
dsp +7
Memory
If the dsp value is negative
label
dsp
Base address
dsp
label
page 29 of 263
Register direct
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,R0
R0
b15
b0
bit,A1
Bit position
Absolute
b0
b7
base
Bit position
[A0]
[A1]
page 30 of 263
b7
0000016
Bit position
b0
base:8[A0]
base:8[A1]
base:16[A0]
base:16[A1]
b7
b0
base
Bit position
SB relative
page 31 of 263
Memory
b7
Register
SB
address
address
base
Bit position
b0
FB relative
bit,base:8[FB]
Memory
If the base value is negative
(Bit position)
However, if the address of the bit that is
the object of the operation is outside the
range 0000016 to 0FFFF16, bits 17 and
above are ignored and the address
returns to 0000016 or 0FFFF16.
The address range that can be specified
by bit, base:8 extends 16 bytes toward
lower addresses or 15 bytes toward
higher addresses from the frame base
register (FB) value.
base
Register
FB
address
address
base
If the base value is positive
Bit position
FLG direct
U
I
O
B
S
Z
D
C
page 32 of 263
Register
b7
FLG
b0
Chapter 3
Functions
3.1 Guide to This Chapter
3.2 Functions
Chapter 3 Functions
Chapter 3 Functions
(1)
(2)
(3)
3.2 Functions
Transfer
MOVe
MOV
[ Syntax ]
MOV
Page: 193
MOV.size (:format) src,dest
G , Q , Z , S (Can be specified)
B,W
(4)
[ Operation ]
dest
(5)
src
[ Function ]
[ Selectable src/dest ]
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
(7)
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
dsp:8[SP]
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the transfer results in MSB of dest = 1; otherwise cleared.
Z :
(8)
(9)
[ Description Example ]
MOV.B:S
#0ABH,R0L
MOV.W
#-1,R2
[ Related Instruction]
90
page 34 of 263
R1H/R3
[A1]
dsp:8[FB]
abs16
dsp:8[SP]
Chapter 3 Functions
(1) Mnemonic
The mnemonic explained in the page.
(3) Syntax
The syntax of the instruction using symbols. If (:format) is omitted, the assembler chooses the optimum
specifier.
MOV.size (: format) src , dest
(a) (b)
(c)
G,Q,S,Z
(f)
B,W
(e)
(d)
(a) Mnemonic
MOV
Shows the mnemonic.
(b) Size specifier
.size
Shows the data sizes in which data is handled. The following data sizes may be specified:
.B
Byte (8 bits)
.W
Word (16 bits)
.L
Long word (32 bits)
Some instructions do not have a size specifier.
(c) Instruction format specifier
(: format)
Shows the instruction format. If (: format) is omitted, the assembler chooses the optimum specifier.
If (: format) is entered, its content is given priority. The following instruction formats may be specified:
:G Generic format
:Q Quick format
:S Short format
:Z Zero format
Some instructions do not have an instruction format specifier.
(d) Operands
src, dest
Shows the operands.
(e) Shows the data sizes that can be specified in (b).
(f) Shows the instruction formats that can be specified in (c).
page 35 of 263
Chapter 3 Functions
Chapter 3 Functions
(1)
(2)
(3)
3.2 Functions
Transfer
MOVe
MOV
[ Syntax ]
MOV
(4)
[ Operation ]
dest
src
(5)
[ Function ]
This instruction transfers src to dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to transfer
data in 16 bits. If src is A0 or A1, the 8 low-order bits of A0 or A1 are transferred.
(6)
[ Selectable src/dest ]
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
(7)
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
dsp:8[SP]
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[ Flag Change ]
Flag
Change
Conditions
S :
Z :
(8)
(9)
The flag is set when the transfer results in MSB of dest = 1; otherwise cleared.
The flag is set when the transfer results in 0; otherwise cleared.
[ Description Example ]
MOV.B:S
#0ABH,R0L
MOV.W
#-1,R2
[ Related Instruction]
90
page 36 of 263
R1H/R3
[A1]
dsp:8[FB]
abs16
dsp:8[SP]
Chapter 3 Functions
(4) Operation
Explains the operation of the instruction using symbols.
(5) Function
Explains the function of the instruction and precautions to be taken when using the instruction.
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
dest
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
dsp:8[SP]
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
(b)
dsp:8[SP]
(d)
(c)
(e)
page 37 of 263
Chapter 3 Functions
The syntax of the jump instructions JMP, JPMI, JSR, and JSRI are illustrated below by example .
Chapter 3 Functions
(1)
(2)
JMP
3.2 Functions
Unconditional jump
JuMP
[ Syntax ]
(3)
JMP
(3) Syntax
Indicates the instruction syntax using symbols.
(a)
(b)
(d)
(c)
(a) Mnemonic
JMP
Shows the mnemonic.
(b) Jump distance specifier
.length
Shows the distance of the jump. If (.length) is omitted from the JMP or JSR instruction, the assembler chooses the optimum specifier. If (.length) is entered, its content is given priority.
The following jump distances may be specified:
.S
3-bit PC forward relative (+2 to +9)
.B
8-bit PC relative
.W
16-bit PC relative
.A
20-bit absolute
(c) Operand
label
Shows the operand.
(d) Shows the jump distances that can be specified in (b).
page 38 of 263
Chapter 3
Functions
3.2
Absolute value
ABSolute
ABS
[ Syntax ]
ABS.size
Functions
ABS
[ Instruction Code/Number of Cycles ]
Page: 138
dest
B,W
[ Operation ]
dest
dest
[ Function ]
This instruction takes the absolute value of dest and stores it in dest.
[ Selectable dest ]
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
dest
R0H/R1
R1L/R2
A1/A1
[A0]
dsp:8[A1]
dsp:8[SB]
dsp:16[A1] dsp:16[SB]
dsp:20[A1] abs20
R3R1
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
Conditions
O : The flag is set (= 1) when dest before the operation is 128 (.B) or 32768 (.W); otherwise cleared (= 0).
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag value is undefined.
[ Description Example ]
ABS.B
ABS.W
R0L
A0
page 39 of 263
Chapter 3
Functions
3.2
ADC
[ Syntax ]
ADC.size
Functions
ADC
[ Instruction Code/Number of Cycles ]
Page: 138
src,dest
B,W
[ Operation ]
dest
src
dest
[ Function ]
This instruction adds dest, src, and the C flag and stores the result in dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to perform
calculation in 16 bits. If src is A0 or A1, the operation is performed on the eight low-order bits of A0 or
A1.
[ Selectable src/dest ]
src
R0L/R0
A0/A0*1
R0H/R1
R1L/R2
*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
dest
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1H/R3
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
*1
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
*1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
R1H/R3
[A0]
[A1]
dsp:8[SB] dsp:8[FB]
dsp:16[SB] abs16
abs20
A1A0
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
[ Flag Change ]
Flag
Change
Conditions
O : The flag is set when a signed operation results in a value exceeding +32767 (.W) or 32768 (.W)
or +127 (.B) or 128 (.B); otherwise cleared.
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when an unsigned operation results in a value exceeding +65535 (.W) or +255 (.B);
otherwise cleared.
[ Description Example ]
ADC.B
ADC.W
ADC.B
ADC.B
#2,R0L
A0,R0
A0,R0L
R0L,A0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 40 of 263
Chapter 3
Functions
3.2
ADCF
[ Syntax ]
ADCF.size
Functions
ADCF
[ Instruction Code/Number of Cycles ]
Page: 140
dest
B,W
[ Operation ]
dest
dest
[ Function ]
This instruction adds dest and the C flag and stores the result in dest.
[ Selectable dest ]
dest
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
Conditions
O : The flag is set when a signed operation results in a value exceeding +32767 (.W) or 32768 (.W)
or +127 (.B) or 128 (.B); otherwise cleared.
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when an unsigned operation results in a value exceeding +65535 (.W) or +255 (.B);
otherwise cleared.
[ Description Example ]
ADCF.B
ADCF.W
R0L
Ram:16[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 41 of 263
Chapter 3
Functions
3.2
ADD
[ Syntax ]
ADD.size (:format)
[ Operation ]
dest
dest
ADD
src,dest
Functions
src
[ Function ]
This instruction adds dest and src and stores the result in dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to perform calculation
in 16 bits. If src is A0 or A1, the operation is performed on the eight low-order bits of A0 or A1.
If dest is a stack pointer and the selected size specifier (.size) is (.B), src is sign extended to perform
calculation in 16 bits.
[ Selectable src/dest ]
src
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
R0L/R0
R0H/R1
R1L/R2
R1H/R3
*1
*1
*1
*1
A0/A0
A1/A1
[A0]
[A1]
A0/A0
A1/A1
[A0]
[A1]
dsp:8[A0] dsp:8[A1]
dsp:8[SB]
dsp:8[FB] dsp:8[A0] dsp:8[A1] dsp:8[SB] dsp:8[FB]
dsp:16[A0] dsp:16[A1] dsp:16[SB] abs16
dsp:16[A0] dsp:16[A1] dsp:16[SB] abs16
dsp:20[A0] dsp:20[A1] abs20
#IMM
dsp:20[A0] dsp:20[A1] abs20
SP/SP*2
R2R0
R3R1
A1A0
R2R0
R3R1
A1A0
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
*2 The operation is performed on the stack pointer indicated by the U flag. Only #IMM can be selected for src.
[ Flag Change ]
Flag
Change
Conditions
O : The flag is set when a signed operation results in a value exceeding +32767 (.W) or 32768 (.W)
or +127 (.B) or 128 (.B); otherwise cleared.
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when an unsigned operation results in a value exceeding +65535 (.W) or +255 (.B);
otherwise cleared.
[ Description Example ]
ADD.B
ADD.B
ADD.B
ADD.W
A0,R0L
R0L,A0
Ram:8[SB],R0L
#2,[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 42 of 263
Chapter 3
Functions
3.2
Functions
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
dest
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP*2
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
*2 The operation is performed on the stack pointer indicated by the U flag. Only #IMM can be selected for src.
Q format
src
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
dest
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM*3
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP*2
*2 The operation is performed on the stack pointer indicated by the U flag. Only #IMM can be selected for src.
*3 The acceptable range of values is 8 < #IMM < +7.
S format*4
src
R0L
abs16
R0L*5
abs16
R0H
#IMM
R0H*5
#IMM
dsp:8[SB]
dsp:8[SB]
dest
dsp:8[FB] R0L
abs16
dsp:8[FB] R0L*5
abs16
R0H
A0
R0H*5
A0
page 43 of 263
dsp:8[SB]
A1
dsp:8[SB]
A1
dsp:8[FB]
dsp:8[FB]
Chapter 3
Functions
3.2
ADJNZ
[ Syntax ]
ADJNZ.size src,dest,label
Functions
ADJNZ
[ Operation ]
dest
dest + src
if dest 0 then jump label
[ Function ]
This instruction adds dest and src and stores the result in dest.
If the addition results in any value other than 0, control jumps to label. If the addition results in 0, the
next instruction is executed.
The op-code of this instruction is the same as that of SBJNZ.
[ Selectable src/dest/label ]
src
dest
R0L/R0
R1H/R3
[A0]
dsp:8[A1]
dsp:16[A0]
abs16
#IMM*1
R0H/R1
A0/A0
[A1]
dsp:8[SB]
dsp:16[A1]
Change
[ Description Example ]
ADJNZ.W #1,R0,label
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
SBJNZ
page 44 of 263
label
R1L/R2
A1/A1
dsp:8[A0]
dsp:8[FB]
dsp:16[SB]
PC*2126
label
PC*2+129
Chapter 3
Functions
3.2
Logically AND
AND
AND
[ Syntax ]
AND.size (:format) src,dest
[ Operation ]
dest
src
Functions
AND
dest
[ Function ]
This instruction logically ANDs dest and src and stores the result in dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to perform
calculation in 16 bits. If src is A0 or A1, operation is performed on the eight low-order bits of A0 or A1.
[ Selectable src/dest ]
src
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
[ Description Example ]
AND.B
AND.B:G
AND.B:G
AND.B:S
Ram:8[SB],R0L
A0,R0L
R0L,A0
#3,R0L
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 45 of 263
Chapter 3
Functions
3.2
Functions
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
dest
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
S format*2
src
R0L
abs16
R0L*3
abs16
R0H
#IMM
R0H*3
#IMM
dsp:8[SB]
dsp:8[SB]
dest
dsp:8[FB] R0L
abs16
dsp:8[FB] R0L*3
abs16
page 46 of 263
R0H
A0
R0H*3
A0
dsp:8[SB]
A1
dsp:8[SB]
A1
dsp:8[FB]
dsp:8[FB]
Chapter 3
Functions
3.2
BAND
[ Syntax ]
BAND src
BAND
[ Instruction Code/Number of Cycles ]
Page: 150
[ Operation ]
C
src
[ Function ]
This instruction logically ANDs the C flag and src and stores the result in the C flag.
[ Selectable src ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
src
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]
[ Flag Change ]
Flag
Functions
Change
Conditions
C : The flag is set when the operation results in 1; otherwise cleared.
[ Description Example ]
BAND
flag
BAND
4,Ram
BAND
16,Ram:16[SB]
BAND
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 47 of 263
Chapter 3
Functions
3.2
Clear bit
Bit CLeaR
BCLR
[ Syntax ]
BCLR (:format)
Functions
BCLR
dest
[ Operation ]
dest
0
[ Function ]
This instruction stores 0 in dest.
[ Selectable dest ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
dest
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]*1
[ Flag Change ]
Flag
Change
[ Description Example ]
BCLR
flag
BCLR
4,Ram:8[SB]
BCLR
16,Ram:16[SB]
BCLR
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 48 of 263
Chapter 3
Functions
3.2
BMCnd
[ Syntax ]
BMCnd
dest
[ Operation ]
if true then
else
dest
dest
Functions
BMCnd
[ Instruction Code/Number of Cycles ]
Page: 152
1
0
[ Function ]
This instruction transfers the true or false value of the condition indicated by Cnd to dest. If the
condition is true, 1 is transferred; if false, 0 is transferred.
The supported types of Cnd are as follows.
Cnd
Condition
Expression
GEU/C C=1
EQ/Z
GTU
PZ
GE
GT
O
Cnd
Condition
LTU/NC C=0
Less than
C flag is 0.
NE/NZ Z=0
Not equal
Z flag is 0.
____
LEU
C Z=0
Equal to or less than
N
S=1
Negative
A
LE
(S O) Z=1 Equal to or less than
(signed value)
A
LT
S O=1
Less than (signed value)
NO
O=0
O flag is 0.
Expression
[ Selectable dest ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
dest
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]
[ Flag Change ]
Flag
Change
C
*1
[ Description Example ]
BMN
3,Ram:8[SB]
BMZ
C
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
JCnd
page 49 of 263
Chapter 3
Functions
3.2
BNAND
[ Syntax ]
BNAND
BNAND
src
[ Operation ]
______
C
src
Functions
[ Function ]
This instruction logically ANDs the C flag and the inverted value of src and stores the result in the C
flag.
[ Selectable src ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
src
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]
[ Flag Change ]
Flag
Change
Condition
C : The flag is set when the operation results in 1; otherwise cleared.
[ Description Example ]
BNAND
BNAND
BNAND
BNAND
flag
4,Ram
16,Ram:16[SB]
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 50 of 263
Chapter 3
Functions
3.2 Functions
BNOR
[ Syntax ]
BNOR src
BNOR
[ Operation ]
______
C
src
[ Function ]
This instruction logically ORs the C flag and the inverted value of src and stores the result in the C
flag.
[ Selectable src ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
src
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]
[ Flag Change ]
Flag
Change
Condition
C : The flag is set when the operation results in 1; otherwise cleared.
[ Description Example ]
BNOR
flag
BNOR
4,Ram
BNOR
16,Ram:16[SB]
BNOR
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 51 of 263
Chapter 3
Functions
3.2 Functions
Invert bit
Bit NOT
BNOT
[ Syntax ]
BNOT(:format)
dest
G ,S
BNOT
[ Operation ]
________
dest
dest
[ Function ]
This instruction inverts dest and stores the result in dest.
[ Selectable dest ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
dest
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]*1
[ Flag Change ]
Flag
Change
[ Description Example ]
BNOT
flag
BNOT
4,Ram:8[SB]
BNOT
16,Ram:16[SB]
BNOT
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 52 of 263
Chapter 3
Functions
3.2 Functions
BNTST
[ Syntax ]
BNTST
BNTST
[ Instruction Code/Number of Cycles ]
Page: 155
src
[ Operation ]
Z
src
______
src
[ Function ]
This instruction transfers the inverted value of src to the Z flag and the inverted value of src to the C
flag.
[ Selectable src ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
src
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]
[ Flag Change ]
Flag
Change
Conditions
Z : The flag is set when src is 0; otherwise cleared.
C : The flag is set when src is 0; otherwise cleared.
[ Description Example ]
BNTST
flag
BNTST
BNTST
BNTST
4,Ram:8[SB]
16,Ram:16[SB]
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 53 of 263
Chapter 3
Functions
3.2 Functions
BNXOR
[ Syntax ]
BNXOR
src
[ Operation ]
______ A
C
src
BNXOR
[ Function ]
This instruction exclusive ORs the C flag and the inverted value of src and stores the result in the C
flag.
[ Selectable src ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
src
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]
[ Flag Change ]
Flag
Change
Conditions
C : The flag is set when the operation results in 1; otherwise cleared.
[ Description Example ]
BNXOR
flag
BNXOR
4,Ram
BNXOR
16,Ram:16[SB]
BNXOR
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 54 of 263
Chapter 3
Functions
3.2 Functions
Logically OR bits
Bit OR carry flag
BOR
[ Syntax ]
BOR src
BOR
[ Instruction Code/Number of Cycles ]
Page: 156
[ Operation ]
C
src
[ Function ]
This instruction logically ORs the C flag and src and stores the result in the C flag.
[ Selectable src ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
src
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]
[ Flag Change ]
Flag
Change
Conditions
C : The flag is set when the operation results in 1; otherwise cleared.
[ Description Example ]
BOR
BOR
BOR
BOR
flag
4,Ram
16,Ram:16[SB]
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 55 of 263
Chapter 3
Functions
3.2 Functions
Debug interrupt
BReaK
BRK
BRK
[ Instruction Code/Number of Cycles ]
Page: 157
[ Syntax ]
BRK
[ Operation ]
SP
M(SP)
SP
M(SP)
PC
SP 2
(PC + 1)H, FLG
SP 2
(PC + 1)ML
M(FFFE416)
[ Function ]
This instruction generates a BRK interrupt.
The BRK interrupt is a nonmaskable interrupt.
Change
Conditions
U : The flag is cleared.
I : The flag is cleared.
D : The flag is cleared.
[ Description Example ]
BRK
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
INT, INTO
page 56 of 263
*1 The flags are saved to the stack area before the BRK instruction is executed. After the interrupt, the flags
change state as shown at left.
Chapter 3
Functions
3.2 Functions
Set bit
Bit SET
BSET
[ Syntax ]
BSET (:format)
BSET
dest
[ Operation ]
dest
1
[ Function ]
This instruction stores 1 in dest.
[ Selectable dest ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
dest
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]*1
[ Flag Change ]
Flag
Change
[ Description Example ]
BSET
flag
BSET
4,Ram:8[SB]
BSET
16,Ram:16[SB]
BSET
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 57 of 263
Chapter 3
Functions
3.2 Functions
BTST
Test bit
Bit TeST
[ Syntax ]
BTST (:format)
src
BTST
[ Operation ]
______
Z
src
C
src
[ Function ]
This instruction transfers the inverted value of src to the Z flag and the non-inverted value of src to
the C flag.
[ Selectable src ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
src
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]*1
[ Flag Change ]
Flag
Change
Conditions
Z : The flag is set when src is 0; otherwise cleared.
C : The flag is set when src is 1; otherwise cleared.
[ Description Example ]
BTST
BTST
BTST
BTST
flag
4,Ram:8[SB]
16,Ram:16[SB]
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 58 of 263
Chapter 3
Functions
3.2 Functions
BTSTC
[ Syntax ]
BTSTC
BTSTC
[ Instruction Code/Number of Cycles ]
Page: 159
dest
[ Operation ]
________
dest
Z
C
dest
dest
0
[ Function ]
This instruction transfers the inverted value of dest to the Z flag and the non-inverted value of
dest to the C flag. Then it stores 0 in dest.
[ Selectable dest ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
dest
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]
[ Flag Change ]
Flag
Change
Conditions
Z : The flag is set when dest is 0; otherwise cleared.
C : The flag is set when dest is 1; otherwise cleared.
[ Description Example ]
BTSTC
flag
BTSTC
4,Ram
BTSTC
16,Ram:16[SB]
BTSTC
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 59 of 263
Chapter 3
Functions
3.2 Functions
BTSTS
[ Syntax ]
BTSTS
BTSTS
[ Instruction Code/Number of Cycles ]
Page: 160
dest
[ Operation ]
________
dest
Z
C
dest
dest
1
[ Function ]
This instruction transfers the inverted value of dest to the Z flag and the non-inverted value of dest to
the C flag. Then it stores 1 in dest.
[ Selectable dest ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
dest
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]
[ Flag Change ]
Flag
Change
Conditions
Z : The flag is set when dest is 0; otherwise cleared.
C : The flag is set when dest is 1; otherwise cleared.
[ Description Example ]
BTSTS
BTSTS
BTSTS
BTSTS
flag
4,Ram
16,Ram:16[SB]
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 60 of 263
Chapter 3
Functions
3.2 Functions
Exclusive OR bits
Bit eXclusive OR carry flag
BXOR
[ Syntax ]
BXOR src
[ Operation ]
C
src
[ Function ]
This instruction exclusive ORs the C flag and src and stores the result in the C flag.
[ Selectable src ]
bit,R0
bit,A0
base:8[A0]
base:16[A0]
C
src
bit,R1
bit,R2
bit,R3
bit,A1
[A0]
[A1]
base:8[A1]
bit,base:8[SB] bit,base:8[FB]
base:16[A1] bit,base:16[SB] bit,base:16
bit,base:11[SB]
[ Flag Change ]
Flag
Change
Conditions
C : The flag is set when the operation results in 1; otherwise cleared.
[ Description Example ]
BXOR
BXOR
BXOR
BXOR
BXOR
flag
4,Ram
16,Ram:16[SB]
[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 61 of 263
Chapter 3
Functions
3.2 Functions
Compare
CoMPare
CMP
[ Syntax ]
CMP.size (:format) src,dest
CMP
[ Operation ]
dest src
[ Function ]
Flag bits in the flag register change depending on the result of subtraction of src from dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to perform
operation in 16 bits. If src is A0 or A1, operation is performed on the 8 low-order bits of A0 or A1.
[ Selectable src/dest ]
src
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
[ Flag Change ]
Flag
Change
Conditions
O : The flag is set when a signed operation results in a value exceeding +32767 (.W) or 32768 (.W),
or +127 (.B) or 128 (.B); otherwise cleared.
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when an unsigned operation results in any value equal to or greater than 0;
otherwise cleared.
[ Description Example ]
CMP.B:S
#10,R0L
CMP.W:G R0,A0
CMP.W
#3,R0
CMP.B
#5,Ram:8[FB]
CMP.B
A0,R0L
page 62 of 263
Chapter 3
Functions
3.2 Functions
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
dest
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
Q format
src
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
dest
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM*2
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP
S format*3
src
R0L
abs16
R0L*4
abs16
R0H
#IMM
R0H*4
#IMM
dsp:8[SB]
dsp:8[SB]
dest
dsp:8[FB] R0L
abs16
dsp:8[FB] R0L*4
abs16
page 63 of 263
R0H
A0
R0H*4
A0
dsp:8[SB]
A1
dsp:8[SB]
A1
dsp:8[FB]
dsp:8[FB]
Chapter 3
Functions
3.2 Functions
DADC
[ Syntax ]
DADC.size
DADC
src,dest
B,W
[ Operation ]
dest
src
dest
[ Function ]
This instruction adds dest, src, and the C flag as decimal data and stores the result in dest.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
A0/A0
A1/A1
dsp:8[A0] dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when the operation results in a value exceeding +9999 (.W) or +99 (.B); otherwise
cleared.
[ Description Example ]
DADC.B
#3,R0L
DADC.W
R1,R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 64 of 263
Chapter 3
Functions
3.2 Functions
DADD
[ Syntax ]
DADD.size
DADD
src,dest
B,W
[ Operation ]
dest
src
dest
[ Function ]
This instruction adds dest and src as decimal data and stores the result in dest.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
A0/A0
A1/A1
dsp:8[A0] dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when the operation results in a value exceeding +9999 (.W) or +99 (.B); otherwise
cleared.
[ Description Example ]
DADD.B
#3,R0L
DADD.W
R1,R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 65 of 263
Chapter 3
Functions
3.2 Functions
Decrement
DECrement
DEC
[ Syntax ]
DEC.size
DEC
[ Instruction Code/Number of Cycles ]
Page: 169
dest
B,W
[ Operation ]
dest
dest
[ Function ]
This instruction decrements dest by 1 and stores the result in dest.
[ Selectable dest ]
*1
R0L
abs16*1
R0H
A0*2
*1
dest
dsp:8[SB]*1
A1*2
dsp:8[FB]*1
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
[ Description Example ]
DEC.W
A0
DEC.B
R0L
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
INC
page 66 of 263
Chapter 3
Functions
3.2 Functions
Signed divide
DIVide
DIV
[ Syntax ]
DIV.size
DIV
[ Instruction Code/Number of Cycles ]
Page: 170
src
B,W
[ Operation ]
If the size specifier (.size) is (.B)
R0L (quotient), R0H (remainder) R0
If the size specifier (.size) is (.W)
R0 (quotient), R2 (remainder) R2R0
src
src
[ Function ]
This instruction divides R2R0 (R0)*1 by the signed value of src and stores the quotient in R0 (R0L)*1
and the remainder in R2 (R0H)*1. The remainder has the same sign as the dividend. Items in parentheses and followed by*1 ( )*1 indicate registers that are the object of the operation when (.B) is
selected as the size specifier (.size).
If src is A0 or A1 and the selected size specifier (.size) is (.B), the operation is performed on the 8 loworder bits of A0 or A1.
If (.B) is selected as the size specifier (.size), the O flag is set when the operation results in a quotient
exceeding 8 bits or the divisor is 0. In this case, R0L and R0H are undefined.
If (.W) is selected as the size specifier (.size), the O flag is set when the operation results in a quotient
exceeding 16 bits or the divisor is 0. In this case, R0 and R2 are undefined.
[ Selectable src ]
src
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
[ Flag Change ]
Flag
Change
Conditions
O : The flag is set when the operation results in a quotient exceeding 16 bits (.W) or 8 bits (.B) or the
divisor is 0; otherwise cleared.
[ Description Example ]
DIV.B
DIV.B
DIV.W
A0
#4
R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 67 of 263
Chapter 3
Functions
3.2 Functions
Unsigned divide
DIVide Unsigned
DIVU
[ Syntax ]
DIVU.size
DIVU
[ Instruction Code/Number of Cycles ]
Page: 171
src
B,W
[ Operation ]
If the size specifier (.size) is (.B)
R0L (quotient), R0H (remainder) R0
If the size specifier (.size) is (.W)
R0 (quotient), R2 (remainder) R2R0
src
src
[ Function ]
This instruction divides R2R0 (R0) *1 by the unsigned value of src and stores the quotient in R0
(R0L)*1 and the remainder in R2 (R0H) *1. Items in parentheses and followed by*1 ( )*1 indicate
registers that are the object of the operation when (.B) is selected as the size specifier (.size).
If src is A0 or A1 and the selected size specifier (.size) is (.B), the operation is performed on the 8 loworder bits of A0 or A1.
If (.B) is selected as the size specifier (.size), the O flag is set when the operation results in a quotient
exceeding 8 bits or the divisor is 0. In this case, R0L and R0H are undefined.
If (.W) is selected as the size specifier (.size), the O flag is set when the operation results in a quotient
exceeding 16 bits or the divisor is 0. In this case, R0 and R2 are undefined.
[ Selectable src ]
src
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
[ Flag Change ]
Flag
Change
Conditions
O : The flag is set when the operation results in a quotient exceeding 16 bits (.W) or 8 bits (.B) or the
divisor is 0; otherwise cleared.
[ Description Example ]
DIVU.B
DIVU.B
DIVU.W
A0
#4
R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 68 of 263
Chapter 3
Functions
3.2 Functions
Signed divide
DIVide eXtension
DIVX
[ Syntax ]
DIVX.size
DIVX
[ Instruction Code/Number of Cycles ]
Page: 172
src
B,W
[ Operation ]
If the size specifier (.size) is (.B)
R0L (quotient), R0H (remainder) R0
If the size specifier (.size) is (.W)
R0 (quotient), R2 (remainder) R2R0
src
src
[ Function ]
This instruction divides R2R0 (R0)*1 by the signed value of src and stores the quotient in R0 (R0L)*1 and the
remainder in R2 (R0H)*1. The remainder has the same sign as the divisor. Items in parentheses and followed
by*1 ( )*1 indicate registers that are the object of the operation when (.B) is selected as the size specifier (.size).
If src is A0 or A1 and the selected size specifier (.size) is (.B), the operation is performed on the 8 loworder bits of A0 or A1.
If (.B) is selected as the size specifier (.size), the O flag is set when the operation results in a quotient
exceeding 8 bits or the divisor is 0. At this time, R0L and R0H are undefined.
If (.W) is selected as the size specifier (.size), the O flag is set when the operation results in a quotient
exceeding 16 bits or the divisor is 0. At this time, R0 and R2 are undefined.
[ Selectable src ]
src
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
R1H/R3
[A1]
dsp:8[FB]
abs16
dsp:20[A1]
R3R1
abs20
A1A0
#IMM
[ Flag Change ]
Flag
Change
Conditions
O : The flag is set when the operation results in a quotient exceeding 16 bits (.W) or 8 bits (.B) or the
divisor is 0; otherwise cleared.
[ Description Example ]
DIVX.B
DIVX.B
DIVX.W
A0
#4
R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 69 of 263
Chapter 3
Functions
3.2 Functions
DSBB
[ Syntax ]
DSBB.size
DSBB
src,dest
B,W
[ Operation ]
dest
dest
____
src
[ Function ]
This instruction subtracts src and the inverted value of the C flag from dest as decimal data and
stores the result in dest.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
A0/A0
A1/A1
dsp:8[A0] dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when the operation results in any value equal to or greater than 0; otherwise
cleared.
[ Description Example ]
DSBB.B
DSBB.W
#3,R0L
R1,R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 70 of 263
Chapter 3
Functions
3.2 Functions
DSUB
[ Syntax ]
DSUB.size
DSUB
src,dest
B,W
[ Operation ]
dest
dest
src
[ Function ]
This instruction subtracts src from dest as decimal data and stores the result in dest.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
A0/A0
A1/A1
dsp:8[A0] dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when the operation results in any value equal to or greater than 0; otherwise
cleared.
[ Description Example ]
DSUB.B
DSUB.W
#3,R0L
R1,R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 71 of 263
Chapter 3
Functions
3.2 Functions
ENTER
[ Syntax ]
ENTER
src
[ Operation ]
SP
M(SP)
FB
SP
ENTER
SP
FB
SP
SP
src
[ Function ]
This instruction generates a stack frame. src represents the size of the stack frame.
The diagrams below show the stack area status before and after the ENTER instruction is executed at
the beginning of a called subroutine.
Direction in
which address
increases
SP
FB (H)
Argument of function
Argument of function
src
#IMM8
[ Flag Change ]
FB (L)
Return address (L)
Return address (M)
[ Selectable src ]
Flag
FB
Change
[ Description Example ]
ENTER
#3
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
EXITD
page 72 of 263
Number of bytes
indicated by src
Chapter 3
Functions
3.2 Functions
EXITD
EXITD
[ Syntax ]
EXITD
[ Operation ]
SP
FB
SP
PCML
SP
PCH
SP
FB
M(SP)
SP +
M(SP)
SP +
M(SP)
SP +
2
2
1
[ Function ]
This instruction deallocates a stack frame and exits from the subroutine.
Use this instruction in combination with the ENTER instruction.
The diagrams below show the stack area status before and after the EXITD instruction is executed
at the end of a subroutine in which an ENTER instruction was executed.
SP
FB (L)
FB (H)
FB
Argument of function
[ Flag Change ]
Flag
Change
[ Description Example ]
EXITD
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
ENTER
page 73 of 263
Argument of function
Chapter 3
Functions
3.2 Functions
Extend sign
EXTend Sign
EXTS
[ Syntax ]
EXTS.size
EXTS
[ Instruction Code/Number of Cycles ]
Page: 178
dest
B,W
[ Operation ]
dest
EXT(dest)
[ Function ]
This instruction sign extends dest and stores the result in dest.
If (.B) is selected as the size specifier (.size), dest is sign extended to 16 bits.
If (.W) is selected as the size specifier (.size), R0 is sign extended to 32 bits. In this case, R2 is used
for the upper bytes.
[ Selectable dest ]
dest
R0L/R0
R0H/R1
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
Conditions
S : If (.B) is selected as the size specifier (.size), the flag is set when the operation results in MSB =
1; otherwise cleared. The flag does not change if (.W) is selected as the size specifier (.size).
Z : If (.B) is selected as the size specifier (.size), the flag is set when the operation results in 0;
otherwise cleared. The flag does not change if (.W) is selected as the size specifier (.size).
[ Description Example ]
EXTS.B
EXTS.W
R0L
R0
page 74 of 263
Chapter 3
Functions
3.2 Functions
FCLR
[ Syntax ]
FCLR dest
FCLR
[ Operation ]
dest
0
[ Function ]
This instruction stores 0 in dest.
[ Selectable dest ]
C
dest
S
B
[ Flag Change ]
Flag
Change *1
*1
*1
*1
*1
*1
*1
*1
[ Description Example ]
FCLR
FCLR
I
S
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
FSET
page 75 of 263
Chapter 3
Functions
3.2 Functions
FSET
[ Syntax ]
FSET dest
FSET
[ Instruction Code/Number of Cycles ]
Page: 180
[ Operation ]
dest
1
[ Function ]
This instruction stores 1 in dest.
[ Selectable dest ]
C
dest
B
[ Flag Change ]
Flag
Change *1
*1
*1
*1
*1
*1
*1
*1
[ Description Example ]
FSET
FSET
I
S
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
FCLR
page 76 of 263
Chapter 3
Functions
3.2 Functions
Increment
INCrement
INC
[ Syntax ]
INC.size
INC
[ Instruction Code/Number of Cycles ]
Page: 180
dest
B,W
[ Operation ]
dest
dest
[ Function ]
This instruction adds 1 to dest and stores the result in dest.
[ Selectable dest ]
*1
R0L
abs16*1
*1
R0H
A0*2
dest
dsp:8[SB]*1
A1*2
dsp:8[FB]*1
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
[ Description Example ]
INC.W
A0
INC.B
R0L
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
DEC
page 77 of 263
Chapter 3
Functions
3.2 Functions
INT
[ Syntax ]
INT
src
[ Operation ]
SP
M(SP)
SP
M(SP)
PC
SP 2
(PC + 2)H, FLG
SP 2
(PC + 2)ML
M(IntBase + src
INT
4)
[ Function ]
This instruction generates a software interrupt specified by src. src represents a software interrupt
number.
If src is 31 or smaller, the U flag is cleared to 0 and the interrupt stack pointer (ISP) is used.
If src is 32 or larger, the stack pointer indicated by the U flag is used.
The interrupts generated by the INT instruction are nonmaskable.
[ Selectable src ]
src
#IMM*1*2
*1 #IMM denotes a software interrupt number.
*2 The acceptable range of values is 0 < #IMM < 63.
[ Flag Change ]
Flag
Change
*3 The flags are saved to the stack area before the INT instruction is executed. After the interrupt, the flags
change state as shown at left.
Conditions
U : The flag is cleared if the software interrupt number is 31 or smaller. The flag does not change if
the software interrupt number is 32 or larger.
I : The flag is cleared.
D : The flag is cleared.
[ Description Example ]
INT
#0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
BRK, INTO
page 78 of 263
Chapter 3
Functions
3.2 Functions
Interrupt on overflow
INTerrupt on Overflow
INTO
[ Syntax ]
INTO
INTO
[ Operation ]
SP
M(SP)
SP
M(SP)
PC
SP 2
(PC + 1)H, FLG
SP 2
(PC + 1)ML
M(FFFE016)
[ Function ]
If the O flag is set to 1, this instruction generates an overflow interrupt. If the flag is cleared to 0, the
next instruction is executed.
The overflow interrupt is nonmaskable.
[ Flag Change ]
Flag
Change
Conditions
U : The flag is cleared.
I : The flag is cleared.
D : The flag is cleared.
[ Description Example ]
INTO
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
BRK, INT
page 79 of 263
C *1 The flags are saved to the stack area before the INTO
instruction is executed. After the interrupt, the flags
change state as shown at left.
Chapter 3
Functions
3.2 Functions
Jump on condition
Jump on Condition
JCnd
[ Syntax ]
JCnd label
JCnd
[ Instruction Code/Number of Cycles ]
Page: 182
[ Operation ]
if true then jump label
[ Function ]
This instruction causes program flow to branch after checking the execution result of the preceding
instruction against the following condition. If the condition indicated by Cnd is true, control jumps to
label. If false, the next instruction is executed.
The following conditions can be used for Cnd :
Cnd
Condition
Expression
GEU/C C=1
EQ/Z
GTU
PZ
GE
GT
O
Cnd
Condition
LTU/NC C=0
=
NE/NZ
LEU
N
LE
LT
NO
Smaller than
C flag is 0.
Z=0
Not equal
Z flag is 0.
____
C Z=0
Equal to or smaller than
S=1
Negative
A
(S O) Z=1 Equal to or smaller than
(signed value)
A
S O=1
Smaller than (signed value)
O=0
O flag is 0.
[ Selectable label ]
Cnd
label
*1
PC 127
PC*1126
label
label
*1
PC +128
PC*1+129
[ Flag Change ]
Flag
Change
[ Description Example ]
JEQ
label
JNE
label
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
BMCnd
page 80 of 263
Expression
Chapter 3
Functions
3.2 Functions
Unconditional jump
JuMP
JMP
[ Syntax ]
JMP(.length) label
[ Operation ]
PC
label
[ Function ]
This instruction causes control to jump to label.
[ Selectable label ]
.length
.S
.B
.W
.A
label
*1
PC +2
label
PC*1+9
PC*1127
label
PC*1+128
*1
PC 32767
label
PC*1+32768
abs20
[ Flag Change ]
Flag
Change
[ Description Example ]
JMP
label
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
JMP
JMPI
page 81 of 263
Chapter 3
Functions
3.2 Functions
Jump indirect
JuMP Indirect
JMPI
[ Syntax ]
JMPI.length
JMPI
[ Instruction Code/Number of Cycles ]
Page: 185
src
W,A
[ Operation ]
When jump distance specifier (.length) is (.W)
PC
PC
src
[ Function ]
This instruction causes control to jump to the address indicated by src. If src is a location in the
memory, specify the address at which the low-order address is stored.
If (.W) is selected as the jump distance specifier (.length), control jumps to the start address of the instruction
plus the address indicated by src (added including the sign bits). If src is a location in the memory, the
required memory capacity is 2 bytes.
If src is a location in the memory and (.A) is selected as the jump distance specifier (.length), the
required memory capacity is 3 bytes.
[ Selectable src ]
If (.W) is selected as the jump distance specifier (.length)
src
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
R2R0
R3R1
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
[ Description Example ]
JMPI.A
JMPI.W
A1A0
R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
JMP
page 82 of 263
Chapter 3
Functions
3.2 Functions
Subroutine call
Jump SubRoutine
JSR
[ Syntax ]
JSR(.length) label
[ Operation ]
SP
SP 1
M(SP)
(PC + n)H
SP
SP 2
M(SP)
(PC + n)ML
PC
label
*1 n denotes the number of instruction bytes.
[ Function ]
This instruction causes control to jump to a subroutine indicated by label.
[ Selectable label ]
.length
.W
.A
label
*1
PC 32767
abs20
PC*1+32768
label
[ Flag Change ]
Flag
Change
[ Description Example ]
JSR.W
JSR.A
func
func
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
JSR
JSRI
page 83 of 263
Chapter 3
Functions
3.2 Functions
JSRI
[ Syntax ]
JSRI.length src
JSRI
[ Operation ]
When jump distance specifier (.length) is (.W)
SP
SP 1
M(SP)
(PC + n)H
SP
SP 2
M(SP)
(PC + n)ML
PC
PC
src
*1 n denotes the number of instruction bytes.
[ Function ]
This instruction causes control to jump to a subroutine at the address indicated by src. If src is a
location in the memory, specify the address at which the low-order address is stored.
If (.W) is selected as the jump distance specifier (.length), control jumps to the subroutine at the start
address of the instruction plus the address indicated by src (added including the sign bits). If src is
a location in the memory, the required memory capacity is 2 bytes.
If src is a location in the memory and (.A) is selected as the jump distance specifier (.length), the
required memory capacity is 3 bytes.
[ Selectable src ]
If (.W) is selected as the jump distance specifier (.length)
src
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
[ Description Example ]
JSRI.A
JSRI.W
A1A0
R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
JSR
page 84 of 263
Chapter 3
Functions
3.2 Functions
LDC
[ Syntax ]
LDC src,dest
LDC
[ Operation ]
dest
src
[ Function ]
This instruction transfers src to the control register indicated by dest. If src is a location in the
memory, the required memory capacity is 2 bytes.
If the destination is INTBL or INTBH, make sure that bytes are transferred in succession.
No interrupt requests are accepted immediately after this instruction.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
A0/A0
A1/A1
dsp:8[A0] dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
FB
[A1]
FLG
dsp:8[FB]
abs16
#IMM
SB
INTBH
SP*1
INTBL
ISP
[ Flag Change ]
Flag
Change *2
*2
*2
*2
*2
*2
*2
*2
[ Description Example ]
LDC
LDC
R0,SB
A0,FB
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 85 of 263
Chapter 3
Functions
3.2 Functions
Restore context
LoaD ConTeXt
LDCTX
[ Syntax ]
LDCTX
LDCTX
[ Instruction Code/Number of Cycles ]
Page: 189
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 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 transferred.
LSB
MSB
FB SB A1 A0 R3 R2 R1 R0
Transferred sequentially
beginning with R0
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
of table
abs20
Direction in
which address
increases
Register information for task with task number n*1. (See above diagram.)
SP correction value for task with task number n*1. (See above diagram.)
*1
n=0 to 255
[ Flag Change ]
Flag
Change
[ Description Example ]
LDCTX
Ram,Rom_TBL
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
STCTX
page 86 of 263
abs16 2
Chapter 3
Functions
3.2 Functions
LDE
[ Syntax ]
LDE.size
LDE
src,dest
B,W
[ Operation ]
dest
src
[ Function ]
This instruction transfers src from the extended area to dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to transfer data
in 16 bits.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
A0/A0
A1/A1
dsp:8[A0] dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
[A1A0]
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the transfer results in MSB of dest = 1; otherwise cleared.
Z : The flag is set when the transfer results in dest = 0; otherwise cleared.
[ Description Example ]
LDE.W
LDE.B
[A1A0],R0
Rom_TBL,A0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 87 of 263
R1H/R3
[A1]
dsp:8[FB]
abs16
Chapter 3
Functions
3.2 Functions
LDINTB
[ Syntax ]
LDINTB
src
[ Operation ]
INTBHL
src
[ Function ]
This instruction transfers src to INTB.
The LDINTB instruction is a macro-instruction consisting of the following:
LDC
LDC
#IMM, INTBH
#IMM, INTBL
[ Selectable src ]
src
#IMM20
[ Flag Change ]
Flag
Change
[ Description Example ]
LDINTB
#0F0000H
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
LDINTB
page 88 of 263
Chapter 3
Functions
3.2 Functions
LDIPL
[ Syntax ]
LDIPL src
[ Operation ]
IPL
src
[ Function ]
This instruction transfers src to IPL.
[ Selectable src ]
src
*1
#IMM
*1
[ Flag Change ]
Flag
LDIPL
Change
[ Description Example ]
LDIPL
#2
page 89 of 263
Chapter 3 Functions
3.2 Functions
Transfer
MOVe
MOV
[ Syntax ]
MOV.size (:format) src,dest
MOV
[ Instruction Code/Number of Cycles ]
Page: 193
G , Q , Z , S (Can be specified)
B,W
[ Operation ]
dest
src
[ Function ]
This instruction transfers src to dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to transfer data
in 16 bits. If src is A0 or A1, the 8 low-order bits of A0 or A1 are transferred.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
R1L/R2
A0/A0*1
A1/A1*1
[A0]
dsp:8[A0] dsp:8[A1]
dsp:8[SB]
dsp:16[A0] dsp:16[A1] dsp:16[SB]
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM*2
dsp:8[SP]*3
dest
R0L/R0
R0H/R1
R1L/R2
A0/A0*1
A1/A1*1
[A0]
dsp:8[A0] dsp:8[A1] dsp:8[SB]
dsp:16[A0] dsp:16[A1] dsp:16[SB]
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
dsp:8[SP]*2 *3
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
*2 If src is #IMM, dsp:8 [SP] cannot be chosen for dest.
*3 The operation is performed on the stack pointer indicated by the U flag. dsp:8 [SP] cannot be chosen
for src and dest simultaneously.
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the transfer results in MSB of dest = 1; otherwise cleared.
Z : The flag is set when the transfer results in 0; otherwise cleared.
[ Description Example ]
MOV.B:S
MOV.W
#0ABH,R0L
#1,R2
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 90 of 263
Chapter 3 Functions
3.2 Functions
dest
R1H/R3
R0L/R0
R0H/R1
R1L/R2
[A1]
A0/A0*1
A1/A1*1
[A0]
dsp:8[FB] dsp:8[A0] dsp:8[A1] dsp:8[SB]
abs16
dsp:16[A0] dsp:16[A1] dsp:16[SB]
*2
#IMM
dsp:20[A0] dsp:20[A1] abs20
dsp:8[SP]*3 R2R0
R3R1
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP
dsp:8[SP]*2*3
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
*2 If src is #IMM, dsp:8 [SP] cannot be chosen for dest.
*3 The operation is performed on the stack pointer indicated by the U flag. dsp:8 [SP] cannot be chosen
for src and dest simultaneously.
Q format
src
R0L/R0
R0H/R1
R1L/R2
A0/A0
A1/A1
[A0]
dsp:8[A0] dsp:8[A1]
dsp:8[SB]
dsp:16[A0] dsp:16[A1] dsp:16[SB]
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
dest
R1H/R3
R0L/R0
R0H/R1
R1L/R2
[A1]
A0/A0
A1/A1
[A0]
dsp:8[FB] dsp:8[A0] dsp:8[A1] dsp:8[SB]
abs16
dsp:16[A0] dsp:16[A1] dsp:16[SB]
*4
#IMM
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP
R0L
abs16*5
R0L*5*6
abs16
R0L
abs16
*5
*6
*7
*8
*9
*5*6*8
R0H
#IMM
R0H*5*6
#IMM
R0H
#IMM*9
src
dsp:8[SB]*5 dsp:8[FB]*5 R0L*5*6
abs16
dsp:8[SB]
dsp:8[FB] R0L*5*6
abs16*5
dsp:8[SB]
dsp:8[FB] R0L*5
abs16*5
*5*6
R0H
A0*5*8
R0H*5*6
A0
R0H*5
A0*9
dest
dsp:8[SB] dsp:8[FB]
A1*5*7
dsp:8[SB]*5 dsp:8[FB]*5
A1
dsp:8[SB]*5 dsp:8[FB]*5
A1*9
Z format
R0L
abs16
R0H
#0
src
dsp:8[SB]
page 91 of 263
dsp:8[FB] R0L
abs16
R0H
A0
dest
dsp:8[SB]
A1
dsp:8[FB]
Chapter 3 Functions
3.2 Functions
MOVA
[ Syntax ]
MOVA
MOVA
src,dest
[ Operation ]
dest
EVA(src)
[ Function ]
This instruction transfers the affective address of src to dest.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
R1L/R2
A0/A0
A1/A1
[A0]
dsp:8[A0] dsp:8[A1]
dsp:8[SB]
dsp:16[A0] dsp:16[A1] dsp:16[SB]
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
dest
R1H/R3
R0L/R0
R0H/R1
R1L/R2
[A1]
A0/A0
A1/A1
[A0]
dsp:8[FB] dsp:8[A0] dsp:8[A1] dsp:8[SB]
abs16
dsp:16[A0] dsp:16[A1] dsp:16[SB]
#IMM
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
[ Flag Change ]
Flag
Change
[ Description Example ]
MOVA
Ram:16[SB],A0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
PUSHA
page 92 of 263
R1H/R3
[A1]
dsp:8[FB]
abs16
Chapter 3 Functions
3.2 Functions
MOVDir
[ Syntax ]
MOVDir
MOVDir
[ Instruction Code/Number of Cycles ]
Page: 201
src,dest
[ Operation ]
Dir
HH
HL
LH
LL
Operation
H4:dest
H4:src
L4:dest
H4:src
H4:dest
L4:src
L4:dest
L4:src
[ Function ]
Be sure to choose R0L for either src or dest.
Dir
Function
HH
Transfers srcs 4 high-order bits to dests 4 high-order bits.
HL
Transfers srcs 4 high-order bits to dests 4 low-order bits.
LH
Transfers srcs 4 low-order bits to dests 4 high-order bits.
LL
Transfers srcs 4 low-order bits to dests 4 low-order bits.
[ Selectable src/dest ]
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
src
R0H/R1
R1L/R2
A1/A1
[A0]
dsp:8[A1]
dsp:8[SB]
dsp:16[A1] dsp:16[SB]
dsp:20[A1] abs20
R3R1
A1A0
R0H/R1
R1L/R2
A1/A1
[A0]
dsp:8[A1]
dsp:8[SB]
dsp:16[A1] dsp:16[SB]
dsp:20[A1] abs20
R3R1
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R1H/R3
R0L/R0
[A1]
A0/A0
dsp:8[FB] dsp:8[A0]
abs16
dsp:16[A0]
#IMM
dsp:20[A0]
R2R0
[ Flag Change ]
Flag
Change
[ Description Example ]
MOVHH
MOVHL
R0L,[A0]
R0L,[A0]
page 93 of 263
dest
R0H/R1
R1L/R2
A1/A1
[A0]
dsp:8[A1] dsp:8[SB]
dsp:16[A1] dsp:16[SB]
dsp:20[A1] abs20
R3R1
A1A0
R0H/R1
R1L/R2
A1/A1
[A0]
dsp:8[A1] dsp:8[SB]
dsp:16[A1] dsp:16[SB]
dsp:20[A1] abs20
R3R1
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
R1H/R3
[A1]
dsp:8[FB]
abs16
Chapter 3 Functions
3.2 Functions
Signed multiply
MULtiple
MUL
[ Syntax ]
MUL.size
MUL
[ Instruction Code/Number of Cycles ]
Page: 203
src,dest
B,W
[ Operation ]
dest
dest
src
[ Function ]
This instruction multiplies src and dest including the sign bits and stores the result in dest.
If (.B) is selected as the size specifier (.size), src and dest are treated as 8-bit data for the operation
and the result is stored in 16 bits. If A0 or A1 is specified as either src or dest, the operation is
performed using the 8 low-order bits of A0 or A1.
If (.W) is selected as the size specifier (.size), src and dest are treated as 16-bit data for the operation
and the result is stored in 32 bits. If R0, R1, or A0 is specified as dest, the result is stored in R2R0,
R3R1, or A1A0 accordingly.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
R1L/R2
*1
*1
A0/A0
A1/A1
[A0]
dsp:8[A0] dsp:8[A1]
dsp:8[SB]
dsp:16[A0] dsp:16[A1] dsp:16[SB]
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
dest
R1H/R3
R0L/R0
R0H/R1
R1L/R2
*1
[A1]
A0/A0
A1/A1
[A0]
dsp:8[FB] dsp:8[A0] dsp:8[A1] dsp:8[SB]
abs16
dsp:16[A0] dsp:16[A1] dsp:16[SB]
#IMM
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
[ Flag Change ]
Flag
Change
[ Description Example ]
MUL.B
A0,R0L
MUL.W
#3,R0
MUL.B
R0L,R1L
MUL.W
A0,Ram
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 94 of 263
Chapter 3 Functions
3.2 Functions
Unsigned multiply
MULtiple Unsigned
MULU
[ Syntax ]
MULU.size
MULU
[ Instruction Code/Number of Cycles ]
Page: 205
src,dest
B,W
[ Operation ]
dest
dest
src
[ Function ]
This instruction multiplies src and dest without the sign bits and stores the result in dest.
If (.B) is selected as the size specifier (.size), src and dest are treated as 8-bit data for the operation
and the result is stored in 16 bits. If A0 or A1 is specified as either src or dest, the operation is
performed using the 8 low-order bits of A0 or A1.
If (.W) is selected as the size specifier (.size), src and dest are treated as 16-bit data for the operation
and the result is stored in 32 bits. If R0, R1, or A0 are specified as dest, the result is stored in R2R0,
R3R1, or A1A0 accordingly.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0/A0*1
A1/A1*1
[A0]
[A1]
dsp:8[A0] dsp:8[A1]
dsp:8[SB]
dsp:8[FB]
dsp:16[A0] dsp:16[A1] dsp:16[SB] abs16
dsp:20[A0] dsp:20[A1] abs20
#IMM
R2R0
R3R1
A1A0
*1 If (.B) is selected as the size specifier (.size),
neously.
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0/A0*1
A1/A1
[A0]
[A1]
dsp:8[A0] dsp:8[A1] dsp:8[SB] dsp:8[FB]
dsp:16[A0] dsp:16[A1] dsp:16[SB] abs16
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
A0 or A1 cannot be chosen for src and dest simulta-
[ Flag Change ]
Flag
Change
[ Description Example ]
MULU.B
A0,R0L
MULU.W
MULU.B
MULU.W
#3,R0
R0L,R1L
A0,Ram
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 95 of 263
Chapter 3 Functions
3.2 Functions
Complement of two
NEGate
NEG
[ Syntax ]
NEG.size
NEG
[ Instruction Code/Number of Cycles ]
Page: 207
dest
B,W
[ Operation ]
dest
0
dest
[ Function ]
This instruction takes the complement of two of dest and stores the result in dest.
[ Selectable dest ]
dest
R0L/R0
R0H/R1
R1L/R2
A0/A0
A1/A1
[A0]
dsp:8[A0] dsp:8[A1]
dsp:8[SB]
dsp:16[A0] dsp:16[A1] dsp:16[SB]
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
Conditions
O : The flag is set when dest before the operation is 128 (.B) or 32768 (.W); otherwise cleared.
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when the operation results in 0; otherwise cleared.
[ Description Example ]
NEG.B
NEG.W
R0L
A1
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
NOT
page 96 of 263
Chapter 3 Functions
3.2 Functions
No operation
No OPeration
NOP
[ Syntax ]
NOP
[ Operation ]
PC
PC
[ Function ]
This instruction adds 1 to PC.
[ Flag Change ]
Flag
NOP
Change
[ Description Example ]
NOP
page 97 of 263
Chapter 3 Functions
3.2 Functions
NOT
[ Syntax ]
NOT.size (:format) dest
NOT
[ Instruction Code/Number of Cycles ]
Page: 208
G , S (Can be specified)
B,W
[ Operation ]
________
dest
dest
[ Function ]
This instruction inverts dest and stores the result in dest.
[ Selectable dest ]
dest
R0L /R0
R0H /R1
R1L/R2
A0/A0
A1/A1
[A0]
dsp:8[A0] dsp:8[A1]
dsp:8[SB]*1
dsp:16[A0] dsp:16[A1] dsp:16[SB]
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
*1
*1
R1H/R3
[A1]
dsp:8[FB]*1
abs16*1
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
[ Description Example ]
NOT.B
NOT.W
R0L
A1
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
NEG
page 98 of 263
Chapter 3 Functions
3.2
Functions
Logically OR
OR
OR
[ Syntax ]
OR.size (:format)
src,dest
[ Operation ]
dest
src
dest
OR
[ Function ]
This instruction logically ORs dest and src and stores the result in dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to perform
operation in 16 bits. If src is A0 or A1, operation is performed using the 8 low-order bits of A0 or A1.
[ Selectable src/dest ]
src
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
[ Description Example ]
OR.B
Ram:8[SB],R0L
OR.B:G
A0,R0L
OR.B:G
R0L,A0
OR.B:S
#3,R0L
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
page 99 of 263
Chapter 3
Functions
3.2
Functions
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
dest
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
S format*2
src
R0L
abs16
R0L*3
abs16
R0H
#IMM
R0H*3
#IMM
dsp:8[SB]
dsp:8[SB]
dest
dsp:8[FB] R0L
abs16
dsp:8[FB] R0L*3
abs16
R0H
A0
R0H*3
A0
dsp:8[SB]
A1
dsp:8[SB]
A1
dsp:8[FB]
dsp:8[FB]
Chapter 3 Functions
3.2
Restore register/memory
POP
POP
Functions
POP
[ Syntax ]
POP.size (:format) dest
[ Operation ]
If the size specifier (.size) is (.W)
dest
M(SP)
SP
SP + 2
[ Selectable dest ]
dest
R0L*1/R0
R0H*1/R1
A0/A0
A1/A1*1
dsp:8[A0] dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
*1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
Change
[ Description Example ]
POP.B
POP.W
R0L
A0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3
Functions
3.2
POPC
[ Syntax ]
POPC
dest
[ Operation ]
dest
SP*1
M(SP)
SP +
Functions
POPC
*1 When dest is SP or when the U flag = 0 and dest is ISP, 2 is not added to SP.
[ Function ]
This instruction restores data from the stack area to the control register indicated by dest.
When restoring an interrupt table register, always be sure to restore INTBH and INTBL in succession.
No interrupt requests are accepted immediately after this instruction.
[ Selectable dest ]
FB
SB
*2
SP
dest
ISP FLG INTBH INTBL
[ Flag Change ]
Flag
Change *3
*3
*3
*3
*3
*3
*3
*3
[ Description Example ]
POPC
SB
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3 Functions
3.2
POPM
[ Syntax ]
POPM
dest
[ Operation ]
dest
SP
M(SP)
SP +
POPM
N*1
FB SB A1 A0 R3 R2 R1 R0
[ Flag Change ]
Flag
Change
[ Description Example ]
POPM
R0,R1,A0,SB,FB
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Functions
Chapter 3
Functions
3.2
PUSH
[ Syntax ]
PUSH.size (:format)
src
[ Function ]
This instruction saves src to the stack area.
[ Selectable src ]
src
R0L /R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
*1
R0H /R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
Change
[ Description Example ]
PUSH.B
PUSH.W
PUSH.B
PUSH.W
#5
#100H
R0L
A0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
PUSH
[ Operation ]
If the size specifier (.size) is (.B)
SP
SP 1
M(SP)
src
*1
Functions
Chapter 3 Functions
3.2
PUSHA
[ Syntax ]
PUSHA
src
[ Operation ]
SP
M(SP)
SP 2
EVA(src)
This instruction saves the effective address of src to the stack area.
[ Selectable src ]
src
R0L/R0
R0H/R1
A0/A0
A1/A1
dsp:8[A0] dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Change
[ Description Example ]
PUSHA
Ram:8[FB]
PUSHA
Ram:16[SB]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
PUSHA
[ Function ]
Flag
Functions
MOVA
Chapter 3
Functions
3.2
PUSHC
[ Syntax ]
PUSHC
src
[ Operation ]
SP
M(SP)
SP
src*1
Functions
PUSHC
*1 When src is SP or when the U flag = 0 and src is ISP, SP is saved before 2 is subtracted.
[ Function ]
This instruction saves the control register indicated by src to the stack area.
[ Selectable src ]
FB
*2
SB
*2
SP
src
ISP FLG INTBH INTBL
[ Flag Change ]
Flag
Change
[ Description Example ]
PUSHC
SB
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3 Functions
3.2
PUSHM
[ Syntax ]
PUSHM
src
[ Operation ]
SP
M(SP)
SP
src
PUSHM
[ Instruction Code/Number of Cycles ]
Page: 217
N*1
R0 R1 R2 R3 A0 A1 SB FB
[ Flag Change ]
Flag
Change
[ Description Example ]
PUSHM
R0,R1,A0,SB,FB
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Functions
Chapter 3
Functions
3.2
REIT
[ Syntax ]
REIT
Functions
REIT
[ Operation ]
PCML
SP
PCH, FLG
SP
M(SP)
SP +
M(SP)
SP +
[ Function ]
This instruction restores the PC and FLG values that were saved when an interrupt request was
accepted and returns from the interrupt handler routine.
[ Flag Change ]
Flag
Change *1
*1
*1
*1
*1
*1
*1
*1
[ Description Example ]
REIT
*1 The flags are reset to the FLG state before the interrupt
request was accepted.
Chapter 3
Functions
3.2
Calculate sum-of-products
Repeat MultiPle and Addition
RMPA
[ Syntax ]
RMPA.size
Functions
RMPA
[ Operation ]*1
Repeat
R2R0(R0) *2
R2R0(R0) *2 +
A0 + 2 (1) *2
A1 + 2 (1) *2
R3 1
M(A0)
M(A1)
A0
A1
R3
R3 = 0
If R3 is set to 0, this instruction is ignored.
Items in parentheses and followed by *2( )*2 apply when (.B) is selected as the size specifier (.size).
Until
*1
*2
[ Function ]
This instruction performs sum-of-product calculations, with the multiplicand address indicated by A0, the multiplier address indicated by A1, and the count of operation indicated by R3. Calculations are performed including
the sign bits and the result is stored in R2R0 (R0)*1.
If an overflow occurs during operation, the O flag is set to terminate the operation. R2R0 (R0)*1
contains the result of the addition performed last. A0, A1, and R3 are undefined.
The content of A0 or A1 when the instruction is completed indicates the next address after the lastread data.
If an interrupt request is received during instruction execution, the interrupt is acknowledged after a sum-ofproduct addition is completed (i.e., after the content of R3 is decremented by 1).
Make sure that R2R0 (R0)*1 is set to the initial value.
Items in parentheses and followed by *1( )*1 apply when (.B) is selected as the size specifier (.size).
[ Fl ag Change ]
Flag
Change
Conditions
O : The flag is set when +2147483647 (.W) or 2147483648 (.W), or +32767 (.B) or 32768 (.B) is
exceeded during operation; otherwise cleared.
[ Description Example ]
RMPA.B
Chapter 3
Functions
3.2
ROLC
[ Syntax ]
ROLC.size
Functions
ROLC
dest
B,W
[ Operation ]
MSB
dest
LSB
[ Function ]
This instruction rotates dest one bit to the left including the C flag.
[ Selectable dest ]
dest
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
R1L/R2
R1H/R3
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in dest = 0; otherwise cleared.
C : The flag is set when the shifted-out bit is 1; otherwise cleared.
[ Description Example ]
ROLC.B
ROLC.W
R0L
R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3
Functions
3.2
RORC
[ Syntax ]
RORC.size
Functions
RORC
dest
B,W
[ Operation ]
MSB
dest
LSB
[ Function ]
This instruction rotates dest one bit to the right including the C flag.
[ Selectable dest ]
dest
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
R1L/R2
R1H/R3
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[A1]
dsp:8[FB]
abs16
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in dest = 0; otherwise cleared.
C : The flag is set when the shifted-out bit is 1; otherwise cleared.
[ Description Example ]
RORC.B
RORC.W
R0L
R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3
Functions
3.2
Rotate
ROTate
ROT
[ Syntax ]
ROT.size
Functions
ROT
[ Instruction Code/Number of Cycles ]
Page: 220
src,dest
B,W
[ Operation ]
src<0
C
dest
MSB
LSB
src>0
[ Function ]
This instruction rotates dest left or right the number of bits indicated by src. Bits overflowing from LSB
(MSB) are transferred to MSB (LSB) and the C flag.
The direction of rotation is determined by the sign of src. If src is positive, bits are rotated left; if negative,
bits are rotated right.
If src is an immediate value, the number of bits rotated is 8 to 1 or +1 to +8. Values less than 8, equal
to 0, or greater than +8 are not valid.
If src is a register and (.B) is selected as the size specifier (.size), the number of bits rotated is 8 to +8.
Although a value of 0 may be set, no bits are rotated and no flags are changed. If a value less than 8 or
greater than +8 is set, the result of the rotation is undefined.
If src is a register and (.W) is selected as the size specifier (.size), the number of bits rotated is 16 to +16.
Although a value of 0 may be set, no bits are rotated and no flags are changed. If a value less than 16 or
greater than +16 is set, the result of the rotation is undefined.
[ Selectable src/dest ]
src
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
*1
R1H /R3
[A1]
dsp:8[FB]
abs16
#IMM*2
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
*1
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3*1
[A1]
dsp:8[FB]
abs16
C
*1 If the number of bits rotated is 0, no flags are changed.
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when the bit shifted out last is 1; otherwise cleared.
[ Description Example ]
ROT.B
#1,R0L
ROT.B
#1,R0L
ROT.W
R1H,R2
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
; Rotated left
; Rotated right
Chapter 3
Functions
3.2
RTS
[ Syntax ]
RTS
SP
M(SP)
SP +
M(SP)
SP +
[ Function ]
This instruction causes control to return from a subroutine.
[ Flag Change ]
RTS
[ Operation ]
PCML
SP
PCH
Flag
Functions
Change
[ Description Example ]
RTS
Chapter 3
Functions
3.2
SBB
[ Syntax ]
SBB.size
Functions
SBB
src,dest
B,W
[ Operation ]
dest
dest
___
src
[ Function ]
This instruction subtracts src and the inverted value of the C flag from dest and stores the result in dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to perform
operation in 16 bits. If src is A0 or A1, the operation is performed using the 8 low-order bits of A0 or
A1.
[ Selectable src/dest ]
src
R0L/R0
A0/A0*1
R0H/R1
R1L/R2
*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
dest
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1H/R3
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
*1
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
*1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
R1H/R3
[A0]
[A1]
dsp:8[SB] dsp:8[FB]
dsp:16[SB] abs16
abs20
A1A0
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
[ Flag Change ]
Flag
Conditions
O : The flag is set when a signed operation results in a value exceeding +32767 (.W) or 32768 (.W),
or +127 (.B) or 128 (.B); otherwise cleared.
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when an unsigned operation results in any value equal to or greater than 0;
otherwise cleared.
[ Description Example ]
SBB.B
#2,R0L
SBB.W
A0,R0
SBB.B
A0,R0L
SBB.B
R0L,A0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3
Functions
3.2
SBJNZ
[ Syntax ]
SBJNZ.size src,dest,label
Functions
SBJNZ
[ Operation ]
dest
dest src
if dest 0 then jump label
[ Function ]
This instruction subtracts src from dest and stores the result in dest.
If the operation results in any value other than 0, control jumps to label. If the operation results in 0,
the next instruction is executed.
The op-code of this instruction is the same as that of ADJNZ.
[ Selectable src/dest/label ]
src
dest
R0L/R0
R1H/R3
#IMM
R0H/R1
A0/A0
R1L/R2
A1/A1
[A0]
[A1]
dsp:8[A0]
dsp:8[A1] dsp:8[SB] dsp:8[FB]
dsp:16[A0] dsp:16[A1] dsp:16[SB]
abs16
*1
label
Change
[ Description Example ]
SBJNZ.W
#1,R0,label
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
ADJNZ
Chapter 3
Functions
3.2
Shift arithmetic
SHift Arithmetic
SHA
[ Syntax ]
SHA.size
Functions
SHA
[ Instruction Code/Number of Cycles ]
Page: 225
src,dest
B,W,L
[ Operation ]
When src < 0
When src > 0
MSB
dest
LSB
MSB
dest
LSB
[ Function ]
This instruction arithmetically shifts dest left or right the number of bits indicated by src. Bits overflowing from LSB (MSB) are transferred to the C flag.
If src is an immediate value , the number of bits shifted is 8 to 1 or +1 to +8. Values less than 8,
equal to 0, or greater than +8 are not valid.
If src is a register and (.B) is selected as the size specifier (.size), the number of bits shifted is 8 to +8.
Although a value of 0 may be set, no bits are shifted and no flags are changed. If a value less than
8 or greater than +8 is set, the result of the shift is undefined.
If src is a register and (.W) or (.L) is selected as the size specifier (.size), the number of bits shifted is
16 to +16. Although a value of 0 may be set, no bits are shifted and no flags are changed. If a value
less than 16 or greater than +16 is set, the result of shift is undefined.
[ Selectable src/dest ]
src
R0L/R0
R0H/R1
A0/A0
A1/A1
dsp:8[A0] dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
dest
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H*1/R3
[A1]
dsp:8[FB]
abs16
#IMM*2
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0*3
R0H/R1*1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1*3
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3*1
[A1]
dsp:8[FB]
abs16
C
*1 If the number of bits shifted is 0, no flags are changed.
Conditions
O : The flag is set when the operation results in MSB changing its state from 1 to 0 or from 0 to 1; otherwise
cleared. However, the flag does not change if (.L) is selected as the size specifier (.size).
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared. However, the flag value is undefined if (.L)
is selected as the size specifier (.size).
C : The flag is set when the bit shifted out last is 1; otherwise cleared. However, the flag is indeterminate if (.L)
is selected as the size specifier (.size).
[ Description Example ]
SHA.B
#3,R0L
SHA.B
#3,R0L
SHA.L
R1H,R2R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3
Functions
3.2
Shift logical
SHift Logical
SHL
[ Syntax ]
SHL.size
Functions
SHL
[ Instruction Code/Number of Cycles ]
Page: 228
src,dest
B,W,L
[ Operation ]
When src < 0
MSB
dest
LSB
MSB
dest
LSB
dest
*1
*1
R0L/R0
R0H/R1
R1L/R2
R1H /R3 R0L/R0
R0H/R1
R1L/R2
R1H/R3*1
A0/A0
A1/A1
[A0]
[A1]
A0/A0
A1/A1
[A0]
[A1]
dsp:8[A0] dsp:8[A1]
dsp:8[SB]
dsp:8[FB] dsp:8[A0] dsp:8[A1] dsp:8[SB] dsp:8[FB]
dsp:16[A0] dsp:16[A1] dsp:16[SB] abs16
dsp:16[A0] dsp:16[A1] dsp:16[SB] abs16
*2
dsp:20[A0] dsp:20[A1] abs20
#IMM
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
A1A0
R2R0*3
R3R1*3
A1A0
*1 If src is R1H, R1 or R1H cannot be chosen for dest.
*2 The acceptable range of values is 8 < #IMM < +8. However, 0 is invalid.
*3 Only (.L) can be selected as the size specifier (.size). (.B) or (.W) can also be specified for dest.
[ Flag Change ]
Flag
Change
C
*1 If the number of bits shifted is 0, no flags are changed.
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared. However, the flag is undefined
if (.L) is selected as the size specifier (.size).
C : The flag is set when the bit shifted out last is 1; otherwise cleared. However, the flag is undefined
if (.L) is selected as the size specifier (.size).
[ Description Example ]
SHL.B
#3,R0L
; Logically shifted left
SHL.B
#3,R0L
; Logically shifted right
SHL.L
R1H,R2R0
[ Related Instructions ]
ROLC, RORC, ROT, SHA
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3
Functions
3.2
SMOVB
[ Syntax ]
SMOVB.size
Functions
SMOVB
[ Operation ]*1
When size specifier (.size) is (.B)
Repeat
M(A1)
M(216
*2
A0
A0
A1
A1
R3
R3
Until
R3 = 0
R1H + A0)
1
1
1
*1
*2
[ Function ]
This instruction transfers a string from a 20-bit source address to a 16-bit destination address by
successively decrementing the address.
Set the 4 high-order bits of the source address in R1H, the 16 low-order bits of the source address in
A0, the destination address in A1, and the transfer count in R3.
When the instruction is completed, A0 or A1 contains the next address after the last-read data.
If an interrupt request is received during instruction execution, the interrupt is acknowledged after one
data transfer is completed.
[ Flag Change ]
Flag
Change
[ Description Example ]
SMOVB.B
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
SMOVF, SSTR
Chapter 3
Functions
3.2
SMOVF
[ Syntax ]
SMOVF.size
Functions
SMOVF
[ Operation ]*1
When size specifier (.size) is (.B)
Repeat
M(A1)
M(216 R1H + A0)
*2*
A0
A0
+
1
A1
A1
+
1
R3
R3
1
Until
R3 = 0
*1
*2
[ Function ]
This instruction transfers a string from a 20-bit source address to a 16-bit destination address by
successively incrementing the address.
Set the 4 high-order bits of the source address in R1H, the 16 low-order bits of the source address in
A0, the destination address in A1, and the transfer count in R3.
When the instruction is completed, A0 or A1 contains the next address after the last-read data.
If an interrupt request is received during instruction execution, the interrupt is acknowledged after one
data transfer is completed.
[ Flag Change ]
Flag
Change
[ Description Example ]
SMOVF.W
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
SMOVB, SSTR
Chapter 3
Functions
3.2
Store string
String SToRe
SSTR
[ Syntax ]
SSTR.size
Functions
SSTR
[ Instruction Code/Number of Cycles ]
Page: 231
B,W
[ Operation ]*1
When size specifier (.size) is (.B)
Repeat
M(A1)
R0L
A1
A1 + 1
R3
R3 1
Until
R3 = 0
*1
[ Function ]
This instruction stores a string with the data to be stored indicated by R0, the transfer address indicated by A1, and the transfer count indicated by R3.
When the instruction is completed, A0 or A1 contains the next address after the last-written data.
If an interrupt request is received during instruction execution, the interrupt is acknowledged after one
data transfer is completed.
[ Flag Change ]
Flag
Change
[ Description Example ]
SSTR.B
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
SMOVB, SMOVF
Chapter 3
Functions
3.2
STC
Functions
STC
[ Syntax ]
STC src,dest
[ Operation ]
dest
src
[ Function ]
This instruction transfers the content of the control register indicated by src to dest. If dest is a
location in the memory, specify the address in which to store the low-order address.
If dest is a location in the memory and src is PC, the required memory capacity is 3 bytes. If src is not
PC, the required memory capacity is 2 bytes.
[ Selectable src/dest ]
src
FB
FLG
dest
*1
SB
INTBH
SP
INTBL
ISP
PC
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R0H/R1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
Change
[ Description Example ]
STC
SB,R0
STC
FB,A0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
R1H/R3
[A1]
dsp:8[FB]
abs16
Chapter 3
Functions
3.2
Save context
STore ConTeXt
STCTX
[ Syntax ]
STCTX
Functions
STCTX
[ Instruction Code/Number of Cycles ]
Page: 233
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.
MSB
LSB
FB SB A1 A0 R3 R2 R1 R0
abs20
Direction in
which address
increases
Register information for task with task number n*1. (See above diagram.)
SP correction value for task with task number n*1. (See above diagram.)
*1
n=0 to 255
[ Flag Change ]
Flag
Change
[ Description Example ]
STCTX
Ram,Rom_TBL
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
LDCTX
abs16 x 2
Chapter 3
Functions
3.2
STE
[ Syntax ]
STE.size
Functions
STE
src,dest
B,W
[ Operation ]
dest
src
[ Function ]
This instruction transfers src to dest in an extended area.
If src is A0 or A1 and the selected size specifier (.size) is (.B), the operation is performed on the 8 loworder bits of A0 or A1. However, the flag changes depending on the A0 or A1 status (16 bits) before the
operation is performed.
[ Selectable src/dest ]
src
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R0H/R1
[A1]
A0/A0
A1/A1
dsp:8[FB] dsp:8[A0] dsp:8[A1]
abs16
dsp:16[A0] dsp:16[A1]
#IMM
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
[A1A0]
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
[ Description Example ]
STE.B
R0L,[A1A0]
STE.W
R0,10000H[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
R1H/R3
[A1]
dsp:8[FB]
abs16
Chapter 3
Functions
3.2
Conditional transfer
STore on Not Zero
STNZ
[ Syntax ]
STNZ
dest
STNZ
[ Instruction Code/Number of Cycles ]
Page: 235
src,dest
[ Operation ]
if Z = 0 then
Functions
src
[ Function ]
This instruction transfers src to dest when the Z flag is 0.
[ Selectable src/dest ]
src
dest
#IMM8
[ Flag Change ]
Flag
Change
[ Description Example ]
STNZ
#5,Ram:8[SB]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
STZ, STZX
R0L
R0H
dsp:8[SB]
abs16
A0
A1
dsp:8[FB]
Chapter 3
Functions
3.2
Conditional transfer
STore on Zero
STZ
[ Syntax ]
STZ
src,dest
[ Operation ]
if Z = 1 then
Functions
STZ
[ Instruction Code/Number of Cycles ]
Page: 235
dest
src
[ Function ]
This instruction transfers src to dest when the Z flag is 1.
[ Selectable src/dest ]
src
dest
#IMM8
[ Flag Change ]
Flag
Change
[ Description Example ]
STZ
#5,Ram:8[SB]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
STNZ, STZX
R0L
R0H
dsp:8[SB]
abs16
A0
A1
dsp:8[FB]
Chapter 3
Functions
3.2
Conditional transfer
STore on Zero eXtention
STZX
[ Syntax ]
STZX
STZX
src1,src2,dest
[ Operation ]
If Z = 1 then
dest
else
dest
[ Function ]
Functions
src1
src2
This instruction transfers src1 to dest when the Z flag is 1. When the Z flag is 0, it transfers src2 to
dest.
[ Selectable src/dest ]
src
dest
#IMM8
[ Flag Change ]
Flag
Change
[ Description Example ]
STZX
#1,#2,Ram:8[SB]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
STZ, STNZ
R0L
R0H
dsp:8[SB]
abs16
A0
A1
dsp:8[FB]
Chapter 3
Functions
3.2
SUB
[ Syntax ]
SUB.size (:format) src,dest
[ Operation ]
dest
dest
Functions
SUB
src
[ Function ]
This instruction subtracts src from dest and stores the result in dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to perform
operation in 16 bits. If src is A0 or A1, operation is performed on the 8 low-order bits of A0 or A1.
(See next page for src / dest classified by format.)
[ Selectable src/dest ]
src
R0L/R0
A0/A0*1
R0H/R1
R1L/R2
*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
dest
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1H/R3
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
*1
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
*1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
R1H/R3
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[A1]
dsp:8[FB]
abs16
SP/SP
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
[ Flag Change ]
Flag
Change
Conditions
O : The flag is set when a signed operation results in a value in exceeding +32767 (.W) or 32768
(.W), or +127 (.B) or 128 (.B); otherwise cleared.
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
C : The flag is set when an unsigned operation results in any value equal to or greater than 0;
otherwise cleared.
[ Description Example ]
SUB.B
A0,R0L
SUB.B
R0L,A0
SUB.B
Ram:8[SB],R0L
SUB.W
#2,[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3
Functions
3.2
Functions
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
dest
R1H/R3
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
R1H/R3
[A1]
dsp:8[FB]
abs16
SP/SP
*1 If (.B) is selected as for the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
S format*2
src
R0L
abs16
R0L*3
abs16
R0H
#IMM
R0H*3
#IMM
dsp:8[SB]
dsp:8[SB]
dest
dsp:8[FB] R0L
abs16
dsp:8[FB] R0L*3
abs16
R0H
A0
R0H*3
A0
dsp:8[SB]
A1
dsp:8[SB]
A1
dsp:8[FB]
dsp:8[FB]
Chapter 3
Functions
3.2
Test
TeST
TST
[ Syntax ]
TST.size
Functions
TST
[ Instruction Code/Number of Cycles ]
Page: 239
src,dest
B,W
[ Operation ]
dest
src
[ Function ]
Each flag in the flag register changes state depending on the result of a logical AND of src and dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to perform
operation in 16 bits. If src is A0 or A1, the operation is performed on the 8 low-order bits of A0 or A1.
[ Selectable src/dest ]
src
R0L/R0
A0/A0*1
R0H/R1
A1/A1*1
dsp:8[A0] dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
dest
R1L/R2
R1H/R3
R0L/R0
R0H/R1
R1L/R2
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[A1]
dsp:8[FB]
abs16
#IMM
A0/A0*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
A1/A1*1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
[A0]
[A1]
dsp:8[SB] dsp:8[FB]
dsp:16[SB] abs16
abs20
A1A0
R1H/R3
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
[ Description Example ]
TST.B
#3,R0L
TST.B
A0,R0L
TST.B
R0L,A0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3
Functions
3.2
UND
[ Syntax ]
UND
Functions
UND
[ Operation ]
SP
M(SP)
SP 2
(PC + 1)H, FLG
SP
M(SP)
PC
SP 2
(PC + 1)ML
M(FFFDC16)
[ Function ]
This instruction generates an undefined instruction interrupt.
The undefined instruction interrupt is nonmaskable.
[ Flag Change ]
Flag
Change
Conditions
U : The flag is cleared.
I : The flag is cleared.
D : The flag is cleared.
[ Description Example ]
UND
*1 The flags are saved to the stack area before the UND
instruction is executed. After the interrupt, the flag status
becomes as shown at left.
Chapter 3
Functions
3.2
Wait
WAIT
WAIT
[ Syntax ]
WAIT
Functions
WAIT
[ Instruction Code/Number of Cycles ]
Page: 241
[ Operation ]
[ Function ]
This instruction halts program execution. Program execution is restarted when an interrupt of a higher
priority level than IPL is acknowledged or a reset is generated.
[ Flag Change ]
Flag
Change
[ Description Example ]
WAIT
Chapter 3
Functions
3.2
Exchange
eXCHanGe
XCHG
[ Syntax ]
XCHG.size
Functions
XCHG
[ Instruction Code/Number of Cycles ]
Page: 242
src,dest
B,W
[ Operation ]
dest
src
[ Function ]
This instruction exchanges the contents of src and dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), the content of src is zero-expanded to
16 bits and placed in A0 or A1, and the 8 low-order bits of A0 or A1 are placed in src.
[ Selectable src/dest ]
src
R0L/R0
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
dest
R0H/R1
R1L/R2
R1H/R3
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[A1]
dsp:8[FB]
abs16
#IMM
[A1A0]
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
[A0]
[A1]
dsp:8[SB] dsp:8[FB]
dsp:16[SB] abs16
abs20
A1A0
[ Flag Change ]
Flag
Change
[ Description Example ]
XCHG.B
R0L,A0
XCHG.W
XCHG.B
R0,A1
R0L,[A0]
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3
Functions
3.2
Exclusive OR
eXclusive OR
XOR
[ Syntax ]
XOR.size
Functions
XOR
[ Instruction Code/Number of Cycles ]
Page: 243
src,dest
B,W
[ Operation ]
dest
dest
src
[ Function ]
This instruction exclusive ORs src and dest and stores the result in dest.
If dest is A0 or A1 and the selected size specifier (.size) is (.B), src is zero-expanded to perform
operation in 16 bits. If src is A0 or A1, the operation is performed on the 8 low-order bits of A0 or A1.
[ Selectable src/dest ]
src
R0L/R0
A0/A0*1
R0H/R1
R1L/R2
*1
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
dest
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1H/R3
[A0]
dsp:8[SB]
dsp:16[SB]
abs20
A1A0
[A1]
dsp:8[FB]
abs16
#IMM
R0L/R0
*1
A0/A0
dsp:8[A0]
dsp:16[A0]
dsp:20[A0]
R2R0
R0H/R1
*1
A1/A1
dsp:8[A1]
dsp:16[A1]
dsp:20[A1]
R3R1
R1L/R2
R1H/R3
[A0]
[A1]
dsp:8[SB] dsp:8[FB]
dsp:16[SB] abs16
abs20
A1A0
*1 If (.B) is selected as the size specifier (.size), A0 or A1 cannot be chosen for src and dest simultaneously.
[ Flag Change ]
Flag
Change
Conditions
S : The flag is set when the operation results in MSB = 1; otherwise cleared.
Z : The flag is set when the operation results in 0; otherwise cleared.
[ Description Example ]
XOR.B
XOR.B
XOR.B
XOR.W
A0,R0L
R0L,A0
#3,R0L
A0,A1
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
Chapter 3
Functions
3.2
Functions
Chapter 4
Instruction Codes/Number of Cycles
4.1 Guide to This Chapter
4.2 Instruction Codes/Number of Cycles
4.1
4.2
LDIPL
(1)
(2)
(3)
(4)
b0 b7
0 1 1
1 1 1 0
1 1
b0
0 1 0
IMM4
Bytes/Cycles
(1)
(2)
MOV
(1) MOV.size:G #IMM, dest
b7
(3)
b0 b7
0 1 1
1 0
1 0 SIZE 1
.B
.W
(4)
1 0 0
dest
.size SIZE
R0L/R0
R0H/R1
Rn
R1L/R2
R1H/R3
A0
An
A1
[A0]
[An]
[A1]
[ Number of Bytes/Number of Cycles ]
Bytes/Cycles
Rn
An
[An]
3/2
3/2
3/3
DEST
dsp8
dsp16/abs16
DEST
0
1
dest
dest code
b0
0000
0001
0010
0011
0100
0101
0110
0111
#IMM8
#IMM16
dest
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
DEST
dsp:8[A0]
dsp:8[A1]
dsp:8[SB]
dsp:8[FB]
dsp:16[A0]
dsp:16[A1]
dsp:16[SB]
abs16
1000
1001
1010
1011
1100
1101
1110
1111
4/3
5/3
5/3
5/3
4.1
(1) Mnemonic
Shows the mnemonic explained in the page.
(2) Syntax
Shows an instruction syntax using symbols.
b7
b0 b7
0 1 1
1 0
1 0 SIZE 1
Correspondence
.B
.W
1 0 0
Rn
An
[An]
DEST
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
0
1
dest code
b0
Correspondence
.size SIZE
dsp8
dsp16/abs16
#IMM8
#IMM16
Correspondence
dest
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
dsp:8[A0]
dsp:8[A1]
dsp:8[SB]
dsp:8[FB]
dsp:16[A0]
dsp:16[A1]
dsp:16[SB]
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
abs20
dsp20
#IMM20
+2
b0
dsp8
#IMM8
dsp16
abs16
#IMM16
+1
8 bits
b7
b0 b7
Low-order 8 bits
b7
High-order 8 bits
b0 b7
Low-order 8 bits
b0
b0 b7
Middle-order 8 bits
0000
b0
High-order
4 bits
Chapter 4
4.2
ABS
(1) ABS.size dest
b7
b0 b7
0 1 1
1 0
1 1 SIZE 1
.size SIZE
.B
0
.W
1
b0
1 1 1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
DEST
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/3
An
2/3
[An]
2/5
abs16
4/5
ADC
(1) ADC.size #IMM, dest
b7
b0 b7
0 1 1
1 0
.size SIZE
.B
0
.W
1
1 1 SIZE 0
Rn
An
[An]
dest code
b0
1 1 0
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
DEST
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
abs16
5/4
Chapter 4
4.2
ADC
(2) ADC.size src, dest
b7
1 0 1
b0 b7
1 0
0 0 SIZE
.size SIZE
.B
0
.W
1
b0
SRC
DEST
src/dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
src code
SRC/DEST
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src/dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC/DEST
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
An
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
[An]
2/3
2/3
2/4
3/4
3/4
4/4
4/4
4/4
abs16
4/3
4/3
4/4
5/4
5/4
6/4
6/4
6/4
Chapter 4
4.2
ADCF
(1) ADCF.size
dest
b7
b0 b7
0 1 1
1 0 1
.size SIZE
.B
0
.W
1
1 SIZE 1
b0
1 1 0
DEST
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/1
An
2/1
[An]
2/3
abs16
4/3
ADD
(1) ADD.size:G
#IMM, dest
b7
0 1 1
b0 b7
1 0 1 1 SIZE 0
.size SIZE
.B
0
.W
1
DEST
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
dest code
b0
1 0 0
(
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
3/2
An
3/2
[An]
3/4
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
abs16
5/4
Chapter 4
4.2
ADD
(2) ADD.size:Q
#IMM, dest
b7
b0 b7
1 1 0
0 1 0 0 SIZE
.size SIZE
.B
0
.W
1
#IMM
0
+1
+2
+3
+4
+5
+6
+7
b0
IMM4
IMM4
0000
0001
0010
0011
0100
0101
0110
0111
DEST
#IMM
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
dsp8
dsp16/abs16
IMM4
1
1
1
1
1
1
1
1
8
7
6
5
4
3
2
1
dest code
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/1
An
[An]
2/1
2/3
3/3
4/3
4/3
abs16
4/3
Chapter 4
4.2
ADD
(3) ADD.B:S #IMM8, dest
b7
dest code
b0
1 0 0
0 0
DEST
dest
Rn
dsp:8[SB/FB]
abs16
#IMM8
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
2/1
dsp:8[SB/FB]
3/3
abs16
4/3
Chapter 4
4.2
ADD
(4) ADD.size:G
src, dest
b7
1 0 1
b0 b7
0 0
0 0 SIZE
.size SIZE
.B
0
.W
1
SRC
An
[An]
DEST
src/dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
src code
b0
SRC/DEST
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src/dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC/DEST
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
An
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
[An]
2/3
2/3
2/4
3/4
3/4
4/4
4/4
4/4
abs16
4/3
4/3
4/4
5/4
5/4
6/4
6/4
6/4
Chapter 4
4.2
ADD
(5) ADD.B:S src, R0L/R0H
b7
src code
b0
0 0 1
0 0 DEST SRC
dsp8
abs16
src
Rn
dsp:8[SB/FB]
abs16
)
dest
SRC
0 0
0 1
1 0
1 1
R0L/R0H
dsp:8[SB]
dsp:8[FB]
abs16
DEST
0
1
R0L
R0H
dsp:8[SB/FB]
Rn
1/2
2/3
abs16
3/3
ADD
(6) ADD.size:G
#IMM, SP
b7
0 1 1
b0 b7
1 1 1 0 SIZE 1
b0
1 1 0
1 0
1 1
#IMM8
#IMM16
.size SIZE
.B
0
.W
1
3/2
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
Chapter 4
4.2
ADD
(7) ADD.size:Q
#IMM, SP
b7
b0 b7
0 1 1
1 1
1 0 1 1
b0
0 1 1
IMM4
The instruction code is the same regardless of whether (.B) or (.W) is selected as the size specifier (.size).
#IMM
0
+1
+2
+3
+4
+5
+6
+7
IMM4
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
#IMM
8
7
6
5
4
3
2
1
IMM4
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
2/1
0
1
0
1
0
1
0
1
Chapter 4
4.2
ADJNZ
(1) ADJNZ.size
b7
b0 b7
1 1 1
1 1
b0
0 0 SIZE
IMM4
DEST
dest code
dsp8
dsp16/abs16
label code
dsp8
#IMM
0
+1
+2
+3
+4
+5
+6
+7
Rn
An
[An]
IMM4
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
#IMM
8
7
6
5
4
3
2
1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
IMM4
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
An
[An] dsp:8[An] dsp:8[SB/FB] dsp:16[An] dsp:16[SB]
3/3
3/3
3/5
4/5
4/5
5/5
5/5
Bytes/Cycles
If the program branches to a label, the number of cycles indicated is increased by 4.
abs16
5/5
Chapter 4
4.2
AND
(1) AND.size:G
#IMM, dest
b7
b0 b7
0 1 1
1 0
1 1 SIZE 0
.size SIZE
.B
0
.W
1
0 1 0
An
[An]
DEST
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
dest code
b0
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
3/2
An
3/2
[An]
3/4
abs16
5/4
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
AND
(2) AND.B:S #IMM8, dest
b7
dest code
b0
1 0 0
1 0
DEST
dest
Rn
dsp:8[SB/FB]
abs16
#IMM8
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
2/1
dsp:8[SB/FB]
3/3
abs16
4/3
Chapter 4
4.2
AND
(3) AND.size:G
src, dest
b7
1 0 0
b0 b7
1 0 0 0 SIZE
.size SIZE
.B
0
.W
1
An
[An]
DEST
src/dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
src code
b0
SRC
SRC/DEST
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src/dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC/DEST
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
An
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
[An]
2/3
2/3
2/4
3/4
3/4
4/4
4/4
4/4
abs16
4/3
4/3
4/4
5/4
5/4
6/4
6/4
6/4
Chapter 4
4.2
AND
(4) AND.B:S src, R0L/R0H
b7
src code
b0
0 0 0
1 0 DEST SRC
dsp8
abs16
src
Rn
dsp:8[SB/FB]
abs16
SRC
R0L/R0H
dsp:8[SB]
dsp:8[FB]
abs16
0
0
1
1
0
1
0
1
dest
R0L
R0H
Rn
1/2
dsp:8[SB/FB]
2/3
abs16
3/3
DEST
0
1
Chapter 4
4.2
BAND
(1) BAND
src
b7
b0 b7
0 1 1
1 1 1 1
0 0
src
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
src code
b0
1 0 0
0
0
0
0
0
0
0
0
SRC
000
001
010
011
100
101
110
111
SRC
dsp8
dsp16
src
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
1
1
1
1
1
1
1
1
SRC
000
001
010
011
100
101
110
111
bit,Rn bit,An
Bytes/Cycles
3/3
3/3
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/7
3/7
3/4
4/7
bit,base:16
bit,base:16
[SB]
4/4
4/4
BCLR
(1) BCLR:G dest
b7
b0 b7
0 1 1
1 1 1
1 0 1
dest
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
b0
0 0 0
DEST
0000
0001
0010
0011
0100
0101
0110
0111
DEST
dest code
dsp8
dsp16
dest
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
bit,Rn bit,An
3/2
3/2
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/6
3/6
3/3
4/6
bit,base:16
bit,base:16
[SB]
4/3
4/3
Chapter 4
4.2
BCLR
(2) BCLR:S bit, base:11[SB]
b7
0 1 0
b0
0 0
BIT
dest code
dsp8
2/3
Chapter 4
4.2
BMCnd
(1) BMCnd
dest
b7
b0 b7
0 1 1
1 1
1 1 0 0
0 1 0
dest
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
Cnd
GEU/C
GTU
EQ/Z
N
LE
O
GE
DEST
0000
0001
0010
0011
0100
0101
0110
0111
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
DEST
0
0
0
0
1
1
1
0
0
1
1
0
0
1
0
1
0
1
0
1
0
LTU/NC
LEU
NE/NZ
PZ
GT
NO
LT
dsp8
dsp16
dest
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
Cnd
CND
0
0
0
0
0
0
0
dest code
b0
CND
DEST
1000
1001
1010
1011
1100
1101
1110
1111
CND
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
0
0
1
1
0
0
1
0
1
0
1
0
1
0
bit,Rn bit,An
4/6
4/6
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
3/10
4/10
4/7
5/10
bit,base:16
bit,base:16
[SB]
5/7
5/7
Chapter 4
4.2
BMCnd
(2) BMCnd
b7
b0 b7
0 1 1
Cnd
GEU/C
GTU
EQ/Z
N
LTU/NC
LEU
NE/NZ
1 1 1 0
Cnd
CND
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
1
1
0
0
1
1 0 1
CND
CND
PZ
LE
O
GE
GT
NO
LT
0
1
0
1
0
1
0
b0
1 1
0
1
1
1
1
1
1
1
0
0
0
1
1
1
1
0
0
1
0
0
1
1
0
1
0
0
1
0
2/1
BNAND
(1) BNAND
src
b7
b0 b7
0 1 1
1 1
1 1 0 0
src
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
b0
1 0 1
SRC
0000
0001
0010
0011
0100
0101
0110
0111
SRC
src code
dsp8
dsp16
src
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
bit,Rn bit,An
3/3
3/3
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/7
3/7
3/4
4/7
bit,base:16
bit,base:16
[SB]
4/4
4/4
Chapter 4
4.2
BNOR
(1) BNOR
src
b7
b0 b7
0 1 1
1 1 1
1 0 0
src
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
b0
1 1 1
0
0
0
0
0
0
0
0
SRC
000
001
010
011
100
101
110
111
SRC
src code
dsp8
dsp16
src
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
1
1
1
1
1
1
1
1
SRC
000
001
010
011
100
101
110
111
bit,Rn bit,An
Bytes/Cycles
3/3
3/3
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/7
3/7
3/4
4/7
bit,base:16
bit,base:16
[SB]
4/4
4/4
BNOT
(1) BNOT:G dest
b7
b0 b7
0 1 1
1 1 1 1
0 1
dest
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
dest code
b0
0 1 0
DEST
0000
0001
0010
0011
0100
0101
0110
0111
DEST
dsp8
dsp16
dest
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
bit,Rn bit,An
3/2
3/2
[An]
2/6
base:8
[An]
3/6
bit,base:8
[SB/FB]
3/3
base:16
[An]
4/6
bit,base:16
bit,base:16
[SB]
4/3
4/3
Chapter 4
4.2
BNOT
(2) BNOT:S bit, base:11[SB]
b7
dest code
b0
0 1 0
1 0
dsp8
BIT
2/3
BNTST
(1) BNTST
src
b7
b0 b7
0 1 1
1 1 1 1
0 0
src
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
b0
0 1 1
SRC
0000
0001
0010
0011
0100
0101
0110
0111
SRC
src code
dsp8
dsp16
src
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
bit,Rn bit,An
3/3
3/3
[An]
2/7
base:8
[An]
3/7
bit,base:8
[SB/FB]
3/4
base:16
[An]
4/7
bit,base:16
bit,base:16
[SB]
4/4
4/4
Chapter 4
4.2
BNXOR
(1) BNXOR
src
b7
b0 b7
0 1 1
1 1 1 1 0 1
src
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
b0
1 0 1
0
0
0
0
0
0
0
0
SRC
000
001
010
011
100
101
110
111
SRC
src code
dsp8
dsp16
src
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
1
1
1
1
1
1
1
1
SRC
000
001
010
011
100
101
110
111
src
Bytes/Cycles
3/3
3/3
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/7
3/7
3/4
4/7
bit,base:16
bit,base:16
[SB]
4/4
4/4
BOR
(1) BOR
src
b7
b0 b7
0 1 1
1 1 1 1
0 0
src
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
src code
b0
1 1 0
SRC
0000
0001
0010
0011
0100
0101
0110
0111
SRC
dsp8
dsp16
src
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
bit,Rn bit,An
3/3
3/3
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/7
3/7
3/4
4/7
bit,base:16
bit,base:16
[SB]
4/4
4/4
Chapter 4
4.2
BRK
(1) BRK
b7
b0
0 0 0
0 0
0 0 0
1/27
If the target address of the BRK interrupt is specified using the interrupt table register (INTB), the
number of cycles shown in the table increases by two. In this case, set FF16 in addresses FFFE416
through FFFE716.
BSET
(1) BSET:G dest
b7
b0 b7
0 1 1
1 1
1 1 0 1
dest
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
dest code
b0
0 0 1
DEST
0000
0001
0010
0011
0100
0101
0110
0111
DEST
dsp8
dsp16
dest
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
bit,Rn bit,An
3/2
3/2
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/6
3/6
3/3
4/6
bit,base:16
bit,base:16
[SB]
4/3
4/3
Chapter 4
4.2
BSET
(2) BSET:S bit, base:11[SB]
b7
dest code
b0
0 1 0
0 1
BIT
dsp8
2/3
BTST
(1) BTST:G src
b7
b0 b7
0 1 1
1 1 1
1 0 1
src
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
src code
b0
0 1 1
SRC
0000
0001
0010
0011
0100
0101
0110
0111
SRC
dsp8
dsp16
src
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
bit,Rn bit,An
3/2
3/2
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/6
3/6
3/3
4/6
bit,base:16
bit,base:16
[SB]
4/3
4/3
Chapter 4
4.2
BTST
(2) BTST:S
bit, base:11[SB]
b7
src code
b0
0 1 0
1 1
BIT
dsp8
2/3
BTSTC
(1) BTSTC
dest
dest code
b7
b0 b7
0 1 1
1 1 1 1
0 0
dest
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
b0
0 0 0
DEST
0000
0001
0010
0011
0100
0101
0110
0111
DEST
dsp8
dsp16
dest
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
bit,Rn bit,An
3/3
3/3
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/7
3/7
3/4
4/7
bit,base:16
bit,base:16
[SB]
4/4
4/4
Chapter 4
4.2
BTSTS
(1) BTSTS
dest
b7
b0 b7
0 1 1
1 1 1
1 0 0
dest
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
dest code
b0
0 0 1
DEST
0000
0001
0010
0011
0100
0101
0110
0111
DEST
dsp8
dsp16
dest
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
bit,Rn bit,An
3/3
Bytes/Cycles
3/3
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/7
3/7
3/4
4/7
bit,base:16
bit,base:16
[SB]
4/4
4/4
BXOR
(1) BXOR
src
b7
b0 b7
0 1 1
1 1 1
1 0 1
src
bit,R0
bit,R1
bit,R2
bit,R3
bit,A0
bit,A1
[A0]
[A1]
bit,Rn
bit,An
[An]
src code
b0
1 0 0
SRC
0000
0001
0010
0011
0100
0101
0110
0111
SRC
dsp8
dsp16
src
base:8[A0]
base:8[An]
base:8[A1]
bit,base:8[SB]
bit,base:8
bit,base:8[FB]
[SB/FB]
base:16[A0]
base:16[An]
base:16[A1]
bit,base:16[SB] bit,base:16[SB]
bit,base:16
bit,base:16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
bit,Rn bit,An
3/3
3/3
[An]
base:8
[An]
bit,base:8
[SB/FB]
base:16
[An]
2/7
3/7
3/4
4/7
bit,base:16
bit,base:16
[SB]
4/4
4/4
Chapter 4
4.2
CMP
(1) CMP.size:G
#IMM, dest
b7
b0 b7
0 1 1
1 0 1 1 SIZE 1
.size SIZE
.B
0
.W
1
Rn
An
[An]
dest code
b0
0 0 0
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
DEST
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
An
[An] dsp:8[An] dsp:8[SB/FB] dsp:16[An] dsp:16[SB]
3/2
3/2
3/4
4/4
4/4
5/4
5/4
Bytes/Cycles
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
abs16
5/4
Chapter 4
4.2
CMP
(2) CMP.size:Q
#IMM, dest
b7
b0 b7
1 1 0
1 0
0 0 SIZE
.size SIZE
.B
0
.W
1
#IMM
0
+1
+2
+3
+4
+5
+6
+7
IMM4
IMM4
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
An
[An]
DEST
#IMM
8
7
6
5
4
3
2
1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
dest code
b0
dsp8
dsp16/abs16
IMM4
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/1
An
2/1
[An]
2/3
abs16
4/3
Chapter 4
4.2
CMP
(3) CMP.B:S #IMM8, dest
b7
dest code
b0
1 1 1
0 0
DEST
dest
Rn
dsp:8[SB/FB]
abs16
#IMM8
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
2/1
dsp:8[SB/FB]
3/3
abs16
4/3
Chapter 4
4.2
CMP
(4) CMP.size:G
src, dest
b7
1 1 0
b0 b7
0 0
.size SIZE
.B
0
.W
1
0 SIZE
SRC
An
[An]
DEST
src/dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
src code
b0
SRC/DEST
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src/dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC/DEST
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
An
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
[An]
2/3
2/3
2/4
3/4
3/4
4/4
4/4
4/4
abs16
4/3
4/3
4/4
5/4
5/4
6/4
6/4
6/4
Chapter 4
4.2
CMP
(5) CMP.B:S src, R0L/R0H
b7
0 0 1
b0
1 1 DEST SRC
src code
dsp8
abs16
src
Rn
dsp:8[SB/FB]
abs16
SRC
dest
0
1
0
1
R0L
R0H
dsp:8[SB/FB]
abs16
2/3
3/3
R0L/R0H
dsp:8[SB]
dsp:8[FB]
abs16
0
0
1
1
DEST
0
1
Rn
1/2
DADC
(1) DADC.B #IMM8, R0L
b7
0 1 1
b0 b7
1 1 1 0
0 1
b0
1 1 0
3/5
1 1
#IMM8
Chapter 4
4.2
DADC
(2) DADC.W #IMM16, R0
b7
0 1 1
b0 b7
1 1 1 0
1 1
b0
1 1 0
1 1
0 1
4/5
DADC
(3) DADC.B R0H, R0L
b7
0 1 1
b0 b7
1 1 1
0 0 1
b0
1 1 0
2/5
#IMM16
Chapter 4
4.2
DADC
(4) DADC.W R1, R0
b7
0 1 1
b0 b7
1 1 1 0
1 1
b0
1 1 0
0 1
2/5
DADD
(1) DADD.B #IMM8, R0L
b7
0 1 1
b0 b7
1 1
1 0 0 1
b0
1 1 0
3/5
1 1
#IMM8
Chapter 4
4.2
DADD
(2) DADD.W #IMM16, R0
b7
0 1 1
b0 b7
1 1 1 0
1 1
b0
1 1 0
1 1
0 1
4/5
DADD
(3) DADD.B R0H, R0L
b7
0 1 1
b0 b7
1 1 1
0 0 1
b0
1 1 0
2/5
#IMM16
Chapter 4
4.2
DADD
(4) DADD.W R1, R0
b7
0 1 1
b0 b7
1 1
1 0 1 1
b0
1 1 0
0 1
2/5
DEC
(1) DEC.B
dest
b7
1 0 1
b0
0 1
DEST
dest
Rn
dsp:8[SB/FB]
abs16
dest code
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
1/1
dsp:8[SB/FB]
2/3
abs16
3/3
Chapter 4
4.2
DEC
(2) DEC.W
dest
b7
b0
1 1 1
1 DEST 0
dest
1 0
DEST
0
1
A0
A1
1/1
DIV
(1) DIV.size #IMM
b7
0 1 1
b0 b7
1 1 1 0 SIZE 1
b0
1 1 0
0 0
#IMM8
#IMM16
.size SIZE
.B
0
.W
1
3/22
If the size specifier (.size) is (.W), the number of bytes and cycles indicated are increased by 1 and 6,
respectively.
The number of cycles may decrease if an overflow occurs or depending on the value of the divisor or
dividend.
Chapter 4
4.2
DIV
(2) DIV.size src
b7
b0 b7
0 1 1
1 0
1 1 SIZE 1 1
.size SIZE
.B
0
.W
1
0 1
An
[An]
SRC
SRC
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
src code
b0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
1
1
1
1
1
1
1
1
SRC
000
001
010
011
100
101
110
111
Rn
2/22
An
2/22
[An]
2/24
abs16
4/24
If the size specifier (.size) is (.W), the number of cycles indicated is increased by 6.
The number of cycles may decrease if an overflow occurs or depending on the value of the divisor or
dividend.
DIVU
0 1 1
b0 b7
1 1
1 0 SIZE 1
b0
1 1 0
0 0
#IMM8
#IMM16
.size SIZE
.B
0
.W
1
3/18
The number of cycles may decrease if an overflow occurs or depending on the value of the divisor or
dividend.
If the size specifier (.size) is (.W), the number of bytes and cycles indicated are increased by 1 and 7,
respectively.
Chapter 4
4.2
DIVU
(2) DIVU.size src
b7
b0 b7
0 1 1
1 0
.size SIZE
.B
0
.W
1
b0
1 SIZE 1 1
0 0
SRC
An
[An]
SRC
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
src code
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
1
1
1
1
1
1
1
1
SRC
000
001
010
011
100
101
110
111
Rn
Bytes/Cycles
2/18
An
2/18
[An]
2/20
abs16
4/20
If the size specifier (.size) is (.W), the number of cycles indicated is increased by 7.
The number of cycles may decrease if an overflow occurs or depending on the value of the divisor or
dividend.
DIVX
(1) DIVX.size #IMM
b7
0 1 1
b0 b7
1 1
1 0 SIZE 1
b0
1 1 0
0 0
#IMM8
#IMM16
.size SIZE
.B
0
.W
1
3/22
The number of cycles may decrease if an overflow occurs or depending on the value of the divisor or
dividend.
If the size specifier (.size) is (.W), the number of bytes and cycles indicated are increased by 1 and 6,
respectively.
Chapter 4
4.2
DIVX
(2) DIVX.size src
b7
b0 b7
0 1 1
1 0
.size SIZE
.B
0
.W
1
1 SIZE 1 0
0 1
An
[An]
SRC
SRC
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
src code
b0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
1
1
1
1
1
1
1
1
SRC
000
001
010
011
100
101
110
111
Rn
2/22
An
2/22
[An]
2/24
abs16
4/24
If the size specifier (.size) is (.W), the number of cycles indicated is increased by 6.
The number of cycles may decrease if an overflow occurs or depending on the value of the divisor or
dividend.
DSBB
0 1 1
b0 b7
1 1
1 0 0 1
b0
1 1 0
3/4
1 1
#IMM8
Chapter 4
4.2
DSBB
(2) DSBB.W #IMM16, R0
b7
0 1 1
b0 b7
1 1
1 0 1 1
b0
1 1 0
1 1
4/4
DSBB
(3) DSBB.B R0H, R0L
b7
0 1 1
b0 b7
1 1 1 0
0 1
b0
1 1 0
2/4
0 1
#IMM16
Chapter 4
4.2
DSBB
(4) DSBB.W R1, R0
b7
0 1 1
b0 b7
1 1
1 0 1 1
b0
1 1 0
0 1
2/4
DSUB
(1) DSUB.B #IMM8, R0L
b7
0 1 1
b0 b7
1 1
1 0 0 1
b0
1 1 0
3/4
1 1
#IMM8
Chapter 4
4.2
DSUB
(2) DSUB.W #IMM16, R0
b7
0 1 1
b0 b7
1 1
1 0 1 1
b0
1 1 0
1 1
4/4
DSUB
(3) DSUB.B R0H, R0L
b7
0 1 1
b0 b7
1 1
1 0 0 1
b0
1 1 0
2/4
0 1
#IMM16
Chapter 4
4.2
DSUB
(4) DSUB.W R1, R0
b7
0 1 1
b0 b7
1 1
1 0 1 1
b0
1 1 0
0 1
2/4
ENTER
(1) ENTER
#IMM8
b7
0 1 1
b0 b7
1 1
1 0 0 1
b0
1 1 1
3/4
0 0
#IMM8
Chapter 4
4.2
EXITD
(1) EXITD
b7
b0 b7
0 1 1
1 1
1 0 1
b0
1 1 1
0 0
2/9
EXTS
(1) EXTS.B
dest
b7
b0 b7
0 1 1
1 1 1 0
dest
R0L
--R1L
------[A0]
[A1]
Rn
--[An]
0 0
b0
1 1 0
DEST
0000
0001
0010
0011
0100
0101
0110
0111
DEST
dest code
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
)
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
[An]
2/3
2/5
abs16
4/5
Chapter 4
4.2
EXTS
(2) EXTS.W R0
b7
b0 b7
0 1 1
1 1
1 0 0 1
b0
1 1 1
0 0
2/3
FCLR
(1) FCLR
dest
b7
b0 b7
1 1 1
0 1
dest
DEST
C
D
Z
S
B
O
I
U
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0 1 1 0
b0
DEST
0
1
0
1
0
1
0
1
2/2
0 1
0 1
Chapter 4
FSET
(1) FSET
dest
b7
b0 b7
1 1 1
0 1
dest
DEST
C
D
Z
S
B
O
I
U
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0 1 1 0
b0
DEST
0 1
0 0
0
1
0
1
0
1
0
1
2/2
INC
(1) INC.B
dest
b7
b0
1 0 1
0 0
DEST
dest
Rn
dsp:8[SB/FB]
abs16
dest code
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
1/1
dsp:8[SB/FB]
2/3
abs16
3/3
4.2
Chapter 4
4.2
INC
(2) INC.W
dest
b7
b0
1 0 1
1 DEST 0 1 0
dest
DEST
0
1
A0
A1
1/1
INT
(1) INT #IMM
b7
1 1 1
b0
0 1
0 1 1
1 1 #IMM
2/19
Chapter 4
4.2
INTO
(1) INTO
b7
1 1 1
b0
1 0
1 1 0
1/1
JCnd
(1) JCnd
label
b7
0 1 1
b0
0 1
CND
label code
dsp8
Cnd
GEU/C
GTU
EQ/Z
N
CND
0
0
0
0
0
0
1
1
0
1
0
1
Cnd
LTU/NC
LEU
NE/NZ
PZ
CND
1
1
1
1
0
0
1
1
0
1
0
1
2/2
Chapter 4
4.2
JCnd
(2) JCnd
label
b7
b0 b7
0 1 1
1 1
1 0 1 1
b0
1 0 0
CND
label code
dsp8
Cnd
LE
O
GE
Cnd
CND
1 0 0 0 GT
1 0 0 1 NO
1 0 1 0 LT
CND
1100
1101
1110
3/2
JMP
(1) JMP.S
label
b7
0 1 1
b0
0 0
dsp
1/5
Chapter 4
4.2
JMP
(2) JMP.B
label
b7
b0
1 1 1
1 1 1 1
label code
dsp8
2/4
JMP
(3) JMP.W
label
b7
1 1 1
b0
1 0 1 0
label code
dsp16
3/4
Chapter 4
4.2
JMP
(4) JMP.A
label
b7
label code
b0
1 1 1
1 1
abs20
1 0 0
4/4
JMPI
(1) JMPI.W
src
b7
b0 b7
0 1 1
1 1 1 0
1 0
b0
0 1 0
SRC
src code
dsp8
dsp16/abs16
dsp20
src
R0
R1
R2
R3
A0
A1
[A0]
[A1]
Rn
An
[An]
SRC
0000
0001
0010
0011
0100
0101
0110
0111
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:20[A0]
dsp:20[An]
dsp:20[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/7
An
[An]
2/7
2/11
abs16
4/11
Chapter 4
4.2
JMPI
(2) JMPI.A
src
b7
b0 b7
0 1 1
1 1 1 0
1 0
b0
0 0 0
SRC
src code
dsp8
dsp16/abs16
dsp20
src
0
0
0
0
0
0
0
0
SRC
000
001
010
011
100
101
110
111
R2R0
R3R1
Rn
----A1A0
An
--[A0]
[An]
[A1]
Items marked --- cannot be selected.
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:20[A0]
dsp:20[An]
dsp:20[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
Rn
2/6
An
2/6
[An]
2/10
abs16
4/10
Chapter 4
4.2
JSR
(1) JSR.W
label
b7
1 1 1
b0
1 0
1 0 1
label code
dsp16
3/8
JSR
(2) JSR.A
label
b7
1 1 1
b0
1 1
label code
1 0 1
4/9
abs20
Chapter 4
4.2
JSRI
(1) JSRI.W
src
b7
b0 b7
0 1 1
1 1
1 0 1 0
b0
0 1 1
src code
dsp8
SRC
dsp16/abs16
dsp20
src
R0
R1
R2
R3
A0
A1
[A0]
[A1]
Rn
An
[An]
0
0
0
0
0
0
0
0
SRC
000
001
010
011
100
101
110
111
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:20[A0]
dsp:20[An]
dsp:20[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
1
1
1
1
1
1
1
1
SRC
000
001
010
011
100
101
110
111
Rn
2/11
Bytes/Cycles
An
2/11
[An]
2/15
abs16
4/15
JSRI
(2) JSRI.A
src
b7
b0 b7
0 1 1
1 1
1 0 1 0
b0
0 0 1
SRC
src code
dsp8
dsp16/abs16
dsp20
src
R2R0
R3R1
----A1A0
--[A0]
[A1]
Rn
An
[An]
SRC
0000
0001
0010
0011
0100
0101
0110
0111
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:20[A0]
dsp:20[An]
dsp:20[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/11
An
2/11
[An]
2/15
abs16
4/15
Chapter 4
4.2
LDC
(1) LDC #IMM16, dest
b7
b0 b7
1 1 1
0 1
dest
0 1 1 0
b0
DEST
0 0
#IMM16
DEST
--INTBL
INTBH
FLG
ISP
SP
SB
FB
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Items marked --- cannot be selected.
[ Number of Bytes/Number of Cycles ]
Bytes/Cycles
4/2
LDC
(2) LDC src, dest
b7
b0 b7
0 1 1
1 1
0 1 0 1
src
An
[An]
DEST
SRC
0000
0001
0010
0011
0100
0101
0110
0111
R0
R1
R2
R3
A0
A1
[A0]
[A1]
Rn
b0
Rn
2/1
An
2/1
[An]
2/3
SRC
src code
dsp8
dsp16/abs16
src
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
dsp:8[A0]
dsp:8[A1]
dsp:8[SB]
dsp:8[FB]
dsp:16[A0]
dsp:16[A1]
dsp:16[SB]
abs16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
)
dest
--INTBL
INTBH
FLG
ISP
SP
SB
FB
DEST
0 0 0
0 0 1
0
0
1
1
1
1
1
1
0
0
1
1
0
1
0
1
0
1
abs16
4/3
Chapter 4
4.2
LDCTX
(1) LDCTX
abs16, abs20
b7
0 1 1
b0 b7
1 1
1 0 0 1
b0
1 1 1
0 0
7/11+2
abs16
abs20
Chapter 4
4.2
LDE
(1) LDE.size abs20, dest
b7
b0 b7
0 1 1
1 0
1 0 SIZE 1
.size SIZE
.B
0
.W
1
b0
0 0 0
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
DEST
src code
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
abs20
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
5/4
An
5/4
[An]
5/5
abs16
7/5
LDE
(2) LDE.size dsp:20[A0], dest
b7
b0 b7
0 1 1
1 0
1 0 SIZE 1
.size SIZE
.B
0
.W
1
0 0 1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
dest code
b0
DEST
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
src code
dsp20
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
5/4
An
5/4
[An]
5/5
abs16
7/5
Chapter 4
4.2
LDE
(3) LDE.size [A1A0], dest
b7
b0 b7
0 1 1
1 0
1 0 SIZE 1
.size SIZE
.B
0
.W
1
b0
0 1 0
DEST
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/4
An
2/4
[An]
2/5
LDINTB
(1) LDINTB #IMM
b7
1 1 1
0 0 0
1 1 1
b0 b7
0 1 0 1 1 0 0 1 0
0
#IMM1
0 0 0 0
0 1 0 1 1 0 0 0 1
#IMM2
b0
0 0
0 0
0 0
0
0
0
8/4
0
0
0
abs16
4/5
Chapter 4
4.2
LDIPL
(1) LDIPL
#IMM
b7
b0 b7
0 1 1
1 1
1 0 1 1
b0
0 1 0
#IMM
2/2
MOV
(1) MOV.size:G
#IMM, dest
b7
b0 b7
0 1 1
1 0
.size SIZE
.B
0
.W
1
1 0 SIZE 1
Rn
An
[An]
b0
1 0 0
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
DEST
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
An
[An] dsp:8[An] dsp:8[SB/FB] dsp:16[An] dsp:16[SB]
3/2
3/2
3/3
4/3
4/3
5/3
5/3
Bytes/Cycles
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
abs16
5/3
Chapter 4
4.2
MOV
(2) MOV.size:Q
#IMM, dest
b7
b0 b7
1 1 0
1 1 0
.size SIZE
.B
0
.W
1
0 SIZE
#IMM
0
+1
+2
+3
+4
+5
+6
+7
IMM4
0000
0001
0010
0011
0100
0101
0110
0111
An
[An]
DEST
#IMM
8
7
6
5
4
3
2
1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
dest code
b0
IMM4
dsp8
dsp16/abs16
IMM4
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/1
An
2/1
[An]
2/2
abs16
4/2
Chapter 4
4.2
MOV
(3) MOV.B:S #IMM8, dest
b7
dest code
b0
1 1 0
0 0
DEST
dest
Rn
dsp:8[SB/FB]
abs16
#IMM8
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
2/1
dsp:8[SB/FB]
3/2
abs16
4/2
Chapter 4
4.2
MOV
(4) MOV.size:S
#IMM, dest
b7
b0
1 SIZE 1
#IMM8
0 DEST 0 1 0
#IMM16
.size SIZE
.B
1
.W
0
dest
DEST
0
1
A0
A1
2/1
If the size specifier (.size) is (.W), the number of bytes and cycles indicated are increased by 1 each.
MOV
(5) MOV.B:Z #0, dest
b7
b0
1 0 1
1 0
DEST
dest
Rn
dsp:8[SB/FB]
abs16
dest code
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
1/1
dsp:8[SB/FB]
2/2
abs16
3/2
Chapter 4
4.2
MOV
(6) MOV.size:G
src, dest
b7
0 1 1
b0 b7
1 0
0 1 SIZE
.size SIZE
.B
0
.W
1
SRC
An
[An]
DEST
src/dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
src code
b0
SRC/DEST
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src/dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC/DEST
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
An
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
[An]
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
abs16
4/2
4/2
4/3
5/3
5/3
6/3
6/3
6/3
Chapter 4
4.2
MOV
(7) MOV.B:S src, dest
b7
b0
0 0 1
1 0 DEST SRC
src code
abs16
src
Rn
dsp:8[SB/FB]
abs16
dsp8
SRC
R0L/R0H
dsp:8[SB]
dsp:8[FB]
abs16
0
0
1
1
dest
DEST
0
1
A0
A1
0
1
0
1
dsp:8[SB/FB]
Rn
1/2
Bytes/Cycles
abs16
3/3
2/3
MOV
(8) MOV.B:S R0L/R0H, dest
b7
b0
0 0 0
0 0 SRC DEST
src
dest code
SRC
0
1
R0L
R0H
abs16
dest
dsp:8[SB/FB]
abs16
dsp:8[SB/FB]
2/2
dsp8
abs16
3/2
dsp:8[SB]
dsp:8[FB]
abs16
DEST
0
1
1
1
0
1
Chapter 4
4.2
MOV
(9) MOV.B:S src, R0L/R0H
b7
b0
0 0 0
0 1 DEST SRC
src code
abs16
src
Rn
dsp:8[SB/FB]
abs16
dsp8
SRC
dest
0
1
0
1
R0L
R0H
dsp:8[SB/FB]
abs16
3/3
R0L/R0H
dsp:8[SB]
dsp:8[FB]
abs16
0
0
1
1
DEST
0
1
Rn
1/2
Bytes/Cycles
2/3
MOV
(10) MOV.size:G dsp:8[SP], dest
b7
b0 b7
0 1 1
1 0
1 0 SIZE 1
.size SIZE
.B
0
.W
1
b0
0 1 1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
DEST
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest code
dsp8
dsp16/abs16
src code
dsp8
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
3/2
An
3/2
[An]
3/3
abs16
5/3
Chapter 4
4.2
MOV
(11) MOV.size:G src, dsp:8[SP]
b7
b0 b7
0 1 1
1 0 1 0 SIZE 0
.size SIZE
.B
0
.W
1
b0
0 1 1
SRC
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
SRC
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
dest code
src code
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dsp8
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
1
1
1
1
1
1
1
1
SRC
000
001
010
011
100
101
110
111
Rn
3/3
An
3/3
[An]
3/4
MOVA
(1) MOVA
src, dest
b7
b0 b7
1 1 1
0 1 0
1 1 0
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
b0
DEST
SRC
1000
1001
1010
1011
1100
1101
1110
1111
SRC
src code
dest
R0
R1
R2
R3
A0
A1
dsp8
dsp16
DEST
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
dsp:8[An]
3/2
abs16
4/2
abs16
5/4
Chapter 4
4.2
MOVDir
(1) MOVDir R0L, dest
b7
b0 b7
0 1 1
Dir
LL
LH
HL
HH
Rn
An
[An]
1 1
1 0 0 1
dest code
b0
DIR
DEST
dsp8
dsp16/abs16
DIR
0 0
1 0
0 1
1 1
dest
--R0H
R1L
R1H
----[A0]
[A1]
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
[An]
2/4
2/5
3/5
3/5
4/5
4/5
4/5
2/7
2/8
3/8
3/8
4/8
4/8
4/8
abs16
Chapter 4
4.2
MOVDir
(2) MOVDir src, R0L
b7
b0 b7
0 1 1
Dir
LL
LH
HL
HH
1 1
1 0 0 0
b0
DIR
SRC
dest code
dsp8
dsp16/abs16
DIR
0 0
1 0
0 1
1 1
src
SRC
R0L
0000
R0H
0001
Rn
R1L
0010
R1H
0011
--0100
An
--0101
[A0]
0110
[An]
[A1]
0111
Items marked --- cannot be selected.
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
Rn
[An]
2/3
2/5
3/5
3/5
4/5
4/5
4/5
2/6
2/8
3/8
3/8
4/8
4/8
4/8
abs16
Chapter 4
4.2
MUL
(1) MUL.size #IMM, dest
b7
b0 b7
0 1 1
1 1
.size SIZE
.B
0
.W
1
1 0 SIZE 0
dest code
b0
1 0 1
DEST
dest
DEST
R0L/R0
0000
--- /R1
0001
Rn
R1L/--0010
--0011
A0
0100
An
--0101
[A0]
0110
[An]
[A1]
0111
Items marked --- cannot be selected.
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
3/4
An
3/4
[An]
3/5
abs16
5/5
If dest is Rn or An and the size specifier (.size) is (.W), the number of bytes and cycles indicated are
increased by 1 each.
If dest is neither Rn nor An and the size specifier (.size) is (.W), the number of bytes and cycles
indicated are increased by 1 and 2, respectively.
Chapter 4
4.2
MUL
(2) MUL.size src, dest
b7
0 1 1
b0 b7
1 1
0 0 SIZE
.size SIZE
.B
0
.W
1
b0
SRC
DEST
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
src code
SRC
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
DEST
R0L/R0
0000
--- /R1
0001
Rn
R1L/--0010
--0011
A0
0100
An
--0101
[A0]
0110
[An]
[A1]
0111
Items marked --- cannot be selected.
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
1
1
1
1
1
1
1
1
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
SRC
000
001
010
011
100
101
110
111
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/4
2/4
2/6
3/6
3/6
4/6
4/6
4/6
An
2/4
2/5
2/6
3/6
3/6
4/6
4/6
4/6
[An]
2/5
2/5
2/6
3/6
3/6
4/6
4/6
4/6
abs16
4/5
4/5
4/6
5/6
5/6
6/6
6/6
6/6
If src is An and dest is Rn and the size specifier (.size) is (.W), the number of cycles indicated is increased by 1.
If src is not An and dest is Rn or An and the size specifier (.size) is (.W), the number of cycles indicated is
increased by 1.
If dest is neither Rn nor An and the size specifier (.size) is (.W), the number of cycles indicated is increased by 2.
Chapter 4
4.2
MULU
(1) MULU.size
#IMM, dest
b7
b0 b7
0 1 1
1 1
.size SIZE
.B
0
.W
1
1 0 SIZE 0
b0
1 0 0
DEST
dest code
dest
DEST
R0L/R0
0000
--- /R1
0001
Rn
R1L/--0010
--0011
A0
0100
An
--0101
[A0]
0110
[An]
[A1]
0111
Items marked --- cannot be selected.
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
3/4
An
3/4
[An]
3/5
abs16
5/5
If dest is Rn or An and the size specifier (.size) is (.W), the number of bytes and cycles indicated are
increased by 1 each.
If dest is neither Rn nor An and the size specifier (.size) is (.W), the number of bytes and cycles
indicated are increased by 1 and 2, respectively.
Chapter 4
4.2
MULU
(2) MULU.size
src, dest
b7
0 1 1
b0 b7
1 0 0
.size SIZE
.B
0
.W
1
0 SIZE
Rn
An
[An]
Rn
An
[An]
src code
b0
SRC
DEST
SRC
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
1
1
1
1
1
1
1
1
dest
R0L/R0
--- /R1
R1L/----A0
--[A0]
[A1]
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
SRC
000
001
010
011
100
101
110
111
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/4
2/4
2/6
3/6
3/6
4/6
4/6
4/6
An
2/4
2/5
2/6
3/6
3/6
4/6
4/6
4/6
[An]
2/5
2/5
2/6
3/6
3/6
4/6
4/6
4/6
abs16
4/5
4/5
4/6
5/6
5/6
6/6
6/6
6/6
If src is An and dest is Rn and the size specifier (.size) is (.W), the number of cycles indicated is increased by 1.
If src is not An and dest is Rn or An and the size specifier (.size) is (.W), the number of cycles indicated is
increased by 1.
If dest is neither Rn nor An and the size specifier (.size) is (.W), the number of cycles indicated is increased by 2.
Chapter 4
4.2
NEG
(1) NEG.size dest
b7
b0 b7
0 1 1
1 0
1 0 SIZE 0
.size SIZE
.B
0
.W
1
b0
1 0 1
DEST
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/1
An
2/1
[An]
2/3
abs16
4/3
NOP
(1) NOP
b7
0 0 0
b0
0 0
1 0 0
1/1
Chapter 4
4.2
NOT
(1) NOT.size:G
dest
b7
b0 b7
0 1 1
1 0 1 0 SIZE 0
.size SIZE
.B
0
.W
1
b0
1 1 1
DEST
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/1
An
2/1
[An]
2/3
NOT
(2) NOT.B:S dest
b7
b0
1 0 1
1 1
DEST
dest
Rn
dsp:8[SB/FB]
abs16
dest code
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
1/1
dsp:8[SB/FB]
2/3
abs16
3/3
abs16
4/3
Chapter 4
4.2
OR
(1) OR.size:G
#IMM, dest
b7
b0 b7
0 1 1
1 0
1 1 SIZE 0
.size SIZE
.B
0
.W
1
dest code
b0
0 1 1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
DEST
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
An
[An] dsp:8[An] dsp:8[SB/FB] dsp:16[An] dsp:16[SB]
Bytes/Cycles
3/2
3/2
3/4
4/4
4/4
5/4
5/4
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
abs16
5/4
OR
(2) OR.B:S
#IMM8, dest
b7
dest code
b0
1 0 0
1 1
DEST
dest
Rn
dsp:8[SB/FB]
abs16
#IMM8
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
2/1
dsp:8[SB/FB]
3/3
abs16
4/3
Chapter 4
4.2
OR
(3) OR.size:G
src, dest
b7
1 0 0
b0 b7
1 1
0 0 SIZE
.size SIZE
.B
0
.W
1
b0
SRC
DEST
src/dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
SRC/DEST
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
dest code
src code
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
)(
dsp8
dsp16/abs16
src/dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC/DEST
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
An
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
[An]
2/3
2/3
2/4
3/4
3/4
4/4
4/4
4/4
abs16
4/3
4/3
4/4
5/4
5/4
6/4
6/4
6/4
Chapter 4
4.2
OR
(4) OR.B:S
src, R0L/R0H
b7
dest code
b0
0 0 0
1 1 DEST SRC
abs16
src
Rn
dsp:8[SB/FB]
abs16
dsp8
SRC
dest
0
1
0
1
R0L
R0H
dsp:8[SB/FB]
abs16
3/3
R0L/R0H
dsp:8[SB]
dsp:8[FB]
abs16
0
0
1
1
DEST
0
1
Rn
1/2
Bytes/Cycles
2/3
POP
(1) POP.size:G
dest
b7
b0 b7
0 1 1
1 0
1 0 SIZE 1
.size SIZE
.B
0
.W
1
b0
1 0 1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
DEST
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/3
An
2/3
[An]
2/4
abs16
4/4
Chapter 4
POP
(2) POP.B:S dest
b7
b0
1 0 0
1 DEST 0 1 0
dest
DEST
0
1
R0L
R0H
1/3
POP
(3) POP.W:S dest
b7
b0
1 1 0
1 DEST 0 1 0
dest
A0
A1
DEST
0
1
1/3
4.2
Chapter 4
4.2
POPC
(1) POPC
dest
b7
b0 b7
1 1 1
0 1
dest
0 1 1 0
DEST
b0
DEST
dest
--INTBL
INTBH
FLG
0 0
DEST
ISP
SP
SB
FB
0 0 0
1 0
0 0 1
1 0
0 1 0
1 1
0 1 1
1 1
Items marked --- cannot be selected.
0
1
0
1
Bytes/Cycles
POPM
(1) POPM
dest
b7
1 1 1
b0
0 1
1 0 1
DEST
dest
FB SB A1
A0
R3 R2 R1 R0
DEST*2
The bit for a selected register is 1.
The bit for a non-selected register is 0.
Chapter 4
4.2
PUSH
(1) PUSH.size:G #IMM
b7
0 1 1
b0 b7
1 1
1 0 SIZE 1
b0
1 1 0
0 0
#IMM8
#IMM16
.size SIZE
.B
0
.W
1
3/2
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
PUSH
(2) PUSH.size:G src
b7
0 1 1
b0 b7
1 0 1 0 SIZE 0
.size SIZE
.B
0
.W
1
b0
1 0 0
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
SRC
src code
SRC
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/2
An
2/2
[An]
2/4
abs16
4/4
Chapter 4
4.2
PUSH
(3) PUSH.B:S
src
b7
b0
1 0 0
0 SRC 0
src
1 0
SRC
0
1
R0L
R0H
1/2
PUSH
(4) PUSH.W:S
src
b7
b0
1 1 0
0 SRC 0 1 0
src
A0
A1
SRC
0
1
1/2
Chapter 4
4.2
PUSHA
(1) PUSHA
src
b7
b0 b7
0 1 1
1 1
1 0 1 1
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
src code
b0
0 0 1
1
1
1
1
1
1
1
1
SRC
dsp8
dsp16/abs16
SRC
000
001
010
011
100
101
110
111
dsp:8[An]
3/2
Bytes/Cycles
PUSHC
(1) PUSHC
src
b7
b0 b7
1 1 1
0 1
src
--INTBL
INTBH
FLG
0 1 1 0
SRC
0
0
0
0
0
0
1
1
b0
SRC
src
0
1
0
1
ISP
SP
SB
FB
0 0
SRC
1
1
1
1
0
0
1
1
2/2
0
1
0
1
abs:16
4/2
Chapter 4
4.2
PUSHM
(1) PUSHM
src
b7
1 1 1
b0
0 1 1 0
SRC
src
R0 R1 R2
R3
A0
A1 SB FB
*1
SRC
The bit for a selected register is 1.
The bit for a non-selected register is 0.
2/2 m
REIT
(1) REIT
b7
1 1 1
b0
1 1
0 1 1
1/6
Chapter 4
4.2
RMPA
(1) RMPA.size
b7
0 1 1
b0 b7
1 1
1 0 SIZE 1
b0
1 1 1
0 0
.size SIZE
.B
0
.W
1
Bytes/Cycles
m).
ROLC
(1) ROLC.size
dest
b7
0 1 1
b0 b7
1 0
1 1 SIZE 1
.size SIZE
.B
0
.W
1
b0
0 1 0
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
DEST
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/1
An
2/1
[An]
2/3
abs16
4/3
Chapter 4
4.2
RORC
(1) RORC.size
dest
b7
b0 b7
0 1 1
1 0
1 1 SIZE 1
.size SIZE
.B
0
.W
1
b0
0 1 1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
DEST
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/1
An
2/1
[An]
2/3
abs16
4/3
Chapter 4
4.2
ROT
(1) ROT.size #IMM, dest
b7
b0 b7
1 1 1
0 0
.size SIZE
.B
0
.W
1
0 0 SIZE
#IMM
+1
+2
+3
+4
+5
+6
+7
+8
Rn
An
[An]
dest code
b0
IMM4
IMM4
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
DEST
#IMM
1
2
3
4
5
6
7
8
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
dsp8
dsp16/abs16
IMM4
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
abs16
4/2+m
Chapter 4
4.2
ROT
(2) ROT.size R1H, dest
b7
b0 b7
0 1 1
1 0
.size SIZE
.B
0
.W
1
b0
0 SIZE 0 1
1 0
DEST
dest code
dest
DEST
R0L/R0
0000
R0H/--0001
Rn
R1L/R2
0010
--- /R3
0011
A0
0100
An
A1
0101
[A0]
0110
[An]
[A1]
0111
Items marked --- cannot be selected.
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
An
Rn
[An]
3/3+m
4/3+m
4/3+m
abs16
4/3+m
RTS
(1) RTS
b7
1 1 1
b0
1 0 0 1
1/6
Chapter 4
4.2
SBB
(1) SBB.size #IMM, dest
b7
b0 b7
0 1 1
1 0 1 1 SIZE 0
.size SIZE
.B
0
.W
1
Rn
An
[An]
b0
1 1 1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
DEST
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
An
[An] dsp:8[An] dsp:8[SB/FB] dsp:16[An] dsp:16[SB]
3/2
3/2
3/4
4/4
4/4
5/4
5/4
Bytes/Cycles
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
abs16
5/4
Chapter 4
4.2
SBB
(2) SBB.size src, dest
b7
1 0 1
b0 b7
1 1
0 0 SIZE
.size SIZE
.B
0
.W
1
b0
SRC
DEST
src/dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
src code
SRC/DEST
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src/dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC/DEST
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
An
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
[An]
2/3
2/3
2/4
3/4
3/4
4/4
4/4
4/4
abs16
4/3
4/3
4/4
5/4
5/4
6/4
6/4
6/4
Chapter 4
4.2
SBJNZ
(1) SBJNZ.size
b7
b0 b7
1 1 1
1 1 0
b0
0 SIZE
IMM4
DEST
dest code
dsp8
dsp16/abs16
label code
dsp8
#IMM
0
1
2
3
4
5
6
7
IMM4
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
#IMM
+8
+7
+6
+5
+4
+3
+2
+1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
IMM4
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
3/3
An
3/3
[An]
3/5
abs16
5/5
Chapter 4
4.2
SHA
(1) SHA.size #IMM, dest
b7
b0 b7
1 1 1
b0
1 0 0 0 SIZE
.size SIZE
.B
0
.W
1
#IMM
+1
+2
+3
+4
+5
+6
+7
+8
IMM4
IMM4
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
DEST
#IMM
1
2
3
4
5
6
7
8
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
dest code
dsp8
dsp16/abs16
IMM4
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
An
[An]
abs16
4/2+m
Chapter 4
4.2
SHA
(2) SHA.size R1H, dest
b7
b0 b7
0 1 1
1 0 1 0 SIZE 1
.size SIZE
.B
0
.W
1
b0
1 1 1
dest
R0L/R0
R0H/--R1L/R2
--- /R3
A0
A1
[A0]
[A1]
Rn
An
[An]
DEST
dest code
dsp8
dsp16/abs16
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
An
SHA
(3) SHA.L
#IMM, dest
b7
b0 b7
1 1 1
#IMM
+1
+2
+3
+4
+5
+6
+7
+8
0 1
0 1 1 1
IMM4
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
1
1
0
0
1
0
1
0
1
0
1
0
0111
#IMM
1
2
3
4
5
6
7
8
b0
0 1 DEST
IMM4
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
2/3+m
IMM4
dest
R2R0
R3R1
DEST
0
1
abs16
4/3+m
Chapter 4
4.2
SHA
(4) SHA.L
R1H, dest
b7
b0 b7
1 1 1
0 1 0 1
dest
R2R0
R3R1
1 0
b0
0 1 DEST 0 0
DEST
0
1
2/4+m
Chapter 4
4.2
SHL
(1) SHL.size #IMM, dest
b7
b0 b7
1 1 1
0 1
.size SIZE
.B
0
.W
1
#IMM
IMM4
IMM4
0
0
0
0
0
0
0
0
+1
+2
+3
+4
+5
+6
+7
+8
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
An
[An]
DEST
#IMM
1
2
3
4
5
6
7
8
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
dest code
b0
0 0 SIZE
dsp8
dsp16/abs16
IMM4
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
An
[An]
abs16
4/2+m
Chapter 4
4.2
SHL
(2) SHL.size R1H, dest
b7
b0 b7
0 1 1
1 0
.size SIZE
.B
0
.W
1
1 0 SIZE 1
b0
1 1 0
DEST
dest code
dest
DEST
R0L/R0
0000
R0H/--0001
Rn
R1L/R2
0010
--- /R3
0011
A0
0100
An
A1
0101
[A0]
0110
[An]
[A1]
0111
Items marked --- cannot be selected.
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
An
[An] dsp:8[An] dsp:8[SB/FB] dsp:16[An] dsp:16[SB]
3/3+m
3/3+m
4/3+m
4/3+m
Bytes/Cycles 2/2+m 2/2+m 2/3+m
m denotes the number of bits to be shifted.
abs16
4/3+m
SHL
(3) SHL.L
#IMM, dest
b7
b0 b7
1 1 1
#IMM
+1
+2
+3
+4
+5
+6
+7
+8
0 1 0 1
IMM4
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
1 1
#IMM
1
2
3
4
5
6
7
8
b0
0 0 DEST
IMM4
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
2/3+m
IMM4
dest
R2R0
R3R1
DEST
0
1
Chapter 4
SHL
(4) SHL.L
R1H, dest
b7
1 1 1
b0 b7
0 1
dest
R2R0
R3R1
0 1 1 0
b0
0 0 DEST 0 0
DEST
0
1
Bytes/Cycles
SMOVB
(1) SMOVB.size
b7
0 1 1
b0 b7
1 1
1 0 SIZE 1
b0
1 1 0
1 0
.size SIZE
.B
0
.W
1
2/5+5
4.2
Chapter 4
4.2
SMOVF
(1) SMOVF.size
b7
0 1 1
b0 b7
1 1 1 0 SIZE 1
b0
1 1 0
1 0
.size SIZE
.B
0
.W
1
2/5+5
SSTR
(1) SSTR.size
b7
0 1 1
b0 b7
1 1 1 0 SIZE 1
b0
1 1 0
1 0
1 0
.size SIZE
.B
0
.W
1
2/3+2
Chapter 4
4.2
STC
(1) STC src, dest
b7
b0 b7
0 1 1
1 1 0
src
1 1 1
dest Code
b0
SRC
DEST
SRC
dest
0 0 0
--0 0 1
INTBL
Rn
0 1 0
INTBH
0 1 1
FLG
1 0 0
ISP
An
1 0 1
SP
1 1 0
SB
[An]
1 1 1
FB
Items marked --- cannot be selected.
dsp8
dsp16/abs16
DEST
0000
0001
0010
0011
0100
0101
0110
0111
R0
R1
R2
R3
A0
A1
[A0]
[A1]
dest
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
DEST
dsp:8[A0]
dsp:8[A1]
dsp:8[SB]
dsp:8[FB]
dsp:16[A0]
dsp:16[A1]
dsp:16[SB]
abs16
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/1
An
2/1
[An]
2/2
abs16
4/2
STC
(2) STC PC, dest
b7
b0 b7
0 1 1
1 1 1 0
0 1
b0
1 0 0
DEST
dest
DEST
R2R0
0000
R3R1
0001
Rn
--0010
--0011
A1A0
0100
An
--0101
[A0]
0110
[An]
[A1]
0111
Items marked --- cannot be selected.
dest Code
dsp8
dsp16/abs16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
)
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/2
An
2/2
[An]
2/3
abs16
4/3
Chapter 4
4.2
STCTX
(1) STCTX
abs16, abs20
b7
b0 b7
0 1 1
1 1
1 0 1 1
b0
1 1 1
0 0
abs16
abs20
7/11+2
STE
(1) STE.size src, abs20
b7
b0 b7
0 1 1
1 0
1 0 SIZE 0
.size SIZE
.B
0
.W
1
b0
0 0 0
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
SRC
src code
SRC
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
dest code
abs20
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
Rn
5/3
An
5/3
[An]
5/4
abs16
7/4
Chapter 4
4.2
STE
(2) STE.size src, dsp:20[A0]
b7
b0 b7
0 1 1
1 0
1 0 SIZE 0
.size SIZE
.B
0
.W
1
b0
0 0 1
SRC
An
[An]
SRC
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
src code
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dest code
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
dsp20
1
1
1
1
1
1
1
1
SRC
000
001
010
011
100
101
110
111
Rn
5/3
An
5/3
[An]
5/4
abs16
7/4
STE
(3) STE.size src, [A1A0]
b7
b0 b7
0 1 1
1 0 1 0 SIZE 0
.size SIZE
.B
0
.W
1
b0
0 1 0
SRC
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
src code
SRC
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
src
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/3
An
2/3
[An]
2/4
abs16
4/4
Chapter 4
4.2
STNZ
(1) STNZ
#IMM8, dest
b7
dest code
b0
1 1 0
1 0
dest
Rn
dsp:8[SB/FB]
abs16
#IMM8
DEST
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
dsp:8[SB/FB]
Rn
2/1
Bytes/Cycles
3/2
abs16
4/2
STZ
(1) STZ #IMM8, dest
b7
b0
1 1 0
0 1
DEST
dest
Rn
dsp:8[SB/FB]
abs16
#IMM8
dest code
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
2/1
dsp:8[SB/FB]
3/2
abs16
4/2
Chapter 4
4.2
STZX
(1) STZX
b7
dest code
b0
1 1 0
1 1
DEST
#IMM81
dest
Rn
dsp:8[SB/FB]
abs16
dsp8
abs16
#IMM82
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
dsp:8[SB/FB]
Rn
3/2
Bytes/Cycles
abs16
5/3
4/3
SUB
(1) SUB.size:G
#IMM, dest
b7
b0 b7
0 1 1
1 0
.size SIZE
.B
0
.W
1
1 1 SIZE 0
Rn
An
[An]
b0
1 0 1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
DEST
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
An
[An] dsp:8[An] dsp:8[SB/FB] dsp:16[An] dsp:16[SB]
3/2
3/2
3/4
4/4
4/4
5/4
5/4
Bytes/Cycles
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
abs16
5/4
Chapter 4
4.2
SUB
(2) SUB.B:S #IMM8, dest
b7
dest code
b0
1 0 0
0 1
DEST
dest
Rn
dsp:8[SB/FB]
abs16
#IMM8
dsp8
abs16
DEST
R0H
R0L
dsp:8[SB]
dsp:8[FB]
abs16
0
1
1
1
1
1
0
0
1
1
1
0
1
0
1
Rn
2/1
dsp:8[SB/FB]
3/3
abs16
4/3
Chapter 4
4.2
SUB
(3) SUB.size:G
src, dest
b7
1 0 1
b0 b7
0 1
0 0 SIZE
.size SIZE
.B
0
.W
1
SRC
An
[An]
DEST
src/dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
src code
b0
SRC/DEST
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src/dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC/DEST
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
An
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
[An]
2/3
2/3
2/4
3/4
3/4
4/4
4/4
4/4
abs16
4/3
4/3
4/4
5/4
5/4
6/4
6/4
6/4
Chapter 4
4.2
SUB
(4) SUB.B:S src, R0L/R0H
b7
b0
0 0 1
0 1 DEST SRC
dest code
dsp8
abs16
src
Rn
dsp:8[SB/FB]
abs16
SRC
R0L/R0H
dsp:8[SB]
dsp:8[FB]
abs16
0
0
1
1
dest
DEST
0
1
R0L
R0H
0
1
0
1
dsp:8[SB/FB]
Rn
1/2
Bytes/Cycles
2/3
abs16
3/3
TST
(1) TST.size #IMM, dest
b7
b0 b7
0 1 1
1 0
.size SIZE
.B
0
.W
1
1 1 SIZE 0
Rn
An
[An]
b0
0 0 0
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
DEST
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
An
[An] dsp:8[An] dsp:8[SB/FB] dsp:16[An] dsp:16[SB]
Bytes/Cycles
3/2
3/2
3/4
4/4
4/4
5/4
5/4
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
abs16
5/4
Chapter 4
4.2
TST
(2) TST.size src, dest
b7
1 0 0
b0 b7
0 0
0 0 SIZE
.size SIZE
.B
0
.W
1
b0
SRC
DEST
src/dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
src code
SRC/DEST
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src/dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC/DEST
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
An
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
[An]
2/3
2/3
2/4
3/4
3/4
4/4
4/4
4/4
abs16
4/3
4/3
4/4
5/4
5/4
6/4
6/4
6/4
Chapter 4
4.2
UND
(1) UND
b7
1 1 1
b0
1 1
1 1 1
1/20
WAIT
(1) WAIT
b7
0 1 1
b0 b7
1 1
1 0 1 1
b0
1 1 1
2/3
0 0
Chapter 4
4.2
XCHG
(1) XCHG.size
src, dest
b7
b0 b7
0 1 1
1 1 0 1 SIZE 0
.size SIZE
.B
0
.W
1
src
R0L/R0
R0H/R1
R1L/R2
R1H/R3
b0
0 SRC
An
[An]
dsp8
dsp16/abs16
SRC
0 0
0 1
1 0
1 1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
DEST
dest code
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
2/4
An
2/4
[An]
2/5
abs16
4/5
Chapter 4
4.2
XOR
(1) XOR.size #IMM, dest
b7
b0 b7
0 1 1
1 0
1 1 SIZE 0
.size SIZE
.B
0
.W
1
0 0 1
dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
dest code
b0
DEST
DEST
0000
0001
0010
0011
0100
0101
0110
0111
dsp8
dsp16/abs16
#IMM8
#IMM16
dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
DEST
1000
1001
1010
1011
1100
1101
1110
1111
Rn
3/2
An
3/2
[An]
3/4
If the size specifier (.size) is (.W), the number of bytes indicated is increased by 1.
abs16
5/4
Chapter 4
4.2
XOR
(2) XOR.size src, dest
b7
1 0 0
b0 b7
0 1
0 0 SIZE
.size SIZE
.B
0
.W
1
b0
SRC
DEST
src/dest
R0L/R0
R0H/R1
R1L/R2
R1H/R3
A0
A1
[A0]
[A1]
Rn
An
[An]
src code
SRC/DEST
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dsp8
dsp16/abs16
dest code
)(
dsp8
dsp16/abs16
src/dest
dsp:8[A0]
dsp:8[An]
dsp:8[A1]
dsp:8[SB]
dsp:8[SB/FB]
dsp:8[FB]
dsp:16[A0]
dsp:16[An]
dsp:16[A1]
dsp:16[SB]
dsp:16[SB]
abs16
abs16
SRC/DEST
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
dest
Rn
An
[An]
dsp:8[An]
dsp:8[SB/FB]
dsp:16[An]
dsp:16[SB]
abs16
Rn
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
An
2/2
2/2
2/3
3/3
3/3
4/3
4/3
4/3
[An]
2/3
2/3
2/4
3/4
3/4
4/4
4/4
4/4
abs16
4/3
4/3
4/4
5/4
5/4
6/4
6/4
6/4
Chapter 5
Interrupts
5.1 Outline of Interrupts
5.2 Interrupt Control
5.3 Interrupt Sequence
5.4 Returning from Interrupt Routines
5.5 Interrupt Priority
5.6 Multiple Interrupts
5.7 Notes on Interrupts
Chapter 5
Interrupts
Hardware
Interrupt
Software
(nonmaskable interrupt)
Special
(nonmaskable interrupt)
Watchdog timer
Oscillation stop detection
Single-step2
Address match
Peripheral I/O1
(maskable interrupt)
Notes 1: Peripheral function interrupts are generated by the peripheral functions built into the
microcomputer system.
2: This is a dedicated interrupt for development support tools. Do not use this interrupt.
Figure 5.1.1 Classification of Interrupts
Maskable interrupt:
This type of interrupt can be controlled by using the I flag to enable (or
disable) the interrupts or by changing the interrupt priority level.
Nonmaskable interrupt: This type of interrupt cannot be controlled by using the I flag to enable (or disable)
the interrupts or by changing the interrupt priority level.
Chapter 5
Interrupts
Address Match
Single Step1
Watchdog TimerOscillation Stop Detection
(Reserved)
(Reserved)
Reset
Note 1: This is a dedicated interrupt used by development support tools. Do not use this interrupt.
Chapter 5
Interrupts
Chapter 5
Interrupts
5.2.1 I Flag
The I flag is used to disable/enable maskable interrupts. When the I flag is set to 1 (enabled), all
maskable interrupts are enabled; when the I flag is cleared to 0 (disabled), they are disabled.
When the I flag is changed, the altered flag status is reflected in determining whether or not to accept an
interrupt request with the following timing:
If the flag is changed by an REIT instruction, the changed status takes effect beginning with the
REIT instruction.
If the flag is changed by an FCLR, FSET, POPC, or LDC instruction, the changed status takes
effect beginning with the next instruction.
When changed by REIT instruction
Interrupt request generated
Previous
instruction
REIT
Interrupt sequence
Time
Previous
instruction
FSET I
Next instruction
Interrupt sequence
Figure 5.2.1 Timing with Which Changes of I Flag are Reflected in Interrupt Handling
5.2.2 IR Bit
The IR bit is set to 1 (interrupt requested) when an interrupt request is generated. The IR bit is cleared to
0 (interrupt not requested) after the interrupt request is acknowledged and the program branches to the
corresponding interrupt vector.
The IR bit can be cleared to 0 by a program. Do not set it to 1.
Chapter 5
Interrupts
Interrupt Priority
Level
0002
0012
Level 1
0102
IPL
0002
0012
Level 2
0102
0112
Level 3
0112
1002
Level 4
1002
1012
Level 5
1012
1102
Level 6
1102
1112
Level 7
1112
Low
High
When the IPL or the interrupt priority level of an interrupt is changed, the altered level is reflected in
interrupt handling with the following timing:
If the IPL is changed by an REIT instruction, the new level takes effect beginning with the instruction
that is executed two clock cycles after the last clock cycle of the REIT instruction.
If the IPL is changed by a POPC, LDC, or LDIPL instruction, the new level takes effect beginning with
the instruction that is executed three clock cycles after the last clock cycle of the instruction used.
If the interrupt priority level of a particular interrupt is changed by an instruction such as MOV, the
new level takes effect beginning with the instruction that is executed two or three clock cycles after the
last clock cycle of the instruction used.
Chapter 5
Interrupts
; Disable interrupts
; Set TXIC register to 0016
; Dummy read
; Enable interrupts
Chapter 5
Interrupts
10
11
12
13
14
15
16
17
18
19
CPU clock
Address bus
Address
0000016
Interrupt
information
Data bus
RD
Undefined
SP-2
Undefined
SP-1
SP-2
contents
Undefined
WR
Note: Undefined parts differ according to the states of the queue buffer.
If the queue buffer is in a state where an instruction can be accepted, a read
cycle is generated.
SP-4
SP-1
contents
SP-4
contents
SP-3
SP-3
contents
VEC
VEC
contents
VEC+1
VEC+1
contents
VEC+2
VEC+2
contents
PC
20
Chapter 5
Interrupts
Instruction
(a)
Interrupt sequence
Instruction in interrupt
routine
20 cycles (b)
Chapter 5
Interrupts
Stack area
Stack area
MSB
LSB
MSB
LSB
Address
Address
m4
m4
PCL
m3
m3
PCM
m2
m2
FLGL
m1
m1
m+1
[SP]
SP value before
interrupt request is
acknowledged
FLGH
[SP]
New SP value
PCH
m+1
Figure 5.3.3 Stack Status Before and After an Interrupt Request is Acknowledged
The register save operations performed as part of an interrupt sequence are executed in four parts 8 bits
at a time. Figure 5.3.4 shows the operations when saving register contents.
Note 1: When the INT instruction for software interrupt numbers 32 to 63 is executed, SP is indicated by
the U flag. It is indicated by ISP in all other cases.
Address
Stack area
[SP]5
[SP]4
PCL
(3)
[SP]3
PCM
(4)
[SP]2
FLGL
[SP]1
FLGH
(1)
PCH
(2)
[SP]
Chapter 5
Interrupts
Chapter 5
Interrupts
Reset
High
Watchdog timer
Oscillation stop detection
Peripheral function
Single-step
Address match
Low
Chapter 5
Interrupts
>
Chapter 5
Interrupts
Interrupt request
generated
Time
Reset
Nesting
Main routine
I=0
Interrupt 1
IPL = 0
I=1
Interrupt 1
I=0
Interrupt 2
IPL = 3
Multiple interrupts
I=1
Interrupt 2
I=0
IPL = 5
Interrupt 3
REIT
REIT
Interrupt priority level = 2
I=1
IPL = 3
Interrupt 3
REIT
REIT
I=1
IPL = 0
Main routine instructions
are not executed.
Interrupt 3
I=0
IPL = 2
REIT
REIT
I=1
IPL = 0
Chapter 5
Interrupts
5.7.2 SP Setting
Set a value in SP before accepting an interrupt. SP is set to 000016 after reset. Therefore, if an interrupt
is accepted before setting a value in SP, the program may go out of control.
Chapter 5
Interrupts
; Disable interrupts
; Set TXIC register to 0016
; Dummy read
; Enable interrupts
Chapter 6
Calculating the Number of Cycles
6.1 Instruction Queue Buffer
Chapter 6
Chapter 6
Instructions
under execution
Fetch code
JMP TEST_11
73F1
64
04
04
04
04
04
04
04
04
64
0040
Fetch
73
JMP TEST_12
MOV.W
Instruction
queue buffer
Fetch
Fetch
73
73
00
00
00
64
64
64
04
04
04
F1
F1
40
40
40
04
04
04
04
04
04
04
04
00
04
64
04
64
04
73
73
73
FF
FF
Sample programs
Address Code
0C062
64
0C063
04
0C064
04
0C065
04
0C066
04
0C067
04
0C068
TEST_11:
0C068
73F10040
0C06C
64
0C06D
04
0C06E
04
0C06F
04
0C070
04
0C071
04
0C072
TEST_12:
00
04
Jump address
BCLK
Address bus
0C065
RD
73
Data bus
0C06F
F1
00
40
64
04
AA
AA
04
04
73
FF
00
DR
DR
WR
P : Indicates a prefetch (reading from memory into the instruction queue buffer).
DR : Indicates a data read.
DW : Indicates a data write.
: Indicates the locations of the instruction queue buffer that are clear.
Instruction
JMP
TEST_11
NOP
NOP
NOP
NOP
NOP
MOV.W 04000h, R1
JMP
TEST_12
NOP
NOP
NOP
NOP
NOP
Q&A
Information in Q&A form to help the user make the most of the R8C/Tiny Series is provided in this section.
In general, one question and its corresponding answer are given on one page; the upper section is used for
the question, the lower for the answer.
Functions closely connected with the issue being discussed are indicated in the upper-right corner.
Q&A-1
CPU
Q
How do I distinguish between the static base register (SB) and the frame base register (FB)?
A
SB and FB function in the same manner, so you can use them as you like when in programming in
assembly language. If you write a program in C, use FB as a stack frame base register.
Q&A-2
Interrupt
Q
Is it possible to change the contents of the interrupt table register (INTB) while a program is being
executed?
A
Yes. But there is a possibility of program runaway if an interrupt request occurs while changing the
contents of INTB. It is therefore not recommended to frequently change the contents of INTB while
a program is being executed.
Q&A-3
CPU
Q
What is the difference between the user stack pointer (USP) and the interrupt stack pointer (ISP)?
What are their roles?
A
USP is used when using the OS. When several tasks are run, the OS secures stack areas to save
the contents of registers for individual tasks. Also, stack areas have to be secured, task by task, to
be used for handling interrupts that occur while tasks are being executed. If you use USP and ISP
in such an instance, the stack for interrupts can be shared by these tasks. This allows efficient use
of stack areas.
Q&A-4
CPU
Q
What happens to the instruction code if I use a bit instruction in absolute addressing ?
A
This explanation takes BSET bit, base:16 as an example.
This instruction is a 4-byte instruction. The 2 higher-order bytes of the instruction code indicate the
operation code, and the 2 lower-order bytes make up the addressing mode to expresse bit,base:16.
The relation between the 2 lower-order bytes and bit,base:16 is as follows:
2 lower-order bytes = base:16 8 + bit
For example, in the case of BSET 2,0AH (setting bit 2 of address 000A16 to 1), the 2 lower-order
bytes become A 8 + 2 = 52H.
In the case of BSET 18,8H (setting the 18th bit from bit 0 of address 000816 to 1), the 2 lower-order
bytes become 8 8 + 18 = 52H, which is equivalent to BSET 2,AH.
The maximum value of base:16
8 + bit, FFFFH, indicates bit 7 of address 1FFF16. This is the
maximum bit you can specify when using a bit instruction in absolute addressing.
Q&A-5
CPU
Q
What is the difference between the DIV instruction and the DIVX instruction?
A
The DIV instruction and the DIVX instruction are both instructions for signed division, but the sign of
the remainder is different.
The sign of the remainder left after the DIV instruction is the same as that of the dividend, but the
sign of the remainder of the DIVX instruction is the same as that of the divisor.
In general, the following relation among quotient, divisor, dividend, and remainder holds:
dividend = divisor quotient + remainder
Since the sign of the remainder is different between these instructions, the quotient obtained either
by dividing a positive integer by a negative integer or by dividing a negative integer by a positive
integer using the DIV instruction is different from that obtained using the DIVX instruction.
For example, dividing 10 by 3 using the DIV instruction yields 3 and leaves a remainder of +1,
while doing the same using the DIVX instruction yields 4 and leaves a remainder of 2.
Dividing 10 by +3 using the DIV instruction yields 3 and leaves a remainder of 1, while doing the
same using the DIVX instruction yields 4 and leaves a remainder of +2.
Q&A-6
Glossary
Technical terms used in this software manual are explained in this section. They apply to in this manual
only.
Glossary-1
Term
Meaning
Related word
borrow
carry
carry
borrow
context
decimal addition
displacement
effective address
extension area
LSB
Glossary-2
MSB
Term
Meaning
Related word
macro instruction
MSB
LSB
operand
operation code
operation
operation code
overflow
pack
SFR area
Glossary-3
operand
Term
Meaning
Related word
shift out
sign bit
sign extension
stack frame
string
A sequence of characters.
unpack
zero extension
Glossary-4
Table of Symbols
The symbols used in this software manual are explained in the following table. They apply to this manual
only.
Symbol-1
Symbol
Meaning
Transposition from the right side to the left side
Interchange between the right side and the left side
Addition
Subtraction
Multiplication
<
Division
Logical conjunction
<
Logical disjunction
Exclusive disjunction
Logical negation
dsp16
16-bit displacement
dsp20
20-bit displacement
dsp8
8-bit displacement
EVA( )
EXT( )
Sign extension
(H)
H4:
(L)
L4:
LSB
M( )
(M)
MSB
PCH
PCML
FLGH
FLGL
Symbol-2
Index
Frame base register 5
Function 37
A0 and A1 5
A1A0 5
Address register 5
Address space 3
I flag 6
Addressing mode 22
B flag 6
INTB 5
Integer 10
C flag 6
Carry flag 6
Cycles 138
IPL 7
ISP 5
D flag 6
Data arrangement in memory 17
M
Data register 4
Maskable interrupt 246
Data type 10
Memory bit 12
Debug flag 6
Mnemonic 35, 38
Description example 37
dest 18
N
Nibble (4-bit) data 16
FB 5
Fixed vector table 19
Flag change 37
O flag 6
Flag register 5
Operand 35, 38
FLG 5
Index-1
Operation 37
Overflow flag 6
U flag 6
User stack pointer 5
USP 5
PC 5
Processor interrupt priority level 7
Program counter 5
R0H, R1H 4
R0L, R1L 4
R2R0 4
Z flag 6
R3R1 4
Zero flag 6
Register bank 8
Register bank select flag 6
Register bit 12
Related instruction 37
Reset 9
S
S flag 6
SB 5
Selectable src / dest (label) 37
Sign flag 6
Size specifier 35
Software interrupt number 20
src 18
Stack pointer 5
Stack pointer select flag 6
Static base register 5
String 15
Syntax 35, 38
Index-2
REVISION HISTORY
Rev.
Date
Page
1.00 Jun 19, 2003
Summary
First edition issued
R8C/Tiny Series
Software Manual