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 开发者_如何学C(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?
QEMU has support for processors with Thumb-2, such as Cortex-M3 and Cortex-A8. It's even included in latest CodeSourcery releases.
The Android emulator (4.0) suggests it uses armeabi-v7a
I'm also trying to see if any cheap hardware Android tablets with Cortex A8 processors run in Thumb-2 mode, or if you can run native Thumb-2 code on them
"The latest release of the NDK supports these ARM instruction sets: ... ARMv7-A (including Thumb-2 ..." not sure what version of Android it requires
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
You have several options. I will list them in order of best to worst.
- QEMU emulated device
- Keil uVision software
- Yocto bitbake tool
Explanations:
QEMU is what I like to call the “subway” of VM’s. You build an entire virtual machine with “everything you want and nothing that you don’t”. This means you can design almost every aspect of the machine you would like to emulate (including the ISA it uses). Some QEMU tech skills needed tho.
Keil uVision is a good tool for developing, testing, and uploading assembly / embedded C code. Keil can handle a good deal of debugging without needing a device attached.
Yocto is an open source tool for creating custom Linux environments. Similar to QEMU, you’re creating a custom architecture. This is less documented and more “finicky” than QEMU though. Very cool project #promotions
精彩评论