- IBM 360/370: program status word (PSW)
- Intel 8086/80286: 16-bit flag register (FLAGS); system flags, control flag, and status flags)
- Intel 80386: 32-bit flag register (EFLAGS); system flags, control flag, and status flags)
- MIX: an overflow toggle and a comparison indicator
- Motorola 680x0, 68300: 16-bit status register (SR); high byte is system byte and requires privileged access, low byte is user byte or condition code register (CCR)
A few typical result flags (with processors that include them):
- auxilary carry Set if a carry out of the most significant bit of a BCD operand occurs (binary coded decimal addition). Also commonly set if a borrow occurs in a BCD subtract. Used in Intel 80x86 [AF].
- carry Set if a carry out of the most significant bit of an operand occurs (addition). Also commonly set if a borrow occurs in a subtract. Used in Digital VAX [C], Intel 80x86 [CF], Motorola 680x0 [C], Motorola 68300 [C], Motorola M68HC16 [C].
- comparison indicator contains one of three values: less, equal, or greater. Used in MIX.
- extend Set to the value of the carry bit for arithmetic operations (used to support implementation of multi-byte arithmetic larger than that implemented directly by the hardware. Used in Motorola 680x0 [X], Motorola 68300 [X].
- half carry Set if a carry out of bit 3 of an operand occurs during BCD addition. Used in Motorola M68HC16 [H].
- negative Set if the most significant bit of a result is set. Used in Digital VAX [N], Motorola 680x0 [N], Motorola 68300 [N], Motorola M68HC16 [N].
- overflow Set if arithmetic overflow occurs. Used in Digital VAX [V], Intel 80x86 [OF], Motorola 680x0 [V], Motorola 68300 [V], Motorola M68HC16 [V].
- overflow toggle a single bit that is either on or off. Used in MIX.
- parity For odd parity machines, set to make an odd number of one bits; for an even parity machine, set to make an even number of one bits. Used in Intel 80x86 [PF]. The IBM 360/370 has odd parity on memory.
- sign Set for negative sign. Used in Intel 80x86 [SF].
- trap Set for traps. Used in Intel 80x86 [TF].
- zero Set if a result equals zero. Used in Digital VAX [Z], Intel 80x86 [ZF], Motorola 680x0 [Z], Motorola 68300 [Z], Motorola M68HC16 [Z].
Some conditions are determined by combining multiple flags. For example, if a processor has a negative flag and a zero flag, the equivalent of a positive flag is the case of both the negative and zero flags both simultaneously being cleared.
A few typical control flags (with processors that include them):
- decimal overflow trap enable Set if decimal overflow occurs (or conversion error on a VAX). Used in Digital VAX [DV].
- direction flag Determines the direction of string operations (set for autoincrement, cleared for autodecrement). Used in Intel 80x86 [DF].
- floating underflow trap enable Set if floating underflow occurs. Used in Digital VAX [FU].
- integer overflow trap enable Set if integer overflow occurs (or conversion error on a VAX). Used in Digital VAX [IV].
- interupt enable Set if interrupts enabled. Used in Intel 80x86 [IF].
- i/o privilege level Used to control access to I/O instructions and hardware (thereby seperating control over I/O from other supervisor/user states). Two bits. Used in Intel 80x86 [IO PL].
- nested task flag Used in Intel 80x86 [NF].
- resume flag Used in Intel 80x86 [RF].
- virtual 8086 mode Used to switch to virtual 8086 emulation. Used in Intel 80x86 [VM].

0 Comments