Question

Any assembly interpreters out there?

What I'm looking for:

  • I have some assembly firmware code I want to run, but not on the actual hardware.
  • I would like to run the code and see what it is doing.

So, is there some sort of free and easy to use assembly simulator out there?

Any other pointers you can think of?

Was it helpful?

Solution

You should look into some processor emulator only that way you can "interpret" assembly, for example: Qemu or Bochs

OTHER TIPS

In order to run assembly code that is designed for a particular device, you will need to run it with an emulator that specifically emulates that device. An x86 emulator like Qemu will be utterly incapable of running assembly code written for an ARM CPU core. This is not a case of "almost works", but it won't even be able to run the first instruction.

As mentioned by Jason S, emulating peripherals or anything outside the CPU core is very specific to the device you've got. Details can even differ between PCB revisions.

If you're just curious about what the assembly code is doing, you might be better off sitting down with the CPU reference manual, and examining each instruction in turn. If you're going to be doing any serious work with this device, you'll have to have that knowledge eventually anyway.

Short answer: Yes.

Longer answer: Depends on the CPU you have assembly for and what kind of peripherals you are interfacing with. There are literally 1000s of different CPU packagings in the world.

For x86 assembly, you could use an x86 PC emulator like Bochs.

Probably, but please note that it's one thing to emulate the core instruction set, and quite another to handle the peripherals.

If you're just emulating an algorithm that operates on data, you can probably get away with just emulating the CPU core.

If you need to emulate an analog-to-digital converter or UART or PWM driver, that's a whole different ball game. The CPU core instruction set is (usually) well-specified to the point where you could imitate its behavior pretty well. The peripherals are only specified to show their functional requirements, and not to guarantee their behavior precisely enough to make an emulator without having to know how they implemented the peripheral in question.

As I saw you have assembly code for dsPIC30F4011. This code is specific for this RISC Microchip machine. You need to download IDE for dsPIC, I suggest take download from MPLAB from, https://www.microchip.com/mplab/mplab-x-ide. After that try to create project for dsPIC30F4011 and add your assembly file. Then try to us simulator, to see what is your code doing. This is more than enough for start.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top