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

Immediate offset problem with the LDR commands

Compiler give error message for following codes.
A1174E: "Data transfer offset 0x00000102 out of range. Permitted values are 0x00..0x1F"

    LDR   R1,=USB_BASE
    LDRB  R0,[R1,#USB0_CSRL0] ; Error code is A1174E !!!!

USB_BASE   EQU 0x40050000
USB0_CSRL0 EQU 0x102

But compiler dont give any error if i write this program thats way

USB_BASE   EQU 0x40050000
USB0_CSRL0 EQU 0x102

    LDR   R1,=USB_BASE
    LDRB  R0,[R1,#USB0_CSRL0] ; Error code is A1174E !!!!

What is wrong?

Parents
  • Or the implications of an assembler that always selects the biggest instruction "just in case".

    An interesting thing here - why would an assembler even have the option to specify if narrow or wide instructions should be used if the assembler always iterated through the complete set of instructions until it found the "optimum" instruction sizes? And how would that affect a developer who expects to be able to count bytes in relation to cache lines or machine cycles when trying to write the optimal loop?

    The OP tries, yet again, to explain the problem, so he is still convinced that he is the only one who sees a problem while everyone else haven't even noticed what the debate is about.

    It's this view (that he is the only one with "the view") that keeps the OP in a constant output-only mode - always trying to argue his case without spending any time looking at other peoples posts. When the world and his view differs, the error is with the world since he sees the ladder of knowledge as finite, and him already on the top rung.

Reply
  • Or the implications of an assembler that always selects the biggest instruction "just in case".

    An interesting thing here - why would an assembler even have the option to specify if narrow or wide instructions should be used if the assembler always iterated through the complete set of instructions until it found the "optimum" instruction sizes? And how would that affect a developer who expects to be able to count bytes in relation to cache lines or machine cycles when trying to write the optimal loop?

    The OP tries, yet again, to explain the problem, so he is still convinced that he is the only one who sees a problem while everyone else haven't even noticed what the debate is about.

    It's this view (that he is the only one with "the view") that keeps the OP in a constant output-only mode - always trying to argue his case without spending any time looking at other peoples posts. When the world and his view differs, the error is with the world since he sees the ladder of knowledge as finite, and him already on the top rung.

Children
No data