You are on page 1of 55

Syllabus

Syllabus
• Types of Assembly Language statements
• Imperative statements
• –An imperative statement in assembly language indicates the action to be performed during execution of
assembly statement
• Ex:- A 1,FOUR
• Declarative Statement:-
• – These statements declares the storage area or declares the constant in program.
• – EX A DS 1
• ONE DC “1”
• Assembler Directives
• – These are the statements used to indicate certain thing regarding how assembly of input program is
• to be performed.
• – Ex START 100
• USING *, 15
Assembler requirements for IBM 360/370
processor
Instruction Format
Sample Program
Database tables

• MOT
• POT
• ST and LT
• BT
Machine Opcode Table(MOT)
Pseudo- Opcode Table
Symbol and Literal table
Base Table
Pass1 Flowchart
Symb LC Value Length Relocation/
ol Absolute
RAM 0 1 R
FOUR 12 4 R
FIVE 16 4 R
TEMP 20 4 R
Pass-II Flowchart
Symb LC Value Length Relocation/
ol Absolute
RAM 0 1 R
FOUR 12 4 R
FIVE 16 4 R
TEMP 20 4 R
Symb LC Value Length Relocation/
ol Absolute
JOHN 0 1 R
FOUR 12 4 R
FIVE 16 4 R
TEMP 20 4 R
Example
0 PG1 START 0
Symbol LC Value Length Relocation/Ab
0 USING *,15
solute
0 L 1,FIVE 3A 1, 16 (0,15) PG1 0 1 R
FIVE 16 4 R
4 A 1,FOUR 4A 1,20 (0,15)
FOUR 20 4 R
8 ST 1,TEMP 5A 1,24 (0,15) TEMP 24 4 R

12 SR 2,2 6A 2,2

14 AR 1,2 3B 1,2

16 FIVE DC F’5’ 16 5

20 FOUR DC F’4’ 20 4

24 TEMP DS 1F 24 ----

28 END PG1
Symbol LC Value Length Relocation/Ab
Example Pg2 0 1
solute
R
Literal LC Value Length Re
so
0 Pg2 start 0
B 4 1 A
=F’2’ 26 4 R
0 Using *, B Two 16 2 R
Three 18 4 R
0 L 1, Two 2A 1, 16(0, 4)
Temp 22 4 R
4 A 1, =F’2’ 3A 1, 26

8 A 1, THREE 4A 1, 18(0, 4)

12 ST 1, TEMP 5A 1, 22(0,4)

16 B EQU 4 ----

16 Two DC H’2’ 16 2

18 Three DC f’2’ 18 2

22 Temp DS 1F 22 ------

26 END 2 26 =F’2’
Sample Program
PG2 Start 0
Using *,15 Symbol LC Value Length Relocation/Ab
L 1,two solute
AR 1,2
A 1, three
M 1, =F’2’
ST 1, temp
SR 2,2
S 5, =F’5’
D 5, three
B EQU 4
Literal LC Value Length Relocation/Ab
Two DC H’2’ solute
Three DC F’2’
Temp DS 1F
END
Single Pass Assembler
Stateme Instructi Source Program Symbol Table(ST) Forward Reference Table( FRT)
nt No on
address Symbol Statement Instruction
no address
3 0 L 1, five
3 0 3A 1, ---------- Five * five 3 0
After Declaration of Symbol Five is encountered
7 16 ’5’ five 16
Databases of one pass Assembler
• 1. Original Source Program
• 2 Location Counter(LC)
• 3 Mnemonic Opcode Table(MOT)
• 4 Pseudo Opcode table(POT)
• 5 Symbol Table(ST)
• 6. Forward Reference Table
Forward Reference Table( FRT)
Symbol Statement no Instruction address
Single Pass Assembler
CHAPTER 3
Macros
General Format of Macro Definition

MACRO START OF DEFINITION

----------- Name of Macro


-----------
Body of the Macro
-----------
-----------
MEND End of the Macro
Macro Processor as a Preprocessor

Macro Processor

Assembler
Example 1
Example2
Example 3
Databases Formats
Output of Pass1
Loader

Loader is system program which transfers object code


into main memory and also prepares it for execution.
Functions of Loader
1.Allocation
2. Relocation
3. Linking
4.Loading

You might also like