tailieunhanh - PRINCIPLES OF COMPUTER ARCHITECTURE phần 4

Chú ý rằng có bus nhau bên trong các đường dữ liệu của hình 4-6. Ba xe buýt kết nối các đường dữ liệu vào hệ thống xe buýt. Điều này cho phép dữ liệu được chuyển đến và từ bộ nhớ chính và các tập tin đăng ký. Ba xe buýt thêm kết nối các tập tin đăng ký vào ALU. | CHAPTER 5 LANGUAGES AND THE MACHINE 177 A linkage editor or linker is a software program that combines separately assembled programs called object modules into a single program which is called a load module. The linker resolves all global-external references and relocates addresses in the separate modules. The load module can then be loaded into memory by a loader which may also need to modify addresses if the program is loaded at a location that differs from the loading origin used by the linker. A relatively new technique called dynamic link libraries DLLs popularized by Microsoft in the Windows operating system and present in similar forms in other operating systems postpones the linking of some components until they are actually needed at run time. We will have more to say about dynamic linking later in this section. LINKING In combining the separately compiled or assembled modules into a load module the linker must Resolve address references that are external to modules as it links them. Relocate each module by combining them end-to-end as appropriate. During this relocation process many of the addresses in the module must be changed to reflect their new location. Specify the starting symbol of the load module. If the memory model includes more than one memory segment the linker must specify the identities and contents of the various segments. Resolving external references In resolving address references the linker needs to distinguish local symbol names used within a single source module from global symbol names used in more than one module . This is accomplished by making use of the .global and .extern pseudo-ops during assembly. The .global pseudo-op instructs the assembler to mark a symbol as being available to other object modules during the linking phase. The .extern pseudo-op identifies a label that is used in one module but is defined in another. A . global is thus used in the module where a symbol is defined such as where a subroutine is located

TỪ KHÓA LIÊN QUAN