Futurebasic/Language/Reference/machlg

MACHLG

edit

Syntax:

edit

MACHLG {constant|variable}[,{constant|variable}...]

Description

edit

Instructions the compiler to insert MC680x0 machine language instructions into the compiled code at the current location; these instructions are executed when the program is run.

Each constant is treated as a 2-byte instruction, and is inserted directly into the code stream. Typically, you will express a constant as a 4-digit hexadecimal number. Each variable is translated into an instruction which loads the variable's address into register A0.

The MACHLG statement is valid only for a "cpu68K" compile, and you should use only MC680x0 machine language instructions in the argument list (not PPC instructions). FB generates an error if you attempt to use MACHLG in a program compiled with the "cpuPPC" or "cpuFAT" options. To get around this problem, you can put the MACHLG statement inside a "COMPILE LONG IF cpu68K" block; in that case, the MACHLG instruction will be ignored in a PPC compile.

Note: It's recommended that you use FutureBasic's "Inline Assembler" syntax rather than the MACHLG statement when you need to insert machine language instructions. Not only does this make your code easier to read, but it also allows you to insert PPC instructions as well as MC680x0 instructions.

See Also:

BEGINASSEM...ENDASSEM