What are you missing about v86? What you want could probably be done if you bring your own assembler (for example by porting NASM using emscripten) and we export some internal apis from v86.
I was hoping for an interface where I can see the registers, flags, memory, etc. in real time along with the .text history, similar to this.
Fun facts:
INC esp(increment stack pointer by one).POP [ptr](pop a dword from the stack and move it to the specified address in memory) updatesespbefore resolvingptr(which can containesp). In some sense it mixes decoding of the instruction and execution.LEA reg, [ptr]is an instruction that computesptrand stores it in a register without referencing memory. Pointer arithmetic is very flexible in x86, being able to add a register with a shift, another register and a constant offset. For example, it can encodea = b + c -1in a single instruction.LEAis also the only instruction that fails when encoded with a register operand (becauseLEA reg1, reg2is invalid) but never fails when encoded with a memory operand.OP reg1, reg2for most instructions.XCHG eax, ris encoded as0x90+r,NOPis0x90orXCHG eax, eax.NOPhasn’t beenXCHG EAX,EAXsince the 80386—it causes an unnecessary dependency onEAXso it’s been special coded for quite a long time.