jagomart
digital resources
picture1_Machine Language Pdf 189061 | Assembler


 138x       Filetype PDF       File size 0.15 MB       Source: cs.gmu.edu


File: Machine Language Pdf 189061 | Assembler
assemblers linkers loaders c program translation hierarchy compiler assembly language program assembler object machine language module object library routine machine language linker executable machine language program loader memory 1 translation ...

icon picture PDF Filetype PDF | Posted on 03 Feb 2023 | 2 years ago
Partial capture of text on file.
                                                      Assemblers, Linkers & Loaders
                                                    C program                          Translation Hierarchy
                                                              Compiler
                                                              Assembly language program
                                                                               Assembler
                                                                       Object: Machine language module   Object: Library routine (machine language) 
                                                                                                   Linker
                                                                                             Executable: Machine language program
                                                                                                                     Loader
                                                                                                                              Memory
                                                                                                                                                                                     1
                       Translation Hierarchy
                  • Compiler
                    – Translates high-level language program into 
                     assembly language (CS 440)
                  • Assembler 
                    – Converts assembly language programs into 
                     object files
                      • Object files contain a combination of machine 
                       instructions, data, and information needed to place 
                       instructions properly in memory
                            Assemblers
                  • Assemblers need to 
                    – translate assembly instructions and pseudo-instructions 
                     into machine instructions
                    – Convert decimal numbers, etc. specified by 
                     programmer into binary
                  • Typically, assemblers make two passes over the 
                   assembly file
                    – First pass: reads each line and records labels in a 
                     symbol table
                    – Second pass: use info in symbol table to produce actual 
                     machine code for each line
                                                              2
                                                                       Object file format
                                                     Object file        Text           Data         Relocation       Symbol        Debugging
                                                       header        segment         segment       information        table       information
                                                  •   Object file header describes the size and position of the 
                                                      other pieces of the file
                                                  •   Text segment contains the machine instructions
                                                  •   Data segment contains binary representation of data in 
                                                      assembly file
                                                  •   Relocation info identifies instructions and data that depend 
                                                      on absolute addresses
                                                  •   Symbol table associates addresses with external labels and 
                                                      lists unresolved references
                                                  •   Debugging info
                                                             Process for producing an 
                                                                           executable file
                                              Source               Assembler                Object
                                                 file                                         file
                                              Source               Assembler                Object                 Linker               Executable
                                                 file                                         file                                          file
                                              Source               Assembler                Object                Program
                                                 file                                         file                 library
                                                                                                                                                                               3
                                                                                    Object file
                                                                                       sub:
                                                                                           ·
                                                             Object file                   ·                                    Executable file
                                               Instructions    main:                       ·                                      main:
                                                                 jal ???                                                            jal printf
                                                                   ·                                                                  ·
                                                                   ·                                                                  ·
                                                                   ·                                                                  ·
                                                                 jal ???                                                            jal sub
                                                                                                       Linker                     printf:
                                               Relocation      call, sub                                                              ·
                                               records         call, printf                                                           ·
                                                                                                                                      ·
                                                                                                                                  sub:
                                                                              Clibrary                                                ·
                                                                                                                                      ·
                                                                                 print:                                               ·
                                                                                        ·
                                                                                        ·
                                                                                        ·
                                                                                         Linker 
                                                   • Tool that merges the object files produced by 
                                                       separate compilation or assembly and creates an 
                                                       executable file
                                                   • Three tasks
                                                        – Searches the program to find library routines used by 
                                                            program, e.g. printf(), math routines,…
                                                        – Determines the memory locations that code from each 
                                                            module will occupy and relocates its instructions by 
                                                            adjusting absolute references
                                                        – Resolves references among files
                                                                                                                                                                                     4
The words contained in this file might help you see if this file matches what you are looking for:

...Assemblers linkers loaders c program translation hierarchy compiler assembly language assembler object machine module library routine linker executable loader memory translates high level into cs converts programs files contain a combination of instructions data and information needed to place properly in need translate pseudo convert decimal numbers etc specified by programmer binary typically make two passes over the file first pass reads each line records labels symbol table second use info produce actual code for format text relocation debugging header segment describes size position other pieces contains representation identifies that depend on absolute addresses associates with external lists unresolved references process producing an source sub main jal printf call clibrary print tool merges produced separate compilation or creates three tasks searches find routines used e g math determines locations from will occupy relocates its adjusting resolves among...

no reviews yet
Please Login to review.