CS 2734
Computer Organization II
Lecture 15: The Two-Pass Assembler
- 2/19/97
Read Tanenbaum p. 397-412 (Section 7.1-7.2)
In this lecture we talk about the basic principles of a two-pass
assembler and will apply these principles to develop an assembler
for a simple machine called the MAC-1.
- Basic functions of a two-pass assembler:
- Pass I: Build up a symbol table.
- Pass II: Produce assembled output.
- Properties of the MAC-1:
- It is a one register machine which
has a stack.
- Each addressable unit of memory is 16 bits.
- An instruction takes up 16 bits.
- Addresses take up 12 bits.
- Try to assemble the following sample program
SKILL: You should be able to trace through the assembly of
a simple MAC-1 program.
Revision Date: 2/17/97