MNEG MOVE NEGATED
Purpose |
move the arithmetic negation of a scalar quantity |
Format |
opcode src.rx, dst.wx |
Operation |
dst ß -scr; |
Condition codes |
N ß dst LSS 0; Z ß dst EOL 0; V ß overflow (Integer); V ß 0 (floating); C ß dst NEQ 0 (integer); C ß 0 (floating); |
Exceptions |
Integer overflow; reserved operand (floating) |
Opcodes |
8E MNEGB Move Negated Byte AE MNEGW Move Negated Word CE MNEGL Move Negated Long 52 MNEGF Move Negated Floating 72 MNEGD Move Negated Double |
Description |
The destination operand is replaced by the negative of the source operand. |
Notes |
1. Integer overflow occurs if the source Operand is the largest negative integer (which has no positive counterpart). On overflow, the destination operand is replaced by the source operand. 2. On floating reserved operand fault, the destination operand is unaffected and the condition codes are unpredictable. 3. If source is positive zero, result is positive zero. If source is reserved operand (minus zero), a reserved operand fault occurs. For all other floating point source values, bit 15 (sign bit) is complemented. |
Example 1
.text
main: .word 0
movb $1, r1 # r1 contains 1
mnegw r1, r2 # r2 contains 0xFFFF
mnegw r2, r3 # r3 contains 1
mnegl r3, r4 # r4 contains 0xFFFFFFFF
halt