Code Generation & Register Allocation

Answer & solution
Answer: B (no official key was published)
1. Evaluate E2 first and save its value in a temporary memory location. Then evaluate E1, leaving the required first operand in the sole register, and subtract the saved E2.
2. Evaluating E1 first would require saving it, evaluating/storing E2, then reloading E1 before subtraction. Thus E2-first, B, avoids an extra reload in the stated accumulator-style model, assuming both expressions require evaluation and their order is free of side-effect constraints.
3. Teaching check: The final subtraction needs register=E1 and memory temporary=E2. E2-first naturally reaches that arrangement after one save. E1-first must preserve E1 across E2’s evaluation, then reload it, adding a memory operation. This argument assumes unrestricted evaluation order and nontrivial expression evaluations.