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?
Sory;
You_little_tyrant equ 1 MOV R0,#You_little_tyrant ; No error !!!!
MOV R0,#You_little_tyrant ; No error !!!! You_little_tyrant equ 1
USB_BASE EQU 0x40050000 USB0_CSRL0 EQU 0x102 LDR R1,=USB_BASE LDRB R0,[R1,#USB0_CSRL0] ; No error !!!!
But folowing program produce the error code A1174E !!!!
I think Keil assembler has a bug.
Because folowing error meaningless for the LDRB assembly command.
A1174E: "Data transfer offset 0x00000102 out of range. Permitted values are 0x00..0x1F"
Isnt it Tamir ?
Are you going to read the assembler manual anytime soon or what?!
So sorry i forget to said "I use cortex m3 family".
Find out and think about the differences between these two instructions below and what a two pass assembler is faced with in the two situations above.
LDRB.N R0,[R1,#USB0_CSRL0] LDRB.W R0,[R1,#USB0_CSRL0]
I know the differences of .N and .W suffix. Limits of the immediate offset of the cortex m3 LDR command can not be between the 0x00 and 0x1F. Therefore assembler gives wrong error.