CPU12
INSTRUCTION SET OVERVIEW
MOTOROLA
REFERENCE MANUAL
5-5
5.8 Compare and Test Instructions
Compare and test instructions perform subtraction between a pair of registers or be-
tween a register and memory. The result is not stored, but condition codes are set by
the operation. These instructions are generally used to establish conditions for branch
instructions. In this architecture, most instructions update condition code bits automat-
ically, so it is often unnecessary to include separate test or compare instructions.
is a summary of compare and test instructions.
Table 5-6 Decrement and Increment Instructions
Decrement Instructions
Mnemonic
Function
Operation
DEC
Decrement Memory
(M) – $01
⇒
M
DECA
Decrement A
(A) – $01
⇒
A
DECB
Decrement B
(B) – $01
⇒
B
DES
Decrement SP
(SP) – $0001
⇒
SP
DEX
Decrement X
(X) – $0001
⇒
X
DEY
Decrement Y
(Y) – $0001
⇒
Y
Increment Instructions
Mnemonic
Function
Operation
INC
Increment Memory
(M)
+
$01
⇒
M
INCA
Increment A
(A)
+
$01
⇒
A
INCB
Increment B
(B)
+
$01
⇒
B
INS
Increment SP
(SP)
+
$0001
⇒
SP
INX
Increment X
(X)
+
$0001
⇒
X
INY
Increment Y
(Y)
+
$0001
⇒
Y
Table 5-7 Compare and Test Instructions
Compare Instructions
Mnemonic
Function
Operation
CBA
Compare A to B
(A) – (B)
CMPA
Compare A to Memory
(A) – (M)
CMPB
Compare B to Memory
(B) – (M)
CPD
Compare D to Memory (16-bit)
(A
:
B) – (M
:
M
+
1)
CPS
Compare SP to Memory (16-bit)
(SP) – (M
:
M
+
1)
CPX
Compare X to Memory (16-bit)
(X) – (M
:
M
+
1)
CPY
Compare Y to Memory (16-bit)
(Y) – (M
:
M
+
1)
Test Instructions
Mnemonic
Function
Operation
TST
Test Memory for Zero or Minus
(M) – $00
TSTA
Test A for Zero or Minus
(A) – $00
TSTB
Test B for Zero or Minus
(B) – $00
Summary of Contents for CPU12
Page 8: ...MOTOROLA CPU12 viii REFERENCE MANUAL ...
Page 14: ...MOTOROLA INTRODUCTION CPU12 1 4 REFERENCE MANUAL ...
Page 20: ...MOTOROLA OVERVIEW CPU12 2 6 REFERENCE MANUAL ...
Page 38: ...MOTOROLA INSTRUCTION QUEUE CPU12 4 6 REFERENCE MANUAL ...
Page 300: ...MOTOROLA DEVELOPMENT AND DEBUG SUPPORT CPU12 8 16 REFERENCE MANUAL ...
Page 338: ...MOTOROLA MEMORY EXPANSION CPU12 10 8 REFERENCE MANUAL ...
Page 364: ...MOTOROLA INSTRUCTION REFERENCE CPU12 A 26 REFERENCE MANUAL ...
Page 386: ...MOTOROLA HIGH LEVEL LANGUAGE SUPPORT CPU12 C 6 REFERENCE MANUAL ...
Page 438: ...MOTOROLA SUMMARY OF CHANGES CPU12 S 2 REFERENCE MANUAL ...
Page 439: ......