Datasheet
FS98O22
Rev. 1.6 132/146
Instruction Set
The FS98O22 instruction set consists of 37 instructions. Each instruction could be converted to 16-bit
OPCODE. The detailed descriptions are shown in the following sections.
14.1. Instruction Set Summary
Table 14-1 FS98O22 instruction set table
Instruction Operation Cycle Flag
ADDLW k
[W]
←
[W] + k
1 C, DC, Z
ADDPCW
[PC] ← [PC] + 1 + [W]
2 None
ADDWF f, d
[Destination] ← [f] + [W]
1 C, DC, Z
ADDWFC f, d
[Destination] ← [f] + [W] + C
1 C, DC, Z
ANDLW k
[W]
←
[W] AND k
1 Z
ANDWF f, d
[Destination] ← [W] AND [f]
1 Z
BCF f, b
[f<b>] ← 0
1 None
BSF f, b
[f<b>] ← 1
1 None
BTFSC f, b Skip if [f<b>] = 0 1, 2 None
BTFSS f, b Skip if [f<b>] = 1 1, 2 None
CALL k Push PC + 1 and GOTO k 2 None
CLRF f
[f]
←
0
1 Z
CLRWDT Clear watch dog timer 1 None
COMF f, d
[f]
←
NOT([f])
1 Z
DECF f, d
[Destination] ← [f] -1
1 Z
DECFSZ f, d
[Destination] ← [f] -1, skip if the result is zero
1, 2 None
GOTO k
PC
←
k
2 None
HALT CPU Stop 1 None
INCF f, d
[Destination] ← [f] +1
1 Z
INCFSZ f, d
[Destination] ← [f] + 1, skip if the result is
zero
1, 2 None
IORLW k
[W]
←
[W] | k
1 Z
IORWF f, d
[Destination] ← [W] | [f]
1 Z
MOVFW f
[W]
←
[f]
1 None
MOVLW k
[W]
←
k
1 None
MOVWF f
[f]
←
[W]
1 None
NOP No operation 1 None
RETFIE Pop PC and GIE = 1 2 None
RETLW k RETURN and W = k 2 None
RETURN Pop PC 2 None
RLF f, d
[Destination<n+1>] ← [f<n>]
1 C,Z
RRF f, d
[Destination<n-1>] ← [f<n>]
1 C, Z
SLEEP Stop OSC 1 PD
SUBLW k
[W]
←
k – [W]
1 C, DC, Z
SUBWF f, d
[Destination] ← [f] – [W]
1 C, DC, Z
SUBWFC f, d
[Destination] ← [f] – [W] –C
‧
1 C, DC, Z
XORLW k
[W]
←
[W] XOR k
1 Z
XORWF f, d
[Destination] ← [W] XOR [f]
1 Z
FORTUNE'
Properties
For Reference Only