English
Language : 

GMS30C2216 Datasheet, PDF (277/320 Pages) Hynix Semiconductor – 16/32 BIT RISC/DSP
Appendix A. Instruction Set Details
Negate (signed)
A-105
NEGS
Format:
RR format
15
OP-code
0101 11
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:
NEGS Rd, Rs
NEGS 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 all signed.
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;
if overflow then
trap => Range Error
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:
Overflow: Range Error.