SS Mod 4
SS Mod 4
PC-relative
Direct addressing
Direct addressing
Direct addressing
This program is written in SIC instructions. Only direct addressing
can be used(No relative addressing). As such, we need many
modification records.
This not only makes the object program bigger, it also slows down
the loading process.
Relocation Bit Mask
• If an object code needs too many modification records, it
would be more efficient to use a relocation bit mask to indicate
where in the object program should be modified when the
object program is loaded.
• A relocation bit is associated with each word of object code.
• Since all SIC instructions occupy one word, there is one
relocation bit for each possible instruction.
• The relocation bits are gathered together in to a bit mask
following the length indicator in each text record.
Relocation Bit Mask Example
Linkage Editor
Linkage Editor
• When the user is ready to run the linked program,
a simple relocating loader can be used to load the
program into memory.
• The only object code modification required is the
addition of an actual load address to relative
values within the program.
• The linkage editor performs relocation of all
control sections relative to the start of the linked
program.
Linkage Editor
• All items that need to be modified at load time have values
that are relative to the start of the linked program.
• The loading can be accomplished in one pass with no
external symbol table required.
• Thus, if a program is to be executed many times without
being reassembled, the use of a linkage editor reduces the
overhead required.
– Resolution of external references and library searching
are only performed once.
– A linking loader searches libraries and resolves external
references every time the program is executed.
• Linking loader is used when
- the program is reassembled for every execution.
- may occur in a program development and testing
environment(student programs)
- when a program is used so infrequently that it is not
worthwhile to store the assembled version in a library.
• The linked program produced by a linkage editor
is suitable for processing by a relocating loader.
• All external references are resolved.
• Relocation is indicated by modification record or
bit mask.
• Information of external references are retained in
the linked program, allows subsequent relinking of
the program to replace control sections, modify
external references etc.
• If a subroutine is modified, after the new version of the
subroutine is assembled or compiled, the linkage editor
can replace this subroutine in the linked version of the
program. It is not necessary to go back to the original
versions of all other subroutines.
INCLUDE PLANNER(PROGLIB)
DELETE PROJECT
INCLUDE PROJECT(NEWLIB)
REPLACE PLANNER(PROGLIB)