Chapter 4 Optimization
Usage Example 57
Example: unconditional branch instruction converted to relative branch
This example shows the branch destination of a JMP LABEL unconditional branch instruction within
the permitted range (-128 to +127 of PC) for relative branching.
The source list is as follows.
The final list file after assembly is shown next. The branch destination of the JMP LABEL instruction
on line number 4 is in the permitted range for relative branching, so it has been converted to BRA LA-
BEL. Note that the mnemonics and object code are different.
opt on
_TEXT section CODE, PUBLIC,1
sub_func
addr_set jmp func_end
org addr_set+127
fun_end end
opt3.lst Page 1
*** PanaX series Series MN1030 Cross Assembler ***
Loc Object Line Source
1 opt on
2 _TEXT section CODE, PUBLIC, 1
40000000 3 sub_func
40000000 CA7F @4 addr_set jmp func_end
5
6 org addr_set+127
4000007f 7 func_end
4000007f F0FC 8 rts
9 end
opt3.lst Page 2
*** Symbol Table ***
40000000 T sub_func
40000000 T addr_set
4000007f T func_end