All mock tests are FREE till 31 December — register to save your progress
Unit 2 · Computer System Architecture Paper 2 CS · December 2018

Consider the following x86 assembly language instructions: MOV AL, 153 NEG AL The contents of the destination register AL (in 8-bit binary), the status of the Carry Flag (CF) and the Sign Flag (SF) after executing these instructions are

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. AL = 01100111; CF = 1; SF = 0

Explanation

153 = 10011001. NEG takes the 2's complement: 256 − 153 = 103 = 01100111. CF is set because the operand was non-zero, and SF = 0 because the result's MSB is 0.

Note on the official key: the official key says option A. Official key gives (A), but NEG of 10011001 is 01100111 (103), not 01100110.

More Computer System Architecture questions