Write out the result of separately performing each of the two assembly commands: complement and negate on the following register values.
a.0x2a
b.0x7d
Ans) complement instruction per forms one's complement and negate instruction performs 2's complement i.e one's complement+1
========
a) 0x2a =0x0010 1010
result after complement instruction is(complement each bit )i.e 0x 1101 0101=0xd5
result is 0xd5
====
result after negate instruction is (2's complement i.e 1's complement+1)
i.e 0x 1101 0101(calculated above ) +1=0x1101 0110=0xd6
result is 0xd6
===============
b)
a) 0x7d =0x0111 1101
result after complement instruction is(complement each bit )i.e 0x 1000 0010=0x82
result is 0x82
====
result after negate instruction is (2's complement i.e 1's complement+1)
i.e 0x 1000 0010(calculated above ) +1=0x1000 0011=0x83
result is 0x83
==============
Get Answers For Free
Most questions answered within 1 hours.