Panasonic PanaXSeries MN1030 Series User Manual page 68

Panasonic microcomputer user's manual
Table of Contents

Advertisement

Chapter 4 Optimization
Example: branch destination of conditional branch instruction out of range
This example shows a branch outside the permitted range (-128 to +127 of PC) of a BCC LABEL con-
ditional branch instruction.
The source list is as follows.
_TEXT
sub_func
addr_set
func_end
The final list file after assembly is shown next. LABEL exceeds the permitted branch range of BCC LA-
BEL, so the code has been converted to BCS *+5, JMP LABEL. Note that the mnemonics and object
code are different.
***
Loc
Object
40000000
40000000
8A00
40000002
A6
40000003
C405CC0080
40000083
40000083
F0FC
***
Symbol
Table
40000000
40000003
40000083
56 Usage Example
opt
section
mov
cmp
bcc
org
rts
end
opt2.lst Page 1
PanaX series Series MN1030 Cross Assembler
Line
Source
1
2
_TEXT
3
sub_func
4
5
@6
addr_set
7
8
9
func_end
10
11
12
opt2.lst Page 2
***
T
sub_func
T
addr_set
T
func_end
on
CODE, PUBLIC,1
0, D2
D1, D2
func_end
addr_set+128
***
opt
on
section CODE, PUBLIC, 1
mov
0, D2
cmp
D1, D2
bcc
func_end
org
addr_set+128
rts
end

Advertisement

Table of Contents
loading

Table of Contents