Panasonic PanaXSeries MN1030 Series User Manual page 62

Panasonic microcomputer user's manual
Table of Contents

Advertisement

Chapter 4 Optimization
Optimization processing of conditional branch instructions
The linker resolves address values for labels when linking multiple files. In the example below, the
linker will determine whether or not the label coded as an operand is within the allowable range of the
current instruction. If not in range, the linker will replace it with instructions for a wider branch range.
Take the BEQ instruction for example.
LABEL
The destination label of the BEQ instructions must be in the range -128 to +127. However, the
assembler cannot make that determination, so the following determinations are made during assembly
and linking.
Assembler processing
The assembler outputs information about instructions to be optimized to the linker.
Linker processing
1. The linker inputs information from the assembler.
2. The linker determines if the branch destinations of conditional branches are in range.
3. If determined to be in range, the linker generates the normal code.
4. If determined to be not in range, the linker will substitute code that can branch correctly.
The substitution for the above example would be as follows.
LABEL
50 Usage Example
BEQ
LABEL
......
BNE
*+5
JMP
LABEL
......

Advertisement

Table of Contents
loading

Table of Contents