计算机组成结构化方法7
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 The Assembly Language Level Chapter 7 Why Use Assembly Language? Comparison of assembly language and high-level language programming, with and without tuning. Format of an Assembly Language Statement (1) Computation of N = I + J. (a) Pentium 4. Format of an Assembly Language Statement (2) Computation of N = I + J. (b) Motorola 680x0. Format of an Assembly Language Statement (3) Computation of N = I + J. (c) SPARC. Pseudoinstructions (1) Some of the pseudoinstructions available in the Pentium 4 assembler (MASM). Pseudoinstructions (2) Some of the pseudoinstructions available in the Pentium 4 assembler (MASM). Macro Definition, Call, Expansion (1) Assembly language code for interchanging P and Q twice. (a) Without a macro. (b) With a macro. Macro Definition, Call, Expansion (2) Comparison of macro calls with procedure calls. Macros with Parameters Nearly identical sequences of statements. (a) Without a macro. (b) With a macro. Two Pass Assemblers (1) The instruction location counter (ILC) keeps track of the address where the instructions will be loaded in memory. In this example, the statements prior to MARIA occupy 100 bytes. Two Pass Assemblers (2) A symbol table for the program of Fig. 7-7. Two Pass Assemblers (3) A few excerpts from the opcode table for a Pentium 4 assembler. Pass One (1) Pass one of a simple assembler. Pass One (2) Pass one of a simple assembler. Pass One (3) Pass one of a simple assembler. Pass Two (1) Pass two of a simple assembler. Pass Two (2) Pass two of a simple assembler. The Symbol Table (1) Hash coding. (a) Symbols, values, and the hash codes derived from the symbols. The Symbol Table (2) Hash coding. (b) Eight-entry hash table with linked lists of symbols and values. Linking and Loading Generation of an executable binary program from a collection of independently translated source proce