Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A Whirlwind Tour of ARM Assembly (coranac.com)
42 points by ANTSANTS on June 21, 2014 | hide | past | favorite | 12 comments


There are so many different variants of ARM assembler, it is difficult to keep track of them all. Somehow ARM managed to get away with it.

I have been hacking Assembler level on many different architectures. Cortex M0 is the first one where I actively try to avoid it. It's just no fun.


What do you mean by 'versions of ARM assembler'?


"instruction set" would be more precise.

There isn't a single ARM instruction set, as it is with x86, for exmple. There are many different versions of it. Sometimes there are even significant variations within a family. e.g. Cortex M0 lacks many useful instructions that are only available in the M3/M4.


It's the same on x86. Not all x86 processors have all the x86 instructions. There have been many extensions over the years.

The main difference is that x86 doesn't have low power processors like the Cortex M series so they didn't have to remove any instructions to lower die size (thus price and power consumption).


Narishma's sibling comment is spot on: the microcontroller profile cores have a subset of the instructions available on application profile cores. Cortex-M0(+) and Cortex-M1 have a base set of instructions, while M3, M4 and M4F each add a new subset to that of the immediately inferior model. This is done to change the trade-off between speed, energy and cost.

If you keep switching between different Cortex-M cores and have difficulty keeping track of the available instructions, this wikipedia page[0] summarizes things in a nice short table.

[0] https://en.wikipedia.org/wiki/ARM_Cortex-M#Instruction_sets


I love ARM, I think it may be my favourite asm family, although MIPS has its aficionados and I'll always have a soft spot for 68000.

x86 is... like someone started with a simple mud hut and tried to turn it into a mansion by successively hot-gluing renovations to it over 30 years. There's really a tiny modernised flat buried somewhere in there which provides all the light and heat and amenities, but there's plasterboard all around it because they're trying to pretend it's really still the same old mud hut with a fancier roof. Truth is, the mud hut fell down decades ago and now it's all glue, duct tape and make-believe.

(I think my analogy got lost somewhere along the way there, but that's kind of my point. Bloody μ-ops.)


This seems outdated. No mention of Thumb 2 and unified assembly, for example.


Yes, it's pretty outdated. It looks like it was written for ARM7TDMI which is ARMv4T. It seems like a decent introduction to RISC assembly programming though. This sort of stuff can get you started, after which you can get up to speed by reading compiler output and the ARMv7 architecture reference manual.

Is there a good and more up-to-date introductive text?


It's targeted at the Game Boy Advance, which has an ARM7TDMI (ARMv4) CPU.


That's pretty funny. I first learned ARM assembler on the Game Boy Advance in the late 1990's. I remember how hard it was to find good, clear docs for any of that, but they started to be formed because of collaborative efforts to homebrew GBA games. I wonder how many people got their start in ARM because of homebrew.


or AArch64 ...


How can he be so wrong when comparing compiled languages and scripted languages: "Every step up the ladder increases the human readability factor and portability, at the cost of runtime speed and program size."

Just think about readibility of Ada and Perl. What increases with higher abstraction levels is mainly the development speed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: