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.

80C186 INSTRUCTION SET ADDITIONS AND EXTENSIONSA.1.2String InstructionsINS source_string, portINS (in string) performs block input from an I/O port to memory. The port address is placed inthe DX register. The memory address is placed in the DI register. This instruction uses the ESsegment register (which cannot be overridden). After the data transfer takes place, the pointer register(DI) increments or decrements, depending on the value of the Direction Flag (DF). Thepointer register changes by one for byte transfers or by two for word transfers.OUTS port, destination_stringOUTS (out string) performs block output from memory to an I/O port. The port address is placedin the DX register. The memory address is placed in the SI register. This instruction uses the DSsegment register, but this may be changed with a segment override instruction. After the datatransfer takes place, the pointer register (SI) increments or decrements, depending on the valueof the Direction Flag (DF). The pointer register changes by one for byte transfers or by two forword transfers.A.1.3High-Level InstructionsENTER size, levelENTER creates the stack frame required by most block-structured high-level languages. The firstparameter, size, specifies the number of bytes of dynamic storage to be allocated for the procedurebeing entered (16-bit value). The second parameter, level, is the lexical nesting level of the procedure(8-bit value). Note that the higher the lexical nesting level, the lower the procedure is inthe nesting hierarchy.The lexical nesting level determines the number of pointers to higher level stack frames copiedinto the current stack frame. This list of pointers is called the display. The first word of the displaypoints to the previous stack frame. The display allows access to variables of higher level (lowerlexical nesting level) procedures.After ENTER creates a display for the current procedure, it allocates dynamic storage space. TheStack Pointer decrements by the number of bytes specified by size. All PUSH and POP operationsin the procedure use this value of the Stack Pointer as a base.Two forms of ENTER exist: non-nested and nested. A lexical nesting level of 0 specifies the nonnestedform. In this situation, BP is pushed, then the Stack Pointer is copied to BP and decrementedby the size of the frame. If the lexical nesting level is greater than 0, the nested form is used.Figure A-1 gives the formal definition of ENTER.A-2

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

Saved successfully!

Ooh no, something went wrong!