Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_asm assemble in-line code</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _asm                Assemble In-Line Code

 _asm   asm_instruction

    _asm can assemble 80x86 instructions; one per line, like this:

                _asm mov ah,2
                _asm mov dl,65
                _asm int 0x21

    or in braces like this:

                _asm
                {
                     mov ah,2
                     mov dl,65
                     int 0x21
                }

    However, you cannot use 80386, 80387, or 80486 specific instructions,
    nor can you store data with data directives (DB, DW, DUP, RECORD,
    STRUCT, and so on). Segments may not be addressed by name. EVEN
    and ALIGN are the only MASM directives that apply here.

    On the other hand, you can address C data directly (i.e. by name),
    and the $ symbol still returns the current offset from the
    beginning of the current segment. Do not use _fastcall calling
    conventions when writing functions in assembler, since _fastcall
    passes arguments in the registers, not on the stack.

    You should also preserve DI, SI, DS, SS, SP, and BP, and return
    values from functions in AX or DX:AX as normal.


 Portability:   Not supported by the ANSI standard.

   -------------------------------- Example ---------------------------------

    This example prints the character 'A' on the screen:

        main()
        {
                _asm
                {
                     mov ah,2
                     mov dl,65
                     int 0x21
                }
        }

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson