XVII - 11
Chapter 17 Flash EEPROM
On-board Serial Interface Programming Mode
Branch instruction for branching to vector service subroutine
Do not use optimization of subroutine call instruction.
Inserting following program disables optimization in user program.
Optimization of subroutine call instruction
When there are many subroutine call instructions, the linker replaces 16 subroutine call instructions in
sequence by vector indirect subroutine call instruction. Normally, optimization covers all JSR instruc-
tions, but you can control whether or not to replace by indirect subroutine call instruction using vecton/
vectoff pseudo instruction. Replacement by vector indirect subroutine call instruction is conducted only
when the function is accessed more than three times. If there are several subroutine calls with the same
number of access for the sixteenth function, the one with the largest address will be replaced by indirect
subroutine call instruction.
vecton
jsr
vecton
dummy1
dummy2
dummy1
dummy2
dummy1
dummy2
dummy15
dummy16
dummy15
dummy16
dummy15
dummy16
nop
Number of JSR instruction access is counted in static program search.
When JSR instruction is used inside a loop, if it is described only once, the number of access
by linker is counted as 1 even though dynamic access is repeated several times.
Vectron pseudo instruction is effective only for function calls stated in lines below it.
Vectron pseudo instruction
Vectron pseudo instruction uses the assembler and linker optimization function to perform auto selection
of vector indirect subroutine call istruction. For JSR instruction, which access the function specified by
the vectron pseudo instruction, it does not perform automatic selection of vector indirect subroutine call
istruction, but always generates vector indirect subroutine call instruction.
Vectron pseudo instruction functions independently of opt pseudo instruction and -Od option.