1. The document describes the general design procedure and data structure of an assembler program.
2. It outlines two passes of the assembler - pass 1 defines symbols and literals, pass 2 generates the object program.
3. The data structure includes tables for machine operations, pseudo operations, symbols, literals, and workspaces to hold instructions and output formatting. These tables are used and updated in both passes.
3. General Design Procedure:
1. Specify the Problem
2. Specify Data Structure
3. Define Format of Data Structure
4. Specify Algorithm
5. Look for modularity
6. Repeat 1 through 5 on modules
5. Pass 1 purpose: Define symbols and
literals
Determine length of machine instructions
(MOTGET1)
Keep track of location counter (LC)
Remember values of symbols until pass 2
(STSTO)
Process some pseudo ops, e.g. EQU, DS
(POTGET1)
Remember literals (LITSTO)
6. Pass 2 purpose: Generate object
program
Look up value of symbols (STGET)
Generate instructions (MOTGET2)
Generate data (for DS, DC and
literals)
Process pseudo ops(POTGET2)
7. Data Structure
Pass 1 data bases:
1. Input source program
2. A Location Counter (LC), used to keep track of each
instruction’s location.
3. A table, the Machine Operation Table (MOT), that
indicates the symbolic mnemonics for each instruction
and its length
4. A table, the Pseudo Operation Table (POT), that
indicates the symbolic mnemonics and action to be
taken for each pseudo-op in pass 1
8. Data Structure
5. A table, the Symbol Table (ST), that is used
to store each label and its corresponding
value.
6. A table, the Literal Table (LT), that is used to
store each literal encountered and its
corresponding assigned locations.
7. A copy of the input to be used later by pass
2. this may be stored in a secondary
storage device.
9. Data Structure
Pass 2 data bases:
1. Copy of source program input to pass 1
2. Location Counter (LC)
3. A table, the Machine Operation Table (MOT), that indicates
for each instruction: i) symbolic mnemonics ii)length
iii)binary machine op code and iv) format
4. A table, the Pseudo Operation Table (POT), that indicates
for each pseudo op the symbolic mnemonics and the action
to be taken in pass 2
10. Data Structure
5. The Symbol Table (ST), prepared by pass 1, containing
each label and its corresponding value.
6. A table, the Base Table (BT), that indicates which registers
are currently specified as base registers by USING pseudo-
ops and what are the specified contents of these registers.
7. A work space, INST, that is used to hold each instruction as
its various parts are being assembled together.
11. Data Structure
8. A workspace, PRINT LINE, used to produce
a printing listing
9. A workspace, PUNCH CARD, used prior to
actual outputting for converting the
assembled instructions into the format
needed by the loader.
10. An output deck of assembled instructions in
the format needed by the loader.