Propeller Manual

Table Of Contents
3: Assembly Language Reference – NEGNC
NEGNC
Instruction: Get a value, or its additive inverse, based on !C.
NEGNC RValue, # Value
Result: –Value or Value is stored in RValue.
RValue (d-field) is the register in which to write –Value or Value.
Value (s-field) is a register or a 9-bit literal whose additive inverse value (if C = 0) or
value (if C = 1) will be written to RValue.
Opcode Table:
–INSTR– ZCRI –CON– –DEST– –SRC– Z Result C Result Result Clocks
101101 001i 1111 ddddddddd sssssssss
Result = 0 S[31] Written 4
Concise Truth Table:
Out
Destination Source Z
C
Effects
Destination Z C
$----_----; -
$FFFF_FFFF; -1 -
0
wz wc
$0000_0001; 1 0 1
$----_----; -
$FFFF_FFFF; -1 -
1
wz wc
$FFFF_FFFF; -1 0 1
$----_----; -
$0000_0000; 0 -
x
wz wc
$0000_0000; 0 1 0
$----_----; -
$0000_0001; 1 -
0
wz wc
$FFFF_FFFF; -1 0 0
$----_----; -
$0000_0001; 1 -
1
wz wc
$0000_0001; 1 0 0
$----_----; -
$7FFF_FFFF; 2,147,483,647
-
0
wz wc
$8000_0001; -2,147,483,647 0 0
$----_----; -
$7FFF_FFFF; 2,147,483,647
-
1
wz wc
$7FFF_FFFF; 2,147,483,647 0 0
$----_----; -
$8000_0000; -2,147,483,648
-
x
wz wc
$8000_0000; -2,147,483,648
1
0 1
$----_----; -
$8000_0001; -2,147,483,647
-
0
wz wc
$7FFF_FFFF; 2,147,483,647 0 1
$----_----; -
$8000_0001; -2,147,483,647
-
1
wz wc
$8000_0001; -2,147,483,647 0 1
1
The smallest negative number (-2,147,483,648) has no corresponding positive value in 32-bit two’s-complement math.
Explanation
NEGNC stores –Value (if C = 0) or Value (if C = 1) into RValue.
If the
WZ effect is specified, the Z flag is set (1) if Value is zero. If the WC effect is specified,
the C flag is set (1) if Value is negative or cleared (0) if Value is positive. The result is
written to RValue unless the
NR effect is specified.
Propeller Manual v1.1 · Page 321