32-bit forms of 16-bit instructions
Last update: 2000-09-11
There are several instructions defined originally as 32-bit that can
be executed as 16-bit ones by means of OPSIZE prefix. The same trick can
be applied to some 16-bit instructions that can be forced to become 32-bit.
BSWAP
Defined as 32-bit, the instruction swaps all bytes in a 32-bit register.
When forced to 16-bit, the instruction takes whole 32-bit register, swaps
the bytes and writes only lower 16-bits, so 0x11223344 becomes 0x11222211.
SMSW
The instruction (introduced in 80286) stores the MSW register into a specified
destination, usually a register. Starting with 386, 16-bit MSW became a
part of 32-bit CR0, and this instruction is obsoleted by MOV reg, CR0.
MOV reg, CR0 in turn is not allowed in protected mode from user privilege
level. SMSW EAX can be used to retrieve the content of CR0 from any privilege
level on most x86 CPUs (this excludes Cyrix chips).
PUSH sreg
The instruction is supposed to push the content of a segment (selector)
register, yero extended to 32 bits if executed in 32-bit mode. (to be continued).
Copyright 2000 by G. Mazur