Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
system prog new.docx
Скачиваний:
0
Добавлен:
01.05.2025
Размер:
275.7 Кб
Скачать

16. Object modules.

• Entry point table

– List of symbols defined in module.

– Can be referenced by other modules.

– Name plus address.

• External reference table

– List of symbols referenced by the module.

– Are defined in other modules.

– Name plus machine instructions that use this symbol.

• Relocation dictionary

– List of addresses in program that need to be relocated.

Most linkers use two passes of table building and module relocation.

Scheme of object module :

Address Spaces :Each object module has its own address space.

– Starts at address 0.

17. Directive extern.

.extern is accepted in the source program--for compatibility with other assemblers--but it is ignored. treats all undefined symbols as external.Directives are used to identify the same characters in the various program modules using a source module to obtain the final executable program. The format of the directives: extern <list of characters> Example: extern z public k, x1, I The directive extern z means that the symbol z is not determined in this software module and will be determined in another software module, which will be combined with this arrangement. Symbol, announced the directive extern, can also be defined in the command file layout. Broadcaster postpone its calculation to komponovki. Directive public k, x1, i mean that the symbols k, x1, i, the value of which is determined in a given software module will also be used in others. Broadcaster remember their value in the output object module to be used for configuration (otherwise after assigning values ​​to the compiler "forgets" characters).The following is the text of the program, which uses these guidelines.

extern z public k, x1, I x equ 1 +2 t equ Z +3 k equ +7 I equ -7 x1 equ 10 x5 equ t +1 Y equ x1 * t X2 equ z * t X3 equ 5 / z As seen from the example program, unspecified code can be used in expression, but this expression 5 / z cause an error message for transmission (division by 0), since in the general case z may be 0. Therefore, these expressions are not available.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]