mathematician wrote:
Instructions like and ax, 2 have always been available. It used to be the case that the only shift instructions with immediate operands were those with shifted the contents of a register by one bit, as in shl ax, 1. All other shifts had to be of the form shl ax,cl, and it had to be the cl register.
Similarly, in/out instructions could only take an immediate operand in the port number was below 0x80. For other ports, the port number had to be loaded into the dx register. out dx,al or in al,dx. Push and pop instructions could never take immediate operands.
irrelevant -- we are not discussing whether or not
AND R/M16, imm16
is legal on 8086, we are talking about whether
AND R/M16, imm8
is legal on 8086 -- did 8086 support sign-extended immediate on AND instruction, that is the question (the manuals don't list it, but nasm emitted it)
edit:
found this on nasm page:
Code:
AND rm16,imm8 8086,LOCK
indicates at least nasm thinks its available on 8086 (so, not a bug in nasm, its intentional, so either they were wrong about its support or it is valid, just officially undocumented, most likely the later