1 / 11

CS2422 Assembly Language & System Programming

This CS2422 Assembly Language & System Programming topic covers Beck's Section 3.2.3 algorithm and data structure for a linking loader, including two passes logic. Pass 1 assigns addresses to external symbols, while Pass 2 performs loading, relocation, and linking. It also discusses ESTAB (external symbol table).

janebarnes
Télécharger la présentation

CS2422 Assembly Language & System Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS2422 Assembly Language & System Programming January 2, 2007

  2. Today’s Topics • Beck’s Section 3.2.3: Algorithm and Data Structure for a Linking Loader

  3. Algorithm and Data Structure • Two Passes Logic • Pass 1: Assign addresses to all external symbols • Pass 2: Perform the actual loading, relocation, and linking • ESTAB (external symbol table) + +

  4. Pass 1 Program Logic • Pass 1: • Assign addresses to all external symbols • Variables & Data structures • PROGADDR (program load address) from OS • CSADDR (control section address) • CSLTH (control section length) • ESTAB • Fig. 3.11(a) • Process Define Record

  5. Fig. 3.11(a)

  6. Pass 2 Program Logic • Pass 2: • Perform the actual loading, relocation, and linking • Modification record • Lookup the symbol in ESTAB • End record for a main program • Transfer address • Fig. 3.11(b) • Process Text record and Modification record

  7. Fig. 3.11(b)

  8. Improve Efficiency • Use local searching instead of multiple searches of ESTAB for the same symbol • Assign a reference number to each external symbol • The reference number is used in Modification records • Implementation • 01: Control section name • Other: External reference symbols • Example • Fig. 3.12

  9. Fig. 3.12 (1/3)

  10. Fig. 3.12 (2/3)

  11. Fig. 3.12 (3/3)

More Related