[Nasm-bugs] [Bug 3392553] Write source for AND but NASM produces ADD

noreply-nasm at gorcunov.org noreply-nasm at gorcunov.org
Sat Feb 2 10:35:57 PST 2019


https://bugzilla.nasm.us/show_bug.cgi?id=3392553

C. Masloch <pushbx at 38.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pushbx at 38.de

--- Comment #2 from C. Masloch <pushbx at 38.de> ---
You write that 83 E0 40 is an ADD instruction, but it isn't actually:

-e 100 83 e0 40
-r
AX=0000 BX=0000 CX=0000 DX=0000 SP=FFFE BP=0000 SI=0000 DI=0000
DS=1209 ES=1209 SS=1209 CS=1209 IP=0100 NV UP EI PL ZR NA PE NC
1209:0100 83E040            and     ax, +40
-

As shown in https://ulukai.org/ecm/insref.htm#insADD there is a form of ADD
that starts with 83h, but it uses /7 in the spare field of the ModR/M byte. E0h
is 1110_0000b, ie the spare field has 100b = 4, which is a form of AND:
https://ulukai.org/ecm/insref.htm#insAND  Note that the spare field of the
ModR/M byte is in the middle, not in the top three bits.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list