Discussion Assignment Unit 7
Discussion Assignment Unit 7
Term 2-2021/2022
Majd Alhaddad
For your discussion question response, please provide a response to each of the
following questions. Make sure that you include the question followed by your
answer to the question in your posting.
Generates instructions through symbols in the process field and finds symbol
value and letters to produce machine code. Now, if the assembler does all of
this work in one scan, it's called the single-pass assembler, otherwise, if it does
it in multiple scans, it's called the multipass assembler. Here the complex
divides these tasks into two phases:
pass 1:
pass 2:
2. There is a method named backpatching that solves this issue with one
pass only. Describe this method.
Backpatching can be used to create a program for logical expressions and the
flow of control statements in a single pass. In this, the compound adjectives
and non-terminal false list B are used to handle the labels in the jump symbol
for Boolean expressions.
Since the program is produced for B, the jumps to true and false are
incomplete, with the label field not populating. These elementary jumps are
found in the lists noted by B.
3. What are the pros and cons for one pass assembly vs. two pass assembly?
The one-pass assembler passes the source file exactly once, in the same path
collects labels, solves future references, and does the actual compilation. The
tricky part is solving future label references, known as the forward reference
problem, and compiling the code in one pass. The one-pass assembler is an
intermediate file, which is used as input by the two-pass assembler.
The two-pass assembler makes two passes over the source file and the second
pass can be over an intermediate file created in the first pass of the assembler.
In the first pass, all it does is look up the label definitions and present them in
the symbol table which is a dynamic table that includes the label name and
title for each label in the source program. In the second pass, after the symbol
table is complete, it does the actual compilation by translating the operations
into machine codes and so on.