Dynamically Relocatable Code - Intel 80C188EC User Manual

Hide thumbs Also See for 80C188EC:
Table of Contents

Advertisement

Type of Memory Reference
Instruction Fetch
Stack Operation
Variable (except following)
String Source
String Destination
BP Used as Base Register
Instructions are always fetched from the current code segment. The IP register contains the in-
struction's offset from the beginning of the segment. Stack instructions always operate on the cur-
rent stack segment. The Stack Pointer (SP) register contains the offset of the top of the stack from
the base of the stack. Most variables (memory operands) are assumed to reside in the current data
segment, but a program can instruct the Bus Interface Unit to override this assumption. Often, the
offset of a memory variable is not directly available and must be calculated at execution time. The
addressing mode specified in the instruction determines how this offset is calculated (see "Ad-
dressing Modes" on page 2-27). The result is called the operand's Effective Address (EA).
Strings are addressed differently than other variables. The source operand of a string instruction
is assumed to lie in the current data segment. However, the program can use another currently
addressable segment. The operand's offset is taken from the Source Index (SI) register. The des-
tination operand of a string instruction always resides in the current extra segment. The destina-
tion's offset is taken from the Destination Index (DI) register. The string instructions
automatically adjust the SI and DI registers as they process the strings one byte or word at a time.
When an instruction designates the Base Pointer (BP) register as a base register, the variable is
assumed to reside in the current stack segment. The BP register provides a convenient way to ac-
cess data on the stack. The BP register can also be used to access data in any other currently ad-
dressable segment.
2.1.9

Dynamically Relocatable Code

The segmented memory structure of the 80C186 Modular Core family allows creation of dynam-
ically relocatable (position-independent) programs. Dynamic relocation allows a multiprogram-
ming or multitasking system to make effective use of available memory. The processor can write
inactive programs to a disk and reallocate the space they occupied to other programs. A disk-res-
ident program can then be read back into available memory locations and restarted whenever it
is needed. If a program needs a large contiguous block of storage and the total amount is available
only in non-adjacent fragments, other program segments can be compacted to free enough con-
tinuous space. This process is illustrated in Figure 2-9.
OVERVIEW OF THE 80C186 FAMILY ARCHITECTURE
Table 2-2. Logical Address Sources
Default
Segment Base
CS
SS
DS
DS
ES
SS
Alternate
Segment Base
NONE
NONE
CS, ES, SS
Effective Address
CS, ES, SS
NONE
CS, DS, ES
Effective Address
Offset
IP
SP
SI
DI
2-13

Advertisement

Table of Contents
loading

This manual is also suitable for:

80c186ec

Table of Contents