Arm Assembler


namco

Member
Joined
Mar 22, 2006
Messages
410
Age
41
Location
Manchester, UK
Website
www.stupendous-stuff.com
I'm reading through the book posted on the gp2x wiki about arm assembly.

I compiled the first small test from the book which is:

CODE

MOV R0, #1;@Initialise count
.loop SWI writeI+"*";@Print a "*"
ADD R0, R0, #1;@Increment count
CMP R0, #20 ;@Compare with limit
BLE loop



I compiled it with:

arm-linux-gcc -o stars.gpe stars.s

and I have:

Error: unknown psuedo-op: '.loop'

What am I doing wrong?

Thanks.
 
namco said:
tried that, but i got the same error :(

You can't use the examples from that book verbatim, as they assume you are using a RISC OS PC which has a function called WriteI. Under Linux, everything is very very different and you will need to try to glean what you can from those examples and come up with your own versions.

GAS syntax is a bit different from the syntax used for the BBC BASIC assembler, as well, so you'll also have that to contend with.
 
Last edited by a moderator:
Don't know for sure but, since you don't need tabs in gcc assembler, try putting a : after the .loop ie .loop:
Then the compiler will not try and find an instruction .loop, but realise it's a label..
Assembler directives look like .section,etc... so .loop may confuse it?

EDIT:
My typing is dreadful :(

EDIT2:
Mmmm, I may be right - try printing this off for quick-ref:
http://microcross.com/GNU-ARM-Assy-Quick-Ref.pdf
 
QUOTE

Don't know for sure but, since you don't need tabs in gcc assembler, try putting a : after the .loop ie .loop:



Of course!! *headdesk*

I do vaguely remember the colon to specify the label from my Sim8086 assembler days!

That worked thanks.

Again thanks to everyone else for your info.
 
Back
Top