/G0, /G1, /G2, /G3, /G4 (Generate Processor-Specific Instructions)

If you are writing programs for a machine with an 8086/8088, 80186/80188, 80286, 80386, or 80486 processor, you can use the /G0, /G1, /G2, /G3, or /G4 option, respectively, to enable the instruction set for those processors. When you use /G2 and /G3 options, the compiler automatically defines the appropriate M_I286 or M_I386 identifier.

Although it is sometimes advantageous to enable the appropriate instruction set, you may not always want to do so. If you have an 80286 processor, for example, but you want your program to be able to run on an 8086/8088, do not compile with the /G2 option.

The /G0 option enables the instruction set for the 8086/8088 processor. You do not have to specify this option explicitly because CL uses the 8086/8088 instruction set by default. Programs compiled with /G0 also run on machines with 80186/80188, 80286, 80386, and 80486 processors but do not take advantage of any processor-specific instructions. When you specify the /G0 option, the compiler automatically defines the identifier M_I8086.

If your program includes inline assembler code that uses a mnemonic instruction supported only by the 80186/87, 80286/87, 80386/87, or 80486 processors, you must compile with the /G1, /G2, /G3, or the /G4 option, respectively; compiling with /G0 results in an error. Note that you cannot use 80186, 80286, 80386, or the 80486 mnemonics as labels, even if you are compiling for an 8086/8088.

These options apply to all filenames that follow on the command line until another /G0, /G1, /G2, /G3, or /G4 option appears.

Note :

The /G0, /G1, and /G2 options work only with the 16-bit compiler; the /G3 and /G4 options work only with the 32-bit compiler.

Command-line drivers that produce 16-bit code (CL3216) generate warnings if they encounter either the /G3 or the /G4 option.