Question 7878 – Digital-Logic-Design
May 30, 2024Question 6786 – Computer-Organization
May 30, 2024Question 3745 – Computer-Organization
What will be the hexadecimal value in the register ax (32-bit) after executing the following instructions?
mov al, 15
mov ah, 15
xor al, al
mov cl, 3
shr ax, cl
Correct Answer: C
Question 462 Explanation:
Step-1: mov al, 15 ← Move 15 to lower part of ‘ax’ register
Step-2: mov ah, 15 ← Move 15 to higher part of ‘ax’ register
Step-3: xor al,al ← Perform Xor operation.
convert 15 into binary number is 00001111
00001111 ← al
00000000 ← al
————-
00000000
————–
Step-4: move cl,3 ← Move 3 to lower part of ‘cx’ register
Step-5: shr ax, cl ← It will shift right and rotate content of ‘ax’ register
Before shifting ‘ax’ value is 0000 1111 0000 0000
After 3 shift right operations then ‘ax’ will become 0000 0001 1110 0000
The value is nothing but 01E0 h (or) (01E0) 16
Step-2: mov ah, 15 ← Move 15 to higher part of ‘ax’ register
Step-3: xor al,al ← Perform Xor operation.
convert 15 into binary number is 00001111
00001111 ← al
00000000 ← al
————-
00000000
————–
Step-4: move cl,3 ← Move 3 to lower part of ‘cx’ register
Step-5: shr ax, cl ← It will shift right and rotate content of ‘ax’ register
Before shifting ‘ax’ value is 0000 1111 0000 0000
After 3 shift right operations then ‘ax’ will become 0000 0001 1110 0000
The value is nothing but 01E0 h (or) (01E0) 16
0F00 h
0F0F h
01E0 h
FFFF h
Subscribe
Login
0 Comments