Consider the following assembly program fragment : stc
Consider the following assembly program fragment :
stc
mov al, 110101110b
mov cl, 2
rcl al, 3
rol al, 4
shr al, cl
mul cl
The contents of the destination register ax (in hexadecimal) and the status of Carry Flag (CF) after the execution of above instructions, are :
Show answerHide answer
Correct answer: (A) ax = 003CH; CF = 0
Explanation
After the rotate and shift instructions al = 00011110, and mul cl multiplies it by 2 (append a 0 bit at the LSB): ax = 0000000000111100 = 003CH. For mul, CF = 0 when the high byte of the result is 0 and CF = 1 otherwise; here the high byte is 0, so CF = 0. Hence ax = 003CH; CF = 0.