0% found this document useful (0 votes)
310 views

Machine Independent Assembler Features

This document discusses different types of loaders used to load programs into memory, including absolute loaders, bootstrap loaders, and relocating loaders. It focuses on relocating loaders and describes two methods for specifying relocation: modification records and relocation bits. Modification records specify the address and length of fields that need to be modified when relocating a program, while relocation bits associated with each instruction indicate whether it needs relocation.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
310 views

Machine Independent Assembler Features

This document discusses different types of loaders used to load programs into memory, including absolute loaders, bootstrap loaders, and relocating loaders. It focuses on relocating loaders and describes two methods for specifying relocation: modification records and relocation bits. Modification records specify the address and length of fields that need to be modified when relocating a program, while relocation bits associated with each instruction indicate whether it needs relocation.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24

MULTIPASS ASSEMBLER

TYPES OF LOADER
ABSOLUTE LOADER BOOTSTRAP LOADER RELOCATING LOADER DIRECT LINKING LOADER

ABSOLUTE LOADER

PROGRAM LOADED IN MEMORY

Unchanged content (no Text record)

Begin read Header record verify program name and length read first Text record E.g., convert the pair of while record type is <> E do characters 14 (two bytes) in the object program to a single begin byte with hexadecimal value 14 {if object code is in character form, convert into internal representation} move object code to specified location in memory read next object program record end jump to address specified in End record end

Bootstrap Loader
When a computer is first turned on or restarted, a special type of absolute loader, called bootstrap loader is executed This bootstrap loads the first program to be run by the computer -- usually an operating system The bootstrap itself begins at address 0 It loads the OS starting address 0x80 No header record, end record and control information, the object code is consecutive bytes of memory

Example: Character:2(50) 50-48=2 2<10,the conversion is complete. Character: A(65) 65-48=17 17 is not less than 10.i.e)the conversion is not complete. 17-7=10

MACHINE DEPENDENT LOADER FEATURES


Motivation
Efficient sharing of the machine with larger memory and when several independent programs are to be run together Support the use of subroutine libraries efficiently

Two methods for specifying relocation


Modification record (Fig. 3.4, 3.5) Relocation bit (Fig. 3.6, 3.7)
Each instruction is associated with one relocation bit These relocation bits in a Text record is gathered into bit masks

zModification record A modification record is used to describe each part ofthe object code that must be changed when theprogram is relocated. Relocation bit A relocation bit associated with each word of object code is used to indicate whether or not this word should be changed when the program is relocated. Hardware relocation Some computers provide a hardware relocation capability that eliminates some of the need for the loader to perform program relocation.

In the object program, there is one Modification record for each value that must be changed during relocation. Each modification record specifies the starting address and length of the field whose value is to be altered. Col. 1 M Col. 2-7 Starting location of the address field to be modified, relative to the beginning of the program Col. 8-9 Length of the address field to be modified, in halfbytes If the field contains an odd number of half-bytes, the starting location begins in the middle of the first byte.

Modification Record
For complex machines Also called RLD specification
Relocation and Linkage Directory
Modification record col 1: M col 2-7: relocation address col 8-9: length (halfbyte) col 10: flag (+/-) col 11-17: segment name

Fig. 3.4

OBJECT PROGRAM WITH RELOCATION BY MODIFICATION RECORD

Fig. 3.7

You might also like