Assembler issue

23 Oct 2013

Hello folks, New to this world, I am trying to write an assembler only application with the mbed compiler. To do this i create a Main.s source file containing the program below (which do nothing! but serve just to see if it is working) This code is very similar to the ARM documentation

--------------

AREA main, CODE ; Name of code main

MOVS r0, #10 ; Set up parameters

MOVS r1, #3

ADD r0, r0, r1 ; r0 = r0 + r1

END

-------------

I get a compiler error 241

What i have done so far is introducing some modification in the code ( like changing MOVS by MOV) to prove that the assembler is doing the job by issuing error and this the case. I guess that the assembly job is done and that the problem may come at the linkedit level (but not sure).

My questions: Is there some documentation about the error codes?

Can someone give me the explanation of error 241.

Many thanks in advance

Gérard

23 Oct 2013

Giving an answer to my own post! Finally the source which compile perfectly, even if it is a non usable program

test program

        AREA    main, CODE     
        EXPORT  main
        EXPORT  __initial_sp
        MOVS     r0, #10      
        MOVS     r1, #3
        ADD      r0, r0, r1    
        AREA     dataprog, DATA
test    DCB      10 
__initial_sp DCB 10    ; note the 2 underscore!
        END                    

Now i may start to work....

Gérard

27 Oct 2013

Gérard Sontag wrote:

AREA main, CODE EXPORT main EXPORT initial_sp MOVS r0, #10 MOVS r1, #3 ADD r0, r0, r1 AREA dataprog, DATA test DCB 10 initial_sp DCB 10 ; note the 2 underscore! END