Consider the following assembly language instructions : mov al, 15 mov ah, 15…
2017
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 ?
- A.
0270H
- B.
0170H
- C.
01E0H
- D.
0370H
Attempted by 40 students.
Show answer & explanation
Correct answer: A
Step-by-step evaluation:
After mov al,15 and mov ah,15 then xor al,al: AH = 0Fh, AL = 00h, so AX = 0F00h.
After mov cl,3 and shr ax,cl: logical right shift 0F00h by 3 gives AX = 01E0h (AH = 01h, AL = E0h).
add al,90h: AL = E0h + 90h = 170h -> AL becomes 70h and a carry-out is produced (carry = 1).
adc ah,0: AH = 01h + 0 + carry(1) = 02h.
Final value: AX = 0270h