| OCR Text |
Show 35 3.2.5.7 Immediate. Immediate addresses are recognized in the assembler code as "#value," where "value" is either a constant or label that has been equated to a constant. To simplify the modeling of immediate values, the decompiler passes the assembler code through a filter that resolves the equated labels into their numeric values. This allows the decompiler to simply strip off the "#" prefix and pass the numeric value unchanged into the C program. 3.2.5.8 Normal. The normal addressing mode is not properly a machine addressing mode, but is an artifact of the assembler. However it is an important mode that is frequently generated by the HLL compiler and must be handled correctly by the decompiler. Essentially, a normal operand is an identifier. The identifier may be associated with either a data location or a program text location. Each case must be handled differently by the decompiler. Whether the identifier refers to data or text can be determined by the context of the operand. If it is used as the target of a jump instruction then it is manifestly a reference to the program text. Otherwise is is assumed to be a data reference.'' Jump targets are passed through "as is ." For more details on how jump target identifiers are used, refer to the representative jump instruction in section 3.2.6. Identifiers that reference data locations require the addition of a prefix. Recall from section 3.2.4 that assembler labels associated with data areas are "#defined" as offsets from the base pointer variable vars. For example, assume that the label LLO has been defined as (vars + 20). This means that if the label is generated unchanged in the C program it will be "macroexpanded" into exactly (vars + 20). However, this is a pointer value, and the context demands a pointer reference. Also the instruction mode will dictate what sort of an object is to be returned . Assuming that the instruction mode is longword, the operand generated would be: *(I *)LLO. * This assumption may seem trivial, however a limitat ion of d irect execution methodology is lurking here. The methodology cannot model the execution of se lf-mod ify ing code. Of the various limitations of the methodology this surely has to be the least important. |