Question 10Asked in UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)

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 :
  1. Aax = 003CH; CF = 0
  2. Bax = 001EH; CF = 0
  3. Cax = 007BH; CF = 1
  4. Dax = 00B7H; CF = 1
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.

From UGC NET Computer Science PYQ, November 2017 (Paper II & III, Selected Questions)

This is question 10 of UGC NET Computer Science PYQ, November 2017 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.