Unit 1
Unit 1
Unit 1
.
CONTENTS :-
1. Introduction
2. Components of Software System
- Text editor
- Loader
- Assembler
- Macroprocessor
- Compiler
- Debugger
- Machine Structure
- Machine Language
- Assembly Language
3. Assemblers : General design procedure
Design of assembler
INTRODUCTION TO SYSTEM PROGRAMMING
➢Working register - The working registers are often called as the "scratch
pads" because they are used to store temporary values while calculation is in
progress.
Text editors
Loaders
Assemblers
Macro processors
Compilers
Debuggers
ELEMENTS OF ASSEMBLY LANGUAGE PROGRAMMING
Elements of Assembly Language
1.Imperative Statements
1.Declaration Statements
1.Assembler Directives
•Imperative Statements : It indicates an action to be performed during the execution of
the assembled program. Each imperative statement typically translates into one machine
instruction.
The DS (Declare Storage) statement reserves areas of memory and associates names with
them.
E.g. A DS 1
B DS 150
➢First statement reserves a memory of 1 word and associates the name of the memory as
A.
➢Second statement reserves a memory of 150 word and associates the name of the
memory as B.
Associates the name ONE with a memory word containing the value ‘1’
Assembler Directives :
Assembler directives instruct the assembler to perform certain actions during
the assembly of a program.
Some Assembler directives are –
START <Constant>
Indicates that the first word of the target program generated by the assembler
should be placed in the memory word with address <Constant>
LTORG – Specifies where the literals should be placed during the program
execution.
Benefits of Assembly Language
Pass-2:
✓Generate object code by converting symbolic op-code
into respective numeric op-code
✓Generate data for literals and look for values of
symbols
DATA STRUCTURES USED
SYMBOL TABLE
LITERAL TABLE
MACHINE OPCODE TABLE
SYMBOL TABLE
Symbol Table is an important data structure created and maintained by
the compiler in order to keep track of variables
LITERAL TABLE
Contains address of literals.
In contrast with variables, the value of literals do not change. It represents a fixed value
in source code.
Intermediate Code
An intermediate representation is the data structure or code used internally by
a compiler or virtual machine to represent source code.
Pass-1:
Define symbols and literals and remember them in symbol table and
literal table respectively.
Keep track of location counter
Process pseudo-operations
Pass-2:
Generate object code by converting symbolic op-code into respective
numeric op-code
Generate data for literals and look for values of symbols
Working of Pass-2: