2 Pass Assembler
2 Pass Assembler
0100 01101001
2 Pass Assembler Process
Symbol Table
Variables / Labels
Literal Table
Constants
Executable Loader
Pass 1 - Analysis
This part scans the program looking for symbols, labels, variables, etc and
organises them in tables
Macros Directives
Names subroutines can can be used Configuration instructions for
more than once. Designed to make assembler (such as memory allocation)
programming easier and more module Not a program instruction itself.
ORG #100
JMP BeginProg
END
countUp 200
21
35
NumA 20
ORG #100
JMP BeginProg
END
countUp 200
21
35
NumA 20
Pass 1 Analysis
walkthrough
ORG #100
Symbol Table
BeginProg LDV #countUp
OUTCH
CMP NumA
JMP Finish
JNE MoveOn
INC
STO countUp
JMP BeginProg
END
countUp 200
21
35
NumA 20
ORG #100
Symbol Table
BeginProg LDV #countUp
BeginProg 100
OUTCH
CMP NumA
JMP Finish
JNE MoveOn
INC
STO countUp
JMP BeginProg
END
countUp 200
21
35
NumA 20
ORG #100
Symbol Table
BeginProg LDV #countUp
BeginProg 100
OUTCH
countUp
CMP NumA
JMP Finish
JNE MoveOn
INC
STO countUp
JMP BeginProg
END
countUp 200
21
35
NumA 20
ORG #100
Symbol Table
BeginProg LDV #countUp
BeginProg 100
OUTCH
countUp
CMP NumA
NumA
JMP Finish
JNE MoveOn
INC
STO countUp
JMP BeginProg
END
countUp 200
21
35
NumA 20
ORG #100
Symbol Table
BeginProg LDV #countUp
BeginProg 100
OUTCH
countUp
CMP NumA
NumA
JMP Finish
Finish
JNE MoveOn
INC
STO countUp
JMP BeginProg
END
countUp 200
21
35
NumA 20
ORG #100
Symbol Table
BeginProg LDV #countUp
BeginProg 100
OUTCH
countUp
CMP NumA
NumA
JMP Finish
Finish
JNE MoveOn
MoveOn
MoveOn LDD countUp
INC
STO countUp
JMP BeginProg
END
countUp 200
21
35
NumA 20
ORG #100
Symbol Table
BeginProg LDV #countUp
BeginProg 100
OUTCH
countUp
CMP NumA
NumA
JMP Finish
Finish
JNE MoveOn
MoveOn 105
MoveOn LDD countUp
INC
STO countUp
JMP BeginProg
END
countUp 200
21
35
NumA 20
ORG #100
Symbol Table
BeginProg LDV #countUp
BeginProg 100
OUTCH
countUp
CMP NumA
NumA
JMP Finish
Finish 109
JNE MoveOn
MoveOn 105
MoveOn LDD countUp
INC
STO countUp
JMP BeginProg
END
countUp 200
21
35
NumA 20
ORG #100
Symbol Table
BeginProg LDV #countUp
BeginProg 100
OUTCH
countUp 111
JMP Finish
Finish 109
INC
STO countUp
JMP BeginProg
END
countUp 200
21
35
NumA 20
ORG #100
Symbol Table
BeginProg LDV #countUp
BeginProg 100
OUTCH
countUp 111
INC
STO countUp
JMP BeginProg
END
countUp 200
21
35
NumA 20
Pass 2
If no errors are found in pass one then the second pass assembles the code into
object code.
Literal Table
Constants
Executable Loader