My results, as extracted from actual assembled files uaing each assembler separately: ============================================================================== Enter an 80x86 instruction mnemonic to convert: add eax,1 ml.exe says "add eax,1" translates to " 83 C0 01 " nasm.exe says "add eax,1" translates to " 66 05 01 00 00 00 " fasm.exe says "add eax,1" translates to " 66 83 C0 01 " . Enter an 80x86 instruction mnemonic to convert: add ax,1 ml.exe says "add ax,1" translates to " 66 83 C0 01 " nasm.exe says "add ax,1" translates to " 05 01 00 " fasm.exe says "add ax,1" translates to " 83 C0 01 ") ============================================================================== Your results, by whatever your technique is: ============================================================================== FASM 1.70.03, 32/64Bit --> ADD EAX,1 --> 83 C0 01 and ADD AX,1 --> 66 83 C0 01 NASM 2.10.01, 32/64Bit --> ADD EAX,1 --> 83 C0 01 and ADD AX,1 --> 66 83 C0 01 ============================================================================== What my technique was is to shorten the assembly process with a switch, so that I do not end up with an .OBJ file true, just a binary file. I repeat the test 8 times, and between each add eax, 1 or each add ax,1 instruction I insert what I consider a pretty viable pair of NOPs of my own choosing, so as to eliminate likely mis-brackets of the assembler results. I then ensure that I get 8 recoveries of the same results. The NOPs I choose to use, to bypass possible matches outside in the surrounding code, is a mov cl,cl and mov ch,ch instruction pair. So the code I send to the assembler looks like:
mov cl,cl mov ch,ch add eax,1 mov cl,cl mov ch,ch add eax,1 mov cl,cl mov ch,ch add eax,1 mov cl,cl mov ch,ch add eax,1 mov cl,cl mov ch,ch add eax,1 mov cl,cl mov ch,ch add eax,1 mov cl,cl mov ch,ch add eax,1 mov cl,cl mov ch,ch add eax,1 mov cl,cl mov ch,ch
or, if I am doing the add ax,1, I send it this instead:
mov cl,cl mov ch,ch add ax,1 mov cl,cl mov ch,ch add ax,1 mov cl,cl mov ch,ch add ax,1 mov cl,cl mov ch,ch add ax,1 mov cl,cl mov ch,ch add ax,1 mov cl,cl mov ch,ch add ax,1 mov cl,cl mov ch,ch add ax,1 mov cl,cl mov ch,ch add ax,1 mov cl,cl mov ch,ch
With ml.exe, I have to provided this as well: .486 .model flat, stdcall option casemap :none .code start:
then at the end I have to provide end start
I call ml.exe with a /c I call nasm.exe with a -a nothing fancy required for fasm.exe
Then I process the created file, break it down by the translation for mov cl,cl and mov ch,ch, which is not even the same each time, sometimes coming out with 8A and sometimes with 88 as the lead hex, and then try to make sense of what I get. No, I can't explain the differences between the assembler results and what you get. I can't even explain the differences in what I get.
_________________ has-been wanna-be (You may not agree with what I say, but it will make you think).
|