Panasonic PanaXSeries MN1030 Series User Manual page 64

Panasonic microcomputer user's manual
Table of Contents

Advertisement

Chapter 4 Optimization
Table 4-8 Substituted Instructions For Out-Of Range Conditional Branch Instructions
Source Instruction
BLT LABEL
BGT LABEL
BGE LABEL
BLE LABEL
BCS LABEL
BHI LABEL
BCC LABEL
BLS LABEL
BEQ LABEL
BNE LABEL
BVC LABEL
BVS LABEL
BNC LABEL
BNS LABEL
Optimization of branches
For unconditional branch instructions, a JMP label instruction is replaced by a BRA label instruction if
the jump target is within the range available for the shorter, relative branch instruction BRA. Similarly,
a CALL label, CALLS label, or JSR label instruction is replaced by the shorter version with a 16-bit
displacement (d16,PC) instead of the one with the 32-bit displacement (d32,PC).
The following table shows the possibilities for optimizing the unconditional branch instructions and the
subroutine call instructions.
Source Instruction
BRA label
JMP label
CALL label
CALLS label
JSR label
52 Usage Example
Candidate instruction 1
BRA LABEL
BGT LABEL
BGE LABEL
BLE LABEL
BCS LABEL
BHI LABEL
BCC LABEL
BLS LABEL
BEQ LABEL
BNE LABEL
BVC LABEL
BVS LABEL
BNC LABEL
BNS LABEL
Table 4-9 Optimization of branches
First Candidate
BRA label
BRA label
CALL label
CALLS label
JSR label
Candidate instruction 2
BGE *+5
JMP LABEL
BLE *+5
JMP LABEL
BLT *+5
JMP LABEL
BGT * +5
JMP LABEL
BCC *+5
JMP LABEL
BLS *+5
JMP LABEL
BCS *+5
JMP LABEL
BHI *+5
JMP LABEL
BNE *+5
JMP LABEL
BEQ *+5
JMP LABEL
BVS *+6
JMP LABEL
BVC *+6
JMP LABEL
BNS *+6
JMP LABEL
BNC *+6
JMP LABEL
Second Candidate
JMP label
JMP label
CALL label
CALLS label
JSR label
Candidate instruction 3
BGE *+7
JMP LABEL
BLE *+7
JMP LABEL
BLT *+7
JMP LABEL
BGT *+7
JMP LABEL
BCC *+7
JMP LABEL
BLS *+7
JMP LABEL
BCS *+7
JMP LABEL
BHI *+7
JMP LABEL
BNE *+7
JMP LABEL
BEQ *+7
JMP LABEL
BVS *+8
JMP LABEL
BVC *+8
JMP LABEL
BNS *+8
JMP LABEL
BNC *+8
JMP LABEL
Third Candidate
JMP label
JMP label

Advertisement

Table of Contents
loading

Table of Contents