EmbeddedRelated.com
Forums

Re: Is there an open source ARM assembler?

Started by Robert Adsett November 27, 2005
At 03:47 PM 11/27/05 +0000, Eric Engler wrote:
>--- In lpc2000@lpc2..., Charles Manning <manningc2@a...>
>
> > If you use the assembler in ".S mode" with a gcc front end then you
>can use C
> > macros etc to preprocess it.
>
>The basic syntax doesn't follow that used by most hc11/hc12
>assemblers. This is understandable because it wasn't designed for this
>target specifically.

Since it's not an hc11/hc12 assembler that's hardly surprising. I have to
say I found the GAS syntax no more obscure than any other assembler I've
ever worked with.

Robert

" 'Freedom' has no meaning of itself. There are always restrictions, be
they legal, genetic, or physical. If you don't believe me, try to chew a
radio signal. " -- Kelvin Throop, III
http://www.aeolusdevelopment.com/


An Engineer's Guide to the LPC2100 Series

--- In lpc2000@lpc2..., Robert Adsett <subscriptions@a...> wrote:

> Since it's not an hc11/hc12 assembler that's hardly surprising. I
have to
> say I found the GAS syntax no more obscure than any other assembler
I've
> ever worked with.

I meant to say it doesn't use ARM syntax, of course. I was wearing my
hc11/hc12 hat by mistake. I posted a corrected message but it was too
late, the bad one already got out :-(

This is a general complaint of GAS/as because it was intended to have
a cross platform syntax, therefore, it doesn't match the syntax of any
particular family.

A translator may be the best idea...take a standard ARM assembler file
as an input and write out a GAS assembler file. Then you can assemble
using GAS and link to gcc-compiled modules.

Eric



At 06:31 PM 11/27/05 +0000, Eric Engler wrote:
>--- In lpc2000@lpc2..., Robert Adsett <subscriptions@a...> wrote:
>
> > Since it's not an hc11/hc12 assembler that's hardly surprising. I
>have to
> > say I found the GAS syntax no more obscure than any other assembler
>I've
> > ever worked with.
>
>I meant to say it doesn't use ARM syntax, of course. I was wearing my
>hc11/hc12 hat by mistake. I posted a corrected message but it was too
>late, the bad one already got out :-(

It happens. >This is a general complaint of GAS/as because it was intended to have
>a cross platform syntax, therefore, it doesn't match the syntax of any
>particular family.

I've seen the same complaint levelled against the x86 variant.

>A translator may be the best idea...take a standard ARM assembler file
>as an input and write out a GAS assembler file. Then you can assemble
>using GAS and link to gcc-compiled modules.


You may well be right, or it might be just as fast to learn the different
syntax. Personally, I suspect learning the syntax would be faster but if
you are translating a lot of existing source you could make an argument for
writing a translator. Or you could just use C ;) It has been accused of
being little more than a portable assembler. I find myself using assembler
rather sparingly for the ARM, so far only interrupt support and task
switching which I always do in assembly in any case.

Actually given gcc's availability I don't see a lot of need for large
amounts of assembly, but not everyone is likely to agree :)

Robert

" 'Freedom' has no meaning of itself. There are always restrictions, be
they legal, genetic, or physical. If you don't believe me, try to chew a
radio signal. " -- Kelvin Throop, III
http://www.aeolusdevelopment.com/




