wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

The FLAGS Register Quiz W1

Total questions: 15

Worksheet time: 3mins

Name
Class
Date
1.

Which set lists only status flags in the 8086 FLAGS register?

a)

CF, PF, AF, TF, IF, DF

b)

CF, ZF, DF, SF, OF

c)

TF, IF, DF, ZF, SF, OF

d)

CF, PF, AF, ZF, SF, OF

2.

A byte addition yields a low byte with exactly four 1-bits and no carry from the most significant bit. Which flags are set to 1?

a)

PF only is set, CF is clear

b)

CF only is set, PF is clear

c)

PF and CF are both set

d)

Neither PF nor CF is set

3.

During subtraction, a borrow occurs into bit 3 of the low byte, the result is 00h, and the most significant bit of the result is 1. Which flags are 1?

a)

AF and ZF are 1; SF is 0

b)

AF and ZF are 1; SF is 1

c)

AF and SF are 1; ZF is 0

d)

AF is 0; ZF and SF are 1

4.

When adding two unsigned 16-bit values, which condition indicates unsigned overflow has occurred?

a)

Carry into and out of MSB do not match

b)

Sum is negative in two’s complement

c)

Result’s MSB differs from operands’ MSBs

d)

Carry out of the MSB is present

5.

Two 16-bit numbers, both with MSB = 0, are added and the result has MSB = 1 with no carry out of the MSB. What overflow flags are set?

a)

OF=0 and CF=0

b)

OF=1 and CF=1

c)

OF=0 and CF=1

d)

OF=1 and CF=0

6.

Which best describes how the processor determines signed overflow during addition?

a)

Any carry happens anywhere in bits

b)

Carry into and carry out of MSB differ

c)

Result equals zero after masking

d)

Result exceeds 65535 decimal

7.

Adding 0x7FFF and 0x7FFF in 16-bit arithmetic yields 0xFFFE. Which interpretation of overflow is correct?

a)

Signed overflow occurs, unsigned does not

b)

Unsigned overflow occurs, signed does not

c)

Both signed and unsigned overflow occur

d)

Neither signed nor unsigned overflow occur

8.

An 8086 executes ADD AX,BX with AX=FFFFh and BX=FFFFh. Which flag combination is correct after the addition?

a)

SF=1, ZF=0, CF=1, OF=0

b)

SF=0, ZF=1, CF=0, OF=1

c)

SF=1, ZF=1, CF=1, OF=1

d)

SF=0, ZF=0, CF=0, OF=0

9.

INC AL when AL=FFh results in AL=00h. Which statement about flags is correct?

a)

ZF cleared, CF unchanged, OF set

b)

ZF set, CF set, OF cleared

c)

ZF is set, CF unchanged, OF cleared

d)

ZF cleared, CF set, OF set

10.

NEG AX with AX=8000h is performed. Which outcome best matches the instruction behavior?

a)

Result=8001h, CF=0, OF=1

b)

Result=7FFFh, CF=1, OF=0

c)

Result=0000h, CF=0, OF=0

d)

Result=8000h, CF=1, OF=1

11.

When tracing with DOS DEBUG, which flag pattern best supports the conclusion that ADD AX,AX changed a positive value to a negative without an unsigned carry?

a)

OV set, NG clear, CY clear, ZR set

b)

OV clear, NG set, CY set, ZR clear

c)

OV clear, NG clear, CY set, ZR clear

d)

OV set, NG set, CY clear, ZR clear

12.

When adding two 16-bit positive numbers in AX and BX, ADD AX,BX produces a negative result in two’s complement. Which flags combination best indicates signed overflow without an unsigned carry out of the msb?

a)

CF=0, OF=0, SF=0, ZF=1

b)

CF=1, OF=1, SF=0, ZF=1

c)

CF=0, OF=1, SF=1, ZF=0

d)

CF=1, OF=0, SF=1, ZF=0

13.

After executing SUB AX,BX on 16-bit registers where AX=0002h and BX=FF0Fh, which interpretation about overflow is correct?

a)

Unsigned overflow occurs, signed overflow does not

b)

Signed overflow occurs, unsigned overflow does not

c)

Both signed and unsigned overflow occur

d)

Neither signed nor unsigned overflow occur

14.

Which statement correctly distinguishes CF and OF for addition and subtraction on the 8086?

a)

CF reports zero detection; OF reports negative detection

b)

CF reports parity of result; OF reports auxiliary carry

c)

CF reports signed overflow; OF reports unsigned overflow

d)

CF reports msb carry/borrow; OF reports signed overflow

15.

What condition indicates a signed overflow has occurred when adding two signed 16-bit values?

a)

Carry out of the MSB is present

b)

Result’s MSB differs from operands’ MSBs

c)

Result is negative in two’s complement

d)

Carry into and out of MSB do not match