|
|
|
NEG.B Dn // Negates the byte representation
// of the int value in data register Dn
|
+----------+----------+----------+----------+
D0 = | 00000000 | 10101010 | 11110000 | 00001111 |
+----------+----------+----------+----------+
NEG.B D0 (use 8 bit operand in D0 !)
Result:
+----------+----------+----------+----------+
D0 = | 00000000 | 10101010 | 11110000 | 11110001 |
+----------+----------+----------+----------+
Because if we negate 00001111, we will get: 11110001
|
+----------+----------+----------+----------+
D0 = | 00000000 | 10101010 | 11110000 | 00001111 |
+----------+----------+----------+----------+
NEG.W D0 (use 16 bit operand in D0 !)
Result:
+----------+----------+----------+----------+
D0 = | 00000000 | 10101010 | 00001111 | 11110001 |
+----------+----------+----------+----------+
Because if we negate: 11110000 00001111
we will get: 00001111 11110001
|