Professional Documents
Culture Documents
4 - Flags Register
4 - Flags Register
4 - Flags Register
BSCpE 3 Hilda
Wycoco The flags register shown above contains
Santos the following settings.
NV UP EI PL NZ NA PO NC
Experiment 04
The Flags Register The settings mean no overflow (NV), up
direction (UP), enable interrupt (EI), plus
sign (PL), nonzero (NZ), no auxiliary carry
I. Objective
(NA), parity odd (PO), and no carry (NC).
OF DF IF TF SF ZF AF PF CF
IF (Interrupt Flag) 5. Use the R command to enter the value
0004 in register CX. Assemble the
The interrupt flag is used to enable and following instruction using the A
disable interrupts. command:
sub ax,cx
DF (Direction Flag)
Use the T command to single-step
The direction flag is used by string
through the above instruction. Write your
operations to determine the direction of data
observations on Table 1.
transfer.
6. Enter the value FFFF to register DX. Use
OF (Overflow Flag)
the A command to assemble the
instruction
The overflow flag is used with signed
numbers to indicate the result of an operation add bx, dx
contains a carry.
Try tracing through the instruction.
Usually, only 3 of the 8 flags are used: the Observe the flag registers. Write your
carry flag, the zero flag and the sign flag. In observations on Table 1.
the following exercises we will be dealing
with these three registers. Notice that the BX register contains 0000
when the result of the ADD instruction is
III. Procedures 10000. Because the register can only hold
2 bytes (four hexadecimal digits) the most
significant part is omitted.
1. Run debug from the DOS prompt.
Table 1
2. Type R and then press the Enter key to
view the registers and their contents. Note STEP CARRY ZERO SIGN
the flags register. Write the status of the 2 NC NZ PL
flags on Table 1. 5 NC ZR PL
6 CY ZR PL
V. Conclusion
Upon accomplishing the activity, I
learned the behavior and conditions of how
different flag resisters work, such as carry
flag, parity flag, auxiliary carry flag, zero
flag, sign flag, interrupt flag, direction flag,
and overflow flag.
Aside from that, I can now identify which
operations can affect the mentioned registers
and how they behave if certain conditions are
satisfied.
Documentation