Asemler
Páginas: 398 (99426 palabras)
Publicado: 17 de agosto de 2012
Preface Introduction A Short History of Assemblers and Loaders Types of Assemblers and Loaders 1 Basic Principles
1.1 Assembler Operation 1.1.1 The source line 13 13 20 24 28 30
xi 1 7 11 13
1.2 The Two-Pass Assembler 1.3 The One-Pass Assembler
1.4 Absolute and Relocatable Object Files 1.4.1 Relocation bits 29 1.4.2 One-pass, relocatable object files 1.4.3 The task ofrelocating 31 1.5 Two Historical Notes 32 1.5.1 Early relocation 32 1.5.2 One-and-a-half pass assemblers 1.6 Forcing Upper 33 1.6.1 Relocating packed instructions
32 34
vi Contents
1.7 Absolute and Relocatable Address Expressions 1.7.1 Summary 36 1.8 Local Labels 36 1.8.1 The LC as a local symbol 38 1.9 Multiple Location Counters 39 1.9.1 The USE directive 39 1.9.2 COMMON blocks 41 1.10Literals 43 1.10.1 The literal table 43 1.10.2 Examples 44 1.11 Attributes of Symbols 45 1.12 Assembly-Time Errors 46 1.13 Review Questions and Projects 49 1.13.1 Project 1–1 50 1.13.2 Project 1–2 52 1.13.3 Project 1–3 53 1.13.4 Project 1–4 54
35
2 The Symbol Table
2.1 2.2 2.3 2.4 2.5 A Linear Array 60 A Sorted Array 60 Buckets with Linked Lists 61 A Binary Search Tree 62 A Hash Table 63 2.5.1Closed hashing 63 2.5.2 Open hashing 65 2.6 Review Questions and Projects 2.6.1 Project 2–1 66 2.6.2 Project 2–2 66 2.6.3 Project 2–3 67
59
66
3 Directives
3.1 Introduction 69 3.2 Program Identification Directives 73 3.3 Source Program Control Directives 74 3.4 Machine Identification Directives 76 3.5 Loader Control Directives 77 3.6 Mode Control Directives 77 3.7 Block Control & LCDirectives 79 3.8 Segment Control Directives 85 3.9 Symbol Definition Directives 86 3.10 Base Register Definition Directives 89
69
Contents
vii
3.11 Subprogram Linkage Directives 90 3.12 Data Generation Directives 93 3.13 Macro Directives 99 3.14 Conditional Assembly Directives 99 3.15 Micro Directives 99 3.15.1 micro substitution 100 3.16 Error Control Directives 100 3.17 Listing ControlDirectives 101 3.18 Remote Assembly Directives 103 3.19 Code Duplication Directives 104 3.20 Operation Definition Directives 105 3.21 OpCode Table Management Directives 3.22 Summary 107 3.23 Review Questions and Projects 108 3.23.1 Project 3–1 108 3.23.2 Project 3–2 108
106
4 Macros
4.1 Introduction 109 4.1.1 The Syntax of macro definition and expansion 112 4.2 Macro Parameters 114 4.2.1 Propertiesof macro parameters 116 4.3 Operation of Pass 0 121 4.4 MDT Organization 122 4.4.1 The REMOVE directive 123 4.4.2 Order of search of the MDT 123 4.5 Other Features of Macros 124 4.5.1 Associating macro parameters with their arguments. 4.5.2 Delimiting macro parameters 125 4.5.3 Numeric values of arguments 125 4.5.4 Attributes of macro arguments 125 4.5.5 Directives related to arguments 126 4.5.6Default arguments 127 4.5.7 Automatic label generation 127 4.5.8 The IRP directive 128 4.5.9 The PRINT directive 129 4.5.10 Comment lines in macros 129 4.6 Nested Macros 130 4.6.1 Nested macro expansion 130 4.7 Recursive Macros 133 4.8 Conditional Assembly 134 4.8.1 Global SET symbols 139
109
124
viii Contents
4.8.2 Array SET symbols 140 4.9 Nested Macro Definition 141 4.9.1 Thetraditional method 144 4.9.2 Revesz’s method 146 4.9.3 A note 154 4.10 Summary of Pass 0 154 4.11 Review Questions and Projects 156 4.11.1 Project 4–1 157 4.11.2 Project 4–2 157
5 The Listing File
5.1 5.2 5.3 5.4 5.5 A 6800 Example 160 A VAX Example 164 A MASM Example 169 An MPW Example 172 Review Questions and Projects 5.5.1 Project 5–1 175
159
175 177
6 Special Assembler Types
6.1High-Level Assemblers 177 6.1.1 NEAT/3 178 6.1.2 PL360 181 6.1.3 PL516 183 6.1.4 BABBAGE 184 6.2 Summary 186 6.3 Meta Assemblers 186 6.4 Disassemblers 189 6.5 Cross Assemblers 193 6.6 Review Questions and Projects 6.6.1 Project 6–1 194
194 195
7 Loaders
7.1 Assemble-Go Loaders 196 7.2 Absolute Loaders 198 7.3 Linking Loaders 199 7.4 The Modify Loader Directive 7.5 Linkage Editors 211 7.6...
Leer documento completo
Regístrate para leer el documento completo.