Anda di halaman 1dari 9

Linker & Loaders

Compile-&-GO Loader Scheme

Program Loaded
in Memory
Source Program Compile-and-Go
Deck Translator (e.g.
Assembler)
Assembler
Limitations

• Core occupied by the assembler is not


available for object program.
• Need to translate source program every
time it is run.
• Difficult to handle multiple segments
written in different languages.
General Loader Scheme

Source Translator Object


Program Program-1
Object Programs
ready for execution
Loader

Source Translator Object


Program Program-2
Loader
Absolute Loader

MAIN
Absolute MAIN
Loader

SQRT

SQRT
Limitations
• Programmer has to specify to the
assembler where to load the program.
• In case of multiple subroutines,
programmer has to remember each
address, and use it explicitly in other
subroutines.
• Change in one subroutine can cause a
change to other subroutines also.
Subroutine Linkage
(Use of EXTRN)
MAIN START
EXTERN SUBROUT
------
------
L 15,=A(SUBROUT)
BALR 14,15
……
END

SUBROUT START
USING *,15
………
BR 14
END
ASSEMBLER LINKAGE PSEUDO-OPS
(Use of Entry pseudo-op)

A START (Defines subroutine A)


ENTRY B1,B2,B3 (defines B1….Bn as
additional subroutine
entry points)

B1 -------
B2 -------
Uses of Multiple Entry Points are:

• Common coding
• Colleting together related routines for
convenience.
• Better or convenient access to common
data base.

Anda mungkin juga menyukai