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.

80C186 INSTRUCTION SET ADDITIONS AND EXTENSIONS<br />

A.1.2<br />

String Instructions<br />

INS source_string, port<br />

INS (in string) performs block input from an I/O port to memory. The port address is placed in<br />

the DX register. The memory address is placed in the DI register. This instruction uses the ES<br />

segment register (which cannot be overridden). After the data transfer takes place, the pointer register<br />

(DI) increments or decrements, depending on the value of the Direction Flag (DF). The<br />

pointer register changes by one for byte transfers or by two for word transfers.<br />

OUTS port, destination_string<br />

OUTS (out string) performs block output from memory to an I/O port. The port address is placed<br />

in the DX register. The memory address is placed in the SI register. This instruction uses the DS<br />

segment register, but this may be changed with a segment override instruction. After the data<br />

transfer takes place, the pointer register (SI) increments or decrements, depending on the value<br />

of the Direction Flag (DF). The pointer register changes by one for byte transfers or by two for<br />

word transfers.<br />

A.1.3<br />

High-Level Instructions<br />

ENTER size, level<br />

ENTER creates the stack frame required by most block-structured high-level languages. The first<br />

parameter, size, specifies the number of bytes of dynamic storage to be allocated for the procedure<br />

being entered (16-bit value). The second parameter, level, is the lexical nesting level of the procedure<br />

(8-bit value). Note that the higher the lexical nesting level, the lower the procedure is in<br />

the nesting hierarchy.<br />

The lexical nesting level determines the number of pointers to higher level stack frames copied<br />

into the current stack frame. This list of pointers is called the display. The first word of the display<br />

points to the previous stack frame. The display allows access to variables of higher level (lower<br />

lexical nesting level) procedures.<br />

After ENTER creates a display for the current procedure, it allocates dynamic storage space. The<br />

Stack Pointer decrements by the number of bytes specified by size. All PUSH and POP operations<br />

in the procedure use this value of the Stack Pointer as a base.<br />

Two forms of ENTER exist: non-nested and nested. A lexical nesting level of 0 specifies the nonnested<br />

form. In this situation, BP is pushed, then the Stack Pointer is copied to BP and decremented<br />

by the size of the frame. If the lexical nesting level is greater than 0, the nested form is used.<br />

Figure A-1 gives the formal definition of ENTER.<br />

A-2

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

Saved successfully!

Ooh no, something went wrong!