Consider the following assembly language instructions : mov al, 15
Consider the following assembly language instructions :
mov al, 15
mov ah, 15
xor al, al
mov cl, 3
shr ax, cl
add al, 90H
adc ah, 0
What is the value in ax register after execution of above instructions?
Show answerHide answer
Correct answer: (A) 0270H
Explanation
AX consists of AH and AL. mov al, 15 → AX = 000FH mov ah, 15 → AX = 0F0FH xor al, al → AX = 0F00H mov cl, 3 → AX = 0F00H, CL = 03 shr ax, cl → AX = 01E0H (shift right 3 times) add al, 90H → AX = 0170H, carry = 1 adc ah, 0 → AX = 0270H (adds the carry) So AX = 0270H.