| |||||||||||||||||||
| |||||||||||||||||||
The syntax of IFDEF and IFNDEF directives is IFDEF symbol IFNDEF symbol If symbol is defined (IFDEF) or not defined (IFNDEF), the conditional block of statements is assembled. A common use of these directives is to customize code for a particular processor.
In the above example, the assembly time variable PROC_TYPE is used to identify the processor type. The /D option (e.g. /D PROC_TYPE=486) can be used to generate code targeted for a particular processor. If the processor type is not specified on the assembly command line (i.e., the /D option is not specified), the default 8086 version is generated. For 80186 or later processors, the PUSHA instruction pushes all registers (AX, BX, CX, DX, SI, DI, BP, and SP) onto the stack. However, there is no such instruction for the 8086 processor, and we have to push each register individually. |