6 Specify the value transferred to the destination register
6. Specify, the value transferred to the destination register by each of the following instructions.
a. mov cl,27 shr 2
b. mov cx,237h + 0A2Bh
c. mov al,27 mod 4
d. mov bx,not 01100101b
Solution
a. mov cl,27 shr 2
shr stands for shift and rotate. 27 in binary is 00011011. The 8bit CL register stores 27 as 00011011. The SHR instruction would shift and rotate the number to its right and convert it into 11000110. The binary number thus obtained is 198 in decimal.
b.mov cx,237h + 0A2Bh
The CX register above is a 16 bit register, hence it can store a 16 bit number. Now, the numbers 237h and 0A2Bh are hexadecimal numbers. These are added before being moved into the CX register. Therefore lets calculate the addition of the numbers first. The addition results in C62h. Therefore the value in CX register is C62h or 3170 in decimal.
c. mov al,27 mod 4
AL is an 8-bit register. 27 mod 4 is 3. Therefore AL contains 3 in decimal or 011 in binary.
d. mov bx,not 01100101b
The BX is again another 16 bit register. The NOT instruction just applies the logical not operation on the given number. Therefore the bits would be flipped. Hence, the bx register would now have binary form of 10011010b. The decimal equivalent is 154.
