CONTENTS
5
3 Machine-Level Representation of C Programs 89
3.1 AHistoricalPerspective .................................... 90
3.2 ProgramEncodings....................................... 92
3.2.1 Machine-LevelCode.................................. 93
3.2.2 CodeExamples..................................... 94
3.2.3 A Note on Formatting ................................. 97
3.3 DataFormats .......................................... 98
3.4 Accessing Information . . . .................................. 99
3.4.1 OperandSpecifiers...................................100
3.4.2 DataMovementInstructions..............................102
3.4.3 DataMovementExample................................103
3.5 Arithmetic and Logical Operations . . . ............................105
3.5.1 LoadEffectiveAddress.................................106
3.5.2 UnaryandBinaryOperations .............................106
3.5.3 ShiftOperations ....................................107
3.5.4 Discussion .......................................108
3.5.5 Special Arithmetic Operations . ............................109
3.6 Control .............................................110
3.6.1 Condition Codes . . ..................................110
3.6.2 Accessing the Condition Codes ............................111
3.6.3 JumpInstructionsandtheirEncodings.........................114
3.6.4 TranslatingConditionalBranches ...........................117
3.6.5 Loops . . . .......................................119
3.6.6 SwitchStatements ...................................128
3.7 Procedures............................................132
3.7.1 StackFrameStructure .................................132
3.7.2 Transferring Control ..................................134
3.7.3 RegisterUsageConventions ..............................135
3.7.4 ProcedureExample...................................137
3.7.5 RecursiveProcedures..................................140
3.8 Array Allocation and Access ..................................142
3.8.1 BasicPrinciples.....................................143
3.8.2 Pointer Arithmetic . ..................................144
评论1
最新资源