Page 137 - DCAP507_SYSTEM_SOFTWARE
P. 137

Unit 9: Design of an Absolute Loader




          The  simple programs  PGA and PGB demonstrate  a broad  range of relocation and linking  Notes
          situations. The display shows the ESD, TXT, and RLD records formed by the assembler for PGA
          and PGB, respectively. Lastly, we show, the contents of main storage after the programs have
          been assigned space, relocated, linked, and loaded.
          You should scrutinize these figures cautiously and validate the accuracy and reasons for each
          value. A few particular points in these examples should be observed. Both PGA and PGB enclose
          an address constant of the form A(A2-A1-3).


























          You should observe that both instances of this address constant  (location 152, 200) have the
          similar value. Since both A2 and A1 are symbols internal to PGA, the assembler processing PGA,
          can work out the whole expression and find out the value of 7. We observe that the TXT record
          for location 48-51 includes the 7 and there are no connected RLD records for address constant.
          Alternatively, these symbols are external PGB; thus, the assembler, while processing PGB has no
          means of assessing the address constant. This is demonstrated also. The TXT record for relative
          location 32-35 comprises a -3, the only part of the address constant that can be gauged by the
          assembler. The last two RLD records inform the loader to add the load address of A2 to location
          32-35 and then subtract the load address of A1. When processed by the loader, this address
          constant in PGB will certainly have the similar value as the one in PGA. As the direct linking
          loader may come across external references in an object file which can not be assessed until a
          later object file is processed, this type of loader needs two passes. Their functions are very alike
          to those of the two passes of an assembler. The main function of pass 1 of a direct linking loader
          is to assign and assign each program location in core and create a symbol table filling in the
          values of the external symbols. The main function of pass 2 is to load the definite program text
          and carry out the relocation modification of any address constants requiring to be altered. The
          first pass assigns storage locations to all segments and accumulates the values of an external
          symbols in a symbol table.



             Did u know?  The external symbol occurs as local definitions on the ESD records of another
             assembled program.

               !
             Caution  For every external reference symbol there must be an analogous internal symbol
             in some other program.



                                           LOVELY PROFESSIONAL UNIVERSITY                                   131
   132   133   134   135   136   137   138   139   140   141   142