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?
If the offset is limited to 0x00 to 0x1f does depend on a couple of things, doesn't it?
For example what chip you have, or what mode you are assembling (not compiling) for. Have you maybe seen the limit 0 to 31 somewhere in any instruction set descriptions?
By the way - when you did decide that the assembler had a bug - did you check what the produced op code result was from your source code?
@Per Westermark
My processor is CM3. Limits of Immediate ofset mode of the LDR command are -255 to 4095.
Therefore i think Keil assembler gives a wrong error message.