In: Computer Science
Show the major steps for computing X9 in “ADD X9, X10, X11” for the given values. Please indicate if there is an overflow and show the final content of X9 as a hexadecimal number. a) X10=0xCFFFFFFF and X11=0xC0000000 b) X10=0xCFFFFFFF and X11=0xA0000000
The below statement will the addition of the value in X10 and X11 and the result will be stored in X9.
ADD X9, X10, X11
a) X10=0xCFFFFFFF and X11=0xC0000000
The binary form of X10 = 1100 1111 1111 1111 1111 1111 1111 1111
The binary form of X11 = 1100 0000 0000 0000 0000 0000 0000 0000
X9 = X10 + X11 = 1 1000 1111 1111 1111 1111 1111 1111 1111
The result will take more than 4 bytes. So, this is an overflow. Carry flag will be enabled.
The content of X9 = 1000 1111 1111 1111 1111 1111 1111 1111 = 0x8FFFFFFF
X9 = 0x8FFFFFFF
b) X10=0xCFFFFFFF and X11=0xA0000000
The binary form of X10 = 1100 1111 1111 1111 1111 1111 1111 1111
The binary form of X11 = 1010 0000 0000 0000 0000 0000 0000 0000
X9 = X10 + X11 = 1 0110 1111 1111 1111 1111 1111 1111 1111
The result will take more than 4 bytes. So, this is an overflow. Carry flag will be enabled.
The content of X9 = 0110 1111 1111 1111 1111 1111 1111 1111 1 = 0x6FFFFFFF
X9 = 0x6FFFFFFF