This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

error: A1898E

I placed a table in the first file of my project:

                    EXPORT  TaskBranchTable
                    ...
TaskBranchTable     DCD     Main
                    DCD     Task1
                    DCD     Task2
                    DCD     Task3

I wroted next code in another file of this project:

                    IMPORT  TaskBranchTable
                    ...
                    ADR     R1, TaskBranchTable
                    LDR     R0, [R1]
                    BX      R0

Keil shows me error: "A1898E: Target cannot be relocated. No suitable relocation exists for this instruction"?
How to write a program so that the error did not occur? Which Directive to use correctly?

Of course you can write in the following form and the error will disappear:

                    IMPORT  TaskBranchTable
                    ...
                    LDR     R1, =TaskBranchTable
                    LDR     R0, [R1]
                    BX      R0


But "LDR R0, =label" pseudo instruction writes a 1 in the least significant bit.