here comes a question of a beginner with an ARM cpu and the
I am using uVision 3 v3.21 ARM evaluation
This is my sourcecode, a single assembly file, the only file
in the project. The target is a generic ARM7 cpu, little endian mode.
Plain ARM code, no thumb instructions. (***)
AREA MY_CODE, CODE, AT 0x02003cb8
// strange looking adress, but i have to use it, because this is the
// address in RAM, where a monitor resides and this particular address
// is normally used by a function of the monitor, that i have chosen
// as a hook to bring in my own code-snippets
mov R1, #0x2100000 // beginn 2nd MB of RAM (not used, not protected)
mov R2, #0x2100010 // end of range to fill <<<--- gives errormsg
str R1, [R1], #4 // store current value of R1, incr R1 by 4
cmp R1, R2 // check if end of range to be filled
blt fill_loop // if not, write another word
nop // done.
the error msg is:
ramfill.s(27): error A108: VALUE OUT OF RANGE
strange enough, but it comes even better:
the error msg is glued to the loading of R2.
When i change the lines loading R1 and R2,
the errormsg blames line 26 instead of line 27..
Does the assembler think, that R2 is some kind of an 8bit register?
Please give some advice.
One of the demo projects (hello for LPC2100) does compile in the unchanged
mode of the project (thumb mode), but gives an error when switching to plain
ARM instruction set in project settings.
The error msg in this case is
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
MODULE: F:\KEIL_ARM\ARM\LIB\CAL.LIB (putchar)
DEFINED: .\Obj\Serial.obj (Serial)
*** WARNING L23: UNRESOLVED EXTERNAL SYMBOLS
Program Size: data=1168 const=20 code=270
Target not created
the value 0x2100010 cannot be directly loaded using a MOV (since this must be a 8-bit constant that can be rotated). Instead you must use a memory pool. Use LDR instead, since this translates either to a MOV or to a memory pool instruction.
This should work:
Take a look to the instruction set user's guide for more details.
Problem 2 is discussed in:
View all questions in Keil forum