Академический Документы
Профессиональный Документы
Культура Документы
Absolute
– Single pass
– Checks for correct header record
– Checks for sufficient available memory
– Moves each text record to proper location
– Upon seeing END passes control to the pgm
Kinds of loaders (cont.)
Bootstrap
– A special absolute loader
– Typically single pass
– ROM
– Loads the OS
Kinds of loaders (cont.)
Relocating
– Modifies appropriate addresses
– Two pass
– Loads object program at a variety of locations
– May perform loading during execution (repeatedly)
– Allows for multiple programs (multiprocessing)
– System libraries require relocation
Methods of Relocation
H – header
– H PgmName Startaddr Length
– 1ch 6ch 6ch 6ch
Our OBJ Records - Text
T – text
– T Startaddr Length records
– 1ch 6ch 2ch ???ch
Our OBJ Records- Define
M – Modification
– M addr len action
– 1ch 6ch 2ch +/- label
– Addr – location to modify
– Len – number of bytes to modify
– Action – how to modify
Our OBJ Records - End
E – End
– E addr
– 1ch 6ch
– Addr is the starting execution location
Mask Method of Relocation
HCOPY 000000001077A
^ ^ ^
T0000001EFFC1400334810390000362800303000154810613C000300002A0C003900002D
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
FFC 111111111100 all 10 words need modification
T 00001E 15 E00 0C0036 481061 080033 4C0000 454F46 000003 000000
^ ^ ^ ^ ^ ^ ^ ^ ^ ^
E00 111000000000 instructions 0,1,2 need load addresses
T0000391EFFC0400300000030E0105D30103FD8105D2800303010575480392C105E38103F
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
T0010570A8001000364C0000F1001000
^ ^ ^ ^ ^ ^ ^
The F1 fouls up alignment, thus a new text record has to be started.
FIGURE 3.7
Program Linking
LIBRARY MYLIB
Loader Options Libraries
Implementation
– During execution time the loader must be kept and
invoked when the function is needed.
– In this case the loader can be thought of as part of the
OS and thus an OS call occurs.
– The binding is at execution time rather than load time.
– Delayed binding gives more capabilities at higher cost.
Bootstrap Loaders