tags:

views:

73

answers:

2

Is there such a thing as an emulator for thumb-2 assembly? I would like to write simple ARM Thumb-2 assembly programs and test them out without needed to use an actual ARM device, so my only option is emulation.

My goal is to implement a sizable number of algorithms in thumb-2 assembly as a learning exercise. I don't even need emulation of other hardware (such as io/display/etc). Just the ability to run thumb-2 assembly (compiled or not) and view the results (that is, basically be able to debug the program and see the contents of the emulated memory after my program is finished).

Does something like this exist, or am I grasping at straws?

+1  A: 

QEMU has support for processors with Thumb-2, such as Cortex-M3 and Cortex-A8. It's even included in latest CodeSourcery releases.

Igor Skochinsky
Is that for non-commercial versions too?
leppie
I'm not sure, maybe not in the free edition. But you can always build your own version anyway.
Igor Skochinsky
Very cool, thanks for pointing this out. I had never heard of this.
LCC
+1  A: 

thumbulator.blogspot.com is thumb only for now, but could be easily modified for thumb2 (which would definitely improve your education of the instruction set). Has less features than qemu, but far greater visibility, and considerably simpler to modify, basically the only peripherals and I/O are the ones you add. Thumb2 is mostly thumb with some new instructions. Most of a thumb2 education is just learning thumb. All thumb2 processors are quite happy with the thumb instruction set. Not unlike learning arm7 before learning arm11 instructions. thumbulator will help with the thumb instruction set, the basics, but not thumb2 additions unless you choose to implement them.

There is also the armulator which is/was arms instruction set emulator, which you can find included in things like gdb. Not any more useful at learning that qemu is, but simpler than qemu if you want to try to watch what is going on. gdb itself may be the platform you are interested in as it has that visibility along with an instruction set emulator.

Qemu is good for say simulating a linux build for some arm/thumb target (and having it run fast). Where drivers are in place, etc. But starting from scratch, just to get where you can see the handful of lines of assembler you will have to some I/O, and may struggle just to get qemu to boot and run your code, might be counter productive to what you are doing. ymmv

dwelch
actually thumb2 adds a bunch of stuff and complicates the prior/original thumb instructions. I would definitely learn thumb first and thumb2 second. The arm-arm-7m is available from arms website as a free download (once registered) and covers the cortex-m3 supported instruction set and all the thumb2 chaos.
dwelch