Inline Assembler code syntax

The ASM statement or, for a "shortcut", the exclamation point (!), is used to insert assembler instructions (or opcodes) into your BASIC program.  They must appear at the beginning of each line that contains an assembler instruction.  The Inline Assembler supports standard instructions and registers, including 8086/8088, 80286, 80386, 80486, Pentium/MMX and 32-bit floating-point opcodes as defined in the Intel Reference Manuals, and can be downloaded from http://developer.intel.com/. 

The machine code generated by ASM statements is placed directly in line with the code from your BASIC statements, so execution of your program will flow just as it appears in your source code.  You should never, under any circumstances, attempt to exit a Sub/Function/Method/Property early by the use of a RET instruction, as that guarantees failure.  If you need to terminate a routine at some point before the End Sub/Function/Method/Property statement, jump to a label at the end of the procedure instead.

 

See Also

The Inline Assembler

Using assembly-language in your code

Flat memory model