Specifications
Processor Description (V40)
The control flags are used by the programmer to direct CPU
operation. The control flags are set (logical 1) and reset
(logical 0) with dedicated instructions. The IE [IF] and BRK [TF]
flags are automatically reset when the program enters an interrupt
service routine.
The PSW [FL] is automatically preserved on the stack at the start
of an interrupt service routine for both hardware and software
initiated interrupts, and at the start of a procedure initiated with
the CALL instruction. A return from interrupt instruction, a return
from procedure instruction, or a return from emulation instruction
will restore the contents of the PSW [FL] from the stack.
Different instructions affect the status flags differently. A detailed
description of each status flag is given on the following pages.
Reference to bit position is based on the least significant bit being
bit 0. The state of a flag is referred to as set when a a logical 1 is
present, and as reset when a logical 0 is present.
Status Flags
CY [CF] (Carry Flag) - The carry flag is set if an addition
results in a carry out of bit 7 for byte operations or bit 15 for word
operations. The CY [CF] flag is also set if a subtraction results in
a borrow into bit 7 for byte operations or bit 15 for word
operations.
For unsigned byte multiplication, CY [CF] is reset if the most
significant byte of the result (register AH) is 0. The same is true
of the most significant word (register DW [DX]) for unsigned
word multiplication.
For signed multiplication, CY [CF] is reset if the sign bit of the
least significant byte (register AL) is extended to the most
significant byte (register AH). The same is true for signed word
multiplication with the least significant word in register AX and
the most significant in register DX.
P [PF] (Parity Flag) - The P [PF] flag is set if the least
significant byte of an arithmetic or logical result has an even
5-15