11.10.1 Unnecessary Loads

11.10.2 Branch (to a) (around a) Branch

11.10.3 Cross Jumping

11.10.4 Recognizing Special Instruction or Modes

11.10.3 Cross-Jumping

IF-THEN-ELSE statements often produce almost duplicate code within the THEN and ELSE clauses. Consider the following:

    IF Condition THEN

      A[I]:=x+1

    ELSE

      A[I]:=y+1

The output code differs by only 1 load. We can perform that load and then execute the rest of the instructions: ADDing 1 and assigning to A[1]. This can be seen pictorially where test is the code for the condition:

In the right-most picture the identical code is written only once.