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
  • 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 !!!!

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

    USB_BASE EQU 0x40050000
    USB0_CSRL0 EQU 0x102

    I think Keil assembler has a bug.

    Because folowing error meaningless for the LDR assembly command.

    A1174E: "Data transfer offset 0x00000102 out of range. Permitted values are 0x00..0x1F"

    Isnt it Tamir ?

Reply
  • 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 !!!!

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

    USB_BASE EQU 0x40050000
    USB0_CSRL0 EQU 0x102

    I think Keil assembler has a bug.

    Because folowing error meaningless for the LDR assembly command.

    A1174E: "Data transfer offset 0x00000102 out of range. Permitted values are 0x00..0x1F"

    Isnt it Tamir ?

Children