DOS debug was an interactive assembler as well as a debugger, introducing assembly code, which led to the fact that this line is immediately converted to machine code - this is what you dumped.
So, all you need to do is automate your favorite assembler with a script or batch file.
Here's the bash function that I came with in a minute or two using the popular nasm assembler:
opcode() { echo $* > tmp.S && nasm tmp.S -o tmp.o && od -x tmp.o rm -f tmp.o tmp.S }
takes less than a second. The call is as follows:
$ opcode mov eax, [ebx] 0000000 6667 038b 0000004 $ opcode fadd st0,st1 0000000 c1d8 0000002
Not brilliant, but you can tweak the command line for better output. This idea should work with any command line assembler while you tell it to use a simple binary output format.
Greg
source share