Académique Documents
Professionnel Documents
Culture Documents
Presentation On
Advance Assembly Process.
Variants Of Assemblers.
Design Of 2 Pass Assemblers.
Assembler
Database
Target
program /
M/C Lang.
Prog.
Example:
MOV
AX, X
Elements of Assembly
Language
1. Mnemonic Operation Code:Eliminates the need to memorize numeric
operation code.
2. Symbolic Operands:Symbolic names can be used.
3. Data Declarations:Data can be declared in any form
Eg:-5, 10.5 etc.
Statement Format
[Label] <Opcode> <operand Spec> [<operand
spec>.]
1. Label:- Is optional.
2. Opcode:- Symbolic opcode
3. Operand:- Symbolic name (Register or
Memory variable)
Instructi
on
Opcode
Assembly
Mnemonic
Remarks
00
STOP
Stop Execution
01
ADD
02
SUB
03
MULT
04
MOVER
05
MOVEM
06
COMP
07
BC
Branch on Condition
08
DIV
09
READ
10
Output Operand2
Instruction Format
sign
opcode
reg operand
memory operand
START 101
READ X
READ Y
MOVER
ADD
AREG, X
AREG, Y
MOVEM
AREG, RESULT
PRINT RESULT
STOP
X
DS 1
DS 1
RESULT
DS 1
END
Variable
Address
108
109
RESULT
110
Figure: After LC
Processing
Assembly Language
Statement
1. Imperative Statement.
2. Declaration Statement.
3. Assembler Directives.
Pass structure of
assembler
Data
Structures
Source
Program
Pass I
Pass II
Intermediate
Code
Figure: Overview of Two Pass
Assembler
Target
Program
Pass I
Pass I uses the following data
structures
1. Machine Opcode table (OPTAB)
2. Symbol Table (ST)
3. Literal Table (LT)
4. Pool Table (PT)
START 200
MOVER AREG, =5
MOVEM AREG, X
L1 MOVER BREG, =2
ORIGIN L1+3
LTORG
NEXT ADD
AREG,=1
SUB
BREG,=2
BC LT, BACK
LTORG
BACK EQU
L1
ORIGIN NEXT+5
MULT CREG,=4
STOP
X DS 1
END
LC
200
201
202
205
206
207
208
209
210
211
212
212
213
214
START 200
Symbol
Addres
s
MOVER
AREG,=5
Symbol Addres
s
Literal
Addres
s
Pool Table
0
200
Literal
=5
Addres
s
---
Pool Table
0
MOVEM
AREG,X
Symbol
X
201
Addres
s
Literal
----
=5
Addres
s
---
L1 MOVER
BREG,=2
202
Symbol Addres
Literal
s
Addres
s
----
=5
---
L1
202
=2
---
Pool Table
0
Pool Table
0
ORIGIN L1+3
Symbol
203
Addres
s
Literal
----
=5
---
L1
202
=2
---
LTORG
Addres
s
Pool Table
0
205
206
Symbol
Addres
s
Literal
Addres
s
----
=5
205
L1
202
=2
206
Pool Table
0
2
NEXT ADD
AREG, =1
Symbol Addres
s
207
Literal
Addres
s
----
=5
205
L1
202
=2
206
NEXT
207
=1
----
SUB BREG,=2
Symbol
Pool Table
0
2
208
Addres
s
Literal
Addres
s
----
=5
205
L1
202
=2
206
NEXT
207
=1
----
=2
-----
Pool Table
0
2
BC LT, BACK
Symbol
209
Addres
s
Literal
----
=5
205
L1
202
=2
206
NEXT
207
=1
----
BACK
----
=2
----
LTORG
Addres
s
Pool Table
0
2
210
211
Symbol
Addres
s
Literal
Addres
s
----
=5
205
L1
202
=2
206
NEXT
207
=1
210
=2
211
Pool Table
0
2
4
BACK
EQU L1
Symbol
212
Addres
s
Literal
----
=5
205
L1
202
=2
206
NEXT
207
=1
210
BACK
202
=2
211
ORIGIN NEXT+5
Symbol
Addres
s
Pool Table
0
2
4
213
Addres
s
Literal
Addres
s
----
=5
205
L1
202
=2
206
NEXT
207
=1
210
BACK
202
=2
211
Pool Table
0
2
4
MULT
Symbol
CREG,=4
212
Addres
s
Literal
----
=5
205
L1
202
=2
206
NEXT
207
=1
210
BACK
202
=2
211
=4
---Addres
s
STOP
Addres
s
Pool Table
0
2
4
213
Symbol
Addres
s
Literal
----
=5
205
L1
202
=2
206
NEXT
207
=1
210
BACK
202
=2
211
=4
----
Pool Table
0
2
4
DS
214
Symbol
Addres
s
Literal
Addres
s
Pool Table
214
=5
205
L1
202
=2
206
NEXT
207
=1
210
BACK
202
=2
211
=4
----
END
Symbol
Addres
s
214
L1
202
NEXT
207
BACK
202
Literal
Addres
s
Pool Table
=5
205
=2
206
=1
210
=2
211
=4
215
Thank You.