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?
www.milinkito.com/.../bart.php
Why? You're not listening to anything that anyone tells you anyhow.
You still don't understand the difference between an Assembler and a Compiler. Understanding & paying attention to subtle distinctions like that is absolutely fundamental if you want to be an Assembly programmer.
If you consider such details too trivial for you to bother with, then Assembly programming is not for you.
My first message wrong written.
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
USB_BASE EQU 0x40050000 USB0_CSRL0 EQU 0x102 LDR R1,=USB_BASE LDRB R0,[R1,#USB0_CSRL0] ; No error !!!!
What is wrong in first one which gives error?
----------------------------------------
Could you please answer my question, and discuss yours anywhere else.
... and writing in Assembly is, by definition, hard work.
It remains a mystery why he insists on struggling with assembly; he clearly isn't going to outsmart a compiler any time soon - so why not just use 'C' ?!
It comes down to this - the OP, just like so many of his kind that land here, does not want to work hard. He wants somebody to give him a one-liner, no-brainer solution to solve his problem. There will be more of them.
"As I said before, you really should read up on the fundamentals of the ARM core."
And not hurtful to also check out the differences between classical ARM instructions, and Thumb or Thumb-2 instructions.
Andy is (once again) absolutely correct - Why do you not take note of the responses you receive?
"What is wrong?"
As the assembler reports, the offset is out of range. It is even helpful enough to tell you what the acceptable range is.
So ... The reason the assembler is rejecting your code is because it is invalid.
As I said before, you really should read up on the fundamentals of the ARM core.
You are using the Assembler - not the Compiler!
You need to take that course - see: http://www.keil.com/forum/18423
View all questions in Keil forum