C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
__emit
                                             Up Contents Index Back
─────C/C++ Language─────────────────────────────────────────────────────────
 
  Keyword:   __emit
 
  Syntax:    __asm __emit byte
 
  Summary:   Defines a single immediate <byte> at the current
             location.
 
  See also:  __asm
 
     The __emit pseudoinstruction is similar to the DB directive of the
     Microsoft Macro Assembler (MASM). 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 inline 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
         }
                                    -♦-