| OCR Text |
Show 25 The behavioral model first compiles the HLL program into the target machine assembler, and then decompiles the assembler into a behaviorally equivalent C program. The compilation of the HLL program into target assembler code is done by a conventional compiler in the usual way. 3.2.1 Decompilation Decompilation is conceptually simple. A target assembler program is the input to the decompiler and a HLL program that performs the same computation is output. Registers, data locations and other components of the machine state are modeled as HLL variables. The target machine instructions are modeled by HLL statements that act on the HLL variables in a manner similar to the target machine. In many cases, only a single HLL assignment statement is necessary to model a machine instruction. Decompilation explicitly preserves the target machine state that may be needed for accurate timing analysis. Moreover, the granularity of the HLL statements is the same as the granularity of the target machine instructions. The HLL program is translated into directly executable code for the host processor by a conventional HLL compiler. The C programming language [20] was chosen as the decompilation destination language.* A combination of factors led to the choice of C: * 1. It is compatible with the Simon System. This allows the processor model to be linked into Simon with a minimum of effort. 2. It supports bit and bit-field operators and types. 3. It allows postincrement and predecrement addressing modes (among others). 4. It supports pointer arithmetic and the explicit conversion of pointer and integer types. 5. It has a "goto" statement. The C language was also used to implement large portions of the program that actually performed the decompilation . This was an independent decision, and should not be confused with the choice of C as the destination language. |