English
Language : 

GMS30C2216 Datasheet, PDF (203/320 Pages) Hynix Semiconductor – 16/32 BIT RISC/DSP
Appendix A. Instruction Set Details
Compare with Source Operand
A-31
CMP
Format:
RR format
15
OP-code
0010 00
10 9
d
87
s
Rd-code
43
0
Rs-code
s = 0: Rs-code encoded G0..G15 for Rs
s = 1: Rs-code encoded L0..L15 for Rs
d = 0: Rd-code encoded G0..G15 for Rd
d = 1: Rd-code encoded L0..L15 for Rd
Notation:
CMP Rd, Rs
CMP Rd, C
(when Rs denotes SR)
Description:
Two operands are compared by subtracting the source operand from the destination
operand. The condition flags are set or cleared according to the result; the result itself is
not retained. Note that the N flag indicates the correct compare result even in the case of an
overflow.
All operands and the result are interpreted as either all signed or all unsigned integers.
When the SR is denoted as a source operand at CMP, C is subtracted instead of SR.
Operation:
When Rs is not SR
result := Rd - Rs;
Z := Rd = Rs;
N := Rd < Rs signed;
V := overflow;
C := Rd < RS unsigned;
When Rs is SR
result := Rd - C;
Z := Rd = C;
N := Rd < C signed;
V := overflow;
C := Rd < C unsigned;
Exceptions:
None