 Question:
Why does my function call fail in a branch ?
Answer: The branch instructions
BR
BRD
CALL
RPTB
RPTBD
LAJ
Bcond
BcondAF
BcondAT
BcondD
CALLcond
DBcond
DBcondD
LAJcond
LATcond
RETIcond
RETIcondD
RETScond
etc
have either 16 or 24-bit displacement fields (+/- 32K or +/- 8M
words, respectively). In most cases, the compiler
uses the conditional branches with 16-bit offset.
One way to fix this is to use a function pointer to
call the function. This will use the register
addressing mode rather than the PC-displacement addressing mode. |