Page 74 - DCAP507_SYSTEM_SOFTWARE
P. 74

System Software




                    Notes          3.  MOT_TABLE       Search the Machine-Op Table (MOT) for a match with the operation of
                                                       the current source card.
                                   4.  SYM_TABLE       Store a label and its associated value into the Symbol Table (ST). If the
                                                       symbol is already in the table, return error indication (multiply defined
                                                       symbol).

                                   5.  LIT_TABLE       Store a literal into the Literal Table (LT); do not store the same literal
                                                       twice.
                                   6.  WRITE1          Write a copy of the assembly source record on a storage device for use
                                                       by pass 2.
                                   7.  DLENGTH         Scan operand field of space consuming pseudo-ops to determine the
                                                       amount of storage required.
                                   8.  EVAL            Evaluate an arithmetic expression consisting of constants and symbols
                                                       (e.g. 6, ALPHA, BETA+14*GAMMA).

                                   9.  STGET           Search the Symbol Table (ST) for the entry corresponding to a specific
                                                       symbol (used by SYM_TABLE, and EVAL).
                                   10.   LIT_LC        Assign storage locations to each literal in the literal table (may use
                                                       DLENGTH).

                                   Pass 2

                                   1.  READ2           Read the next assembly source record from the file copy.
                                   2.  POT_TABLE       Same as in pass 1
                                   3.  MOT_TABLE       Same as in pass 1 (evaluate expressions).

                                   4.  EVAL            Same as in pass 1 (evaluate expressions).
                                   5.  OBJECT          Transform produced  instruction to  object record  format; write  the
                                                       record when it is filled with data.

                                   6.  PRINT           Transform relative location and produced code to character format;
                                                       print the line along with copy of the source card.
                                   7.  DATAGEN         Process the fields of the data-generating pseudo-op to produce object
                                                       code (uses EVAL).
                                   8.  DLENGTH         Similar as in pass 1.
                                   9.  LIT_GEN         Produce code for literals (uses DATAGEN).

                                   Each of these functions should separately go via the whole design process (problem statement,
                                   data basics, algorithm, modularity, etc.). These functions can be executed as disconnected external
                                   subroutines, as internal subroutines, or as sections of the pass 1 and pass 2 programs. In any case,
                                   the aptitude to tract functions separately makes it much simpler to design the structure of the
                                   assembler and each of its parts. So, instead of observing the assembler as a single program (of
                                   1,000 to 10,000 source statements), we examine it as a coordinated collection of routines each of
                                   relatively minor size and complexity. We will not attempt to scrutinize all of these functional
                                   routines in detail since they are quite uncomplicated. There are two particular observations of
                                   interest:
                                   1.  Many of the routines involve the scanning or evaluation of fields (e.g., DLENGTH, EVAL,
                                       DATA_GEN);





          68                                LOVELY PROFESSIONAL UNIVERSITY
   69   70   71   72   73   74   75   76   77   78   79