Instruction Set
All excerpts are from the "KUE-CHIP2 Educational Board Reference Manual"
Abbreviation |
Instruction code (First) |
B' (Second) |
Instruction Function Overview |
NOP
|
0 0 0 0 0 - - -
|
⨯
|
No OPeration
|
|
HLT
|
0 0 0 0 1 - - -
|
⨯
|
HaLT
|
Halt
|
|
0 1 0 1 - - - -
|
⨯
|
|
Unused (HLT)
|
OUT
|
0 0 0 1 0 - - -
|
⨯
|
OUTput
|
(ACC)→OBUF
|
IN
|
0 0 0 1 1 - - -
|
⨯
|
INput
|
(IBUF)→ACC
|
RCF
|
0 0 1 0 0 - - -
|
⨯
|
Reset CF
|
0→CF
|
SCF
|
0 0 1 0 1 - - -
|
⨯
|
Set CF
|
1→CF
|
Bcc
|
0 0 1 1 cc
|
⦾
|
Branch cc
|
If the condition is satisfied, B'→PC
|
Ssm
|
0 1 0 0 A 0 sm
|
⨯
|
Shift sm
|
(A)→shift, rotate→A
Overflowing bit→CF
|
Rsm
|
0 1 0 0 A 1 sm
|
⨯
|
Rotate sm
|
LD
|
0 1 1 0 A B
|
◯
|
LoaD
|
(B)→A
|
ST
|
0 1 1 1 A B
|
⦾
|
STore
|
(A)→B
|
SBC
|
1 0 0 0 A B
|
◯
|
SuBtract with Carry
|
(A)-(B)-CF→A
|
ADC
|
1 0 0 1 A B
|
◯
|
ADd with Carry
|
(A)+(B)+CF→A
|
SUB
|
1 0 1 0 A B
|
◯
|
SUBtract
|
(A)-(B)→A
|
ADD
|
1 0 1 1 A B
|
◯
|
ADD
|
(A)+(B)→A
|
EOR
|
1 1 0 0 A B
|
◯
|
Exclusive OR
|
(A)⨁(B)→A
|
OR
|
1 1 0 1 A B
|
◯
|
OR
|
(A)∨(B)→A
|
AND
|
1 1 1 0 A B
|
◯
|
AND
|
(A)∧(B)→A
|
CMP
|
1 1 1 1 A B
|
◯
|
CoMPare
|
(A)-(B)
|
A
B'
- ⨯: Not Needed
- ◯: Needed or Not Needed
- ⦾:Needed
B
000
: ACC
001
: IX
01-
: d (Immediate Address)
100
: [d] (Absolute Address)
101
: (d) (Absolute Address)
110
: [IX+d] (Indexed Address)
111
: (IX+d) (Indexed Address)
cc: Condition Code
A
|
0 0 0 0
|
Always
|
VF
|
1 0 0 0
|
on oVerFlow
|
NZ
|
0 0 0 1
|
on Not Zero
|
Z
|
1 0 0 1
|
on Zero
|
ZP
|
0 0 1 0
|
on Zero or Positive
|
N
|
1 0 1 0
|
on Negative
|
P
|
0 0 1 1
|
on Positive
|
ZN
|
1 0 1 1
|
on Zero or Negative
|
NI
|
0 1 0 0
|
on No Input
|
NO
|
1 1 0 0
|
on No Output
|
NC
|
0 1 0 1
|
on Not Carry
|
C
|
1 1 0 1
|
on Carry
|
GE
|
0 1 1 0
|
on Greater than or Equal
|
LT
|
1 1 1 0
|
on Less Than
|
GT
|
0 1 1 1
|
on Greater Than
|
LE
|
1 1 1 1
|
on Less than or Equal
|
sm: Shift Mode
RA
|
0 0
|
Right Arithmetically
|
LA
|
0 1
|
Left Arithmetically
|
RL
|
1 0
|
Right Logically
|
LL
|
1 1
|
Left Logically
|