Flags

Question 1

Consider the following x86 - assembly language instructions :

    MOV AL, 153
    NEG AL

The contents of the destination register AL (in 8-bit binary notation), the status of Carry Flag(CF) and Sign Flag(SF) after the execution of above instructions, are

A
AL = 0110 0110; CF = 0; SF = 0
B
AL = 0110 0111; CF = 0; SF = 1
C
AL = 0110 0110; CF = 1; SF = 1
D
AL = 0110 0111; CF = 1; SF = 0
Question 1 Explanation: 
153 = 1001 1001
NEG(1001 1001) = 1's complement of(1001 1001) = 0110 0110
MOV AL 153
AL = 1001 1001
NEG AL
AL = 0110 0101
MSB is 0. Hence SF=0
By default CF=0 and it will not change with above operations (MOV, NEG)
So, option 1 is the correct answer.
Note: Original UGC Key given correct answer is option-(4).
There is 1 question to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access