03.01.2015 Views

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

OVERVIEW OF THE 80C186 FAMILY ARCHITECTURE<br />

String instructions automatically update the SI register, the DI register, or both, before processing<br />

the next string element. The Direction Flag (DF) determines whether the index registers are autoincremented<br />

(DF = 0) or auto-decremented (DF = 1). The processor adjusts the DI, SI, or both<br />

registers by one for byte strings or by two for word strings.<br />

If a repeat prefix is used, the count register (CX) is decremented by one after each repetition of<br />

the string instruction. The CX register must be initialized to the number of repetitions before the<br />

string instruction is executed. If the CX register is 0, the string instruction is not executed and<br />

control goes to the following instruction.<br />

Table 2-8. String Instruction Register and Flag Use<br />

SI<br />

DI<br />

CX<br />

AL/AX<br />

DF<br />

ZF<br />

Index (offset) for source string<br />

Index (offset) for destination string<br />

Repetition counter<br />

Scan value<br />

Destination for LODS<br />

Source for STOS<br />

Direction Flag<br />

0 = auto-increment SI, DI<br />

1 = auto-decrement SI, DI<br />

Scan/compare terminator<br />

2.2.1.5 Program Transfer Instructions<br />

The contents of the Code Segment (CS) and Instruction Pointer (IP) registers determine the instruction<br />

execution sequence in the 80C186 Modular Core family. The CS register contains the<br />

base address of the current code segment. The Instruction Pointer register points to the memory<br />

location of the next instruction to be fetched. In most operating conditions, the next instruction<br />

will already have been fetched and will be waiting in the CPU instruction queue. Program transfer<br />

instructions operate on the IP and CS registers. Changing the contents of these registers causes<br />

normal sequential operation to be altered. When a program transfer occurs, the queue no longer<br />

contains the correct instruction. The Bus Interface Unit obtains the next instruction from memory<br />

using the new IP and CS values. It then passes the instruction directly to the Execution Unit and<br />

begins refilling the queue from the new location.<br />

The 80C186 Modular Core family offers four groups of program transfer instructions (see Table<br />

2-9). These are unconditional transfers, conditional transfers, iteration control instructions and interrupt-related<br />

instructions.<br />

2-23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!