NASM Forum > Using NASM

Opcodes 0x83/1, 0x83/4 and 0x83/6 with CPU 286?

(1/1)

ktx59:
Dear all,
When I try to assemble code with NASM that contains an instruction like "and cx, 0x01", NASM consistently generates the following code, even when I use "CPU 286" or "CPU 8086":

--- Code: --- 83E101            and cx,byte +0x1
--- End code ---
However, to my knowledge, opcodes 0x83/1 ("or r/m16, imm8") 0x83/4 ("and r/m16, imm8") and 0x83/6 ("xor r/m16, imm8") are documented only for 80386 and later processors. (I have checked scanned versions of the original Intel developers' manuals.) I have also checked other online references, according to http://ref.x86asm.net/coder32.html#x83, this instruction is only available on 80386+ (or at least, it does not mention that these are present but undocumented). Could somebody provide me some reliable reference on this? Or is this a bug in NASM?

debs3759:
That looks like a bug to me. Until it gets fixed, you could use

AND CX,WORD 0x01.

ktx59:
Thanks for the suggestion, but I have already tried this, makes no difference (it still generates 83E101). The only workaround I have found is db 0x81,0xE1,0x01,0x00.

Navigation

[0] Message Index

Go to full version