ARM Technical Support Knowledge Articles

INLINE ASSEMBLY GENERATES TARGET OUT OF RANGE

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

I have added a complex in-line assembly function to my C source file, but I am now getting the following error:

error A51: TARGET OUT OF RANGE

Is this a compiler problem?

ANSWER

No, it is definitely not a compiler problem, but an issue of your source code. You are very likely getting this error on a short JMP instruction (SJMP, JNZ, JZ, CJNE, JC, DJNZ). TARGET OUT OF RANGE indicates that the address specified in the instruction cannot be reached by this instruction.

You may solve this problem with a small change in your source code. For example, when the following instruction generates the error A51: TARGET OUT OF RANGE:

       JNZ     label

You may just re-write this code with:

       JZ      Hlabel
       JMP     label
Hlabel:

MORE INFORMATION

SEE ALSO

Article last edited on: 2005-07-15 11:49:53

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential