Interpreting assembly code [closed]

谁说我不能喝 提交于 2019-11-28 01:54:54

问题


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?


回答1:


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




回答2:


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.




回答3:


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.




回答4:


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




回答5:


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.




回答6:


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.



来源:https://stackoverflow.com/questions/448580/interpreting-assembly-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!