Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

'Hello World' ARM assembly on Keil

Status
Not open for further replies.

ivar

Junior Member level 1
Junior Member level 1
Joined
Jun 29, 2008
Messages
18
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,418
arm asm hello world

I want to simulate the below ARM assembly program on uvision3:
Code:
AREA HelloW, CODE, READONLY
SWI_WriteC EQU &0
SWI_Exit EQU &11

ENTRY
START ADR r1,TEXT
LOOP  LDRB r0,[r1],#1
          CMP r0,#0
          SWINE SWI_WriteC
          BNE LOOP
          SWI SWI_Exit
TEXT  = "Hello,World!",&0a,&0d,0
          END



The target is LPC2129 but i just want to run it on the simulator. The problem is when i use the default startup.s file, i get the following error on build:
Build target 'Target 1'
linking...
HelloWorld.axf: Warning: L6665W: Neither Lib$$Request$$armlib Lib$$Request$$cpplib defined, not searching ARM libraries.
HelloWorld.axf: Error: L6218E: Undefined symbol __main (referred from startup.o).
HelloWorld.axf: Error: L6218E: Undefined symbol __use_two_region_memory (referred from startup.o).
Target not created



If i try to build the source without the startup, i get the following error:
Build target 'Target 1'
assembling Main.S...
linking...
HelloWorld.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST.
"HelloWorld.axf" - 1 Error(s), 0 Warning(s).


My questions:
1)Should i include the startup.s file eventhough i only want to simulate the code on KEIL
2)Any inputs on how i can remove the errors appearing above
 

l6236e

Do you only have two source files in your project? startup.s and <hello>.s?
startup.s makes reference to external symbols, after it does the initial setup it branches main, so a function by that name should be in one of the source files.

To resolve the main symbol, create a C file with int main() / void main() or add a new assembler subroutine called main that just loops.

As for the other symbol I'm not sure, perhaps look at the reference project where you picked startup.s from. I might be a #define or EQU constant that is missing.

- Jayson
 

arm assembler hello world

You can't use the semihosting SWI calls in the uVision debugger. Take out the SWI instructions and change the AREA sectionname to RESET and your code will build and run in the debugger. You'll see R0 getting loaded and compared, not very interesting but a sort of 'Hello World' I suppose.
Code:
      AREA  RESET, CODE, READONLY 
      ENTRY
      ADR   r1, TEXT
LOOP  LDRB  r0, [r1], #1
      CMP   r0, #0
      BNE   LOOP
      B     .
TEXT = "Hello World!", &0a, &0d, 0
      END
You don't need the startup.s file.
 
Re: arm assembler hello world

You can't use the semihosting SWI calls in the uVision debugger. Take out the SWI instructions and change the AREA sectionname to RESET and your code will build and run in the debugger. You'll see R0 getting loaded and compared, not very interesting but a sort of 'Hello World' I suppose.
Code:
      AREA  RESET, CODE, READONLY 
      ENTRY
      ADR   r1, TEXT
LOOP  LDRB  r0, [r1], #1
      CMP   r0, #0
      BNE   LOOP
      B     .
TEXT = "Hello World!", &0a, &0d, 0
      END
You don't need the startup.s file.

thankyou......
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top