Documente Academic
Documente Profesional
Documente Cultură
DESIGN
ROLE OF ASSEMBLER
Source
Program
Assembler
Object
Code
Linker
Executable
Code
Loader
CHAP 2
INTRODUCTION TO ASSEMBLERS
Fundamental functions
translating mnemonic operation codes to their machine language
equivalents
assigning machine addresses to symbolic labels
Machine dependency
different machine instruction formats and codes
CHAP 2
ASSEMBLERS FUNCTIONS
equivalents
Convert symbolic operands to their equivalent machine
addresses
Build the machine instructions in the proper format
Convert the data constants to internal machine
representations
Write the object program and the assembly listing
the program.
Loc
Label
Operator Operand
1000
FIRST
STL
1003
CLOOP
JSUB
1012
1033
RETADR
RETADR
RDREC
CLOOP
RESW
Multi-pass assembler
Allow forward references during symbol definition.
ONE-PASS ASSEMBLER
The main problem is about forward reference.
Eliminating forward reference to data items
too restrictive.
PROGRAM EXAMPLE
TWO TYPES
There are two types of one-pass assembler:
Produce object code directly in memory for immediate
execution
No loader is needed
Load-and-go for program development and testing
Good for computing center where most students reassemble
execution
DATA STRUCTURES
Operation Code Table (OPTAB)
Symbol Table (SYMTAB)
Location Counter(LOCCTR)
INTERNAL IMPLEMENTATION
The assembler generate object code
PROCESSING EXAMPLE
MULTI-PASS ASSEMBLER
If we use a two-pass assembler, the following
EQU
BETA
BETA
EQU
DELTA
DELTA
RESW 1
MULTI-PASS ASSEMBLER(CONTD)
It is unnecessary for a multi-pass assembler to make more than
forward references.