System Software Er. Inderjeet Bal
System Software Er. Inderjeet Bal
1. Label:- Is optional.
1. Imperative
Statement.
2. Declaration
Statement.
3. Assembler
Directives.
Imperative Statements:-
– Indicates an action to be taken during execution of a
program.
– Eg: MOV, ADD, MULT, etc.
• Declaration Statement:-
– To reserve memory for variable.
[Label] DS <constant> eg: X DS 5
[Label] DC ‘<value>’ eg: X DC 3
• Assembler Directives:-
– Instructs the assembler to perform ceratin action
during assembly of a program.
START <constant>
END
PHASES OF A COMPILER:
There are mainly 6 phases in a compiler, as these phases help in
converting the H.L.L in to the machine code. The phases of a
compiler are
1.lexical analysis
2.syntax analysis
3.semantic analysis
4.intermediate code generator
5.code optimizer
6. code generator
All these phases convert the source code by dividing in to tokens,
creating pare trees, and optimizing the source code by different
phases.
Phases of Compiler
TYPES OF COMPILERS:
• Native code compiler
The compiler used to compile a source code for same type
of platform only.
• Cross compiler
The compiler used to compile a source code for different
kinds platform.
• Source to source compiler
The compiler that takes high-level language code as input
and outputs source code of another high level language only.
• One pass compiler
It is a type of compiler that compiles the whole process
in only one-pass.
• Threaded code compiler
The compiler which simply replace a string by an appropriate
binary code.
• Incremental compiler
The compiler which compiles only the changed lines from the
source code and update the object code.
• Source compiler
The compiler which converts the source code high level language
code in to assembly language only
Loaders and Linkers
FUNDAMENTAL PROCESS OF LOADERS
• Allocation : the space for program is allocated in the
main memory, by calculating the size of the program.
• Loading – brings the object program into memory for
execution.
• Relocation – modifies the object program so that it can
be loaded at an address different from the location
originally specified.
• Linking, which combines two or more separate object
programs and supplies the necessary information.
Type of loaders
• Assemble-and-Go Loader
• Absolute Loader (Bootstrap
Loader)
• Relocating Loader (Relative
Loader)
• Direct Linking Loader
ASSEMBLE-AND-GO LOADER
• Characteristic
the object code is stored in memory after
assembly
single JUMP instruction
• Advantage
simple, developing environment
• Disadvantage
whenever the assembly program is to be
executed, it has to be assembled again
programs have to be coded in the same
language
Absolute Loader