12.07.2015 Views

80C186EB/80C188EB Microprocessor User's Manual - CEUNES

80C186EB/80C188EB Microprocessor User's Manual - CEUNES

80C186EB/80C188EB Microprocessor User's Manual - CEUNES

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 ARCHITECTUREUnconditional transfer instructions can transfer control either to a target instruction within thecurrent code segment (intrasegment transfer) or to a different code segment (intersegment transfer).The assembler terms an intrasegment transfer SHORT or NEAR and an intersegment transferFAR. The transfer is made unconditionally when the instruction is executed. CALL, RET andJMP are all unconditional transfers.CALL is used to transfer the program to a procedure. A CALL can be NEAR or FAR. A NEARCALL stacks only the Instruction Pointer, while a FAR CALL stacks both the Instruction Pointerand the Code Segment register. The RET instruction uses the information pushed onto the stackto determine where to return when the procedure finishes. Note that the RET and CALL instructionsmust be the same type. This can be a problem when the CALL and RET instructions are inseparately assembled programs. The JMP instruction does not push any information onto thestack. A JMP instruction can be NEAR or FAR.Conditional transfer instructions are jumps that may or may not transfer control, depending onthe state of the CPU flags when the instruction is executed. Each conditional transfer instructiontests a different combination of flags for a condition (see Table 2-10). If the condition is logicallyTRUE, control is transferred to the target specified in the instruction. If the condition is FALSE,control passes to the instruction following the conditional jump. All conditional jumps areSHORT. The target must be in the current code segment within –128 to +127 bytes of the nextinstruction’s first byte. For example, JMP 00H causes a jump to the first byte of the next instruction.Jumps are made by adding the relative displacement of the target to the Instruction Pointer.All conditional jumps are self-relative and are appropriate for position-independent routines.2-24

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

Saved successfully!

Ooh no, something went wrong!