Page 69 - DCAP507_SYSTEM_SOFTWARE
P. 69

Unit 4: Design of Assembler




                                                                                                Notes


















          In preserving with the purpose of pass 1 of an assembler (define symbols and literals), we can
          generate the symbol and literal tables displayed below.

          Symbol Table















          Literal Table







          We scan the program above along with a local counter. For every symbol in the label field we
          make an entry in the symbol table. For the symbol PRGAM2 its value is its relative location. We
          modernize the location counter, observing that the every instruction is 1 word long. Continuing,
          we discover that the next four symbols are defined by the pseudo-op EQU. These symbols are
          entered into the symbol to and the connected values given in the argument fields of the EQU
          statements entered.
          Observe that none of the Pseudo-ops encountered effect location counter as they do not effect in
          any object code. So the location counter has a value 8 when LOOP is encountered. Thus, LOOP is
          entered into the symbol table with a value 2. It is a relocatable variable. Its length is 1 word as
          it signifies a location that will enclose an instruction. All other symbols are entered in like
          manner. In the same pass all literals are renowned and entered into a literal  table. The first
          literal is in statement 10 and its value is the address of the location that comprises the literal.
          Because this is the first literal, it will have the first address the literal area. The literal table will
          be positioned at the end of the program.







                                           LOVELY PROFESSIONAL UNIVERSITY                                   63
   64   65   66   67   68   69   70   71   72   73   74