mbed assembly language test program

31 Jan 2013

Iam really unhappy with the only program I can get to work with the mbed is the "HellWorld" program. I typed it in ( both the C portion and the *.s ) I got it down to the last error and it would not tell me what line the problem was on. I took the assembly (*.s) portion and took it down to one LDR line and the with on thel the " Area, int_func, etc. and the "END" and it still did not work. I am really perplexed. Does anyone have any idea where I am going wrong?

Or should I just give up on Assembly on a MCU?

triad

31 Jan 2013

Doing assembly language on microprocessors - is very rare these days. If at all, it would be on teeny 8 bit micros where asm makes sense to keep the microprocessor at $0.50. That's really limited to someone counting pennies to do a million-up sales. The rest of us use C/C++, even on 8 bit micros with just 8, 16 or more KB of flash and a few KB of RAM.

A teeny amount of asm code is needed for bigger ARM processors. But rarely written by novices.

Geesh, even the $35 Raspberry Pi with Linux can run a Python application, as well as C/C++.

31 Jan 2013

I am beginning to realize that. Thank you.

Triad

31 Jan 2013

Where some one would need to learn Assembly after mastering C, I am vise versa and am in a learning curve.

triadx

31 Jan 2013

ok, on tc C :)

31 Jan 2013

Knowing assembly language, CPU architecture, I/O bits, interrupts, is great for embedded. Do a little ASM for that. On a simple 8 bit micro. The move on.

31 Jan 2013

Or build a time machine, travel back to the early 80's and learn programming on the likes of ZX80, ZX81, Spectrum, Beeb Micro, C64 and any of the other home micros at the time. Its how I learned...without the time machine of course!

Regards

Andy

31 Jan 2013

If you do want to use assembler on mbed etc, have a look at the following http://mbed.org/cookbook/Assembly-Language

I've not used it myself but it might help (a bit).

Good luck whichever way you go.

Cheers,

Jez

28 May 2014

The cookbook is useful. There are lots of opportunities for assembler still, especially in microcontrollers, so don't let the C zealouts fool you, they just haven't pushed the limits of the hardware, or spend $$ on more hardware to deal with compiler overhead.

I wouldn't use it for everything, only where needed, but sometimes you need very tight timing control, or you need to save some space, or you otherwise know what the hardware is capable of but can't outsmart the compiler into doing it (or think it is ridiculous to try only to watch it break with the next release or a change in compiler flags).

So there are lots of things you can do without it, but some things that you can't. Pushing the limits of the hardware with a compiler is like pushing anything with a wet noodle. If you have lots of units for a project and can use a less expensive chip with assembler then that can be a win too. As well anytime something goes wrong with the compiler, the first answer is usually "look at the assembler output". The higher language abstractions are great and make simple jobs easy, but still worth knowing exactly what is going on under the hood in any event.

I was VERY glad to see the cookbook, that can only encourage more pushing of the limits of the hardware, though I did notice the mbed ide isn't reporting asm errors very well.