_emit
◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Keyword: _emit
Syntax: _asm _emit byte
Summary: Defines a single immediate <byte> at the current
location.
The _emit pseudoinstruction is similar to the DB directive of the
Microsoft Macro Assembler. It allows definition of a single
immediate <byte> at the current location in the current code
segment. However, _emit can define only one byte at a time, and it
can only define bytes in the code (_TEXT) segment. It uses the
same syntax as the INT instruction.
One use for _emit is to define 80386-specific instructions, which
the in-line assembler does not support. The following fragment
defines the 80386 CWDE instruction:
// Macro for cwde instruction assumes 16-bit mode
#define cwde _asm _emit 0x66 _asm _emit 0x98
. . .
_asm
{
. . . ; Assembly instructions
cwde ; Macro to generate CWDE
. . . ; More instructions
}
See also: ◄_asm►
-♦-