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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

OVERVIEW OF THE 80C186 FAMILY ARCHITECTURE<br />

Unconditional transfer instructions can transfer control either to a target instruction within the<br />

current code segment (intrasegment transfer) or to a different code segment (intersegment transfer).<br />

The assembler terms an intrasegment transfer SHORT or NEAR and an intersegment transfer<br />

FAR. The transfer is made unconditionally when the instruction is executed. CALL, RET and<br />

JMP are all unconditional transfers.<br />

CALL is used to transfer the program to a procedure. A CALL can be NEAR or FAR. A NEAR<br />

CALL stacks only the Instruction Pointer, while a FAR CALL stacks both the Instruction Pointer<br />

and the Code Segment register. The RET instruction uses the information pushed onto the stack<br />

to determine where to return when the procedure finishes. Note that the RET and CALL instructions<br />

must be the same type. This can be a problem when the CALL and RET instructions are in<br />

separately assembled programs. The JMP instruction does not push any information onto the<br />

stack. A JMP instruction can be NEAR or FAR.<br />

Conditional transfer instructions are jumps that may or may not transfer control, depending on<br />

the state of the CPU flags when the instruction is executed. Each conditional transfer instruction<br />

tests a different combination of flags for a condition (see Table 2-10). If the condition is logically<br />

TRUE, control is transferred to the target specified in the instruction. If the condition is FALSE,<br />

control passes to the instruction following the conditional jump. All conditional jumps are<br />

SHORT. The target must be in the current code segment within –128 to +127 bytes of the next<br />

instruction’s first byte. For example, JMP 00H causes a jump to the first byte of the next instruction.<br />

Jumps are made by adding the relative displacement of the target to the Instruction Pointer.<br />

All conditional jumps are self-relative and are appropriate for position-independent routines.<br />

2-24

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

Saved successfully!

Ooh no, something went wrong!