2 Pass Assembler

You might also like

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 2

Assembler Pass One

Begin pass 1 LC 0 Read next line Analyze line for syntax yes count error any error no Determine statement type yes .END No yes label No yes Sym Def No yes storage No yes instruc No yes comment No No Invalid statement directive yes perform function compute size of instruction compute size of allocation increment LC by size compute symbol value specification label value is LC store name and value in sym table continue with pass 2

Assembler Pass Two


Begin Pass 2 Initialize LC to Zero

Read next line from source

Determine statement type

Label or symbol no End Statement no Assembler Directive no Storage Allocation no

yes yes yes

any more char on source line

no

output listing line to listing file

Exit

yes Perform Function

yes output data to object file no increment LC by size of data

Instructrion yes Translate opcode to binary

invalid statement

Evalute operand specification and output binary convert addresses instruction to to binary object file

insert hex instruction in field of listing

update LC by instruction size

You might also like