Then, the three-address code for the expression(x=x+3)+4 T1=x+3 Ⅹ=tl T2=t1+4 Can be translated into the following P-code Lda tl Lod x Ldc 3 Adi Lod t1 Sto Lda t2 od t1 dc 4 Adi Sto
• Then, the three-address code for the expression (x=x+3)+4: T1 = x + 3 X = t1 T2 = t1 + 4 • Can be translated into the following P-code: Lda t1 Lod x Ldc 3 Adi Sto Lad x Lod t1 Sto Lda t2 Lod t1 Ldc 4 Adi Sto
If we want to eliminate the extra temporaries then a more sophisticated scheme than pure macro expansion must be used T2+ Ⅹ.t1+
If we want to eliminate the extra temporaries, then a more sophisticated scheme than pure macro expansion must be used. T2 + X, t1 + 4 X 3
Contents Part One 8. 1 Intermediate Code and Data Structure for code Generation 8.2 Basic Code Generation Techniques Part two 8.3 Code generation of data structure reference 8.4 Code generation of Control Statements and logical Expression 8. 5 Code generation of procedure and function calls Other Parts 8.6 Code Generation on Commercial Compilers: Two Case Studies 8.7TM: A Simple Target Machine 8.8 A Code Generator for the tINY Language 8.9 A Survey of Code Optimization Techniques 8.10 Simple Optimizations for TINY Code Generator
Contents Part One 8.1 Intermediate Code and Data Structure for code Generation 8.2 Basic Code Generation Techniques Part Two 8.3 Code Generation of Data Structure Reference 8.4 Code Generation of Control Statements and Logical Expression 8.5 Code Generation of Procedure and Function calls Other Parts 8.6 Code Generation on Commercial Compilers: Two Case Studies 8.7 TM: A Simple Target Machine 8.8 A Code Generator for the TINY Language 8.9 A Survey of Code Optimization Techniques 8.10 Simple Optimizations for TINY Code Generator
8. 3 Code generation of data Structure References
8.3 Code Generation of Data Structure References
8. 3. 1 Address calculations
8.3.1 Address Calculations