2-7
OVERVIEW OF THE 80C186 FAMILY ARCHITECTURE
2.1.6 Flags
The 80C186 Modular Core family has six status flags (see Figure 2-5) that the Execution Unit
posts as the result of arithmetic or logical operations. Program branch instructions allow a pro-
gram to alter its execution depending on conditions flagged by a prior operation. Different in-
structions affect the status flags differently, generally reflecting the following states:
•
If the Auxiliary Flag (AF) is set, there has been a carry out from the low nibble into the high
nibble or a borrow from the high nibble into the low nibble of an 8-bit quantity (low-order
byte of a 16-bit quantity). This flag is used by decimal arithmetic instructions.
•
If the Carry Flag (CF) is set, there has been a carry out of or a borrow into the high-order bit
of the instruction result (8- or 16-bit). This flag is used by instructions that add or subtract
multibyte numbers. Rotate instructions can also isolate a bit in memory or a register by
placing it in the Carry Flag.
•
If the Overflow Flag (OF) is set, an arithmetic overflow has occurred. A significant digit
has been lost because the size of the result exceeded the capacity of its destination location.
An Interrupt On Overflow instruction is available that will generate an interrupt in this
situation.
•
If the Sign Flag (SF) is set, the high-order bit of the result is a 1. Since negative binary
numbers are represented in standard two’s complement notation, SF indicates the sign of
the result (0 = positive, 1 = negative).
•
If the Parity Flag (PF) is set, the result has even parity, an even number of 1 bits. This flag
can be used to check for data transmission errors.
•
If the Zero Flag (ZF) is set, the result of the operation is zero.
Additional control flags (see Figure 2-5) can be set or cleared by programs to alter processor op-
erations:
•
Setting the Direction Flag (DF) causes string operations to auto-decrement. Strings are
processed from high address to low address (or “right to left”). Clearing DF causes string
operations to auto-increment. Strings are processed from low address to high address (or
“left to right”).
•
Setting the Interrupt Enable Flag (IF) allows the CPU to recognize maskable external or
internal interrupt requests. Clearing IF disables these interrupts. The Interrupt Enable Flag
has no effect on software interrupts or non-maskable interrupts.
•
Setting the Trap Flag (TF) bit puts the processor into single-step mode for debugging. In
this mode, the CPU automatically generates an interrupt after each instruction. This allows
a program to be inspected instruction by instruction during execution.
The status and control flags are contained in a 16-bit Processor Status Word (see Figure 2-5). Re-
set initializes the Processor Status Word to 0F000H.
Содержание 80C186EA
Страница 1: ...80C186EA 80C188EA Microprocessor User s Manual...
Страница 2: ...80C186EA 80C188EA Microprocessor User s Manual 1995...
Страница 19: ......
Страница 20: ...1 Introduction...
Страница 21: ......
Страница 28: ...2 Overview of the 80C186 Family Architecture...
Страница 29: ......
Страница 79: ......
Страница 80: ...3 Bus Interface Unit...
Страница 81: ......
Страница 129: ......
Страница 130: ...4 Peripheral Control Block...
Страница 131: ......
Страница 139: ......
Страница 140: ...5 ClockGenerationand Power Management...
Страница 141: ......
Страница 165: ......
Страница 166: ...6 Chip Select Unit...
Страница 167: ......
Страница 190: ...7 Refresh Control Unit...
Страница 191: ......
Страница 205: ......
Страница 206: ...8 Interrupt Control Unit...
Страница 207: ......
Страница 239: ...INTERRUPT CONTROL UNIT 8 32...
Страница 240: ...9 Timer Counter Unit...
Страница 241: ......
Страница 265: ......
Страница 266: ...10 Direct Memory Access Unit...
Страница 267: ......
Страница 295: ...DIRECT MEMORY ACCESS UNIT 10 28...
Страница 296: ...11 Math Coprocessing...
Страница 297: ......
Страница 314: ...12 ONCE Mode...
Страница 315: ......
Страница 318: ...A 80C186 Instruction Set Additions and Extensions...
Страница 319: ......
Страница 330: ...B Input Synchronization...
Страница 331: ......
Страница 334: ...C Instruction Set Descriptions...
Страница 335: ......
Страница 383: ...INSTRUCTION SET DESCRIPTIONS C 48...
Страница 384: ...D Instruction Set Opcodes and Clock Cycles...
Страница 385: ......
Страница 408: ...Index...
Страница 409: ......