AN202
V1.0 | Page 70/73
www.cmostek.com
17 Instruction Set List
CMT2189C uses the reduced instruction set architecture with a total of 37 instructions, and the following is the
description of the instructions.
Table 17-1. Instruction Set Table
CMT
Instruction
Period
Function
Operation
Status
BCR R, b
1
Bit clear
0-> R(b)
NONE
BSR R, b
1
Bit set
1-> R(b)
NONE
BTSC R, b
1
(
2
)
Bit test, skip if 0
Skip if R(b)=0
NONE
BTSS R, b
1
(
2
)
Bit test, skip if 1
Skip if R(b)=1
NONE
NOP
1
No operation
None
NONE
CLRWDT
1
Clear WDT
0-> WDT
/PF, /TF
SLEEP
1
ENTER SLEEPMODE
0-> WDT, STOP OSC
/PF, /TF
STTMD
1
Store W TO TMODE
W-> TMODE
NONE
CTLIO R
1
Control IO direction reg
W-> IODIRr
NONE
ST R R
1
Store W to reg
W-> R
NONE
L D R R , d
1
Load reg to d
R-> d
Z
SWAPR R,d
1
Swap halves reg
[R(0-3)R(4-7)]-> d
NONE
I N C R R , d
1
Increment reg
R+ 1-> d
Z
I N C R SZ R , d
1
(
2
)
Increment reg, skip if 0
R+ 1-> d
NONE
ADDWR R, d
1
Add W and reg
W+ R-> d
C, HC, Z
SUBWR R, d
1
Sub W from reg
R- W-> d R+ /W+ 1-> d
C, HC, Z
DECR R, d
1
Decrement reg
R- 1-> d
Z
DECRSZ R, d
1
(
2
)
Decrement reg, skip if 0
R- 1-> d
NONE
A N DW R R , d
1
AND W and reg
R& W-> d
Z
IORW R R, d
1
Inclu.OR W and reg
W| R-> d
Z
XORWR R, d
1
Exclu.OR W and reg
W^ R-> d
Z
COMR R, d
1
Complement reg
/R-> d
Z
RRR R, d
1
Rotate right reg
R(n)-> R(n-1), C-> R(7), R(0)-> C
C
RLR R, d
1
Rotate left reg
R(n)-> R(n+1), C-> R(0), R(7)-> C
C
CLRW
1
Clear working reg
0-> W
Z
CLRR R
1
Clear reg
0-> R
Z
RETI
2
Return from interrupt
Stack-> PC,1-> GIE
NONE
RET
2
Return from subroutine
Stack-> PC
NONE
LCALL N
2
Long CALL subroutine
N-> PC, PC+1-> Stack
NONE
LJUMP N
2
Long JUMP address
N-> PC
NONE
L D W I I
1
Load immediate to W
I-> W
NONE
A N D W I I
1
AND W and imm
W& I-> W
Z
IORW I I
1
Inclu.OR W and imm
W| I-> W
Z