8.22.2 Instruction expansion
When as
encounters an instruction with an operand that is either not known or does not fit the operand size of the instruction, as
(and ld
) will expand the instruction into a sequence of instructions semantically equivalent to the operand fitting the instruction. Expansion will take place for the following instructions:
- GETA
- Expands to a sequence of four instructions:
SETL
,INCML
,INCMH
andINCH
. The operand must be a multiple of four.
- Conditional branches
- A branch instruction is turned into a branch with the complemented condition and prediction bit over five instructions; four instructions setting
$255
to the operand value, which like withGETA
must be a multiple of four, and a finalGO $255,$255,0
.
- PUSHJ
- Similar to expansion for conditional branches; four instructions set
$255
to the operand value, followed by aPUSHGO $255,$255,0
.
- JMP
- Similar to conditional branches and
PUSHJ
. The final instruction isGO $255,$255,0
.
The linker ld
is expected to shrink these expansions for code assembled with --relax (though not currently implemented).