命令セット
すべて「KUE-CHIP2教育用ボードリファレンスマニュアル」からの抜粋です
略記号 |
命令コード(1語目) |
B'(2語目) |
命令機能の概略 |
NOP |
0 0 0 0 0 - - - |
⨯ |
No OPeration |
|
HLT |
0 0 0 0 1 - - - |
⨯ |
HaLT |
停止 |
|
0 1 0 1 - - - - |
⨯ |
|
未使用(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 |
条件が成立すればB'→PC |
Ssm |
0 1 0 0 A 0 sm |
⨯ |
Shift sm |
(A)→shift, rotate→A
はみ出したビット→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'
- ⨯:不要
- ◯:不要 or 必要
- ⦾:必要
B
000
: ACC
001
: IX
01-
: d(即値アドレス)
100
: [d](絶対アドレス)
101
: (d)(絶対アドレス)
110
: [IX+d](インデックス修飾アドレス)
111
: (IX+d)(インデックス修飾アドレス)
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 |