Intel iAPX 86 User Manual page 235

Table of Contents

Advertisement

iAPX 86.88 Family Utilities
Additional Information for iRMX 86 Users
Example 4: L.inking and Locating Programs with Overlays
Without OVERLAY Cc)ntrol
It is harder to produce overlay modules without using the OVERLAY control.
However, sometimes it is necessary to build programs in this way, for example,
building a program for running under an operating system that does not support
overlay modules contained in the same file as the root module.
But regardless of the reason, building overlays in this fashion places an extra burden
on the programmer. He must do some of the work that would be left to LINK86
(and LOC86) if he were to use the OVER LA Y control. In the following example we
prepare a root and two overlay modules in separate files.
First we must compile all modules. Examples of the invocation lines are shown
below:
PLM86 :F1:ROOT.SRC SMALL<cr>
PLM86 :F1:0V1.SRC SMALL<cr>
PLM86 :F1:0V2.SRC SMALL<cr>
In the next step we must link the ,root module to resolve external symbols with a
library and to obtain a link map:
LIN K 8 6 : F 1 : ' R 0 0 T • 0 B
J ,
USE R • LIB M P < c r >
We will need the link map for locating purposes. The link map, shown in figure J-4,
shows the size of each segment in the root. Since the overlays are self-contained
except for references to the root, we do not need a link map for them. The PL/M-86
listing files will show the size of each overlay's segments, as illustrated in figure J-5.
Note that the length of the root's code segment and OVI's code segment must fit
within 64K. This means that the code for the overlays must be in a part of memory
contiguous with the root (to avoid altering the CS register during execution). OV2's
CONST and DATA segments are larger than OV l's so that the STACK segment
must be placed to leave room for OV2's CONST and DATA segments.
If
the
overlays share the STACK and MEMORY segments with the root, they must be
located at the same address.
lRMX 86 8086 LINKER,
V~y
INPUT FILES:
:F1:ROOT.OBJ,USER.LIB
OUTPUT FILE:
:F1:ROOT.LNK
CONTROLS SPECIFIED IN INVOCATION COMMAND:
MAP
DATE:
MMIOOIYY
TIME:
LINK MAP OF MODULE LOANER
LOGICAL SEGMENTS INCLUDED:
LENGTH ADDRESS ALIGN
SEGMENT
8A9BH ------
W
CODE
0381H ------
W
CONST
029 1 H ______
W
DATA
0030H ------
STACK
OOOOH ------
M~MORY
NP T MODULES rNCLUDED:
F1 ROOT .OBJ (ROOT)
FO
USEH.LIB(LOADE~)
FO USER.LIB(EXIT)
FO
US~~.LIB(ERROR)
FO USER.LIB(IIME)
CLASS
CODE
CONST
DATA
STACK
~IEMOH
Y
OVERLAY
Figure J-4. LINK86 r"lap for Root File
J-9

Advertisement

Table of Contents
loading

This manual is also suitable for:

Iapx 88

Table of Contents