English
Language : 

GMS30C2216 Datasheet, PDF (276/320 Pages) Hynix Semiconductor – 16/32 BIT RISC/DSP
A-104
Negate (unsigned or unsigned)
Appendix A. Instruction Set Details
NEG
Format:
RR format
15
OP-code
0101 10
10 9 8 7
43
0
ds
Rd-code
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:
NEG Rd, Rs
NEG Rd, C (when SR is denoted as a Rs)
Description:
The source operand (Rs) is subtracted from zero, the result is placed in the destination
register (Rd) and the condition flag are set or cleared accordingly.
Both operands and the result are interpreted as either all signed or all unsigned integers.
When the SR is denoted as a source operand, carry flag C is negated instead of the SR.
Operation:
When Rs is not SR
Rd := - Rs;
Z := Rd = 0;
N := Rd(31);
V := overflow;
C := carry;
When Rs is SR
Rd := - C;
Z := Rd = 0; N := Rd(31);
V := overflow; C := carry;
if C is set then Rd := -1;
else Rd := 0;
Exceptions:
None.