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
AL = 0110 0110; CF = 0; SF = 0 | |
AL = 0110 0111; CF = 0; SF = 1
| |
AL = 0110 0110; CF = 1; SF = 1 | |
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).
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).