OVERVIEW OF THE 80C186 FAMILY ARCHITECTURE

Before

 

After

Relocation

 

Relocation

Code

 

 

Segment

 

 

 

CS

CS

 

SS

SS

Stack

DS

DS

Segment

ES

ES

 

 

Code

Data

 

Segment

 

Stack

Segment

 

 

Segment

 

 

 

 

Data

 

 

Segment

Extra

 

Extra

Segment

 

Segment

 

 

Free Space

 

 

A1039-0A

Figure 2-9. Dynamic Code Relocation

To be dynamically relocatable, a program must not load or alter its segment registers and must not transfer directly to a location outside the current code segment. All program offsets must be relative to the segment registers. This allows the program to be moved anywhere in memory, pro- vided that the segment registers are updated to point to the new base addresses.

2-14

Page 43
Image 43
Intel 80C186XL, 80C188XL user manual Before After Relocation Code Segment, Segment Code Data, Segment Data Extra