x86 assembly emulator
I want an x86 assembly emulator where I can type in the assembly instruction, then press RUN, and see the resulting memory/register values. It needs to run in Protected mode and be able to simulate memory addresses.
I downloaded Bochs, but is some kind of BIOS/ring0/kernel/whatever emulator, not Windows Protected mode emulator.
Currently the most convenient way is to write code into an empty app in OllyDbg.
If you want to see what happens with a set of instructions in Windows, then some sort of Windows debugger is probably your best choice. WinDBG actually has an "assembler" option - although I'm not sure how good it is - so you can type in new instructions into an existing (say a load of NOP's) piece of application code.
If you want to emulate the system from boot onwards, then Bochs or QEMU would be choices.
The problem with OllyDbg is that I need to count with the space - I can't just add an instruction between two other instructions.
WinDbg allows assembling without specified addresses for each instruction?
Not sure, I haven't used WinDBG for about 4 years now.
Originally Posted by maxorator
Generally when I write assembler code it's inside a inline assembler chunk in C (or C++).
Jasmin and Ketman are not the stuff you asked for - they can't
do protected mode stuff - but they are related and someone might find
Jasmin is an opensource x86 ASM interpreter written in Java.
It implements NASM syntax and quite a few ASM commands.
However it doesn't assemble the code (since it is an interpreter).
You won't be able to write self-modifying code.
Jasmin has 2 types of labels. The first type is for JMPs.
The second type is the so called pseudo labels used for
accessing data in memory defined by DB or RESW and the like.
It also comes with good documentation. Its quite neat for a learning
tool: you can test standalone ASM functions using Jasmin. What
you can't do is accessing hardware or the OS.
Ketman's tutorial is actually a small 16-bit ASM interpreter.
The real way
In case you want to play with ASM the real way, get some IDE where
you can set breakpoints and quickly launch your code into a debugger.
Compiling, running, debugging in one step.
Interpreter written in an interpreter? What a waste..
Originally Posted by kalevi