PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Help me on my assemble code!!!!!

Severals days ago,i found some interestring things about assemble code which is embedded in c++,so i tried a simple code,it's like this:
EXPORT Add
Add
MOV r12,sp
stmfd sp!,{r4-r11,lr}
add r0,r0,r1
ldmfd sp!,{r4-r11,pc}
END
what i want do is just add two numbers and return their sum,but when i compiled it ,i always get "code inside data section",what's the matter?
Thanks For Any Help!!
try starting the file with something like this:

AREA ArmGfxLib,CODE,READONLY

also, have a look at this thread when having problems, it's a great faq :)

http://pocketmatrix.com/forums/viewtopic.php?t=4063&postdays=0&postorder=&start=0
snow_wolf · 14 Dec 2003, 11:01 UTC — it also doesn't work
when i follow you ,i get another error:
unknown opcode:ArmGfxLib
Thanks any way!
Try putting a tab in front of all of the assembler directives.