Monday, December 14, 2009

Success!

Just a brief update tonight.

After going over the startup.s file for the TI chip some more, I read up on EXPORT and IMPORT. I decided to take another run at HelloWorld. If you remember, when I tried to just create a standalone project, it ran into memory management issues because there was no scatter file. If I used a technology with a Keil-generated start up file, it didn't seem to run my code.

What I needed to do, then, was use EXPORT and IMPORT to call my code from the generated code. I read up on the syntax, started a new project, and copied/added one of my HelloWorld.s samples from before to the new project.

I had to futz around with breakpoints a little to be sure it was running, but it did run. Here's the code:

; A Hello World type of program intended to see if I can get something to compile.
; Name: HelloWorld.s


AREA HelloWorld, CODE, READONLY ;
EXPORT mystart ; Export this code to the project

mystart
MOV R3, #25 ; Set R3 to 25
MOV R2, R3 ; Set R2 to R3

stop
BAL stop ; gives me a loop to be caught in
END ; end.


I was able to set breakpoints on it and verify that R3 got a value of 0x00000019 and then R2 got the same value.

No comments:

Post a Comment