| OCR Text |
Show 39 An exception is the "Z_ bar" condition code setting. The C convention for boolean values is that a zero integer value is "fa lse" and all nonzero integers are "true." This is precisely the opposite of the definition of the MC68020 "Z" condition code setting. All nonzero results cause Z to be set to fa lse, and only a result of zero causes Z to be set to true. The C expression necessary to set the Z condition code compiled into a minimum of six host (VAX) instructions. However, by defining "Z_ bar" to be the complement of the Z condition code, the setting could be minimized to a single host instruction . The conditional tests that use the Z flag are modeled using Z bar, logically complemented as necessary. The expressions for setting the "C" and "V" condition codes are particularly complicated since these codes depend not only on the most significant bit of the result but on most significant bits of the destination and source as well . The identifier msb I is defined as the hexidecimal value 80000000. This is used to mask the most significant bit of the longword values. The scratch register reg.t1.1 is used to hold the result to be used in setting the condition codes. As can be seen, much of the simulation overhead is due to condition code setting. However, much of the condition code setting is unnecessary, since only a few settings affect the conditional instru.ctions. Removing redundant condition code settings can significantly reduce simulation overhead. This is discussed in greater detail in Chapter 4. 3.2.6.5 The JMP instruction. The JMP (unconditional jump) instruction is modeled in a natural fashion by a goto statement. The modeling strategy relies on the fact that branch target operands generated by compiler are always "normal" operands. In other words, they are references to labels in the assembler program text. When the decompiler encounters labels in the assembler text, code is generated to "#define" them to the current "location counter" label. As an example, assume that the following assembler instructions are part of the 68020 assembler program that is being modeled: |