I started using the lpc2000 chips as a replacement for
my pic and avr set. Even ARM is aiming at the 8-bit
market with the arm7 core (and with the lpc2101,
they're actually cheaper than many 8-bitters).

I'd prefer to start with assembly code (thumb likely)
for small and highly predictable code. For more
complex stuff I'd use chips with bigger ram/flash and
RTOSes, which frequently demand the use of C as in
Keil compiler C or GCC. If a free arm assembler with
the traditional arm syntax is available, I'd be one of
the users. I however admit I havent taken a closer
look at the gcc's arm assembler yet. --- Eric Engler <englere.geo@engl...> wrote:

> --- In lpc2000@lpc2..., Robert Adsett
> <subscriptions@a...> wrote:
>
> > Actually given gcc's availability I don't see a
> lot of need for large
> > amounts of assembly, but not everyone is likely to
> agree :)
>
> I think everyone would agree with this. We sometimes
> need assembler,
> but it's use should be rare. Only drivers, compiler
> libraries, or
> special speed-critical code should be done in
> assembler.
>
> Even Forth is better than assembler in cases where C
> is not
> appropriate. But Forth has a learning curve in order
> to be very
> productive with it. I find assembler to be easier to
> work with for
> people who have already been exposed to some flavor
> of assembler.
>
> My main involvement with assembler is for college
> classes that teach
> the low-level architecture. They also emphasize
> standard syntax
> because they use official documentation as reference
> material.
>
> I've recommended the IAR EWARM free version, but
> some professors don't
> like to do that for some reason. I think it depends
> on who is in the
> legal department and whether they take the time to
> actually look at
> the license agreement seriously. Many professors
> just don't even take
> it to the legal department for review - they just
> assume the answer is
> going to be "no".
>
> Tip to tool vendors: please consider making a custom
> educational
> license that is easy to understand (if the professor
> sees it as a
> no-brainer he's more likely to ask the legal
> department for a ruling
> on it). You want your tools to get used by students
> because they are
> tomorrow's engineers. Wouldn't it be great if they
> already had some
> exposure to your tools in class? People like to
> select tools that are
> familiar to them.
>
> Eric >
>




--- In lpc2000@lpc2..., Robert Adsett <subscriptions@a...> wrote:

> Actually given gcc's availability I don't see a lot of need for large
> amounts of assembly, but not everyone is likely to agree :)

I think everyone would agree with this. We sometimes need assembler,
but it's use should be rare. Only drivers, compiler libraries, or
special speed-critical code should be done in assembler.

Even Forth is better than assembler in cases where C is not
appropriate. But Forth has a learning curve in order to be very
productive with it. I find assembler to be easier to work with for
people who have already been exposed to some flavor of assembler.

My main involvement with assembler is for college classes that teach
the low-level architecture. They also emphasize standard syntax
because they use official documentation as reference material.

I've recommended the IAR EWARM free version, but some professors don't
like to do that for some reason. I think it depends on who is in the
legal department and whether they take the time to actually look at
the license agreement seriously. Many professors just don't even take
it to the legal department for review - they just assume the answer is
going to be "no".

Tip to tool vendors: please consider making a custom educational
license that is easy to understand (if the professor sees it as a
no-brainer he's more likely to ask the legal department for a ruling
on it). You want your tools to get used by students because they are
tomorrow's engineers. Wouldn't it be great if they already had some
exposure to your tools in class? People like to select tools that are
familiar to them.

Eric



Ghazan Haider wrote:

>I started using the lpc2000 chips as a replacement for
>my pic and avr set. Even ARM is aiming at the 8-bit
>market with the arm7 core (and with the lpc2101,
>they're actually cheaper than many 8-bitters).
>
>I'd prefer to start with assembly code (thumb likely)
>for small and highly predictable code. For more
>complex stuff I'd use chips with bigger ram/flash and
>RTOSes, which frequently demand the use of C as in
>Keil compiler C or GCC. If a free arm assembler with
>the traditional arm syntax is available, I'd be one of
>the users. I however admit I havent taken a closer
>look at the gcc's arm assembler yet. >
Now you have hit upon one of the reasons I did not use PIC as a choice
in new hardware designs. The early PICs did not have an interrupt
structure and you had to carefully balance the time taken between
sections of the program so that you could arrive back in time to do
something like pull the next char out of the UART.

I've coded in Assembler for 25+ years now, lots and lots of assembler +
C. On the 8051, 6502, Z80, 8070, 8042, 80C188, ..., assembler was
choice of languages for deterministic programming. Hand coded
assembler could be written, "in the day", to be tighter code than what
the compilers of 10 years ago were producing. When I look at the output
of a modern C compiler, such as GNU gcc, the optimizer does such good
job producing tight code, that I won't bother with assembler.

Have you taken a critical look at a C language program output lately?
Try the -O2 option, the code optimization is staggering, especially with
the ARM Instruction Set!!

However, you are certainly free to make your own decision. BTW,
assembler ports real easily to C, and vise-versa. Many call C
"glorified assembler".

Regards,

TomW

--
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------