|  |   | 
| (359 intermediate revisions by 2 users not shown) | 
| Line 1: | Line 1: | 
|  | By [[IBM]]
 |  | {{IBM-Reprint}} | 
|  |   |  | 
|  | === About this Reference ===
 |  | 
|  | 
 |  | 
 | 
|  |  | == About this Reference == | 
|  | The following notations are used in this reference: |  | The following notations are used in this reference: | 
|  |  | {| | 
|  |  | |'''KEYWORD'''||Commands and language keywords. | 
|  |  | |- | 
|  |  | |'''KEYWORD'''||The default value for a command or language keyword when multiple values are possible but none are actually specified. | 
|  |  | |- | 
|  |  | |Phrase||Typically indicates a hypertext link to a separate panel containing a description for that phrase. | 
|  |  | |- | 
|  |  | |''Parameter''||Parameters whose actual names or values are to be supplied by the programmer. | 
|  |  | |- | 
|  |  | |'''''Definition'''''||A term being defined for the first time, or special emphasis. | 
|  |  | |- | 
|  |  | |Subscript||Subscripted text. | 
|  |  | |- | 
|  |  | |Superscript||Superscripted text (other than ý). | 
|  |  | |- | 
|  |  | |<Name>||A text value represented by "Name" is to be substituted in place of <Name> typically at assembler run-time. | 
|  |  | |} | 
|  | 
 |  | 
 | 
|  | '''KEYWORD'''Commands and languagekeywords.
 |  | == Assembly Language Processor (ALP) Overview == | 
|  |  | The Assembly Language Processor (ALP) is an assembler that runs under OS/2 Warp. ALP is a functional replacement for the Microsoft Macro Assembler (MASM) and accepts: | 
|  |  | * The full syntax of the Intel 80X86 architecture | 
|  |  | * The full syntax of the MASM 5.10 high-level directive language | 
|  |  | * A subset of the MASM 6.00 high-level directive language | 
|  | 
 |  | 
 | 
|  | ''KEYWORD''The default value for a command orlanguage keyword when multiple values are possible but none are actually specified.
 |  | ALP generates standard Object Module Format (OMF) files that can be linked to produce DOS or OS/2 executables. It can also generate symbolic debugging information compatible with the IBM family of source code debuggers. A MASM 5.10-compatible command line utility (MASM2ALP) is also provided to enable use of ALP with little or no change to existing build environments. | 
|  | 
 |  | 
 | 
|  | Phrase Typically indicates ahypertext link to aseparate panel containing adescription for that phrase.
 |  | ALP also offers a rich set of command line options, as well as a comprehensive listing output cabability that is highly configurable, allowing a visual perspective not possible with other assemblers. | 
|  | 
 |  | 
 | 
|  | ''Parameter''Parameters whose actual names or values are to be supplied by the programmer.
 |  | * [[ALP Programming Guide and Reference/Installation|Installation]] | 
|  | 
 |  | 
 | 
|  | '''''Definition''A term being defined for the first time, or special emphasis.'''
 |  | *[[ALP Programming Guide and Reference/Understanding ALP|Understanding ALP]] | 
|  | 
 |  | 
 | 
|  | Subscript Subscripted text.
 |  | * [[ALP Programming Guide and Reference/Using ALP|Using ALP]] | 
|  | 
 |  | 
 | 
|  | Superscript Superscripted text (other than ý).
 |  | == Language Elements == | 
|  |  | ;Description | 
|  |  | The following sections describe the elements you use to build an ALP program source file. | 
|  | 
 |  | 
 | 
|  | <Name> A text value represented by "Name" is to be substituted in place of <Name>, typically at assembler run-time. <br />
 |  | '''Character Set''' | 
|  | 
 |  | 
 | 
|  | === Assembly Language Processor (ALP) Overview ===
 |  | All elements in an assembler language source file are built from collections of characters contained in the '''character set''', which are defined as: | 
|  | 
 |  | 
 | 
|  | The Assembly Language Processor (ALP)is an assembler that runs under OS/2 Warp. ALP is a functional replacement for the Microsoft Macro Assembler ( MASM) and accepts: |  | * The uppercase and lowercase letters of the English alphabet | 
|  |  | * The decimal digits 0 through 9  | 
|  |  | * The following graphic characters: | 
|  |  |  ~   !   "   #   $   %   ^   &   '   (   )   |  | 
|  |  |  *   +   ,   -   .   /   :   ;   =   <   >   ?  | 
|  |  |  [   \   ]   _   {   }   @  | 
|  | 
 |  | 
 | 
|  | * The full syntax of the Intel 80X86 architecture  |  | * The space and horizontal tab characters | 
|  | * The full syntax of the MASM 5.10 high-level directive language  |  | * The end of line character(s) | 
|  | * A subset ofthe MASM 6.00 high-level directive language <br />
 |  | 
|  | 
 |  | 
 | 
|  | ALP generates standard Object Module Format (OMF) files that can be linked to produce DOS or OS/2 executables. It can also generate symbolic debugging information compatible with the IBM family of source code debuggers. A MASM 5.10-compatible command line utility (MASM2ALP) is also provided to enable use of ALP with little or no change to existing build environments.
 |  | '''White Space''' | 
|  | 
 |  | 
 | 
|  | ALP also offers arich set ofcommand line options, as well as a comprehensive listing output cabability that ishighly configurable, allowing a visual perspective not possible with other assemblers.
 |  | White space is a character or contiguous stream of characters that is ignored or removed from the input stream by the ALP preprocessor. | 
|  | 
 |  | 
 | 
|  | === Installation ===
 |  | '''White space characters''' are any contiguous sequence of one or more space or tab characters not enclosed in single or double quotes. White space characters are significant only in that they serve to separate language tokens from one another; they are removed from the input stream by the scanner. | 
|  | 
 |  | 
 | 
|  | The following components are part of the ALP package:
 |  | ;Syntax | 
|  | 
 |  | 
 | 
|  | '''ALP'''The assembler itself. These are the basic files that must be installed before the assembler can be used. |  | ''Token:'' | 
|  |  | : ''Reserved-Word'' | 
|  |  | : ''Identifier'' | 
|  |  | : ''Literal'' | 
|  |  | : ''Punctuator'' | 
|  | 
 |  | 
 | 
|  | '''MASM2ALP'''The MASM 5.10 Command Line Driver. The ALP component must be installed before theMASM2ALP utility can be utilized.<br />
 |  | === Reserved Words === | 
|  |  | ;Description | 
|  |  | This section describes all of the assembler reserved words. | 
|  | 
 |  | 
 | 
|  | === Installing ALP ===
 |  | ;Syntax | 
|  |  | ''Reserved-Word:'' | 
|  |  | : ''Preprocessor-Directive'' | 
|  |  | : ''Assembler-Directive'' | 
|  |  | : ''Processor-Mnemonic'' | 
|  |  | : ''Processor-Register'' | 
|  |  | : ''Scalar-TypeName'' | 
|  |  | : ''Distance-TypeName'' | 
|  |  | : ''Language-Name'' | 
|  |  | : ''Anonymous-Label-Alias'' | 
|  |  | : ''Location-Counter-Alias'' | 
|  |  | : ''Indeterminate-Value-Alias'' | 
|  |  | : ''Directive-Keyword'' | 
|  |  | : ''Operator-Keyword'' | 
|  | 
 |  | 
 | 
|  | ALP consists oftwo files: <br />
 |  | ==== Preprocessor Directives ==== | 
|  |  | ;Description | 
|  |  | '''Preprocessor Directives''' are symbolic names that describe the various assembly-time text processing instructions interpreted by the preprocessor phase of the assembler. | 
|  | 
 |  | 
 | 
|  | <pre>alp . exe 
 |  | ;Syntax | 
|  | alp . msg </pre>
 |  | ''Preprocessor-Directive:'' one of | 
|  | You can rename the root portions of the two file names if desired. In most cases, it does not matter whether the file names are in upper- or lowercase because the default OS/2 file systems disregard case. It is possible, however, that the use of an OS/2 Installable File System (IFS) might require that file names be referenced exactly as they are named with respect to upper- and lowercase. If this is true, then the root portion of the '''alp.exe'''and '''alp.msg'''file names (see [[00008.htm|BaseEXE]]) must be spelled identically and the ''.msg''extension on the messages file name must be specified in lowercase or the assembler will not be able to find the messages file at run time.
 |  |  CATSTR      COMMENT     ELSE        ELSEIF | 
|  |  |  ELSEIF1     ELSEIF2     ELSEIFB     ELSEIFDEF | 
|  |  |  ELSEIFDIF   ELSEIFDIFI  ELSEIFE     ELSEIFIDN | 
|  |  |  ELSEIFIDNI  ELSEIFNB    ELSEIFNDEF  ENDIF | 
|  |  |  ENDM        EQU         EXITM       FOR | 
|  |  |  FORC        IF          IF1         IF2 | 
|  |  |  IFB         IFDEF       IFDIF       IFDIFI | 
|  |  |  IFE         IFIDN       IFIDNI      IFNB | 
|  |  |  IFNDEF      INCLUDE     INSTR       IRP | 
|  |  |  IRPC        LOCAL       MACRO       PURGE | 
|  |  |  REPEAT      REPT        SIZESTR     SUBSTR | 
|  | 
 |  | 
 | 
|  | To install ALP on OS/2:
 |  | ==== Assembler Directives ==== | 
|  |  | ;Description | 
|  |  | '''''Assembler Directives''''' are symbolic names that describe the various assembly-time instructions interpreted by the assembler itself. | 
|  | 
 |  | 
 | 
|  | 1.Copy '''alp.exe'''into a directory ofyour choice.If the assembler will be invoked from the command line (rather than by absolute reference from a makefile or command file), then the selected directory should be among those referenced by the [[00033.htm|PATH]]environment variable.
 |  | ;Syntax | 
|  |  | ''Assembler-Directive:'' one of | 
|  |  |  .186          .286          .286C         .286P | 
|  |  |  .287          .386          .386C         .386P | 
|  |  |  .387          .486          .486C         .486P | 
|  |  |  .586          .586P         .686          .686P | 
|  |  |  .8086         .8087          ALIGN        .ALPHA | 
|  |  |   ASSUME       %BIN          .CODE          COMM | 
|  |  |  .CONST        .CREF         .DATA         .DATA? | 
|  |  |   DB            DD            DF            DOSSEG | 
|  |  |  .DOSSEG        DQ            DT            DW | 
|  |  |   ECHO          END           ENDP          ENDS | 
|  |  |   EQU          .ERR          .ERR1         .ERR2 | 
|  |  |  .ERRB         .ERRDEF       .ERRDIF       .ERRDIFI | 
|  |  |  .ERRE         .ERRIDN       .ERRIDNI      .ERRNB | 
|  |  |  .ERRNDEF      .ERRNZ         EVEN          EXTERN | 
|  |  |   EXTERNDEF     EXTRN        .FARDATA      .FARDATA? | 
|  |  |   GROUP         INCLUDELIB    LABEL        .LALL | 
|  |  |  .LFCOND       .LIST         .LISTALL      .LISTIF | 
|  |  |  .LISTMACRO    .LISTMACROALL  LOCAL        .MMX | 
|  |  |  .MODEL         NAME         .NOCREF       .NOLIST | 
|  |  |  .NOLISTIF     .NOLISTMACRO  .NOMMX         OPTION | 
|  |  |   ORG          %OUT           PAGE          PROC | 
|  |  |   PUBLIC       .RADIX         RECORD       .SALL | 
|  |  |   SEGMENT      .SEQ          .SFCOND       .STACK | 
|  |  |   STRUC         STRUCT        SUBTITLE      SUBTTL | 
|  |  |  .TFCOND        TITLE         TYPEDEF       UNION | 
|  |  |  .XALL         .XCREF        .XLIST | 
|  | 
 |  | 
 | 
|  | 2.For best performance, the '''alp.msg'''file should be copied into thesame directory used in step 1 or ina directory referenced by the[[00030.htm|<BaseEXE>_PATH]] environment variable. It is not necessary to setany additional environment variables if the first method is used.
 |  | ==== Processor Mnemonics ==== | 
|  |  | ;Description | 
|  |  | '''Processor Mnemonics''' are symbolic names given to the various instructions in the processor instruction set. | 
|  | 
 |  | 
 | 
|  | Alternatively, a directory referenced by the [[00031.htm|DPATH]]environment variable may also be used, but performance may be degraded during initialization, since the assembler must search all of the listed directories for the '''alp.msg''' file. See [[00006.htm|The ALP Messages File]]for more information.
 |  | ;Syntax | 
|  |  | ''Processor-Mnemonic:'' one of | 
|  | 
 |  | 
 | 
|  | 3.Optionally, default values for command line options may be established. See [[00029.htm|<BaseEXE>_OPTIONS]]for more information. <br />
 |  |  AAA        AAD        AAM        AAS        ADC | 
|  |  |  ADD        AND        ARPL       BOUND      BSF | 
|  |  |  BSR        BSWAP      BT         BTC        BTR | 
|  |  |  BTS        CALL       CBW        CDQ        CLC | 
|  |  |  CLD        CLI        CLTS       CMC        CMOVA | 
|  |  |  CMOVAE     CMOVB      CMOVBE     CMOVC      CMOVE | 
|  |  |  CMOVG      CMOVGE     CMOVL      CMOVLE     CMOVNA | 
|  |  |  CMOVNAE    CMOVNB     CMOVNBE    CMOVNC     CMOVNE | 
|  |  |  CMOVNG     CMOVNGE    CMOVNL     CMOVNLE    CMOVNO | 
|  |  |  CMOVNP     CMOVNS     CMOVNZ     CMOVO      CMOVP | 
|  |  |  CMOVPE     CMOVPO     CMOVS      CMOVZ      CMP | 
|  |  |  CMPS       CMPSB      CMPSD      CMPSW      CMPXCHG | 
|  |  |  CMPXCHG8B  CPUID      CWD        CWDE       DAA | 
|  |  |  DAS        DEC        DIV        EMMS       ENTER | 
|  |  |  ESC        F2XM1      FABS       FADD       FADDP | 
|  |  |  FBLD       FBSTP      FCHS       FCLEX      FCMOVB | 
|  |  |  FCMOVBE    FCMOVE     FCMOVNB    FCMOVNBE   FCMOVNE | 
|  |  |  FCMOVNU    FCMOVU     FCOM       FCOMI      FCOMIP | 
|  |  |  FCOMP      FCOMPP     FCOS       FDECSTP    FDISI | 
|  |  |  FDIV       FDIVP      FDIVR      FDIVRP     FENI | 
|  |  |  FFREE      FIADD      FICOM      FICOMP     FIDIV | 
|  |  |  FIDIVR     FILD       FIMUL      FINCSTP    FINIT | 
|  |  |  FIST       FISTP      FISUB      FISUBR     FLD | 
|  |  |  FLD1       FLDCW      FLDENV     FLDENVD    FLDENVW | 
|  |  |  FLDL2E     FLDL2T     FLDLG2     FLDLN2     FLDPI | 
|  |  |  FLDZ       FMUL       FMULP      FNCLEX     FNDISI | 
|  |  |  FNENI      FNINIT     FNOP       FNSAVE     FNSAVED | 
|  |  |  FNSAVEW    FNSTCW     FNSTENV    FNSTENVD   FNSTENVW | 
|  |  |  FNSTSW     FPATAN     FPREM      FPREM1     FPTAN | 
|  |  |  FRNDINT    FRSTOR     FRSTORD    FRSTORW    FSAVE | 
|  |  |  FSAVED     FSAVEW     FSCALE     FSETPM     FSIN | 
|  |  |  FSINCOS    FSQRT      FST        FSTCW      FSTENV | 
|  |  |  FSTENVD    FSTENVW    FSTP       FSTSW      FSUB | 
|  |  |  FSUBP      FSUBR      FSUBRP     FTST       FUCOM | 
|  |  |  FUCOMI     FUCOMIP    FUCOMP     FUCOMPP    FWAIT | 
|  |  |  FXAM       FXCH       FXTRACT    FYL2X      FYL2XP1 | 
|  |  |  HLT        IDIV       IMUL       IN         INC | 
|  |  |  INS        INSB       INSD       INSW       INT | 
|  |  |  INTO       INVD       INVLPG     IRET       IRETD | 
|  |  |  IRETDF     IRETF      JA         JAE        JB | 
|  |  |  JBE        JC         JCXZ       JE         JECXZ | 
|  |  |  JG         JGE        JL         JLE        JMP | 
|  |  |  JNA        JNAE       JNB        JNBE       JNC | 
|  |  |  JNE        JNG        JNGE       JNL        JNLE | 
|  |  |  JNO        JNP        JNS        JNZ        JO | 
|  |  |  JP         JPE        JPO        JS         JZ | 
|  |  |  LAHF       LAR        LDS        LEA        LEAVE  | 
|  |  |  LES        LFS        LGDT       LGS        LIDT  | 
|  |  |  LLDT       LMSW       LOCK       LODS       LODSB  | 
|  |  |  LODSD      LODSW      LOOP       LOOPD      LOOPE  | 
|  |  |  LOOPED     LOOPEW     LOOPNE     LOOPNED    LOOPNEW  | 
|  |  |  LOOPNZ     LOOPNZD    LOOPNZW    LOOPW      LOOPZ  | 
|  |  |  LOOPZD     LOOPZW     LSL        LSS        LTR  | 
|  |  |  MOV        MOVD       MOVQ       MOVS       MOVSB  | 
|  |  |  MOVSD      MOVSW      MOVSX      MOVZX      MUL  | 
|  |  |  NEG        NOP        NOT        OR         OUT  | 
|  |  |  OUTS       OUTSB      OUTSD      OUTSW      PACKSSDW  | 
|  |  |  PACKSSWB   PACKUSWB   PADDB      PADDD      PADDSB  | 
|  |  |  PADDSW     PADDUSB    PADDUSW    PADDW      PAND  | 
|  |  |  PANDN      PCMPEQB    PCMPEQD    PCMPEQW    PCMPGTB  | 
|  |  |  PCMPGTD    PCMPGTW    PMADDWD    PMULHW     PMULLW  | 
|  |  |  POP        POPA       POPAD      POPD       POPF  | 
|  |  |  POPFD      POPW       POR        PSLLD      PSLLQ  | 
|  |  |  PSLLW      PSRAD      PSRAW      PSRLD      PSRLQ  | 
|  |  |  PSRLW      PSUBB      PSUBD      PSUBSB     PSUBSW  | 
|  |  |  PSUBUSB    PSUBUSW    PSUBW      PUNPCKHBW  PUNPCKHDQ  | 
|  |  |  PUNPCKHWD  PUNPCKLBW  PUNPCKLDQ  PUNPCKLWD  PUSH  | 
|  |  |  PUSHA      PUSHAD     PUSHD      PUSHF      PUSHFD  | 
|  |  |  PUSHW      PXOR       RCL        RCR        RDMSR  | 
|  |  |  RDPMC      RDTSC      REP        REPE       REPNE  | 
|  |  |  REPNZ      REPZ       RET        RETF       RETN  | 
|  |  |  ROL        ROR        RSM        SAHF       SAL  | 
|  |  |  SAR        SBB        SCAS       SCASB      SCASD  | 
|  |  |  SCASW      SETA       SETAE      SETB       SETBE  | 
|  |  |  SETC       SETE       SETG       SETGE      SETL  | 
|  |  |  SETLE      SETNA      SETNAE     SETNB      SETNBE  | 
|  |  |  SETNC      SETNE      SETNG      SETNGE     SETNL  | 
|  |  |  SETNLE     SETNO      SETNP      SETNS      SETNZ  | 
|  |  |  SETO       SETP       SETPE      SETPO      SETS  | 
|  |  |  SETZ       SGDT       SHL        SHLD       SHR  | 
|  |  |  SHRD       SIDT       SLDT       SMSW       STC  | 
|  |  |  STD        STI        STOS       STOSB      STOSD  | 
|  |  |  STOSW      STR        SUB        TEST       UC2  | 
|  |  |  VERR       VERW       WAIT       WBINVD     WRMSR  | 
|  |  |  XADD       XCHG       XLAT       XLATB      XOR | 
|  | 
 |  | 
 | 
|  | === Installing MASM2ALP === |  | ==== Processor Registers ==== | 
|  |  | ;Description | 
|  |  | '''Processor Registers''' are the symbolic names assigned to the various internal processor registers. They are normally used as operands to processor instructions. | 
|  | 
 |  | 
 | 
|  | The MASM2ALP utility consists of a single file:<br />
 |  | ;Syntax | 
|  |  | ''Processor-Register:'' | 
|  |  | : ''General-Purpose-Register'' | 
|  |  | : ''Segment-Register'' | 
|  |  | : ''Control-Register'' | 
|  |  | : ''Debug-Register'' | 
|  |  | : ''Test-Register'' | 
|  |  | : ''MMX-Register'' | 
|  |  | : ''Floating-Point-Register'' | 
|  | 
 |  | 
 | 
|  | <pre>masm2alp . exe </pre>
 |  | ''General-Purpose-Register:'' | 
|  | To install MASM2ALP on OS/2:
 |  | : ''8-Bit-Register'' | 
|  |  | : ''16-Bit-Register'' | 
|  |  | : ''32-Bit-Register'' | 
|  | 
 |  | 
 | 
|  | 1.Copy '''masmalp.exe'''into a directory of your choice. If the utility will be invoked from the command line (rather than by absolute reference from a makefile or command file), then the selected directory should be among those referenced by the [[00033.htm|PATH]]environment variable.
 |  | ''8-Bit-Register:'' one of  | 
|  |  | : '''AL AH BL BH CL CH DL DH''' | 
|  | 
 |  | 
 | 
|  | It is recommended that both '''masm2alp.exe'''and '''alp.exe'''be installed in the same directory, especially in build environments where reliance on environment variables is discouraged. If '''masm2alp.exe'''is invoked by absolute path name (rather than via a [[00033.htm|PATH]]search), it will use that same path when it first attempts to execute '''alp.exe'''. This technique allows execution of '''alp.exe'''without requiring it to be referenced in the [[00033.htm|PATH]]. If the search fails, the path name prefix will be removed and MASM2ALP will rely on the operating system to locate '''alp.exe'''.
 |  | ''16-Bit-Register:'' one of   | 
|  |  | : '''AX BX CX DX DI SI BP SP''' | 
|  | 
 |  | 
 | 
|  | 2.If you also use the Microsoft Macro Assembler, you must decide if MASM2ALP will replace MASM or co-exist with it. This usually means renaming the MASM executable ('''masm.exe''') to something else, then renaming '''masm2alp.exe'''to '''masm.exe'''. Alternatively, you may choose to leave the names unchanged, taking manual steps in your makefiles or build scripts to insure that the correct executables are referenced from your build environment.
 |  | ''32-Bit-Register:'' one of | 
|  |  | : '''EAX EBX ECX EDX EDI ESI EBP ESP''' | 
|  | 
 |  | 
 | 
|  | 3.Optionally, default values for command line options may be established by defining the '''MASM'''environment variable. MASM2ALP interprets the contents ofthis environment variable before processing the command line. Any values set in this manner are translated and passed to '''alp.exe'''via the command line. The [[00029.htm|<BaseEXE>_OPTIONS]]environment variable used by '''alp.exe'''is not queried or modified by MASM2ALP.
 |  | ''Segment-Register:'' one of   | 
|  |  | : '''CS DS ES FS GS SS''' | 
|  | 
 |  | 
 | 
|  | 4.If it becomes necessary to analyze a problem with MASM2ALP (such as failure to invoke '''alp.exe''', or other unexpected behavior), defining the '''ALP_ ECHO'''environment variable to any non-empty value will cause MASM2ALP to echo the generated command line to the standard output device. <br />
 |  | ''Control-Register:'' one of  | 
|  |  | : '''CR0 CR2 CR3 CR4''' | 
|  | 
 |  | 
 | 
|  | === Understanding ALP ===
 |  | ''Debug-Register:'' one of | 
|  |  | : '''DR0 DR1 DR2 DR3 DR4 DR5 DR6 DR7''' | 
|  | 
 |  | 
 | 
|  | This chapter describes:
 |  | ''Test-Register:'' one of | 
|  | *The ALP message file
 |  | : '''TR3 TR4 TR5 TR6 TR7''' | 
|  | *ALP internal variables
 |  | 
|  | 
 |  | 
 | 
|  | Though you do not need to understand this information to be able to use ALP , you may need this information for troubleshooting purposes.
 |  | ''MMX-Register:'' one of | 
|  |  | : '''MM0 MM1 MM2 MM3 MM4 MM5 MM6 MM7''' | 
|  | 
 |  | 
 | 
|  | === The ALP Messages File ===
 |  | ''Floating-Point-Register:'' | 
|  |  | '''ST''' | 
|  | 
 |  | 
 | 
|  | Nearly every message displayed by ALP at run time is stored in a separate message file.The exception to this rule aremessages that are displayed if themessage file cannot be opened: ALP ends if one ofthese messages is displayed.
 |  | ==== Scalar Type Names ==== | 
|  |  | ;Description | 
|  |  | '''Scalar Type Names''' are the symbolic names given to the integral data types. These are the fundamental types of data upon which the processor can directly operate. | 
|  | 
 |  | 
 | 
|  | When ALP starts, it determines the name of the message file by creating a name of the form <[[00008.htm|BaseEXE]]>'''.msg'''(see [[00008.htm|BaseEXE]]). Once ALP knows the name of the message file, ALP searches the following directories in the following order for the file:
 |  | ;Syntax | 
|  |  | ''Scalar-TypeName:'' | 
|  |  | : '''BYTE''' | 
|  |  | : '''SBYTE''' | 
|  |  | : '''WORD''' | 
|  |  | : '''SWORD''' | 
|  |  | : '''DWORD''' | 
|  |  | : '''SDWORD''' | 
|  |  | : '''REAL4''' | 
|  |  | : '''FWORD''' | 
|  |  | : '''QWORD''' | 
|  |  | : '''REAL8''' | 
|  |  | : '''TBYTE''' | 
|  |  | : '''REAL10''' | 
|  | 
 |  | 
 | 
|  | 1.Current directory <br /> 2.The directory contained in the[[00009.htm|BasePATH]]internal variable <br /> 3.Each of thedirectories specified in the [[00008.htm|BaseEXE]]internal variable <br /> 4.Each of thedirectories specified in the [[00033.htm|PATH]]environment variable <br /> 5.Each of thedirectories specified in the[[00031.htm|DPATH]]environment variable <br />
 |  | ==== Distance Type Names ==== | 
|  |  | ;Description | 
|  |  | '''Distance Type Names''' are the symbolic names given to the integral types of pointers directly supported by the processor. Their names reflect a fundamental property of the Intel processor architecture known as ''distance''. The type of pointer is defined by the ''distance'' required to reach the information to which it points. | 
|  | 
 |  | 
 | 
|  | === Internal Variables ===
 |  | ;Syntax | 
|  |  | ''Distance-TypeName:'' | 
|  |  | : '''NEAR''' | 
|  |  | : '''NEAR16''' | 
|  |  | : '''NEAR32''' | 
|  |  | : '''FAR''' | 
|  |  | : '''FAR16''' | 
|  |  | : '''FAR32''' | 
|  | 
 |  | 
 | 
|  | ALP maintains a set of ''internal variables''that it uses for variouspurposes . These variables reflect theALP environment; programmers do not use these variables. Their values may be indirectly affected by theuser of ALP , for instance, through theuse of various command line options.
 |  | ==== Language Names ==== | 
|  |  | ;Description | 
|  |  | '''Language Names''' refer to the various high level programming languages (or more specifically, the calling conventions used by such languages) with which the assembler has the ability to interface. | 
|  | 
 |  | 
 | 
|  |  | ;Syntax | 
|  |  | ''Language-Name:'' | 
|  |  | : '''C''' | 
|  |  | : '''SYSCALL''' | 
|  |  | : '''STDCALL''' | 
|  |  | : '''PASCAL''' | 
|  |  | : '''FORTRAN''' | 
|  |  | : '''BASIC''' | 
|  |  | : '''OPTLINK''' | 
|  | 
 |  | 
 | 
|  | === BaseEXE === |  | ==== Anonymous Label Aliases ==== | 
|  |  | ;Description | 
|  |  | The '''''Anonymous Label Aliases''''' are reserved symbolic names that return a context-sensitive value when referenced in expressions. | 
|  | 
 |  | 
 | 
|  | When ALP is invoked, if the full path nameof the ALP executable was provided by the operating system, then the "base" portion is isolated and used to construct the value of the '''BaseEXE'''internal variable. For instance , if the user invoked ALP and the nameof the executable was made available as "C:\TOOLS\ALP.EXE", then the '''BaseEXE'''internal variable would contain thevalue "ALP". The value of '''BaseEXE'''is used to differentiate ALP-specific components in theenvironment (such as data files or environment variables) from those that are globally accessible to all programs. Even multiple versions of ALP can coexist without environmental "collisions" simply by copying and renaming the ALP executable and its associated message file.
 |  | The reserved name '''@B''' (backward reference) returns the internally generated name representing the nearest '''@@:''' code label appearing before the current location in the input stream. | 
|  | 
 |  | 
 | 
|  | If the file nameof the ALP executable is '''not'''available at run time, then thevalue of '''BaseEXE'''defaults to "ALP".
 |  | The reserved name '''@F''' (forward reference) returns the internally generated name representing the nearest '''@@:''' code label appearing after the current location in the input stream. | 
|  | 
 |  | 
 | 
|  |  | ;Syntax | 
|  |  | ''Anonymous-Label-Alias:'' | 
|  |  | : '''@B''' | 
|  |  | : '''@F''' | 
|  | 
 |  | 
 | 
|  |  | ==== Location Counter Alias ==== | 
|  |  | ;Description | 
|  |  | The '''''Location Counter Alias''''' is a reserved name used in expressions to return the offset within the current segment or structure being assembled. | 
|  | 
 |  | 
 | 
|  | === BasePATH ===
 |  | ;Syntax | 
|  |  | ''Location-Counter-Alias:'' | 
|  |  | : '''$''' | 
|  | 
 |  | 
 | 
|  | When ALP is invoked, if the full path name of the ALP executable was provided by the operating system, then the "path" portion is isolated and used to construct the value of the '''BasePATH'''internal variable. For instance, if the user invoked ALP and the name of the executable was made available as "C:\TOOLS\ALP.EXE", then the '''BasePATH'''internal variable would contain the value "C:\TOOLS\". The value of '''BasePATH'''can be usedto locate ALP-specific components inthe environment (such as the ALP messages file) without the need tostore this information in analternate environment variable such as DPATH. Check your operating system documentation to see if it feasible to use the '''BasePATH'''method of locating ALP components.
 |  | ==== Indeterminate Value Alias ==== | 
|  |  | ;Description | 
|  |  | The '''''Indeterminate Value Alias''''' is a reserved name used in expressions to represent an uninitialized value. | 
|  | 
 |  | 
 | 
|  | If the file name of the ALP executable is '''not'''available at run time, then the value of '''BasePATH'''is NULL.
 |  | ;Syntax | 
|  |  | ''Indeterminate-Value-Alias:'' | 
|  |  | : '''?''' | 
|  | 
 |  | 
 | 
|  |  | ==== Directive Keywords ==== | 
|  |  | ;Description | 
|  |  | '''''Directive Keywords''''' are symbolic names recognized and used in the body of various assembler directives. | 
|  | 
 |  | 
 | 
|  | === IncDIR ===
 |  | ;Syntax | 
|  |  | ''Directive-Keyword:'' | 
|  |  |  ABS         AT            BASIC         C | 
|  |  |  CASEMAP     CODE          COMMON        DOTNAME | 
|  |  |  EMULATOR    EPILOGUE      ERROR         EXPORT | 
|  |  |  EXPR16      EXPR32        FARSTACK      FLAT | 
|  |  |  FORTRAN     HUGE          LANGUAGE      LARGE | 
|  |  |  LJMP        MEDIUM        NEARSTACK     NODOTNAME | 
|  |  |  NOEMULATOR  NOKEYWORD     NOLANGUAGE    NOLJMP | 
|  |  |  NONE        NOOLDMACROS   NOOLDSTRUCTS  NOREADONLY | 
|  |  |  NOSCOPED    NOSIGNEXTEND  NOTHING       NOTPUBLIC | 
|  |  |  OLDMACROS   OLDSTRUCTS    OPTLINK       OS_DOS | 
|  |  |  OS_OS2      PAGE          PARA          PASCAL | 
|  |  |  PRIVATE     PROC          PROLOGUE      PUBLIC | 
|  |  |  READONLY    SCOPED        SEGMENT       SIGNEXTEND | 
|  |  |  SMALL       STACK         STDCALL       SYSCALL | 
|  |  |  TINY        USE16         USE32         USES | 
|  | 
 |  | 
 | 
|  | This variable contains the empty string unless explicitly initialized with the '''Fdi'''parameterized command line option; it contains the cumulative value of all the specified include paths.
 |  | ==== Operator Keywords ==== | 
|  |  | ;Description | 
|  |  | '''''Operator Keywords''''' are symbolic names used in expressions to denote an operation to be performed on one or more operands. | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | ;Syntax | 
|  |  | ''Operator-Keyword:'' | 
|  |  |  AND         DUP         EQ          GE | 
|  |  |  GT          HIGH        HIGHWORD    LE | 
|  |  |  LENGTH      LENGTHOF    LOW         LOWWORD | 
|  |  |  LT          MASK        MOD         NE | 
|  |  |  NOT         OFFSET      OPATTR      OR | 
|  |  |  PTR         SEG         SHL         SHORT | 
|  |  |  SHR         SIZE        SIZEOF      THIS | 
|  |  |  .TYPE       TYPE        WIDTH       XOR | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00053.htm|Fdi - Specify Include File Search Path]] <br />
 |  | === Identifiers === | 
|  |  | ;Description | 
|  |  | This section describes the syntax for identifiers and the various types of information they can be made to represent. | 
|  | 
 |  | 
 | 
|  |  | ;Syntax | 
|  |  | ''Identifier:'' | 
|  |  | : ''Normal-Identifier'' | 
|  |  | : ''Dot-Identifier'' | 
|  |  | : ''Normal-Identifier'' | 
|  |  | : ''NonDigit'' | 
|  |  | : ''Normal-Identifier Identifer-Character'' | 
|  | 
 |  | 
 | 
|  | === IncEXT ===
 |  | ''Dot-Identifier'' | 
|  |  | ''. Normal-Identifier'' | 
|  | 
 |  | 
 | 
|  | This variable contains the default include file name extension that is conditionally appended to unadorned file names generated by the '''INCLUDE'''preprocessor directive. The default value for '''IncEXT'''is ".inc" unless altered by use of the '''Fei'''parameterized command line option.
 |  | ''Identifier-Character'' | 
|  |  | ''NonDigit'' | 
|  |  | ''Digit'' | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | ''NonDigit:'' one of | 
|  |  |  _ $ @ ? | 
|  |  |  a b c d e f g h i j k l m | 
|  |  |  n o p q r s t u v w x y z | 
|  |  |  A B C D E F G H I J K L M | 
|  |  |  N O P Q R S T U V W X Y Z | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00058.htm|Fei - Control Include File Extension (IncEXT)]] <br />
 |  | ''Digit:'' one of | 
|  |  |  0 1 2 3 4 5 6 7 8 9 | 
|  | 
 |  | 
 | 
|  |  | ==== Identifier Types ==== | 
|  |  | ;Description | 
|  |  | This section describes the various types of identifiers that the assembler will create and manipulate. | 
|  | 
 |  | 
 | 
|  |  | ;Definition | 
|  |  | ''Identifier-Type:'' | 
|  |  | : ''EquateName'' | 
|  |  | : ''FieldName'' | 
|  |  | : ''GroupName'' | 
|  |  | : ''LabelName'' | 
|  |  | : ''MacroName'' | 
|  |  | : ''SegmentName'' | 
|  |  | : ''UserDefined-TypeName'' | 
|  | 
 |  | 
 | 
|  | === LstDIR === |  | ===== Equate Name ===== | 
|  | 
 |  | 
 | 
|  | This variable contains the empty string unless explicitly initialized with the '''Fdl'''parameterized command line option;it is only used if the value specified by the '''Fl'''command line option did not contain any path information.
 |  | ;Definition | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | ''EquateName:'' | 
|  |  | : ''Numeric-EquateName'' | 
|  |  | : ''Text-EquateName'' | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00050.htm|Fl - Produce Listing File]] <br />�[[00054.htm|Fdl - Directory to Store Listing File (LstDIR)]] <br />
 |  | ;Description | 
|  |  | An ''EquateName'' is a symbolic identifier that is associated with an expression or a body of text. The assembler substitutes the value of the ''EquateName'' at the point of reference. | 
|  | 
 |  | 
 | 
|  |  | ====== Numeric Equate Name ====== | 
|  |  | An identifier becomes a ''Numeric-EquateName'' when it is defined in a EQU or = directive. Procedure parameter names and local variable names are also created as ''Numeric-EquateNames'', but are visible only from within the procedure where they are defined. All other ''Numeric-EquateNames'' are globally-scoped identifiers visible across the entire module. | 
|  | 
 |  | 
 | 
|  |  | A ''Numeric-EquateName'' may only be referenced from within expressions, as its replacement value is itself an expression. | 
|  | 
 |  | 
 | 
|  | === LstEXT === |  | ====== Text Equate Name ====== | 
|  |  | A ''Text-EquateName'' is a globally-scoped identifier created during the processing of a EQU preprocessor directive. A ''Text-EquateName'' is associated with a body of text whose content may not span across line breaks. In certain contexts the assembler replaces the ''Text-EquateName'' with the text that it represents and recursively evaluates the result. | 
|  | 
 |  | 
 | 
|  | This variable contains the default listing file name extension that is conditionally appended to the concatenated values of [[00012.htm|LstDIR]]and [[00014.htm|LstNAME]];the assembler treats the resulting string as the fully qualified listing file name. The default value for '''LstEXT'''is ".lst" unless altered by use of the '''Fel'''parameterized command line option.
 |  | ===== Field Name ===== | 
|  |  | ;Definition | 
|  |  | ''FieldName:'' | 
|  |  | : ''Record-FieldName'' | 
|  |  | : ''Structure-FieldName'' | 
|  |  | : ''Union-FieldName'' | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | ;Description | 
|  |  | An identifier becomes a ''FieldName'' when it is defined within a RECORD, STRUCT, or UNION directive. | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00059.htm|Fel - Control Listing File Extension (LstEXT)]] <br />
 |  | ====== Record Field Name ====== | 
|  |  | A ''Record-FieldName'' is a globally-scoped identifier created during the processing of a RECORD directive. It is a special variation of a ''Numeric-EquateName'' and can be used in the same contexts. | 
|  | 
 |  | 
 | 
|  |  | ====== Structure Field Name ====== | 
|  |  | An identifier becomes a ''Structure-FieldName'' when it is defined in a STRUCT directive. If the assembler is operating in M510 mode, or if the OPTION OLDSTRUCTS directive has been specified, then a ''Structure-FieldName'' is a globally-scoped identifier treated as a special variation of a ''Numeric-EquateName'' and can be used in the same contexts. Otherwise, a ''Structure-FieldName'' is private to the defining structure and is only accessible in expressions through use of the Structure/Union Field Selection (. Operator). | 
|  | 
 |  | 
 | 
|  |  | ====== Union Field Name ====== | 
|  |  | An identifier becomes a ''Union-FieldName'' when it is defined in a UNION directive. A ''Union-FieldName'' is private to the defining union and is only accessible in expressions through use of the Structure/Union Field Selection (. Operator). | 
|  | 
 |  | 
 | 
|  | === LstNAME === |  | ===== Group Name ===== | 
|  |  | A ''GroupName'' is a globally-scoped identifier created during the processing of a GROUP directive. It is referenced from within expressions. | 
|  | 
 |  | 
 | 
|  | This variable contains the same value as the contents of [[00024.htm|SrcNAME]], unless initialized with the '''Fl'''parameterized command line option.
 |  | ===== Label Name ===== | 
|  |  | ;Definition | 
|  |  | ''LabelName:'' | 
|  |  | : ''Code-LabelName'' | 
|  |  | : ''Data-LabelName'' | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | ;Description | 
|  |  | A ''LabelName'' is globally-scoped identifier that is associated with a program address at application run-time. It has an explicit or inherited ''Type-Declaration'', and an optional ''Language-Attribute''. These attributes are described in the following sections. | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00050.htm|Fl - Produce Listing File]] <br />
 |  | ;Type Declaration | 
|  |  | The type declaration associated with a label name depends on how the label was defined. See the ''Code-LabelName'' and ''Data-LabelName'' sections for descriptions on how this attribute is assigned. | 
|  | 
 |  | 
 | 
|  |  | ;Language Attribute | 
|  |  | A ''LabelName'' can have an assigned ''Language-Attribute'', set either implicitly through the use of a ''Language-Name'' keyword in the body of a .MODEL or OPTION directive, or explicitly through the use of an overriding ''Language-Name'' keyword in the body of a EXTERN/EXTRN, EXTERNDEF, PROC, or PUBLIC directive. The ''Language-Attribute'' determines the exact spelling of the ''LabelName'' identifier when it is written to the object file. According to the ''Language-Attribute'', identifier spellings are modified from their appearance in the assembly language source module as follow: | 
|  |  | {| class="wikitable" | 
|  |  | !LANGUAGE ATTRIBUTE!!IDENTIFIER SPELLING | 
|  |  | |- | 
|  |  | |OPTLINK, SYSCALL||No modifications are made to the identifier when written to the object file. | 
|  |  | |- | 
|  |  | |C, STDCALL||A leading underscore character is appended to the front of the name. | 
|  |  | |- | 
|  |  | |BASIC, FORTRAN, PASCAL||All characters in the identifier are converted to uppercase. | 
|  |  | |} | 
|  | 
 |  | 
 | 
|  |  | ===== Code Label Name ===== | 
|  |  | ;Definition | 
|  |  | ''Code-LabelName:'' | 
|  |  | : ''Target-LabelName'' | 
|  |  | : ''Procedure-LabelName'' | 
|  | 
 |  | 
 | 
|  | === MsgDIR ===
 |  | ;Description | 
|  |  | A ''Code-LabelName'' is an identifier that is associated with an executable code address at application run-time. There are two types of ''Code-LabelNames: Target-LabelNames'' and ''Procedure-LabelNames''. | 
|  | 
 |  | 
 | 
|  | This variable contains the empty string unless explicitly initialized with the '''Fdm'''parameterized command line option; it isonly used if the value specified by the '''Fm'''command line option did not contain any path information.
 |  | ====== Target Label Name ====== | 
|  |  | An identifier becomes a ''Target-LabelName'' when it is defined with a :, ::, or LABEL directive. | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | If a ''Target-LabelName'' created with a single colon (:) is defined within the body of a procedure, then the name is visible only from within that procedure unless operating in M510 mode (and no .MODEL directive with a ''Language-Name'' has been specified), or unless the OPTION NOSCOPED directive has been specified. | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00051.htm|Fm -Produce Messages File]] <br />�[[00055.htm|Fdm - Directory to Store Messages File (MsgDIR)]] <br />
 |  | A ''Target-LabelName'' defined outside the body of a procedure is visible to the entire module, and may also be given PUBLIC visibility. | 
|  | 
 |  | 
 | 
|  |  | ====== Procedure Label Name ====== | 
|  |  | An identifier becomes a ''Procedure-LabelName'' when it is defined in a '''PROC''' directive. | 
|  | 
 |  | 
 | 
|  |  | ===== Data Label Name ===== | 
|  |  | A ''Data-LabelName'' is an identifier that is the address of a program variable at application run-time. An identifier becomes a ''Data-LabelName'' when it is named in a data allocation statement, or when a scalar, aggregate, or vector type is associated with the identifier named in a LABEL, EXTERN/ EXTRN, EXTERNDEF, or COMM directive. | 
|  | 
 |  | 
 | 
|  | === MsgEXT === |  | ==== Macro Name ==== | 
|  |  | A ''MacroName'' is a globally-scoped identifier created during the processing of a '''MACRO''' directive. It is associated with a multi-line body of text. A ''MacroName'' may only be used in contexts where a normal assembler directive is expected. | 
|  | 
 |  | 
 | 
|  | This variable contains the default messages file name extension that is conditionally appended to the concatenated values of [[00015.htm|MsgDIR]]and [[00017.htm|MsgNAME]]; the assembler treats the resulting string as the fully qualified messages file name. The default value for '''MsgEXT'''is".msg" unless altered by use of the '''Fem'''parameterized command lineoption.
 |  | ===== Macro Parameter Name ===== | 
|  |  | An identifier becomes a ''Macro-ParameterName'' when it is named as a parameter to a macro in a '''MACRO''' directive. It is associated with a body of text whose content may not span across line breaks. It is only recognized and acted upon from within the body of a macro expansion. | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | ==== Segment Name ==== | 
|  |  | A ''SegmentName'' is a globally-scoped identifier created during the processing of a SEGMENT directive. It may be referenced from within expressions or in the body of a GROUP directive. | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00060.htm|Fem -Control Messages File Extension (MsgEXT)]] <br />
 |  | ==== User-Defined Type Name ==== | 
|  |  | ;Definition | 
|  |  | ''UserDefined-TypeName:'' | 
|  |  | : ''Record-TypeName'' | 
|  |  | : ''Structure-TypeName'' | 
|  |  | : ''Typedef-TypeName'' | 
|  |  | : ''Union-TypeName'' | 
|  | 
 |  | 
 | 
|  |  | ;Description | 
|  |  | An identifier becomes a ''UserDefined-TypeName'' when it is defined within a RECORD, STRUCT, TYPEDEF, or UNION directive. | 
|  | 
 |  | 
 | 
|  |  | ===== Record Type Name ===== | 
|  |  | A ''Record-TypeName'' is a globally-scoped identifier created during the processing of a RECORD directive. It is recognized from within ''Expressions'', ''Type-Declarations'', or as a pseudo-directive in a data allocation statement. | 
|  | 
 |  | 
 | 
|  | === MsgNAME === |  | ===== Structure Type Name ===== | 
|  |  | A ''Structure-TypeName'' is a globally-scoped identifier created during the processing of a STRUCT directive. It is recognized from within ''Expressions'', ''Type-Declarations'', or as a pseudo-directive in a data allocation statement. | 
|  | 
 |  | 
 | 
|  | This variable contains thesame value as the contents of[[00024.htm|SrcNAME]], unless initialized with the '''Fm'''parameterized command line option.
 |  | ===== Typedef Type Name ===== | 
|  |  | A ''Typedef-TypeName'' is a globally-scoped identifier created during the processing of a TYPEDEF directive. It is recognized from within ''Expressions'', ''Type-Declarations'', or as a pseudo-directive in a data allocation statement. | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | ===== Union Type Name ===== | 
|  |  | A ''Union-TypeName'' is a globally-scoped identifier created during the processing of a UNION directive. It is recognized from within ''Expressions'', ''Type-Declarations'', or as a pseudo-directive in a data allocation statement. | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00051.htm|Fm - Produce Messages File]] <br />
 |  | === Predefined Identifiers === | 
|  |  | The following sections describe the predefined identifiers created by the assembler. When a case-sensitive assembly is being performed, the predefined identifiers must be spelled exactly as they appear in the following descriptions with respect to uppercase and lowercase characters. | 
|  | 
 |  | 
 | 
|  |  | ==== Segment Information ==== | 
|  |  | The following sections describe the predefined identifiers created by the assembler in support of segment manipulation. | 
|  | 
 |  | 
 | 
|  |  | ===== @code ===== | 
|  |  | The '''@code''' identifier is a ''Text-EquateName'' created by the assembler when a .MODEL directive is encountered, at which time the assembler performs an automatic '''ASSUME CS:@code''' operation. The '''@code''' symbol is not defined if a .MODEL directive has not been issued. | 
|  | 
 |  | 
 | 
|  | === ObjDIR ===
 |  | Under MASM 5.10 emulation, the '''@code''' symbol is set to the name of the implicitly-defined default code segment (the segment opened when a .CODE directive is used) and its value is never changed. In other modes, the '''@code''' symbol is updated to reflect whatever segment is opened by using .CODE, whether defined implicitly or as an explicit parameter to the .CODE directive. | 
|  | 
 |  | 
 | 
|  | This variable contains the empty string unless explicitly initialized with the '''Fdo'''parameterized command line option; it isonly used if the value specified by the'''Fo'''command line option did not contain any path information.
 |  | The value assigned to the '''@code''' symbol when the default code segment is opened is determined by the memory model as follows: | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | '''Memory Model Value for @code''' | 
|  |  | : TINY DGROUP | 
|  |  | : SMALL _TEXT | 
|  |  | : MEDIUM ''module'' _TEXT | 
|  |  | : COMPACT_TEXT  | 
|  |  | : LARGE ''module'' _TEXT | 
|  |  | : HUGE ''module'' _TEXT | 
|  |  | : FLAT CODE32 | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00052.htm|Fo -Produce Object File]] <br />�[[00056.htm|Fdo - Directory to Store Object File (ObjDIR)]] <br />
 |  | The ''module'' entry is replaced with base file name of the top-level module being assembled. | 
|  | 
 |  | 
 | 
|  |  | ===== @CodeSize ===== | 
|  |  | The '''@CodeSize''' identifier is a ''Numeric-EquateName'' created by the assembler when a .MODEL directive is encountered. '''@CodeSize''' indicates whether code segments created by the .CODE directive are named such that the linker will combine them into a single (NEAR) segment or into multiple (FAR) segments. The '''@CodeSize''' symbol is set to 0 (NEAR) for the '''TINY, SMALL, COMPACT,''' and '''FLAT''' memory models, and to 1 (FAR) for the '''MEDIUM, LARGE,''' and '''HUGE''' memory models. The '''@CodeSize''' symbol is not defined if a .MODEL directive has not been issued. | 
|  | 
 |  | 
 | 
|  |  | ===== @CurSeg ===== | 
|  |  | The '''@CurSeg''' identifier is a ''Text-EquateName'' defined by the assembler to hold the name of the currently opened segment. If no segment is currently open, '''@CurSeg''' will expand into an empty string. | 
|  | 
 |  | 
 | 
|  | === ObjEXT === |  | ===== @data ===== | 
|  |  | The '''@data''' identifier is a ''Text-EquateName'' created by the assembler when a .MODEL directive is encountered. It expands to the group name shared by all of the near data segments. If a '''.MODEL FLAT''' has been issued, the '''@data''' identifier expands to FLAT. For all other memory models, it expands to DGROUP. | 
|  | 
 |  | 
 | 
|  | This variable contains the default object file name extension that is conditionally appended to the concatenated values of [[00018.htm|ObjDIR]]and [[00020.htm|ObjNAME]]; the assembler treats the resulting string as the fully qualified object file name. Thedefault value for '''ObjEXT'''is".obj" unless altered by use of the '''Feo'''parameterized command line option.
 |  | ===== @DataSize ===== | 
|  |  | The '''@DataSize''' identifier is a ''Numeric-EquateName'' created by the assembler when a .MODEL directive is encountered, and represents the default data distance. Depending on the currently selected memory model, the '''@DataSize''' identifier is set to the following values: | 
|  |  | : TINY 0 | 
|  |  | : SMALL 0 | 
|  |  | : COMPACT 1 | 
|  |  | : MEDIUM 1 | 
|  |  | : LARGE 1 | 
|  |  | : HUGE 2 | 
|  |  | : FLAT 0 | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | ===== @Model ===== | 
|  |  | The '''@Model''' identifier is a ''Numeric-EquateName'' created by the assembler when a .MODEL directive is encountered, and is set to a unique value for each memory model. The values are as follows: | 
|  |  | : TINY 1 | 
|  |  | : SMALL 2 | 
|  |  | : COMPACT 3 | 
|  |  | : MEDIUM 4 | 
|  |  | : LARGE 5 | 
|  |  | : HUGE 6 | 
|  |  | : FLAT 7 | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00061.htm|Feo - Control Object File Extension (ObjEXT)]] <br />
 |  | ===== @WordSize ===== | 
|  |  | The '''@WordSize''' identifier is a ''Numeric-EquateName'' that reflects the address size attribute of the current segment. It is set to 2 for a '''USE16''' segment, and 4 for a '''USE32''' segment. If no segment is currently open, it reflects the default address size as determined by the currently selected processor. | 
|  | 
 |  | 
 | 
|  |  | ==== Version Information ==== | 
|  |  | These identifiers offer methods of testing the various operating modes of the assembler to determine what features are activated or disabled, or how the assembler will behave under various conditions. | 
|  | 
 |  | 
 | 
|  |  | ===== @Alp ===== | 
|  |  | The '''@Alp''' identifier is a ''Text-EquateName'' that can be tested to determine if ALP is assembling the source file (versus some other assembler). It is always set to the string '''100'''. | 
|  | 
 |  | 
 | 
|  | === ObjNAME === |  | ===== @AlpMajor ===== | 
|  |  | The '''@AlpMajor''' identifier is a ''Text-EquateName'' that reflects the ''major'' portion of the three-part assembler version number. It is padded on the right with zeros to allow major version number comparisions independant of the minor version and revisions numbers. See @AlpVersion for more information. | 
|  | 
 |  | 
 | 
|  | This variable contains the same value as the contents of [[00024.htm|SrcNAME]], unless initialized with the '''Fo'''parameterized command line option. |  | This identifier is only defined in ALP mode. | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | ===== @AlpMinor ===== | 
|  |  | The '''@AlpMinor''' identifier is a ''Text-EquateName'' that reflects the ''minor'' portion of the three-part assembler version number. It is padded on the right with zeros to allow minor version number comparisions independant of the major version and revisions numbers. See @AlpVersion for more information. | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00052.htm|Fo - Produce Object File]] <br />
 |  | This identifier is only defined in ALP mode. | 
|  | 
 |  | 
 | 
|  |  | ===== @AlpRevision ===== | 
|  |  | The '''@AlpRevision''' identifier is a ''Text-EquateName'' that reflects the ''revision'' portion of the three-part assembler version number. It allows revision number comparisions independant of the major and minor version numbers. See @AlpVersion for more information. | 
|  | 
 |  | 
 | 
|  | === SourceNAME ===
 |  | This identifier is only defined in ALP mode. | 
|  | 
 |  | 
 | 
|  | This variable contains thename of thetop-level source file currently being processed by the assembler; itscontents appear exactly as theuser typed it on thecommand line. Other internal variables derive their contents from this value. |  | ===== @AlpVersion ===== | 
|  |  | The '''@AlpVersion''' identifier is a ''Text-EquateName'' that reflects the full three-part assembler version number. This is an encoding of the version number printed in the program banner when the assembler is invoked. This number and its requisite parts may be tested to determine the presence or absence of features provided by the assembler. | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | The assembler version number consists of three parts: | 
|  |  | # The major version number (one digit) | 
|  |  | # The minor version number (two digits) | 
|  |  | # The revision number (three digits) | 
|  | 
 |  | 
 | 
|  | �[[00039.htm|File Names]] <br />
 |  | In the assembler banner, the numbers are separated by the period (.) character; the period is removed from the text defined by the predefined identifiers. | 
|  | 
 |  | 
 | 
|  | === SrcDIR ===
 |  | For example, if the major version number is '''1''', the minor version number is '''2''', and the revision number is '''3''', then the full version number is printed in the assembler banner as '''1.02.003''', and the various predefined version identifers would be set as follows: | 
|  |  |  @AlpVersion   102003 | 
|  |  |  @AlpMajor     100000 | 
|  |  |  @AlpMinor       2000 | 
|  |  |  @AlpRevision     003 | 
|  |  | This identifier is only defined in ALP mode. | 
|  | 
 |  | 
 | 
|  | This variable is derived from [[00021.htm|SourceNAME]]and reflects any drive or path information contained therein. For instance, if the value of [[00021.htm|SourceNAME]]is "D:\Source\Dump\DumpMain.asm", then the value of '''SrcDIR'''would be "D:\Source \Dump\". If no drive or path information was specified in the file name, then '''SrcDIR'''will contain theempty string.
 |  | ===== @Cpu ===== | 
|  |  | The '''@Cpu''' identifier is a ''Numeric-EquateName'' that reflects the currently selected processor for which ALP is assembling instructions. This value is affected by issuing a ''Processor-Control-Directive'', and is a bit map that indicates the currently active processor instruction set(s). | 
|  |  | {|class="wikitable" | 
|  |  | !B!!A!!9!!8!!7!!6!!5!!4!!3!!2!!1!!0!!BIT SET IF ASSEMBLING FOR | 
|  |  | |- | 
|  |  | | || || || || || || || || || || ||1||8086/8088 | 
|  |  | |- | 
|  |  | | || || || || || || || || || ||1|| ||80186 | 
|  |  | |- | 
|  |  | | || || || || || || || || ||1|| || ||80286 | 
|  |  | |- | 
|  |  | | || || || || || || || ||1|| || || ||80386 | 
|  |  | |- | 
|  |  | | || || || || || || ||1|| || || || ||80486 | 
|  |  | |- | 
|  |  | | || || || || || ||1|| || || || || ||80586 (Pentium) | 
|  |  | |- | 
|  |  | | || || || || ||1|| || || || || || ||80686 (Pentium Pro) | 
|  |  | |- | 
|  |  | | || || || ||1|| || || || || || || ||Privileged mode | 
|  |  | |- | 
|  |  | | || || ||1|| || || || || || || || ||8087 | 
|  |  | |- | 
|  |  | | || ||1|| || || || || || || || || ||MMX Extensions | 
|  |  | |- | 
|  |  | | ||1|| || || || || || || || || || ||80287 | 
|  |  | |- | 
|  |  | |1|| || || || || || || || || || || ||80387 | 
|  |  | |} | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | ===== @Version ===== | 
|  |  | The '''@Version''' identifier is a ''Text-EquateName'' that reflects the MASM-compatible version number. The current emulation mode of the assembler affects the value of this symbol as follows: | 
|  |  | : M510 510 | 
|  |  | : M600 600 | 
|  |  | : ALP 4294967295 (the highest possible value for an unsigned 32-bit integer) | 
|  | 
 |  | 
 | 
|  | �[[00039.htm|File Names]] <br />
 |  | ==== Date and Time Information ==== | 
|  |  | These identifiers allow the programmer to query the system date or time during the assembly. Each time they are referenced, a new system request for the current date and time is made and the values held in the identifiers are refreshed. | 
|  | 
 |  | 
 | 
|  |  | ===== @Date ===== | 
|  |  | The '''@Date''' identifier is a ''Text-EquateName'' that is set to the current system date. If the current operating mode is M600, the date is returned in the MM/DD/YY format. In native ALP mode, the date is returned in the MM/DD/YYYY format. | 
|  | 
 |  | 
 | 
|  | === SrcEXT ===
 |  | The '''@Date''' identifier is not available in M510 mode. | 
|  | 
 |  | 
 | 
|  | This variable contains the default source file name extension that is conditionally appended to the concatenated values of [[00022.htm|SrcDIR]]and [[00024.htm|SrcNAME]]; the assembler treats the resulting string as the fully qualified input file name. Thedefault value for '''SrcEXT'''is".asm" unless altered by use of the '''Fes'''parameterized command line option.
 |  | ===== @Time ===== | 
|  |  | The '''@Time''' identifier is a ''Text-EquateName'' that is set to the current system time in 24-hour HH:MM:SS format. | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | The '''@Time''' identifier is not available in M510 mode. | 
|  | 
 |  | 
 | 
|  | �[[00036.htm|Options]] <br />�[[00039.htm|FileNames]] <br />�[[00062.htm|Fes - Control Source File Extension (SrcEXT)]] <br />
 |  | ==== File Information ==== | 
|  |  | These identifiers return information about the file(s) being assembled. | 
|  | 
 |  | 
 | 
|  |  | ===== @FileName ===== | 
|  |  | The '''@FileName''' identifier is a ''Text-EquateName'' that is set to the base name of the main file being assembled (as it appears on the command line). | 
|  | 
 |  | 
 | 
|  | === SrcNAME === |  | ===== @Line ===== | 
|  |  | The '''@Line''' identifier is a ''Numeric-EquateName'' that is set to the current source line number in the file currently being assembled. | 
|  | 
 |  | 
 | 
|  | This variable contains the "root file name" portion of the source file name , which is extracted from the contents of the [[00021.htm|SourceNAME]]variable. For instance, if the value of [[00021.htm|SourceNAME]]is "D:\Source\Dump\DumpMain.asm", then the value of '''SrcNAME'''would be "DumpMain". '''SrcNAME'''should never contain the empty string unless the input file name was incorrectly specified; inwhich case the assembler will generate an error when it tries to access the file.
 |  | The '''@Line''' identifier is not available in M510 mode. | 
|  | 
 |  | 
 | 
|  | Related Information:
 |  | === Literals === | 
|  |  | ;Description | 
|  |  | '''''Literals''''' are the notational method whereby numeric values or strings of character data are represented in the source stream. Literals are also commonly referred to as '''''constants''''' (especially in the context of high level languages) because they typically represent objects whose values do not change throughout the life of the assembly or compilation. However, literals should not be confused with run-time "constants"; ("read-only"; data items allocated by the programmer); they are assembly-time tokens used by the assembler to represent numeric values or character strings. | 
|  | 
 |  | 
 | 
|  | �[[00039.htm|File Names]] <br />
 |  | ;Syntax | 
|  |  | ''Literal:'' | 
|  |  | : ''Floating-Point-Literal'' | 
|  |  | : ''Integer-Literal'' | 
|  |  | : ''String-Literal'' | 
|  | 
 |  | 
 | 
|  |  | ==== Integer Literals ==== | 
|  |  | ;Description | 
|  |  | An '''''integer literal''''' represents a fixed-point numeric value. An integer literal must begin with one of the numeric digits 0 - 9, and may be optionally terminated with a suffix character called a '''''radix specifier'''''. The radix specifier tells the assembler whether the literal is to be interpreted as a base 2 (binary), 8 (octal), 10 (decimal), or 16 ( hexadecimal) number. If the literal is not suffixed with a radix specifier , the assembler uses the value of the current radix to determine the base of the number. The default radix is 10 (decimal), but the '''''.RADIX''''' directive can be used to specify an alternate radix. | 
|  | 
 |  | 
 | 
|  | === Using ALP ===
 |  | ;Syntax | 
|  |  | ''Integer-Literal:'' | 
|  |  | : ''Binary-Integer-Literal'' | 
|  |  | : ''Octal-Integer-Literal'' | 
|  |  | : ''Decimal-Integer-Literal'' | 
|  |  | : ''Hexadecimal-Integer-Literal'' | 
|  | 
 |  | 
 | 
|  | This chapter tells you how to:
 |  | ===== Binary Integer Literals ===== | 
|  |  | ;Syntax | 
|  |  | ''Binary-Integer-Literal:'' | 
|  |  | : ''Unqualified-Binary-Integer-Literal'' | 
|  |  | : ''Qualified-Binary-Integer-Literal'' | 
|  | 
 |  | 
 | 
|  | 1.Invoke and use ALP <br /> 2.Use environment variables to pass information to ALP <br />
 |  | ''Unqualified-Binary-Integer-Literal:'' | 
|  |  | : ''Binary-Digit'' | 
|  |  | : ''Binary-Integer-Literal Binary-Digit'' | 
|  | 
 |  | 
 | 
|  |  | ''Qualified-Binary-Integer-Literal:'' | 
|  |  | : ''Unqualified-Binary-Integer-Literal Binary-Radix'' | 
|  | 
 |  | 
 | 
|  | === Invoking ALP ===
 |  | ''Binary-Digit:'' | 
|  |  | : '''0''' | 
|  |  | : '''1''' | 
|  | 
 |  | 
 | 
|  | To invoke ALP from the command line, type:<br />
 |  | ''Binary-Radix:'' | 
|  |  | : '''b''' | 
|  |  | : '''B''' | 
|  |  | : '''y''' | 
|  |  | : '''Y''' | 
|  | 
 |  | 
 | 
|  | <pre>alp </pre>
 |  | ;Description | 
|  | You can also invoke ALP by absolute reference from a makefile or command file; to do this, the directory should be among those referenced by the[[00033.htm|PATH]]environment variable.
 |  | A base-2 number containing either of the digits '''''0''''' and '''''1'''''. | 
|  | 
 |  | 
 | 
|  | === Using Environment Variables ===
 |  | ;Examples | 
|  |  | The following are examples of unqualified binary integer literals: | 
|  |  |  10101 | 
|  |  |  0 | 
|  |  |  000001 | 
|  |  |  1111000010101010 | 
|  | 
 |  | 
 | 
|  | This section describes the environment variables that you can set and that areused by ALP.
 |  | The following are examples of qualified binary integer literals: | 
|  |  |  00001111b | 
|  |  |  1111Y | 
|  |  |  00y | 
|  |  |  1111000010101010B | 
|  | 
 |  | 
 | 
|  |  | ===== Octal Integer Literals ===== | 
|  |  | ;Syntax | 
|  |  | ''Octal-Integer-Literal:'' | 
|  |  | : ''Unqualified-Octal-Integer-Literal'' | 
|  |  | : ''Qualified-Octal-Integer-Literal'' | 
|  | 
 |  | 
 | 
|  | === _INCLUDE ===
 |  | ''Unqualified-Octal-Integer-Literal:'' | 
|  |  | : ''Octal-Digit'' | 
|  |  | : ''Octal-Integer-Literal Octal-Digit'' | 
|  | 
 |  | 
 | 
|  | When ALP processes an '''INCLUDE'''directive, ALP translates the value of the [[00008.htm|BaseEXE]]internal variable to uppercase and uses this value to construct the name of an ALP-specific environment variable having the form: <br />
 |  | ''Qualified-Octal-Integer-Literal:'' | 
|  |  | : ''Unqualified-Octal-Integer-Literal Octal-Radix'' | 
|  | 
 |  | 
 | 
|  | <pre>< BaseEXE > _ INCLUDE </pre>
 |  | ''Octal-Digit:'' one of:  | 
|  | For example, If the value of [[00008.htm|BaseEXE]]is ''alp'', then ALP constructs an environment variable called '''ALP_INCLUDE'''and tries to locate it in the environment. If found, its contents would be expected to contain a list ofdirectories in a format identical to that of the standard [[00032.htm|INCLUDE]] environment variable.
 |  |  0 1 2 3 4 5 6 7 | 
|  | 
 |  | 
 | 
|  |  | ''Octal-Radix:'' | 
|  |  | : '''o''' | 
|  |  | : '''O''' | 
|  |  | : '''q''' | 
|  |  | : '''Q''' | 
|  | 
 |  | 
 | 
|  | === _OPTIONS ===
 |  | ;Description | 
|  |  | A base-8 number containing any of the digits '''''0''''' through '''''7'''''. | 
|  | 
 |  | 
 | 
|  | ALP translates the value ofthe [[00008.htm|BaseEXE]]internal variable to uppercase and uses this value to construct the name of an ALP-specific environment variable having the form:<br />
 |  | ;Examples | 
|  |  | The following are examples of unqualified octal integer literals: | 
|  |  |  01234567 | 
|  |  |  27 | 
|  |  |  765 | 
|  | 
 |  | 
 | 
|  | <pre>< BaseEXE > _ OPTIONS </pre>
 |  | The following are examples of qualified octal integer literals: | 
|  | For example, if the value of [[00008.htm|BaseEXE]]is ''alp'', then ALP constructs an environment variable called '''ALP_OPTIONS'''and tries to locate it in the environment. If found, its contents are logically prepended to the assembler command line.
 |  |  27q | 
|  |  |  013o | 
|  |  |  567O | 
|  |  |  01234567Q  | 
|  | 
 |  | 
 | 
|  | You can use this variable to set alternate default values for assembler command line options. For maximum flexibility, it is recommended that this variable contain a reference to a command line response file using an '''@ Filename'''directive, which allows the default command line options to be stored in a file rather than in the environment variable itself.
 |  | ===== Decimal Integer Literals ===== | 
|  |  | ;Syntax | 
|  |  | ''Decimal-Integer-Literal:'' | 
|  |  | : ''Unqualified-Decimal-Integer-Literal'' | 
|  |  | : ''Qualified-Decimal-Integer-Literal'' | 
|  | 
 |  | 
 | 
|  | === _PATH ===
 |  | ''Unqualified-Decimal-Integer-Literal:'' | 
|  |  | : ''Decimal-Digit'' | 
|  |  | : ''Decimal-Integer-Literal Decimal-Digit'' | 
|  | 
 |  | 
 | 
|  | Whenever ALP needs to search for one of its own component files (such as the messages file), the value of the [[00008.htm|BaseEXE]]internal variable is translated to uppercase and is used to construct the name of an ALP specific environment variable having the form "<[[00008.htm|BaseEXE]]>'''_PATH'''." For example, if the value of [[00008.htm|BaseEXE]]is "alp," then an environment variable called '''ALP_PATH'''would be constructed and an attempt would be made to locate it in the environment. If found, its contents would be expected to contain a list of directories in a format identical to that of the standard [[00033.htm|PATH]] environment variable. ALP then searches this list of paths when attempting to locate the component file.
 |  | ''Qualified-Decimal-Integer-Literal:'' | 
|  |  | : ''Unqualified-Decimal-Integer-Literal Decimal-Radix'' | 
|  | 
 |  | 
 | 
|  | === DPATH ===
 |  | ''Decimal-Digit:'' one of: | 
|  |  |  0 1 2 3 4 5 6 7 8 9 | 
|  | 
 |  | 
 | 
|  | The '''DPATH'''environment variable may be utilized for the same purposes as the [[00030.htm|<BaseEXE>_PATH]]internal variable if so desired.
 |  | ''Decimal-Radix:'' | 
|  |  | : '''d''' | 
|  |  | : '''D''' | 
|  |  | : '''t''' | 
|  |  | : '''T''' | 
|  | 
 |  | 
 | 
|  | === INCLUDE ===
 |  | ;Description | 
|  |  | A base-10 number containing any of the digits '''''0''''' through '''''9'''''. | 
|  | 
 |  | 
 | 
|  | The '''INCLUDE'''environment variable may be utilized for the same purposes as the [[00028.htm|<BaseEXE>_INCLUDE]]internal variable if so desired. |  | ;Examples | 
|  |  | The following are examples of unqualified decimal integer literals: | 
|  |  |  0123456789 | 
|  |  |  19 | 
|  |  |  090 | 
|  | 
 |  | 
 | 
|  |  | The following are examples of qualified decimal integer literals: | 
|  |  |  01d | 
|  |  |  89t | 
|  |  |  4567D | 
|  |  |  0123456789T  | 
|  | 
 |  | 
 | 
|  | === PATH === |  | ===== Hexadecimal Integer Literals ===== | 
|  |  | ;Syntax | 
|  |  | ''Hexadecimal-Integer-Literal:'' | 
|  |  | : ''Unqualified-Hexadecimal-Integer-Literal'' | 
|  |  | : ''Qualified-Hexadecimal-Integer-Literal'' | 
|  | 
 |  | 
 | 
|  | The '''PATH'''environment variable may be utilized for the same purposes as the [[00030.htm|<BaseEXE>_PATH]]internal variable if so desired.
 |  | ''Unqualified-Hexadecimal-Integer-Literal:'' | 
|  |  | : ''Decimal-Digit'' | 
|  |  | : ''Hexadecimal-Integer-Literal Decimal-Digit'' | 
|  |  | : ''Hexadecimal-Integer-Literal Hexadecimal-Digit'' | 
|  | 
 |  | 
 | 
|  | === Using the Command Line ===
 |  | ''Qualified-Hexadecimal-Integer-Literal:'' | 
|  |  | : ''Unqualified-Hexadecimal-Integer-Literal Hexadecimal-Radix'' | 
|  | 
 |  | 
 | 
|  | This section describes command line parameter types, syntax, and options.
 |  | ''Decimal-Digit:'' one of:  | 
|  |  |  0 1 2 3 4 5 6 7 8 9 | 
|  | 
 |  | 
 | 
|  | === Command Line Parameter Types ===
 |  | ''Hexadecimal-Digit:'' one of:  | 
|  |  |  a b c d e f | 
|  |  |  A B C D E F | 
|  | 
 |  | 
 | 
|  | Command line '''''parameters''are individual "words," or patterns of characters separated by white space. Each individual parameter is recognized by the command line lexical analyzer as having a certain "pattern," and is thus assigned a '''''parameter type'', as described in the following sections. Parameters should be separated by one or more blanks, tabs, or (when reading from a response file) new line characters, and double quotation marks may be used on the command line to remove the special meaning from the operating system metacharacters. Although the host operating system may support the enclosing of command line parameters within double quotes ( "") (known as "quoting"), the ALP command line parser also performs quote interpretation. This is necessary to properly interpret quoted parameters within '''@Filename'''response files, for which there is no built-in support provided by the default operating system command shell.''''''
 |  | ''Hexadecimal-Radix:'' | 
|  |  | : '''h''' | 
|  |  | : '''H''' | 
|  | 
 |  | 
 | 
|  | Parameter types are determined by looking at the first character of each individual "word." Options begin with a plus (+) or minus (-), andfile names begin with any other legal file name character (as dictated by theoperating system). A special case is aword beginning with the ''at sign''(@) character, which signifies the beginning of the '''@Filename'''(read from a response file) directive.
 |  | ;Description | 
|  |  | A base-16 number using any combination of the digits '''0''' through '''9''' and the lowercase letters '''a''' through '''f''' or the uppercase letters '''A''' through '''F'''. The lowercase and uppercase representations of any given hexadecimal letter are equivalent. | 
|  | 
 |  | 
 | 
|  |  | ;Constraints | 
|  |  | A hexadecimal integer literal may not begin with any of the alphabetic hexadecimal characters or it will be interpreted as an identifier; such numbers must be prefixed with the '''0''' digit. | 
|  | 
 |  | 
 | 
|  | === Options ===
 |  | ;Examples | 
|  |  | The following are examples of unqualified hexadecimal integer literals: | 
|  |  |  01BD | 
|  |  |  9A | 
|  |  |  0AB | 
|  | 
 |  | 
 | 
|  | Options appear on the command line as mnemonic identifiers prefixed by either ofthe plus (+) or minus (-) characters, and must be separated from other command line parameters by at least one blank character. Case is not significant in option identifiers.
 |  | The following are examples of qualified hexadecimal integer literals: | 
|  |  |  1234ABCDh | 
|  |  |  01DH | 
|  |  |  0bh | 
|  |  |  1111FFFFH | 
|  | 
 |  | 
 | 
|  | A single option may be specified more than once on the command line within a given scope; the last occurrence overrides all previous definitions within that scope unless the effect of the option isto collect information in acumulative fashion.Options are not cumulative unless documented otherwise on an individual basis. |  | ==== Floating-Point Literals ==== | 
|  |  | ;Description | 
|  |  | A '''floating-point literal''' is a notation for representing real numbers. The assembler provides both decimal and hexadecimal floating-point notations for representing real numbers. | 
|  | 
 |  | 
 | 
|  | There are two forms of options:
 |  | ;Syntax | 
|  |  | ''Floating-Point-Literal:'' | 
|  |  | : ''Decimal-Floating-Point-Literal'' | 
|  |  | : ''Hexadecimal-Floating-Point-Literal'' | 
|  | 
 |  | 
 | 
|  | �[[00037.htm|Switch Option]] <br />�[[00038.htm|Parameterized Option]] <br />
 |  | ===== Decimal Floating-Point Literals ===== | 
|  |  | ;Syntax | 
|  | 
 |  | 
 | 
|  | Some options may actually combine both functions of the ''switched''and ''parameterized''variations; for instance, the '''+Fl'''switch option "turns on" the creation of a listing file, while a parameterized option of the same name (for example, '''+Fl:george.lst''') has the same effect, but also treats the argument field as the name ofthe listing file to create.
 |  | ''Decimal-Floating-Point-Literal:''<br />''Significand-Part''<br />''Significand-Part Exponent-Part''<br /><br />''Significand-Part:''<br />''Digit-Sequence'''''.'''''Digit-Sequence''<br />''Digit-Sequence'''''.'''<br /><br />''Exponent-Part:''<br />''E-Character Digit-Sequence''<br />''E-Character Sign Digit-Sequence''<br /><br />''E-Character:''<br />'''e'''<br />'''E'''<br /><br />''Sign:''<br />'''-'''<br />'''+'''<br /><br />''Digit-Sequence:''<br />''Digit''<br />''Digit-Sequence Digit''<br /><br />''Digit:''one of: '''<br />0 1 2 3 4 5 6 7 8 9 <br />''' | 
|  | 
 |  | 
 | 
|  | === Switch Option ===
 |  | ;Description | 
|  |  | A decimal floating-point literal has a ''significand part'' that may be followed by an ''exponent part''. The significand part consists of a digit sequence representing the whole-number part, followed by a period (.), followed by a digit sequence representing the fraction part. The exponent part consists of an introductory character ('''e'''or '''E'''), followed by an optional sign character ('''+'''or '''-'''), followed by a digit sequence representing the exponent. | 
|  | 
 |  | 
 | 
|  | '''''Switch Options''represent a Boolean value ('''on'''or '''off''', '''yes'''or '''no''', '''true'''or '''false''') for the identifier specifiedin theoption.The plus (+) or minus ( -)character introducing the option specifies the value of the switch; "+" is equivalent to '''on''', '''yes''', or '''true'''; and "-" is equivalent to '''off''', '''no''', or '''false'''.''' |  | ;Constraints | 
|  |  | The introductory ''Digit-Sequence'' in the ''Significand-Part'' must be specified ( the literal cannot begin with a "."). | 
|  | 
 |  | 
 | 
|  | Because plus (+) is not a character traditionally used to introduce a command line option, ALP provides an alternate method of specifying a switch option that resembles a more commonly used syntax.The character that affects the actual value of the "switch" (that is, the (+) or (-) character) may also be specified directly after the option identifier; in this case the option must still be introduced by either the (+) or (-) character, but the trailing "switch value" takes precedence.
 |  | ;Examples | 
|  |  |  25.23  | 
|  |  |  2.523E1  | 
|  |  |  2523.0E-2 | 
|  | 
 |  | 
 | 
|  | The following are examples of '''''Switch Options'': <br />'''
 |  | ===== Hexadecimal Floating-Point Literals ===== | 
|  |  | ;Syntax | 
|  | 
 |  | 
 | 
|  | <pre> |  | ''Hexadecimal-Floating-Point-Literal:''<br />''Hexadecimal-Literal Float-Radix''<br /><br />''Hexadecimal-Literal:''<br />''Decimal-Digit''<br />''Hexadecimal-Literal Decimal-Digit''<br />''Hexadecimal-Literal Hexadecimal-Digit''<br /><br />''Decimal-Digit:''one of: '''<br />0 1 2 3 4 5 6 7 8 9 <br />'''<br />''Hexadecimal-Digit:''one of: '''<br />a b c d e f <br />A B C D E F <br />'''<br />''Float-Radix:''<br />'''r'''<br />'''R''' | 
|  | + ML 
 |  | 
|  | - ml +  |  | 
|  | + Fl 
 |  | 
|  | - Fl - </pre> |  | 
|  | 
 |  | 
 | 
|  | === Parameterized Option ===
 |  | ;Description | 
|  |  | A hexadecimal floating-point literal provides a means of initializing floating point values using a notation more closely tied to the internal machine representation than that of the ''Decimal-Floating-Point-Literal''. Such literals are coded in a fashion similar to that of a normal ''Hexadecimal-Integer-Literal'', but a different radix suffix is used to inform the assembler that the value is to be used in the allocation of real numbers rather than integers. | 
|  | 
 |  | 
 | 
|  | '''''Parameterized Options''are introduced in thesame manner asswitch options, but are instead followed by a colon (:) or anequals sign (=) (withno intervening blank space) to indicate that theoption takes one or more '''''arguments''. The format of the argument field is option specific.''''''
 |  | ;Constraints | 
|  |  | A hexadecimal floating-point literal may not begin with any of the alphabetic hexadecimal characters or it will be interpreted as an identifier; such numbers must be prefixed with the '''''0''''' digit. | 
|  | 
 |  | 
 | 
|  | Using theplus (+) character versus theminus (-) character tointroduce a parameterized option may or may not have an effect upon how theoption is interpreted.Refer to thedescription ofeach individual option for details.
 |  | The literal must specify the correct number of hexadecimal digits according to the size of the real-number data-type to which it will be assigned. For '''REAL4''', '''REAL8''', and '''REAL10''' variables, the respective number of digits in the literal must be 8, 16, and 20. For literals encoded with a leading zero, the respective number of digits must be 9, 17, and 21. | 
|  | 
 |  | 
 | 
|  | The following are examples of '''''Parameterized Options'': <br />'''
 |  | ;Examples | 
|  |  |  3F800000r | 
|  | 
 |  | 
 | 
|  | <pre>
 |  | ==== String Literals ==== | 
|  | - Fl =Zappa . lst 
 |  | ;Syntax | 
|  | - Sv : M510 
 |  | 
|  | + fo = "\ obj \ dd \ driver . obj " 
 |  | 
|  | - m : 127 - </pre>
 |  | 
|  | 
 |  | 
 | 
|  | === File Names ===
 |  | ''String-Literal:''<br />''D-String''<br />''S-String''<br /><br />''D-String:''<br />''D-Quote D-Quote''<br />''D-Quote D-Char-Sequence D-Quote''<br /><br />''S-String:''<br />''S-Quote S-Quote''<br />''S-Quote S-Char-Sequence S-Quote''<br /><br />''D-Char-Sequence:''<br />any printable character except ''D-Quote''<br />''D-Quote D-Quote''<br /><br />''S-Char-Sequence:''<br />any printable character except ''S-Quote''<br />''S-Quote S-Quote''<br /><br />''D-Quote:''<br />'''"'''<br /><br />''S-Quote:'' | 
|  | 
 |  | 
 | 
|  | A file name may be used asan argument to certain command line options or asa stand-alone command line parameter. The file name characterset and naming conventions are operating system dependent, andare treated astransparently as possible by ALP. The use ofoperating system metacharacters in file names should beavoided, and file names should not begin with theplus (+) or minus (-) characters. |  | ;Description | 
|  |  | A '''string literal''' contains a sequence of zero or more characters enclosed in quotation mark symbols. Either a single (') or double (") quotation mark symbol may be used as the '''quote character''' that opens and closes the string literal. If a single quotation mark symbol is used as the quote character, then double quotation mark symbols may appear as data characters within the string literal, and vice versa. If the quote character must also appear as a character within the string literal, use two adjacent quote characters; this will allow a single occurrence of the quote character to be inserted into the string literal. | 
|  | 
 |  | 
 | 
|  | Any file name may be"qualified" with drive or path information as appropriate for thehost operating system. ALP accepts both theforward slash (/) and thebackward slash (\) aslegal path name characters,as well as thecolon (:) character. Care must be exercised however, because theunderlying operating system may reject theusage of some of these characters.
 |  | A quote character must be used to terminate the string literal before the end of the line is reached, otherwise an error message is issued and the literal is terminated by the end of line character. A string literal may span multiple lines only if a backslash (\) appears as the last non- whitespace character on the line, in which case the backslash, all surrounding whitespace characters, and the end of line character are deleted and the literal is continued with the first character on the next line. | 
|  | 
 |  | 
 | 
|  |  | ;Examples | 
|  |  |  'Hello, world' | 
|  |  |  "That's the way it is" | 
|  |  |  'Unless it''s not' | 
|  |  |  "SuperStringCon \ | 
|  |  |  catenated" | 
|  | 
 |  | 
 | 
|  | === Command Line Syntax === |  | === Punctuators === | 
|  |  | ;Description | 
|  |  | Punctuators are used as operators and separator characters. | 
|  | 
 |  | 
 | 
|  | <br /> |  | ;Syntax | 
|  |  | ''Punctuator:''one of '''<br />[ ] ( ) { } * , : = ; %''' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------------\
 |  | == Declarations == | 
|  | |                                                                               | 
 |  | A '''''Type Declaration''''' is a language construct that specifies the characteristics of code and data objects used in a program. | 
|  | |                                                  /----------------------\     | 
 |  | 
|  | |                                                  |                      |     | 
 |  | 
|  | | >>--ALP-------------------------------------------FileName File Options---->< | 
 |  | 
|  | |          \-Global Options-/  \-Group Options-/                                |
 |  | 
|  | |                                                                               | 
 |  | 
|  | \-------------------------------------------------------------------------------/</pre>
 |  | 
|  | 
 |  | 
 | 
|  |  | === Type Declarations === | 
|  |  | ;Description | 
|  |  | A ''Type-Declaration'' is a common construct used in various assembler directives to establish type attribute information for a program object. A ''Type-Declaration'' is needed to determine the data type of a variable or labeled address. The [[#TYPEDEF|TYPEDEF]] directive offers a method of assigning a name to a ''Type-Declaration''. | 
|  | 
 |  | 
 | 
|  | The assembler accepts one or more file names for processing. Each file name is taken to be the name of a source file to assemble;file names are not interpreted according to their file "type" or extension to determine if they are valid input files.
 |  | ;Syntax | 
|  |  | ''Type-Declaration:'' | 
|  |  | :''TypeName'' | 
|  |  | :''TypeName Array-Spec'' | 
|  |  | :''Pointer-Spec'' | 
|  |  | :''Pointer-Spec TypeName'' | 
|  |  | :''Pointer-Spec TypeName Array-Spec'' | 
|  | 
 |  | 
 | 
|  | The OS/2 version of the assembler is enabled to accept ''wild-card characters''(? and *) in file names, which emulates the UNIX ability to expand a single file name specification into a list of all files that match the wild -card pattern. The '''?'''character matches any single file name character in the given position, and the '''*'''character matches any number of file name characters.
 |  | ''Pointer-Spec:'' | 
|  |  | :'''PTR''' | 
|  |  | :''[[#Distance-TypeName|Distance-TypeName]]'' '''PTR''' | 
|  |  | :''Pointer-Spec Array-Spec'' | 
|  | 
 |  | 
 | 
|  |  | ''Array-Spec:'' | 
|  |  | :'''[''' ''Expression'' ''']''' | 
|  |  | :''Array-Spec'' '''[''' ''Expression'' ''']''' | 
|  | 
 |  | 
 | 
|  | === Global Options ===
 |  | ''TypeName:'' | 
|  |  | :''Distance-TypeName'' | 
|  |  | :''Scalar-TypeName'' | 
|  |  | :''UserDefined-TypeName'' | 
|  | 
 |  | 
 | 
|  | Command line options fall into this category only if they apply to the assembler executable itself and not to any specified files. Options that request the display of assembler help messages fall into this category, as well as the option that controls display of the assembler banner.
 |  | ;Examples | 
|  | 
 |  | 
 | 
|  | === Group Options ===
 |  | The '''TYPEDEF''' directive is used to illustrate the type declaration syntax: | 
|  |  | <pre> | 
|  |  | CHAR        typedef   byte               ;   Alias of intrinsic TypeName | 
|  |  | PBYTE       typedef   ptr  byte          ;   Pointer to intrinsic TypeName | 
|  |  | PCHAR       typedef   ptr  CHAR          ;   Pointer to TypeDef-TypeName | 
|  |  | PPCHAR      typedef   ptr  PCHAR         ;   Pointer to a pointer to a CHAR | 
|  |  | PPBYTE      typedef   ptr  ptr byte      ;   Similar to PPCHAR | 
|  |  | PVOID       typedef   ptr                ;   Pointer to nothing (pointer to code) | 
|  |  | PCODE       typedef   ptr  PROC          ;   Similar to PVOID | 
|  |  | PFCODE      typedef   far  ptr far       ;   Far pointer to far code address | 
|  | 
 |  | 
 | 
|  | Command line options fall into this category if the settings they control can be applied to a list of multiple files within a given scope without causing ambiguities. Group options are useful for such operations as:
 |  | ; vector declarations | 
|  | 
 |  | 
 | 
|  | �Requesting a listing file be generated for all files within the group <br />�Specifying the target directory for all generated object files <br />�Controlling the display ofwarning and informational messages for all files within the group <br />
 |  | ACHAR       typedef   CHAR[16]          ;   Array of 16 characters | 
|  |  | AAWORD      typedef   word[2][2]        ;   multi-dimensional array | 
|  |  | APBYTE      typedef   ptr[8] byte       ;   Array of 8 pointers to byte | 
|  |  | APACHAR     typedef   ptr[4] ACHAR      ;   Array of 4 ptrs to arrays of 16 chars | 
|  | 
 |  | 
 | 
|  | Within a given scope (see [[00044.htm|Command Line Scope Operator ()]]) the command line parser assigns the ''group''classification to each option until the first source file name is encountered;group option settings are applied to all file names that follow within a given scope. After encountering the first source file name, options are assigned the ''file''classification.
 |  | SIZES_T     struct                     ;   define an intrinsic structure type | 
|  |  |    little   byte      ? | 
|  |  |    Medium   word      ?  | 
|  |  |    BIG      dword     ?  | 
|  |  | SIZES_T     ends  | 
|  | 
 |  | 
 | 
|  | [[[00042.htm|prev]]][[[00044.htm|next]]][[[00040.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | SIZES       typedef   SIZES_T           ;   alias for intrinsic structure type | 
|  |  | PSIZES      typedef   ptr SIZES_T       ;   and a type to point to it | 
|  | 
 |  | 
 | 
|  | === File Options ===
 |  | PFORWARD    typedef   ptr FORWARD       ;   Pointers to forward-referenced types | 
|  |  | FORWARD     struct                     ;   are assumed to be pointers to structs | 
|  |  |    blah      word     ? | 
|  |  | FORWARD     ends | 
|  |  | </pre> | 
|  | 
 |  | 
 | 
|  | All options appearing tothe right of afile name within agiven scope (see [[00044.htm|Command Line Scope Operator ()]]) are applied to that file only. File options take precedence over any settings inherited from previously encountered group options.
 |  | == Expressions == | 
|  |  | An expression is a sequence of ''operators'' and ''operands'' that are evaluated to derive a numeric result, an effective address, or a register operand. | 
|  | 
 |  | 
 | 
|  | It should be noted that file names specified usingwild-card characters and used incombination with file options maynot yield the expected result; the file options will beapplied only to thelast file inthe resulting wild-card expansion file name list.
 |  | Expressions are specified using standard infix notation, which is recursive in nature, ie., expressions may be nested within other expressions. The evaluation of an expression occurs in a left to right manner, and is influenced by the rules of operator ''precedence'' and ''associativity''. The order in which expressions are evaluated can be controlled by grouping operands and operators together using parentheses (). | 
|  | 
 |  | 
 | 
|  | [[[00043.htm|prev]]][[[00045.htm|next]]][[[00040.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | === Expression Syntax === | 
|  |  | ;Description  | 
|  |  | This section describes the complete expression syntax. | 
|  | 
 |  | 
 | 
|  | === Command Line Scope Operator () ===
 |  | ;Syntax | 
|  |  | ''Expression:'' | 
|  |  | : ''Duplicative-Expression'' | 
|  | 
 |  | 
 | 
|  | At any point on the command line, a new ''scope''may be opened using the scope operator (). The scope operator effectively creates a new logical command line whose contents are enclosed in parentheses and is parsed in isolation from other scopes. Any group options in effect at the time the new scope is opened are inherited and applied to all files named within.
 |  | ''Duplicative-Expression:'' | 
|  |  | : ''Attribute-Expression'' | 
|  |  | : ''Attribute-Expression'' DUP '''(''' ''Initializer-List'' ''')''' | 
|  | 
 |  | 
 | 
|  | [[[00044.htm|prev]]][[[00046.htm|next]]][[[00034.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ''Attribute-Expression:'' | 
|  |  | : ''OR-Expression'' SHORT ''Additive-Expression'' | 
|  |  | : .TYPE ''OR-Expression'' | 
|  |  | : OPATTR ''OR-Expression'' | 
|  | 
 |  | 
 | 
|  | === Command Line Options ===
 |  | ''OR-Expression:'' | 
|  |  | : ''AND-Expression'' | 
|  |  | : ''OR-Expression'' OR ''AND-Expression'' | 
|  |  | : ''OR-Expression'' XOR ''AND-Expression'' | 
|  | 
 |  | 
 | 
|  | This section describes all the ALP command line options. For each option, a table appears in the description section with the following format:<br /><br />
 |  | ''AND-Expression]]:'' | 
|  |  | : ''NOT-Expression'']] | 
|  |  | : ''AND-Expression'']] AND ''NOT-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ''NOT-Expression]]:'' | 
|  | |Type|Global|Group|File|Default                                           |
 |  | : ''Relational-Expression'' NOT ''Relational-Expression'' | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |... |...   |...  |... |...                                               |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | The values appearing in this table are defined as follows:
 |  | 
|  | 
 |  | 
 | 
|  | Type This field specifies the ''type''of the option described in that row, and can be one of:
 |  | ''Relational-Expression:'' | 
|  |  | : ''Additive-Expression'' | 
|  |  | : ''Relational-Expression'' EQ ''Additive-Expression'' | 
|  |  | : ''Relational-Expression'' NE ''Additive-Expression'' | 
|  |  | : ''Relational-Expression'' GT ''Additive-Expression'' | 
|  |  | : ''Relational-Expression'' GE ''Additive-Expression'' | 
|  |  | : ''Relational-Expression'' LT ''Additive-Expression'' | 
|  |  | : ''Relational-Expression'' LE ''Additive-Expression'' | 
|  | 
 |  | 
 | 
|  | '''S'''-[[00037.htm|Switch Option]] <br />'''P'''-[[00038.htm|Parameterized Option]] |  | ''Additive-Expression:' | 
|  |  | : ''Multiplicative-Expression'' | 
|  |  | : ''Additive-Expression'' + ''Multiplicative-Expression'' | 
|  |  | : ''Additive-Expression'' - ''Multiplicative-Expression'' | 
|  | 
 |  | 
 | 
|  | Global Specifies whether or not the option is valid only in a '''''global''context; that is, in the outermost scope on the command line. These options typically have meaning only for the assembler executable itself, and not for any files to be processed.'''
 |  | ''Multiplicative-Expression:'' | 
|  |  | : ''Narrowed-Expression'' | 
|  |  | : ''Multiplicative-Expression'' * ''Narrowed-Expression'' | 
|  |  | : ''Multiplicative-Expression'' / ''Narrowed-Expression'' | 
|  |  | : ''Multiplicative-Expression'' MOD ''Narrowed-Expression'' | 
|  |  | : ''Multiplicative-Expression'' SHL ''Narrowed-Expression'' | 
|  |  | : ''Multiplicative-Expression'' SHR ''Narrowed-Expression'' | 
|  | 
 |  | 
 | 
|  | Group Specifies whether or not the option is valid in a '''''group''context; that is, if the option may be applied to multiple files within a given scope without causing ambiguities.'''
 |  | ''Narrowed-Expression:'' | 
|  |  | : ''Cast-Expression''   | 
|  |  | : HIGH ''Cast-Expression'' | 
|  |  | : HIGHWORD ''Cast-Expression'' | 
|  |  | : LOW ''Cast-Expression'' | 
|  |  | : LOWWORD ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | File Specifies whether or not the option is valid only in a '''''file''context; that is, if the option may only be applied to a single file within a given scope.'''
 |  | ''Cast-Expression:'' | 
|  |  | : ''Element-Selection-Expression'' | 
|  |  | : OFFSET ''Cast-Expression'' | 
|  |  | : SEG ''Cast-Expression'' | 
|  |  | : THIS ''Element-Selection-Expression'' | 
|  |  | : TYPE ''Element-Selection-Expression'' | 
|  |  | : ''Cast-Expression'' PTR ''Cast-Expression'' | 
|  |  | : ''Cast-Expression'' : ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | Default This field shows the default value for the option being described.<br />
 |  | ''Element-Selection-Expression:'' | 
|  |  | : ''Sign-Expression'' | 
|  |  | : ''Element-Selection-Expression'' | 
|  |  | : ''Sign-Expression'' | 
|  |  | : ''Element-Selection-Expression'' . ''Sign-Expression'' | 
|  | 
 |  | 
 | 
|  | [[[00045.htm|prev]]][[[00047.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ''Sign-Expression:'' | 
|  |  | : ''Primary-Expression''  | 
|  |  | : - ''Primary-Expression'' | 
|  |  | : + ''Primary-Expression'' | 
|  | 
 |  | 
 | 
|  | === Base Options ===
 |  | ''Primary-Expression:'' | 
|  |  | : ''Literal-Operand'' | 
|  |  | : ''Record-Constant'' | 
|  |  | : ''Identifier-Operand'' | 
|  |  | : ''Register-Operand'' | 
|  |  | : ''Integral-TypeName-Operand'' | 
|  |  | : ''Value-Substitution-Operand'' | 
|  |  | : LENGTH ''Identifier-Operand'' | 
|  |  | : LENGTHOF ''Identifier-Operand'' | 
|  |  | : MASK ''Identifier-Operand'' | 
|  |  | : SIZE ''Element-Selection-Expression'' | 
|  |  | : SIZEOF ''Element-Selection-Expression'' | 
|  |  | : WIDTH ''Identifier-Operand'' | 
|  |  | : ''Parenthesized-Expression'' | 
|  |  | : ''Indirected-Expression'' | 
|  |  | : ''Compound-Initializer'' | 
|  | 
 |  | 
 | 
|  | This section describes the standalone base options that are defined by a single unique mnemonic identifier character.
 |  | ''Literal-Operand:'' | 
|  |  | : ''Floating-Point-Literal'' | 
|  |  | : ''Integer-Literal'' | 
|  |  | : ''String-Literal'']] | 
|  | 
 |  | 
 | 
|  | [[[00046.htm|prev]]][[[00048.htm|next]]][[[00046.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ''Record-Constant:'' | 
|  |  | : ''Identifier-Operand'' '''<''' ''Field-List'' '''>''' | 
|  |  | : ''Identifier-Operand'' '''{''' ''Field-List'' '''}''' | 
|  | 
 |  | 
 | 
|  | === D -Define Text Macro ===
 |  | ''Field-List:'' | 
|  |  | : ''Attribute-Expression'' | 
|  |  | : ''Field-List'' ''',''' ''Attribute-Expression'' | 
|  | 
 |  | 
 | 
|  | This option allows the definition of a symbolic identifier that becomes visible during the assembly of the input file. A single parameter must be specified using one of the following forms:
 |  | ''Identifier-Operand:'' | 
|  |  | : ''Identifier'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ''Register-Operand:'' | 
|  |  | : ''Processor-Register'' | 
|  | 
 |  | 
 | 
|  | <pre>Name[=Value]</pre>
 |  | ''Integral-TypeName-Operand:'' | 
|  | <br /><br />
 |  | : ''Scalar-TypeName'' | 
|  |  | : ''Distance-TypeName'' | 
|  | 
 |  | 
 | 
|  | <pre>Name[:Value]</pre>
 |  | ''Value-Substitution-Operand:'' | 
|  | <br />
 |  | : ''Anonymous-Label-Alias'' | 
|  |  | : ''Location-Counter-Alias'' | 
|  |  | : ''Indeterminate-Value-Alias'' | 
|  |  | : '''FLAT''' | 
|  | 
 |  | 
 | 
|  | The ''Name''entry must have the same lexical syntax as a normal assembler [[00149.htm|''Identifier'']]. The ''Name''entry is converted to a [[00157.htm|''Text-EquateName'']]before assembly begins. If no explicit value is specified for the name, then it is assigned the empty string. This is equivalent to specifying the following assembler statement: <br />
 |  | ''Parenthesized-Expression:'' | 
|  |  | : '''(''' ''Attribute-Expression'' ''')''' | 
|  | 
 |  | 
 | 
|  | <pre>     Name   EQU   < > </pre>
 |  | ''Indirected-Expression:'' | 
|  | If an explicit value is to be assigned, the ''Name''entry must be immediately followed by a colon (:) or equals sign (=) delimiter with no intervening spaces. Blank characters may be specified between the delimiter and the value field. The ''Value''field may contain any text data, but it must be enclosed in double quotes ("") if it contains blanks, tabs, or operating system metacharacters (such as & or |).
 |  | : '''[''' ''Attribute-Expression'' ''']''' | 
|  | 
 |  | 
 | 
|  | '''Note:'''If quotes are used to specify a value containing embedded blanks or tabs, then at least one blank is required between the delimiter (colon or equals sign) and the opening quote of the value field. For example: <br /> |  | ''Compound-Initializer:'' | 
|  |  | : '''<''' ''Initializer-List'' '''>''' | 
|  |  | : '''{''' ''Initializer-List'' '''}''' | 
|  | 
 |  | 
 | 
|  | <pre>   -D :NAME =   " This   string   will   be   correctly   interpreted " 
 |  | ''Initializer-List:'' | 
|  |    -D :NAME = " This   will   not ;   no   blank   after   the   equals   sign " </pre>
 |  | : ''Duplicative-Expression'' | 
|  | <br />
 |  | : ''Initializer-List'' ''',''' ''Duplicative-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ==== Duplicative Initialization Expression ==== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | ;Description | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | A '''''Duplicative Initialization Expression''''' is one that can be optionally used during the initialization of variables such that the operand is duplicated a specified number of times. | 
|  | |P   |Yes   |Yes  |Yes |(no default value)                                |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00047.htm|prev]]][[[00049.htm|next]]][[[00046.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === I - Specify Include File Search Path ===
 |  | ;Syntax | 
|  | 
 |  | 
 | 
|  | See [[00053.htm|Fdi - Specify Include File Search Path]].
 |  | ''Duplicative-Expression:'' | 
|  |  | :''Attribute-Expression'' | 
|  |  | :''Attribute-Expression'' | 
|  |  | :[[#DUP]] '''(''' ''Initializer-List''' '')''' | 
|  | 
 |  | 
 | 
|  | [[[00048.htm|prev]]][[[00050.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ''Initializer-List:'' | 
|  |  | :''Duplicative-Expression'' | 
|  |  | :''Initializer-List'' ''',''' ''Duplicative-Expression'' | 
|  | 
 |  | 
 | 
|  | === File Control Options === |  | ===== Duplicative Initialization (DUP Operator) ===== | 
|  |  | ;Description | 
|  |  | The '''DUP''' operator creates a ''Duplicated-ExpressionType'' from the ''Initializer-List'' enclosed in parentheses. This construct can be used to create arrays of information during data allocation. | 
|  | 
 |  | 
 | 
|  | All options that perform file or file name manipulation are described in this section. File Control Options begin with the letter '''"F"''', and the last letter of the option identifier specifies the type of file or file name to which the option applies as follows:
 |  | ;Syntax | 
|  | 
 |  | 
 | 
|  | '''i'''Include File <br />'''l'''Listing File <br />'''m'''Messages File <br />'''o'''Object File <br />'''s'''Source File <br /> |  | ''Attribute-Expression'' '''DUP ('''''Initializer-List''''')''' | 
|  |  | ''Initializer-List:'' | 
|  |  | ''Duplicative-Expression'' | 
|  |  | ''Initializer-List''''','''|''Duplicative-Expression'' | 
|  | 
 |  | 
 | 
|  | [[[00049.htm|prev]]][[[00051.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Constraints | 
|  | 
 |  | 
 | 
|  | === Fl -Produce Listing File ===
 |  | The left hand operand of the '''DUP''' operator must evaluate to an ''Absolute-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | Turn this flag on toproduce anassembler listing file. Using the parameterized version of the option allows the listing file to be explicitly named.
 |  | Each ''Duplicative-Expression'' in the ''Initializer-List'' must evaluate to an ''Initializer-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | Only this option controls the actual creation of a listing file;[[00063.htm|Listing Control Options]]have no effect if this option has not been turned on.
 |  | ;Examples | 
|  |  |  STR   STRUCT  | 
|  |  |   One   BYTE  0 | 
|  |  |   Two   BYTE  0 | 
|  |  |  STR   ENDS  | 
|  | 
 |  | 
 | 
|  | <br /> |  |  Array1  WORD 4 DUP (1,2,3,4)         ; allocates 16 words | 
|  |  |  Array2  STR  8 DUP (<1,2>)           ; 8 structures | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ==== Attribute Expression ==== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | ;Description | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | An '''Attribute Expression''' is one that optionally extracts or modifies one or more of the basic properties of its operand. | 
|  | |S   |Yes   |Yes  |Yes |-Fl (no listing file is generated)                |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |No    |No   |Yes |-Fl:<LstDIR><LstNAME>[<LstEXT>]                   |
 |  | 
|  | |    |      |     |    |(A listing file name isgenerated using thevalues|
 |  | 
|  | |    |      |     |    |ofthe referenced internal variables.  The LstEXT |
 |  | 
|  | |    |      |     |    |extension is appended if this feature is turned   |
 |  | 
|  | |    |      |     |    |on.)                                              |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00050.htm|prev]]][[[00052.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Fm -Produce Messages File ===
 |  | ;Syntax | 
|  |  | ''Attribute-Expression:'' | 
|  |  | : ''OR-Expression'' | 
|  |  | : SHORT ''Additive-Expression'' | 
|  |  | : .TYPE ''OR-Expression'' | 
|  |  | : OPATTR ''OR-Expression'' | 
|  | 
 |  | 
 | 
|  | Turn this flag on to produce a messages file.Using the parameterized version of the option allows the messages file to beexplicitly named.
 |  | ===== Expression Descriptor Bitmap (.TYPE Operator) ===== | 
|  |  | ;Description | 
|  |  | The '''.TYPE''' operator is considered obsolete. The [[#OPATTR]] operator should be used instead. | 
|  | 
 |  | 
 | 
|  | Within the context of a given assembly, by default all error, warning, and informational messages are printed to the standard output device. Use of the '''Fm'''option allows these messages to be redirected to aseparate file; this can beuseful when dissecting theoutput from multiple assemblies. Messages with a severity greater than '''Error'''are printed to thestandard errordevice,and do not appear in themessages file.
 |  | The '''.TYPE''' operator returns a byte value bitmap that describes various attributes of its operand. The return value is 0 if the expression could not be correctly parsed or evaluated, otherwise the bitmap returned is formatted according to the following table: | 
|  |  | {|class="wikitable" | 
|  |  | !7!!6!!5!!4!!3!!2!!1!!0!!BIT SET IF EXPRESSION | 
|  |  | |- | 
|  |  | | || || || || || || ||1||Is a Direct-ExpressionType | 
|  |  | |- | 
|  |  | | || || || || || ||1|| ||Is a Indirect-ExpressionType, an Indexed-ExpressionType, or a combination of both | 
|  |  | |- | 
|  |  | | || || || || ||1|| || ||Is an Immediate-ExpressionType | 
|  |  | |- | 
|  |  | | || || || ||1|| || || ||Is an Indirect-ExpressionType | 
|  |  | |- | 
|  |  | | || || ||1|| || || || ||Is a Register-ExpressionType | 
|  |  | |- | 
|  |  | | || ||1|| || || || || ||Was parsed and evaluated without error (no undefined symbols, etc.) | 
|  |  | |- | 
|  |  | | ||1|| || || || || || ||Is relative to the SS Segment-Register | 
|  |  | |- | 
|  |  | |1|| || || || || || || ||Contains an External Reference | 
|  |  | |} | 
|  | 
 |  | 
 | 
|  | <br />
 |  | .TYPE OR-Expression | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Syntax | 
|  | |Type|Global|Group|File|Default                                           |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-Fm (no messages file is generated;all messages  |
 |  | 
|  | |    |      |     |    |are printed on the standard output)               |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |No    |No   |Yes |-Fm:<MsgDIR><MsgNAME>[<MsgEXT>]                   |
 |  | 
|  | |    |      |     |    |(A messages file name is generated using the      |
 |  | 
|  | |    |      |     |    |values of the referenced internal variables.  The |
 |  | 
|  | |    |      |     |    |MsgEXT extension is appended if this feature is   |
 |  | 
|  | |    |      |     |    |turned on.)                                       |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00051.htm|prev]]][[[00053.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Fo -Produce Object File ===
 |  | '''.TYPE''' ''OR-Expression'' | 
|  | 
 |  | 
 | 
|  | An object file name is generated using the values of the referenced internal variables. The [[00019.htm|ObjEXT]]extension is appended if this feature is turned on.
 |  | ;Examples | 
|  | 
 |  | 
 | 
|  | By default, this switch is turned on andthus an object file is produced ( provided the assembly completes without errors); this switch may be turned off if an object file is not desired.Using the parameterized version of the option allows the object file tobe explicitly named.
 |  |  BumpCounter macro bump  | 
|  |  |    if (((.TYPE (bump)) and 07h) eq 04h) | 
|  |  |       Counter = Counter + bump | 
|  |  |    else | 
|  |  |       .err <Non-constant value passed to BumpCounter> | 
|  |  |    endif | 
|  |  |  endm | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ===== Extended Descriptor Bitmap (OPATTR Operator) ===== | 
|  |  | OPATTR OR-Expression | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Syntax | 
|  | |Type|Global|Group|File|Default                                           |
 |  | '''OPATTR''' ''OR-Expression' | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+Fo (an object file is generated)                 |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |No    |No   |Yes |-Fo:<ObjDIR><ObjNAME>[<ObjEXT>]                   |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00052.htm|prev]]][[[00054.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Fdi - Specify Include File Search Path ===
 |  | ;Description | 
|  | 
 |  | 
 | 
|  | This option accepts a path (or list of paths separated by semicolons) that are searched by the assembler while attempting to locate an '''INCLUDE'''file. When multiple occurrences ofthis option are specified within a given scope , theeffect is cumulative rather than destructive; successive occurrences add to theexisting list rather than overwriting previous definitions.The more conventional spelling "'''I'''" can beused as an alias for the '''Fdi'''option.
 |  | The '''OPATTR''' operator returns a superset of the information returned by the .TYPE operator, which should be considered obsolete. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | The '''OPATTR''' operator returns a word value bitmap that describes various attributes of its operand. The return value is 0 if the expression could not be correctly parsed or evaluated, otherwise the bitmap returned is formatted according to the following table: | 
|  |  | {|class="wikitable" | 
|  |  | !A98 | 
|  |  | !7 | 
|  |  | !6 | 
|  |  | !5 | 
|  |  | !4 | 
|  |  | !3 | 
|  |  | !2 | 
|  |  | !1 | 
|  |  | !0 | 
|  |  | !BIT SET IF EXPRESSION | 
|  |  | |- | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |1 | 
|  |  | |Is a Direct-ExpressionType | 
|  |  | |- | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |1 | 
|  |  | | | 
|  |  | |Is a Indirect-ExpressionType, an Indexed-ExpressionType, or a combination of both | 
|  |  | |- | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |1 | 
|  |  | | | 
|  |  | | | 
|  |  | |Is an Immediate-ExpressionType | 
|  |  | |- | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |1 | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |Is an Indirect-ExpressionType | 
|  |  | |- | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |1 | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |Is a Register-ExpressionType | 
|  |  | |- | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |1 | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |Was parsed and evaluated without error (no undefined symbols, etc.) | 
|  |  | |- | 
|  |  | | | 
|  |  | | | 
|  |  | |1 | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |Is relative to the SS Segment-Register | 
|  |  | |- | 
|  |  | | | 
|  |  | |1 | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |Contains an External Reference | 
|  |  | |- | 
|  |  | |LLL | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | | | 
|  |  | |Language encoding (described below) | 
|  |  | |} | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | The '''LLL''' field (bits 8, 9, and A) comprise an enumerated value that describes the language attribute assigned to the expression as follows: | 
|  | |Type|Global|Group|File|Default                                           |
 |  | * 000 No language attribute used in expression | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | * 001 C | 
|  | |P   |Yes   |Yes  |Yes |-Fdi:<IncDIR>                                     |
 |  | * 010 SYSCALL | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | * 011 STDCALL | 
|  | [[[00053.htm|prev]]][[[00055.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | * 100 PASCAL | 
|  |  | * 101 FORTRAN | 
|  |  | * 110 BASIC | 
|  |  | * 111 OPTLINK | 
|  | 
 |  | 
 | 
|  | === Fdl - Directory to Store Listing File (LstDIR) ===
 |  | ;Constraints | 
|  |  | This operator is not available in M510 mode. | 
|  | 
 |  | 
 | 
|  | This option affects the [[00012.htm|LstDIR]]variable and allows the user tospecify a target directory where the listing file(s)will be stored; by default this variable is empty andlisting file(s)are created in the current working directory. This value is ignored if the '''Fl'''option was used to explicitly name the listing file, and the name included absolute or relative path information.
 |  | ;Examples | 
|  |  |  L_MASK     equ 011100000000y               ; mask to isolate language bits | 
|  |  |  L_OPTLINK  equ 011100000000y               ; setting for OptLink calling convention | 
|  |  |  VerifyCallBack   macro   ProcName  | 
|  |  |    if (((OPATTR (ProcName)) and L_MASK) ne L_OPTLINK) | 
|  |  |       .err <Call-back routine must have OptLink linkage> | 
|  |  |    endif | 
|  |  |  endm | 
|  | 
 |  | 
 | 
|  | If the value specified in this option is anything other than an unadorned '''''drive letter''(for example, '''D:''') or a string ending with a '''''path separator character''('''/'''or '''\'''), then the '''''path separator character''appropriate for the underlying operating system is appended to the string.'''''''''
 |  | ===== Force Short Relative Address (SHORT Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''SHORT''' ''Additive-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Description | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | The '''SHORT''' operator forces the assembler to calculate the distance from the start of the next instruction to the target specified by the operand (given by ''Additive-Expression'') to be less than 128 bytes away. This can cause the assembler to generate more efficient control transfer instructions when the target is a forward reference. By default, the assembler assumes that the code-relative target is of '''NEAR''' distance when the target is an unqualified forward reference. | 
|  | |Type|Global|Group|File|Default                                           |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-Fdl:<LstDIR>                                     |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00054.htm|prev]]][[[00056.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Fdm -Directory toStore Messages File (MsgDIR) ===
 |  | ;Constraints | 
|  |  | The ''Additive-Expression'' must evaluate to a ''Direct-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | This option affects the [[00015.htm|MsgDIR]]variable and allows the user to specify a targetdirectory where the messages file(s) will be stored;by default this variable is empty and messages file(s) are created in the current working directory.This value is ignored if the '''Fm'''option was used to explicitly name the message file, and the name included absolute or relative path information.
 |  | ;Examples | 
|  |  |    JMP     Forward                ; target unknown, NEAR jump generated | 
|  |  |    JMP     SHORT Forward          ; force SHORT encoding | 
|  |  |    . | 
|  |  |    .                      ; fewer than 128 bytes of instructions | 
|  |  |    . | 
|  |  |  Forward:                 ; definition of target | 
|  | 
 |  | 
 | 
|  | If the value specified in this option is anything other than an unadorned '''''drive letter''(for example, '''D:''') or a string ending with a '''''path separator character''('''/'''or '''\'''), then the'''''path separator character''appropriate for the underlying operating system isappended to thestring.'''''''''
 |  | ==== Bitwise OR Expression ==== | 
|  |  | ;Description | 
|  |  | A '''Bitwise OR Expression''' is one where an optional binary bitwise '''OR''' operation between the left and right operands is performed and the result returned. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Syntax | 
|  |  | ''OR-Expression:'' ''AND-Expression'' | 
|  |  | ''OR-Expression'' OR ''AND-Expression'' | 
|  |  | ''OR-Expression'' XOR ''AND-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ===== Bitwise Inclusive OR (OR Operator) ===== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | ;Syntax | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | ''OR-Expression'' '''OR''' ''AND-Expression'' | 
|  | |P   |Yes   |Yes  |Yes |-Fdm:<MsgDIR>                                    |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00055.htm|prev]]][[[00057.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Fdo - Directory to Store Object File (ObjDIR) ===
 |  | ;Description | 
|  |  | The '''OR''' operator performs a binary bitwise OR operation on the left and right hand operands. | 
|  | 
 |  | 
 | 
|  | This option affects the [[00018.htm|ObjDIR]]variable and allows the user tospecify atarget directory where the object file(s) will be stored; by default this variable is empty and object file(s) are created in the current working directory. This value is ignored if the '''Fo'''option was used to explicitly name the object file, and the name included absolute or relative path information.
 |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | If the value specified in this option is anything other than an unadorned '''''drive letter''(for example,'''D:''') or a string ending with a '''''path separator character''('''/'''or '''\'''), then the '''''path separator character''appropriate for the underlying operating system is appended to the string.'''''''''
 |  | ;Examples | 
|  |  |  One  EQU  1 | 
|  |  |  Two  EQU  2 | 
|  |  |   | 
|  |  |  MOV  AX, One OR Two        ; moves 3 into AX | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ===== Bitwise Exclusive OR (XOR Operator) ===== | 
|  |  | ;Syntax | 
|  |  | ''OR-Expression'' '''XOR''' ''AND-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Description | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The '''XOR''' operator performs a binary bitwise XOR operation on the left and right hand operands. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-Fdo:<ObjDIR>                                    |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00056.htm|prev]]][[[00058.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Fds -Directory to Locate Source File (SrcDIR) ===
 |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | This option affects the [[00022.htm|SrcDIR]]variable and allows the user to specify a source directory from which source file(s) will be loaded;by default this variable is empty and source file(s) are searched for in the current working directory. This value is ignored if the source file name included absolute or relative path information.
 |  | ;Examples | 
|  |  |  Lower  EQU  0101y          ; 7h - binary radix suffix | 
|  |  |  Upper  EQU  1100y          ; Eh - binary radix suffix | 
|  |  |   | 
|  |  |  MOV  AX, Upper XOR Lower   ; moves 1001 into AX | 
|  | 
 |  | 
 | 
|  | If the value specified in this option is anything other than an unadorned '''''drive letter''(for example, '''D:''') or a string ending with a '''''path separator character''('''/'''or '''\'''), then the'''''path separator character''appropriate for the underlying operating system isappended to thestring.'''''''''
 |  | ==== Bitwise AND Expression ==== | 
|  |  | ;Description | 
|  |  | A '''Bitwise AND Expression''' is one where an optional binary bitwise '''AND''' operation between the left and right operands is performed and the result returned. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Syntax | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ''AND-Expression:'' | 
|  | |Type|Global|Group|File|Default                                           |
 |  | :''NOT-Expression'' | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | :''AND-Expression'' AND ''NOT-Expression'' | 
|  | |P   |Yes   |Yes  |Yes |-Fds:<SrcDIR>                                     |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00057.htm|prev]]][[[00059.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Fei - Control Include File Extension (IncEXT) === |  | ===== Bitwise AND (AND Operator) ===== | 
|  |  | ;Syntax | 
|  |  | ''AND-Expression'' '''AND''' ''NOT-Expression'' | 
|  | 
 |  | 
 | 
|  | This option determines whether or not the value of the [[00011.htm|IncEXT]]variable is appended to file names generated by the preprocessor when processing the INCLUDE directive. Theparameterized version of this option affects the actual value of the[[00011.htm|IncEXT]]variable.
 |  | ;Description | 
|  |  | The '''AND''' operator performs a binary bitwise AND operation on the left and right hand operands. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Examples | 
|  | |Type|Global|Group|File|Default                                           |
 |  |  Lower  EQU  0111y           ; 7h - binary radix suffix | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  |   Upper  EQU  1110y           ; Eh - binary radix suffix | 
|  | |S   |Yes   |Yes |Yes |-Fei                                              |
 |  |   | 
|  | |    |      |     |    |(the value of IncEXT is not appended to include   |
 |  |  MOV  AX, Upper XOR Lower    ; moves 0110 into AX | 
|  | | |      |     |    |file names)                                       |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-Fei:<IncEXT>                                    |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00058.htm|prev]]][[[00060.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Fel - Control Listing File Extension (LstEXT) === |  | ==== Bitwise One's Complement Expression ==== | 
|  |  | ;Description | 
|  |  | A '''Bitwise One's Complement Expression''' is one that performs an optional unary bitwise negation of its operand and returns the result. | 
|  | 
 |  | 
 | 
|  | This option determines whether or not the value of the [[00013.htm|LstEXT]]variable is appended to listing file names. The parameterized version of this option affects the actual value of the [[00013.htm|LstEXT]]variable.
 |  | ;Syntax | 
|  |  | ''NOT-Expression:'' | 
|  |  | ''Relational-Expression'' | 
|  |  | NOT ''Relational-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ===== Bitwise One's Complement (NOT Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''NOT''' ''Relational-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Description | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The '''NOT''' operator performs a unary bitwise negation on its operand. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+Fel                                              |
 |  | 
|  | |    |      |     |    |(the value of LstEXT is appended to listing file  |
 |  | 
|  | |    |      |     |    |names)                                            |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |+Fel:<LstEXT>                                     |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00059.htm|prev]]][[[00061.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Fem -Control Messages File Extension (MsgEXT) ===
 |  | ;Constraints | 
|  |  | The operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | This option determines whether or not the value of the [[00016.htm|MsgEXT]]variable is appended to messages file names. The parameterized version of this option affects the actual value of the [[00016.htm|MsgEXT]]variable.
 |  | ;Examples | 
|  |  |    Value  EQU 0111y          ; 7h - binary radix suffix | 
|  | 
 |  | 
 | 
|  | <br />
 |  |    MOV    EAX, NOT Value     ; moves FFFFFFF8 into EAX | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ====Relational Expression==== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | ;Description | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | A '''Relational Expression''' is one where an optional binary comparision operation between the left and right operands is performed and the result returned. | 
|  | |S   |Yes   |Yes  |Yes |+Fem                                              |
 |  | 
|  | |    |      |     |    |(thevalue of MsgEXT isappended to messages file |
 |  | 
|  | |    |      |     |    |names)                                            |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |+Fem:<MsgEXT>                                     |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00060.htm|prev]]][[[00062.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Feo -Control Object File Extension (ObjEXT) ===
 |  | ;Syntax | 
|  |  | :''Relational-Expression:'' | 
|  |  | :''Additive-Expression'' | 
|  |  | :''Relational-Expression'' EQ ''Additive-Expression'' | 
|  |  | :''Relational-Expression'' NE ''Additive-Expression'' | 
|  |  | :''Relational-Expression'' GT ''Additive-Expression'' | 
|  |  | :''Relational-Expression'' GE ''Additive-Expression'' | 
|  |  | :''Relational-Expression'' LT ''Additive-Expression'' | 
|  |  | :''Relational-Expression'' LE ''Additive-Expression'' | 
|  | 
 |  | 
 | 
|  | This option determines whether or not the value of the [[00019.htm|ObjEXT]]variable is appended to object file names. The parameterized version of this option affects the actual value of the [[00019.htm|ObjEXT]]variable.
 |  | =====Equal To (EQ Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Relational-Expression'' '''EQ''' ''Additive-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Description | 
|  |  | The '''EQ''' operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if they are equal, and false (all bits off) if they are not equal. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Constraints | 
|  | |Type|Global|Group|File|Default                                           |
 |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+Feo                                              |
 |  | 
|  | |    |      |     |    |(the value of ObjEXT is appended toobject file   |
 |  | 
|  | |    |      |     |    |names)                                            |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |+Feo:<ObjEXT>                                     |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00061.htm|prev]]][[[00063.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Fes - Control Source File Extension (SrcEXT) === |  | ;Examples | 
|  |  |    IF 1234 EQ 5678 | 
|  |  |      TRUE = 1 | 
|  |  |    ELSE | 
|  |  |      TRUE = 0                ; Sets TRUE to 0 | 
|  |  |    ENDIF  | 
|  | 
 |  | 
 | 
|  | This option determines whether or not the value of the [[00023.htm|SrcEXT]]variable is appended to source file names. The parameterized version of this option affects the actual value of the [[00023.htm|SrcEXT]]variable.
 |  | =====Not Equal To (NE Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Relational-Expression'' '''NE''' ''Additive-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Description | 
|  |  | The '''NE''' operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if they are not equal, and false (all bits off) if they are equal. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Constraints | 
|  | |Type|Global|Group|File|Default                                           |
 |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+Fes                                              |
 |  | 
|  | |    |      |     |    |(the value of SrcEXT is appended tosource file   |
 |  | 
|  | |    |      |     |    |names)                                            |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |+Fes:<SrcEXT>                                     |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00062.htm|prev]]][[[00064.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Listing Control Options === |  | ;Examples | 
|  |  |  IF 1234 NE 5678 | 
|  |  |      TRUE = 1                ; Sets TRUE to 1 | 
|  |  |  ELSE | 
|  |  |      TRUE = 0 | 
|  |  |  ENDIF | 
|  | 
 |  | 
 | 
|  | This section describes all options related to controlling the content of the assembler listing file. All listing control options begin with the letter '''"L"'''.
 |  | =====Greater Than (GT Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Relational-Expression'' '''GT''' ''Additive-Expression'' | 
|  | 
 |  | 
 | 
|  | Options that manipulate thecharacteristics of individual listing file columns reference a particular column by having a single character mnemonic identifier as part of theoption identifier.Listing column mnemonics are as follows:
 |  | ;Description | 
|  |  | The '''GT''' operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is greater than the right operand, and false (all bits off) if it is not. | 
|  | 
 |  | 
 | 
|  | '''C''''''Conditional assembly nesting level'''is a numeric value that appears during processing of a conditional assembly directive and is incremented for each level of nesting that occurs. |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | '''D''''''Macro definition line number'''tracks line numbers for each new MACRO definition introduced into the assembly.
 |  | ;Examples | 
|  |  |  IF 1234 GT 5678  | 
|  |  |    TRUE = 1  | 
|  |  |  ELSE  | 
|  |  |    TRUE = 0              ; Sets TRUE to 0 | 
|  |  |  ENDIF | 
|  | 
 |  | 
 | 
|  | '''F''''''True or false conditional flag'''appears during processing of a conditional assembly directive and is either a plus (+) character to denote that the conditional expression was TRUE and tokens appearing within the block are being interpreted, or a minus (-) character to denote that the conditional expression was FALSE and tokens appearing within the block are being ignored. |  | =====Greater Than or Equal To (GE Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Relational-Expression'' '''GE''' ''Additive-Expression'' | 
|  | 
 |  | 
 | 
|  | '''G''''''Generated machine code data'''column shows thehexadecimal values for data generated by machine instructions ordata allocation statements. |  | ;Description | 
|  |  | The '''GE''' operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is greater than or equal to the right operand, and false (all bits off) if it is not. | 
|  | 
 |  | 
 | 
|  | '''I''''''Include file nesting level'''is a numeric value that appears during processing of INCLUDE files and is incremented for each level of nesting that occurs. |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | '''L''''''Macro expansion indentation level'''is a text field whose width reflects the current nesting level of expanded macros, and whose value contains a simulated "arrow"using the "--->" characters.
 |  | ;Examples | 
|  |  |  IF 1234 GE 1234  | 
|  |  |      TRUE = 1                ; Sets TRUE to 1 | 
|  |  |  ELSE  | 
|  |  |      TRUE = 0  | 
|  |  |  ENDIF | 
|  | 
 |  | 
 | 
|  | '''M''''''Macro expansion nesting level'''is a numeric value that appears during macro expansions and is incremented for each level of nesting that occurs. |  | =====Less Than (LT Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Relational-Expression'' '''LT''' ''Additive-Expression'' | 
|  | 
 |  | 
 | 
|  | '''O''''''Location counter offset value'''is anumeric value displayed in hexadecimal notation andindicates thecurrent offset of thelocation counter within the current segment or structure. |  | ;Description | 
|  |  | The '''LT''' operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is less than the right operand, and false (all bits off) if it is not. | 
|  | 
 |  | 
 | 
|  | '''S''''''Source line data'''column contains the text data of the current line in the input source file. |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | '''X''''''Cumulative listing line number'''is incremented for every new line that appears in the listing file.
 |  | ;Examples | 
|  |  |    IF 1234 LT 5678 | 
|  |  |        TRUE = 1               ; Sets TRUE to 1 | 
|  |  |    ELSE | 
|  |  |        TRUE = 0 | 
|  |  |    ENDIF | 
|  | 
 |  | 
 | 
|  | '''Y''''''Individual source file line number'''tracks line numbers for the top-level source file and for each separate INCLUDE file. |  | =====Less Than or Equal To (LE Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Relational-Expression'' '''LE''' ''Additive-Expression'' | 
|  | 
 |  | 
 | 
|  | '''Z''''''Macro expansion line number'''tracks thecurrent line number for each MACRO expanded during theassembly.<br /> |  | ;Description | 
|  |  | The '''LE''' operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is less than or equal to the right operand, and false (all bits off) if it is not. | 
|  | 
 |  | 
 | 
|  | [[[00063.htm|prev]]][[[00065.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | === Lc* - Control Display of Individual Columns === |  | ;Examples | 
|  |  |    IF 1234 LE 1234 | 
|  |  |      TRUE = 1                  ; Sets TRUE to 1 | 
|  |  |    ELSE  | 
|  |  |      TRUE = 0 | 
|  |  |    ENDIF | 
|  | 
 |  | 
 | 
|  | This family of options controls whether or not anindividual column physically appears in the listing file. The display of each column may be controlled with a switch option by using thestandard ON (+) or OFF (-) switch values (see [[00037.htm|Switch Option]]) or by using theparameterized option syntax (see [[00038.htm|Parameterized Option]]) with one of the following keyword values in the argument field:
 |  | ====Additive Expression==== | 
|  |  | ;Description | 
|  |  | A '''Additive Expression''' is one where an optional binary additive arithmetic operation between the left and right operands is performed and the result returned. | 
|  | 
 |  | 
 | 
|  | '''B'''Abbreviation for BLANK. <br />'''BLANK'''The column will appear as a place-holder in the listing file, but the column data will not be displayed. <br />'''OFF'''The column will not be displayed. <br />'''ON'''The column will be displayed. <br />'''Z'''Abbreviation for ZBLANK. <br />'''ZBLANK'''The column data will only display if its value is nonzero (valid only for numeric fields). <br /> |  | ;Syntax | 
|  |  | :''Additive-Expression:'' | 
|  |  | :''Multiplicative-Expression'' | 
|  |  | :''Additive-Expression'' + ''Multiplicative-Expression'' | 
|  |  | :''Additive-Expression'' - ''Multiplicative-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | =====Addition (+ Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Additive-Expression'' '''+''' ''Multiplicative-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Description | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The '''+''' operator performs a binary addition operation on the left and right hand operands, and returns the result. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcX (display Cumulative Listing Line Number)     |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcY (display Individual Source File Line Number) |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-LcZ:Z (display Macro Expansion Line Number if not|
 |  | 
|  | |    |      |     |    |zero)                                             |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-LcD:Z (display Macro Definition Line Number if   |
 |  | 
|  | |    |      |     |    |not zero)                                         |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcL (display Macro Expansion Indentation Level)  |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-LcM:Z (display Macro Expansion Nesting Level if  |
 |  | 
|  | |    |      |     |    |not zero)                                         |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-LcI:Z (display Include File Nesting Level if not |
 |  | 
|  | |    |      |     |    |zero)                                             |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcC (display Conditional Assembly Nesting Level) |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcF (display True or False Conditional Flag)     |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcO (display Location Counter Offset Value)      |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcG (display Generated Machine Code Data)        |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcS (display Source Line Data)                   |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00064.htm|prev]]][[[00066.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Lcm* -Specify Left Margin for Individual Columns ===
 |  | ;Constraints | 
|  |  | One of the operands must evaluate to a ''Constant-ExpressionType''. If one of the operands references an external identifier, then the other operand must be a ''Constant-ExpressionType'' without an external reference. Both operands must be of scalar type. | 
|  | 
 |  | 
 | 
|  | This family of options specifies the left margin value for each individual column, which determines the number of blank spaces that will appear tothe left of the column data.
 |  | ;Examples | 
|  |  |   VALUE = 100 + 11          ; sets VALUE to 111 | 
|  | 
 |  | 
 | 
|  | <br />
 |  | =====Subtraction (- Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Additive-Expression'' '''-''' ''Multiplicative-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Description | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The '''-''' operator performs a binary subtraction operation on the left and right hand operands, and returns the result. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmX:0 (Cumulative Listing Line Number)          |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmY:1 (Individual Source File Line Number)      |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmZ:1 (Macro Expansion Line Number)             |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmD:1 (Macro Definition Line Number)            |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmL:0 (Macro Expansion Indentation Level)       |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmM:1 (Macro Expansion Nesting Level)           |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmI:1 (Include File Nesting Level)              |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmC:1 (Conditional Assembly Nesting Level)      |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmF:1 (True or False Conditional Flag)          |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmO:2 (Location Counter Offset Value)           |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmG:2 (Generated Machine Code Data)             |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmS:2 (Source Line Data)                        |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00065.htm|prev]]][[[00067.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Lct* -Specify Truncation ofIndividual Columns ===
 |  | ;Constraints | 
|  |  | The right operand must evaluate to a ''Constant-ExpressionType'' and reference no external identifiers. If both operands are relocatable, they must reside within the same segment, in which case the result is converted to a ''Absolute-ExpressionType''. Both operands must be of scalar type. | 
|  | 
 |  | 
 | 
|  | This family of options specifies whether or not the data contained within an individual column will be truncated if it exceeds the column width, or whether it will overflow onto additional lines until the entire column contents have been printed.
 |  | ;Examples | 
|  |  |   VALUE = 111 - 11           ; sets VALUE to 100 | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ====Multiplicative Expression==== | 
|  |  | ;Description | 
|  |  | A '''Multiplicative Expression''' is one where an optional binary multiplicative arithmetic operation between the left and right operands is performed and the result returned. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Syntax | 
|  | |Type|Global|Group|File|Default                                           |
 |  | :''Multiplicative-Expression:'' | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | :''Narrowed-Expression'' | 
|  | |S   |Yes   |Yes  |Yes |+LcmX (truncate Cumulative Listing Line Number)   |
 |  | :''Multiplicative-Expression'' * ''Narrowed-Expression'' | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | :''Multiplicative-Expression'' / ''Narrowed-Expression'' | 
|  | |S   |Yes   |Yes  |Yes |+LcmY (truncate Individual Source File Line       |
 |  | :''Multiplicative-Expression'' MOD ''Narrowed-Expression'' | 
|  | |    |      |     |    |Number)                                           |
 |  | :''Multiplicative-Expression'' SHL ''Narrowed-Expression'' | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | :''Multiplicative-Expression'' SHR ''Narrowed-Expression'' | 
|  | |S   |Yes   |Yes  |Yes |+LcmZ (truncate Macro Expansion Line Number)      |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-LcmD (do not truncate Macro Definition Line      |
 |  | 
|  | |    |      |     |    |Number)                                           |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-LcmL (do not truncate Macro Expansion Indentation|
 |  | 
|  | |    |      |     |    |Level)                                            |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcmM (truncate Macro Expansion Nesting Level)    |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcmI (truncate Include File Nesting Level)       |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcmC (truncate Conditional Assembly Nesting      |
 |  | 
|  | |    |      |     |    |Level)                                            |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcmF (truncate True or False Conditional Flag)   |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-LcmO (do not truncate Location Counter Offset    |
 |  | 
|  | |    |      |     |    |Value)                                            |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-LcmG (do not truncate Generated Machine Code     |
 |  | 
|  | |    |      |     |    |Data)                                             |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+LcmS (truncate Source Line Data)                 |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00066.htm|prev]]][[[00068.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Lcw*- Specify Width of Individual Columns === |  | =====Multiplication (* Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Multiplicative-Expression'' '''*''' ''Narrowed-Expression'' | 
|  | 
 |  | 
 | 
|  | This family of options specifies the width of each individual listing column in single character positions. Note that the width of column '''L'''( Macro Expansion Indentation Level) will vary according to the macro expansion nesting level (which is also displayed as anumeric value in column '''M''') if the nesting level value exceeds the column width. This behavior may be avoided by setting the width of column '''L'''such that its width never exceeds thevalue of column '''M''',or by turning off thedisplay of column '''L'''altogether.
 |  | ;Description | 
|  |  | The '''*''' operator performs a binary multiplication operation on the left and right hand operands, and returns the result. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Examples | 
|  | |Type|Global|Group|File|Default                                           |
 |  |    VALUE = 9 * 3                 ; sets VALUE to 27 | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes |Yes  |Yes |-LcmX:4 (Cumulative Listing Line Number)          |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmY:4 (Individual Source File Line Number)      |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmZ:3(Macro Expansion Line Number)             |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmD:3 (Macro Definition Line Number)            |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmL:0 (Macro Expansion Indentation Level)       |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmM:2 (Macro Expansion Nesting Level)           |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmI:2 (Include File Nesting Level)              |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmC:2 (Conditional Assembly Nesting Level)      |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmF:1 (True or False Conditional Flag)          |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmO:4 (Location Counter Offset Value)           |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmG:24 (Generated Machine Code Data)            |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-LcmS:90 (Source Line Data)                       |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00067.htm|prev]]][[[00069.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Lc - Control display of false Conditional blocks === |  | =====Division (/ Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Multiplicative-Expression'' '''/''' ''Narrowed-Expression'' | 
|  | 
 |  | 
 | 
|  | This switch determines whether or not sections of source code appear in thelisting file when they are rendered inactive by a false conditional expression. By default, theassembler does not show source code in the listing file if it is skipped during conditional processing; turn this switch on if listing of all source code is desired.
 |  | ;Description | 
|  |  | The '''/''' operator performs a binary division operation on the left and right hand operands, and returns the result. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Examples | 
|  | |Type|Global|Group|File|Default                                           |
 |  |    VALUE = 27 / 9                ; sets VALUE to 3 | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes |Yes  |Yes |-Lc (do not list false conditional blocks)        |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00068.htm|prev]]][[[00070.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Ld - Control Display of Listing Directives === |  | =====Remainder (MOD Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Multiplicative-Expression'' '''MOD''' ''Narrowed-Expression'' | 
|  | 
 |  | 
 | 
|  | This switch controls whether or not assembler listing directives appear in thelisting output. Listing directives are shown by default; turn this switch off to hide them.
 |  | ;Description | 
|  |  | The '''MOD''' operator performs a binary modulus division operation on the left and right hand operands, and returns the remainder as the result. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Examples | 
|  | |Type|Global|Group|File|Default                                           |
 |  |    VALUE = 18 MOD 4              ; sets VALUE to 2 | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S |Yes   |Yes  |Yes |+Lc (show all listing directives)                 |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00069.htm|prev]]][[[00071.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Le - Control Display of Error/Warning/Info Messages === |  | =====Bitwise Left Shift (SHL Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Multiplicative-Expression'' '''SHL''' ''Narrowed-Expression'' | 
|  | 
 |  | 
 | 
|  | By default, any time theassembler prints an Error, Warning, or Info message during theassembly, themessage also appears in thelisting file following the source line to which it refers. Turn this switch off if such messages are not desired in thelisting output.
 |  | ;Description | 
|  |  | The '''SHL''' operator shifts the bits in the left hand operand to the left by the number of bits specified in the right hand operand, and returns the result. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Examples | 
|  | |Type|Global|Group|File|Default                                           |
 |  |    VALUE = 1111y SHL 4          ; sets VALUE to 11110000y | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S |Yes   |Yes  |Yes |+Le (show messages in listing file)               |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00070.htm|prev]]][[[00072.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Lf - Control Use of FormFeed Characters === |  | =====Bitwise Right Shift (SHR Operator)===== | 
|  |  | ;Syntax | 
|  |  | :''Multiplicative-Expression'' '''SHR''' ''Narrowed-Expression'' | 
|  | 
 |  | 
 | 
|  | When theassembler is generating formatted listing output and it needs to advance to thenext page, it inserts theASCII FormFeed character (0x0C) into thelisting output stream. If this causes problems,turning this switch off will instead cause the assembler to generate the appropriate number of newline character sequences to perform thepage eject operation.
 |  | ;Description | 
|  |  | The '''SHR''' operator shifts the bits in the left hand operand to the right by the number of bits specified in the right hand operand, and returns the result. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | Each operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Examples | 
|  | |Type|Global|Group|File|Default                                           |
 |  |    VALUE = 11110000y SHR 4      ; sets VALUE to 00001111y | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S |Yes   |Yes  |Yes |+Lf (the FormFeed character is used)              |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00071.htm|prev]]][[[00073.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Li - Control Display of INCLUDE Files === |  | ====Narrowed Expression==== | 
|  |  | ;Description | 
|  |  | A '''Narrowed Expression''' is one that performs an optional unary narrowing operation on its operand and returns the result. | 
|  | 
 |  | 
 | 
|  | When the assembler processes source code stored in an INCLUDE file, by default the contents of the file are expanded in the listing output;depending on the types of files that are included, this behavior can result in large volumes of listing output. Turn this switch off if the expansion is not desired.
 |  | ;Syntax | 
|  |  | ''Narrowed-Expression:'' | 
|  |  | :''Cast-Expression'' HIGH ''Cast-Expression'' | 
|  |  | :HIGHWORD ''Cast-Expression'' | 
|  |  | :LOW ''Cast-Expression'' | 
|  |  | :LOWWORD ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | =====Upper 8 Bits of WORD Expression (HIGH Operator)===== | 
|  |  | ;Syntax | 
|  |  | :'''HIGH''' ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Description | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The '''HIGH''' operator returns the upper 8 bits of a 16-bit expression. Only bits 8-15 are returned, even if the magnitude of the operand exceeds 16 bits. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+Li (INCLUDE files areexpanded in listing output)|
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00072.htm|prev]]][[[00074.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Llp -Specify Length of Page ===
 |  | ;Constraints | 
|  |  | The operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | To correctly format the listing file for subsequent hardcopy output, the assembler must know how many physical lines of output will fit vertically on the printed page. This setting is especially important if the use of FormFeed characters has been turned off with the '''Lf'''option. The default value for this option is 66 lines per page.
 |  | ;Examples | 
|  |  |   FIRST  = 1234h | 
|  |  |   SECOND = HIGH FIRST        ; Sets SECOND to 12h | 
|  | 
 |  | 
 | 
|  | <br />
 |  | =====Upper 16 Bits of DWORD Expression (HIGHWORD Operator)===== | 
|  |  | ;Syntax | 
|  |  | :'''HIGHWORD''' ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Description | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The '''HIGHWORD''' operator returns the upper 16 bits of a 32-bit expression. Only bits 16-31 are returned, even if the magnitude of the operand exceeds 32 bits. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-Llp:66 (the default page length is 66 lines)     |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:''' |  | 
|  | 
 |  | 
 | 
|  | �[[00071.htm|Lf -Control Use of FormFeed Characters]] <br />�[[00085.htm|Lwp - Specify Width of Page]] <br />
 |  | ;Constraints | 
|  |  | The operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | [[[00073.htm|prev]]][[[00075.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | This operator is not available in M510 mode. | 
|  | 
 |  | 
 | 
|  | === Lm - Control Display of Macro Expansions === |  | ;Examples | 
|  |  |   FIRST  = 12345678h  | 
|  |  |   SECOND = HIGHWORD FIRST    ; Sets SECOND to 1234h | 
|  | 
 |  | 
 | 
|  | This switch controls whether or not the text body ofan expanded macro appears in the listing output. While turning this switch on can be very useful when debugging macros, it can also result in large volumes of listing output if many macros are utilized. By default, macro expansions do not appear in the listing output;turn this switch on if this behavior is desired.
 |  | =====Lower 8 Bits of WORD Expression (LOW Operator)===== | 
|  |  | ;Syntax | 
|  |  | :'''LOW''' ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Description | 
|  |  | The '''LOW''' operator returns the lower 8 bits of its operand. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Constraints | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The operand must evaluate to a ''Constant-ExpressionType''. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-Lm (macro expansions do not appear in listing    |
 |  | 
|  | |    |      |     |    |output)                                           |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00074.htm|prev]]][[[00076.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Lmb - Specify Bottom Margin === |  | ;Examples | 
|  |  |   FIRST  = 1234h | 
|  |  |   SECOND = LOW FIRST         ; Sets SECOND to 34h | 
|  | 
 |  | 
 | 
|  | This option determines how many blank lines will appear at the bottom ofthe page in the listing output;by default this value is 4. The correct behavior of this option depends on the setting of the '''Llp'''and '''Lf'''options, and that they match the settings of the physical output device. If there are problems with these settings, then the actual bottom margin may not appear to correctly reflect the value of this option.
 |  | =====Lower 16 Bits of DWORD Expression (LOWWORD Operator)===== | 
|  |  | ;Syntax | 
|  |  | :'''LOWWORD''' ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Description | 
|  |  | The '''LOWWORD''' operator returns the lower 16 bits of its operand. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Constraints | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The operand must evaluate to a ''Constant-ExpressionType''. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-Lmb:4 (4 blank lines at bottom of page)          |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:''' |  | 
|  | 
 |  | 
 | 
|  | �[[00071.htm|Lf - Control Use of FormFeed Characters]] <br />�[[00073.htm|Llp - Specify Length of Page]]<br />�[[00077.htm|Lmb - Specify Middle Margin after Title]] <br />�[[00079.htm|Lmt - Specify Top Margin before Title]] <br />
 |  | This operator is not available in [[#M510]] mode. | 
|  | 
 |  | 
 | 
|  | [[[00075.htm|prev]]][[[00077.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Examples | 
|  |  |   FIRST  = 12345678h | 
|  |  |   SECOND = LOWWORD FIRST     ; Sets SECOND to 5678h | 
|  | 
 |  | 
 | 
|  | === Lml - Specify Left Margin === |  | ==== Type Conversion Expression ==== | 
|  |  | ;Description | 
|  |  | A '''Type Conversion Expression''' is one that performs an optional type conversion operation on its operand and returns the result. | 
|  | 
 |  | 
 | 
|  | This option specifies the number of blank characters that are printed to the left of every line of listing output. The default value for this option is 4.
 |  | ;Syntax | 
|  |  | ''Cast-Expression:'' | 
|  |  | : ''Element-Selection-Expression'' | 
|  |  | : OFFSET ''Cast-Expression'' | 
|  |  | : SEG ''Cast-Expression'' | 
|  |  | : THIS ''Element-Selection-Expression'' | 
|  |  | : TYPE ''Element-Selection-Expression'' | 
|  |  | : ''Cast-Expression'' PTR ''Cast-Expression'' | 
|  |  | : ''Cast-Expression'' : ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ===== Address Offset (OFFSET Operator) ===== | 
|  |  | ;Description | 
|  |  | The '''OFFSET''' operator returns the offset portion of its operand. For relocatable values, this is the offset into the segment or group to which the expression is relative. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Syntax | 
|  | |Type|Global|Group|File|Default                                           |
 |  | '''OFFSET''' ''Cast-Expression'' | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-Lml:4 (left margin is 4 blank characters wide)   |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:''' |  | 
|  | 
 |  | 
 | 
|  | �[[00078.htm|Lmr - Specify Right Margin]]<br />�[[00085.htm|Lwp -Specify Width of Page]] <br />�[[00065.htm|Lcm* -Specify Left Margin for Individual Columns]] <br />
 |  | ;Constraints | 
|  |  | The operand may evaluate to any one of the following ''[[#ExpressionType]]s:'' | 
|  |  | * ''Absolute-ExpressionType'' | 
|  |  | * ''Constant-ExpressionType'' | 
|  |  | * ''Immediate-ExpressionType'' | 
|  |  | * ''Direct-ExpressionType'' | 
|  |  | * ''Indirect-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | [[[00076.htm|prev]]][[[00078.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Examples | 
|  |  |  CodeLabel: | 
|  |  |         MOV   AX, CodeLabel            ; illegal, no data at address  | 
|  |  |         MOV   AX, OFFSET   CodeLabel   ; we want the address itself | 
|  | 
 |  | 
 | 
|  | === Lmb - Specify Middle Margin after Title === |  | ===== Address Segment (SEG Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''SEG''' ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | This option specifies the number of blank lines that separate the assembler heading, the title and subtitle (if there are any), from both the '''''column ruler''(if there is one) and thebody of the generated listing text. The default value for this option is2 blank lines.'''
 |  | ;Description | 
|  |  | The '''SEG''' operator returns the segment or group to which a relocatable expression is relative. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | The operand must evaluate to one of the following ''ExpressionTypes:'' | 
|  |  | * ''Immediate-ExpressionType'' | 
|  |  | * ''Direct-ExpressionType'' | 
|  |  | * ''Indirect-ExpressionType'' | 
|  |  | * ''Indexed-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Examples | 
|  | |Type|Global|Group|File|Default                                           |
 |  |  DATA    SEGMENT  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  |  Stuff   DB    ?  | 
|  | |P |Yes |Yes  |Yes |-Lmm:2 (2 blank lines after title and subtitle,  |
 |  |          MOV   AX, SEG Stuff    ; This construct is | 
|  | | |      |     |    |and before ruler line)                            |
 |  |          MOV   AX, DATA         ; equivalent to this | 
|  | \-------------------------------------------------------------------------/</pre>
 |  |  DATA    ENDS | 
|  | '''Related Information:'''
 |  | 
|  | 
 |  | 
 | 
|  | �[[00073.htm|Llp -Specify Length of Page]] <br />�[[00075.htm|Lmb -Specify Bottom Margin]] <br />�[[00079.htm|Lmt - Specify Top Margin before Title]] <br />�[[00081.htm|Lr - Control Display of Column Ruler]] <br />
 |  | ====== Address Alias (THIS Operator) ====== | 
|  |  | ;Syntax | 
|  |  | '''THIS''' ''Element-Selection-Expression'' | 
|  | 
 |  | 
 | 
|  | [[[00077.htm|prev]]][[[00079.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Description | 
|  |  | The '''THIS''' operator returns an operand whose: | 
|  |  | * ''Relative Frame'' attribute is set to that of the current segment | 
|  |  | * ''Displacement'' attribute is set to the current location counter | 
|  |  | * ''Type Declaration'' attribute is set to that of the expression given by the ''Element-Selection-Expression'' operand. | 
|  | 
 |  | 
 | 
|  | === Lmr -Specify Right Margin ===
 |  | ;Constraints | 
|  |  | The operand must evaluate to a ''Type-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | This option specifies the number of blank characters that are reserved (but not actually printed) tothe right of every line of listing output. The default value for thisoption is 4. |  | ;Examples | 
|  |  |  DATA      SEGMENT | 
|  |  |   | 
|  |  |  ALIAS   EQU   THIS BYTE        ; reference this address as a byte | 
|  |  |  Stuff   DB    ?  | 
|  |  |          MOV   AL, ALIAS        ; This construct is | 
|  |  |          MOV   AL, Stuff        ; equivalent to this | 
|  |  |  DATA    ENDS | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ===== Datatype Extraction (TYPE Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''TYPE''' ''Element-Selection-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Description | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The '''TYPE''' operator returns the ''Type-ExpressionType'' attribute of its operand. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-Lmr:4 (right margin is 4 blank characters wide)  |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:''' |  | 
|  | 
 |  | 
 | 
|  | �[[00076.htm|Lml - Specify Left Margin]] <br />�[[00085.htm|Lwp - Specify Width of Page]] <br />�[[00065.htm|Lcm* - Specify Left Margin for Individual Columns]] <br />
 |  | ;Constraints | 
|  |  | None | 
|  | 
 |  | 
 | 
|  | [[[00078.htm|prev]]][[[00080.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | ;Examples | 
|  |  |  CODE    SEGMENT  | 
|  |  |          ASSUME  CS:CODE, DS:CODE | 
|  |  |  Stuff   DB      ?                        ; TYPE Stuff is BYTE | 
|  |  |          MOV     [BX],(TYPE Stuff) PTR 1  ; stores 1 as a BYTE at [BX] | 
|  |  |  CODE    ENDS | 
|  | 
 |  | 
 | 
|  | === Lmt - Specify Top Margin before Title === |  | ===== Type Conversion (PTR Operator) ===== | 
|  |  | ;Syntax | 
|  |  | ''Cast-Expression'' '''PTR''' ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | This option specifies thenumber of blank lines that appear at thetop of thepage before any other listing output is generated. The default value for this option is 2 blank lines.
 |  | ;Description | 
|  |  | The '''PTR'''operator converts the right operand to the type specified by the left operand. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | The left operand must be a ''Type-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Examples | 
|  | |Type|Global|Group|File|Default                                           |
 |  |  CODE     SEGMENT  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  |           MOV  BYTE PTR [BX], 1    ; stores 1 as a BYTE at [BX] | 
|  | |P   |Yes   |Yes |Yes |-Lmt:2 (2 blank lines at the top of the page) |
 |  |   CODE     ENDS | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:'''
 |  | 
|  | 
 |  | 
 | 
|  | �[[00073.htm|Llp -Specify Length of Page]] <br />�[[00075.htm|Lmb -Specify Bottom Margin]] <br />�[[00077.htm|Lmb - Specify Middle Margin after Title]] <br />
 |  | ===== Segment Override (: Operator) ===== | 
|  |  | ;Syntax | 
|  |  | ''Cast-Expression'' ''':''' ''Cast-Expression'' | 
|  | 
 |  | 
 | 
|  | [[[00079.htm|prev]]][[[00081.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Description | 
|  |  | The ''':''' (colon) operator forces the right operand to have the ''Relative Frame'' attribute of the left operand. | 
|  | 
 |  | 
 | 
|  | === Lp -Generate Listing on Specific Pass ===
 |  | ;Constraints | 
|  |  | The left operand must evaluate to one of the following ''[[#ExpressionType]]s:'' | 
|  |  | * ''Register-ExpressionType'' where the ''Register Value'' attribute is that of a ''Segment-Register'' | 
|  |  | * ''Immediate-ExpressionType'' where the ''Relative Frame'' attribute is that of a ''GroupName'' or ''SegmentName''. | 
|  | 
 |  | 
 | 
|  | This option allows the user tocontrol whether or not listing information is generated on a specific pass of the assembler. By default,the assembler only generates listing information on pass two. If the user is encountering "phase errors" or other unusual situations, it may be helpful to request a listing for the first pass as well.
 |  | ;Examples | 
|  |  |  DATA       SEGMENT | 
|  |  |  Variable   DW    ? | 
|  |  |  DATA       ENDS | 
|  |  |   | 
|  |  |  DGROUP     GROUP DATA, CODE | 
|  |  |   | 
|  |  |  CODE       SEGMENT | 
|  |  |    ASSUME   CS:CODE, DS:DGROUP | 
|  |  |    MOV      AX, DGROUP:Variable         ; insure Variable is relative to DGROUP | 
|  |  |    ASSUME   DS:NOTHING | 
|  |  |    MOV      BX, CS:Variable             ; access Variable through CS register | 
|  |  |  CODE       ENDS | 
|  | 
 |  | 
 | 
|  | The arguments to this option are either a series of numeric digits (without intervening white space) or the '''ALL'''or '''NONE'''keywords. In the default assembler configuration, use ofthe '''-Lp:ALL'''form is equivalent tospecifying '''-Lp:12''', because the assembler makes two passes through the source file by default. The '''NONE'''keyword prevents generation of any pass- related information in the listing file; however, symbol table information will still appear if selected.
 |  | ==== Element Selection Expression ==== | 
|  |  | ;Description | 
|  |  | A '''Element Selection Expression''' is one that optionally selects a specific element of its operand and returns a reference to it. | 
|  | 
 |  | 
 | 
|  | When using numeric digits to specify the desired pass numbers, a listing will only be generated for the numbers given in the argument field;the default setting (or settings given by previous occurrences of the option) will be discarded.
 |  | ;Syntax | 
|  |  | ''Element-Selection-Expression:'' | 
|  |  | :''Sign-Expression'']] | 
|  |  | :''Element-Selection-Expression'' [''Sign-Expression''] | 
|  |  | :''Element-Selection-Expression'' .''Sign-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ===== Subscript ([] Operator) ===== | 
|  |  | ;Syntax | 
|  |  | ''Element-Selection-Expression'' '''[''' ''Sign-Expression'' ''']''' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Description | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The '''[]''' binary operator performs a subscripting (or ''indexing'') operation between the operand to the left of the brackets and the operand enclosed within the brackets. This is a simple additive operation of '''BYTE''' granularity; the arithmetic performed is not influenced by the ''Operand Size'' of either operand. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-Lp:2 (listing on pass 2 only)                   |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00080.htm|prev]]][[[00082.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Lr -Control Display of Column Ruler ===
 |  | The syntax for this operator describes a binary operation between the left hand expression and the bracketed expression. The bracketed expression is also subject to the same operations performed during the processing of a standalone ''Indirected-Expression'' as described in the section on ''Primary-Expressions''. | 
|  | 
 |  | 
 | 
|  | This switch to determines whether or not the '''''column ruler''appears at the top ofeach page in thelisting output. This ruler is simply a line of information containing astring of alphabetic characters corresponding to each vertical column of listing information. The ruler reflects the current width, margins, and placement of the various listing columns at the time each page is printed, and helps the user to determine which column they are looking at. Turn this switch off if display of the column ruler is not desired.'''
 |  | ;Constraints | 
|  |  | Only one of the operands may specify a relocatable value. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Examples | 
|  |  |  CODE    SEGMENT  | 
|  |  |          ASSUME  CS:CODE, DS:CODE | 
|  |  |   | 
|  |  |  Value    DB    0                         ;   Value [0] | 
|  |  |           DB    1                         ;   Value [1] | 
|  |  |           DB    2                         ;   Value [2] | 
|  |  |           DB    3                         ;   Value [3] | 
|  |  |           DB    4                         ;   Value [4]  | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  |    MOV      AL, Value [3]        ;   load AL with the fourth byte at Value (3) | 
|  | |Type|Global|Group|File|Default                                           |
 |  |    MOV      BX, offset Value     ;   get address of Value  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  |    MOV      AL, [BX] [1] [2]     ;   also gets the fourth byte ( 3 )  | 
|  | |S |Yes   |Yes  |Yes |+Lr (show the column ruler in listing output)|
 |  |   | 
|  | \-------------------------------------------------------------------------/</pre>
 |  |  CODE     ENDS | 
|  | [[[00081.htm|prev]]][[[00083.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Ls - Control Display of Symbol Table === |  | ===== Structure/Union Field Selection (. Operator) ===== | 
|  |  | ;Syntax | 
|  |  | ''Element-Selection-Expression'' '''.''' ''Sign-Expression'' | 
|  | 
 |  | 
 | 
|  | This switch determines whether ornot a summary of thesymbol table contents is included at theend ofthe listing file. Thedefault behavior is toomit thesymbol table summary; turn this switch on to include it.
 |  | ;Description | 
|  |  | The '''.''' (period) operator selects a structure or union field entry. It adds the left and right hand operands together and returns the result. The left operand should be an ''Indirect-ExpressionType'', ''Indexed-ExpressionType'', or ''Type-ExpressionType'' whose ''Type Declaration'' attribute resolves to that of a ''Structure-TypeName'' or ''Union-TypeName''. The right operand should refer to a ''FieldName'' defined within the referenced type. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | The ''Operand Size'' attribute of the result depends on the operands involved. If both operands have an operand size, a ''Structure-FieldName'' appearing as the right hand operand would override the operand size of the left operand and would dictate the operand size of the resulting expression. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Constraints | 
|  | |Type|Global|Group|File|Default                                           |
 |  | Only one of the operands may specify a relocatable value. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-Ls (do not include symbol table in listing       |
 |  | 
|  | |    |      |     |    |output)                                           |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00082.htm|prev]]][[[00084.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Lt1 - Specify Title ===
 |  | ;Examples | 
|  |  |  Number   STRUC | 
|  |  |    One    DB   1 | 
|  |  |    Two    DW   2 | 
|  |  |  Number   ENDS | 
|  | 
 |  | 
 | 
|  | This option allows theuser tospecify thetext ofa default title to be printed at thetop of each listing page;there is no default title.Title information must be enclosed in double quotes ""if it contains white space characters.
 |  |  ; The following line is only allowed in MASM 5.10 mode ( OPTION OLDSTRUCTS )  | 
|  |  |   | 
|  |  |    MOV   AX,[BX] .Two         ;  BX points to a "Number", get the "Two" entry  | 
|  |  |   | 
|  |  |  ; In other modes, "Two" is private to the "Number" structure type, so  | 
|  |  |  ; one of the following methods are required :  | 
|  |  |   | 
|  |  |    MOV   AX,(Number PTR[BX]).Two  ; Explicit override | 
|  |  |    MOV   AX,[BX] + Number.Two     ; Fully qualified reference | 
|  |  |    ASSUME BX:Number               ; Associate BX with "Number" | 
|  |  |    MOV   AX,[BX].Two              ; then original syntax is allowed | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ==== Unary Arithmetic Expression ==== | 
|  |  | ;Description | 
|  |  | A '''Unary Arithmetic Expression''' is one that optionally alters the sign of its operand and returns the result. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Syntax | 
|  | |Type|Global|Group|File|Default                                           |
 |  | ''Sign-Expression:'' | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | :''Primary-Expression'' | 
|  | |P   |Yes   |Yes  |Yes |-Lt1:<empty> (no default title information)       |
 |  | :-''Primary-Expression'' | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | :+''Primary-Expression'' | 
|  | [[[00083.htm|prev]]][[[00085.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Lt2 -Specify Subtitle === |  | ===== Unary Minus (- Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''-''' ''Primary-Expression'' | 
|  | 
 |  | 
 | 
|  | This option allows the user to specify the text of adefault subtitle to be printed at thetop of each listing page; there is no default subtitle. Subtitle information must be enclosed in double quotes "" if it contains white space characters.
 |  | ;Description | 
|  |  | The '''-''' operator makes its operand into a negative number and returns the result. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | The operand must evaluate to a ''Constant-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Examples | 
|  | |Type|Global|Group|File|Default                                           |
 |  |  Value  EQU  1 | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  |   | 
|  | |P   |Yes   |Yes |Yes |-Lt2:<empty>(no default subtitle information)    |
 |  |   MOV  AX, -Value     ; move -1 into AX | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00084.htm|prev]]][[[00086.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Lwp - Specify Width of Page === |  | ===== Unary Plus (+ Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''+''' ''Primary-Expression'' | 
|  | 
 |  | 
 | 
|  | To correctly format the listing file for subsequent hardcopy output, the assembler must know how many physical characters of output will fit horizontally on the printed page. Thedefault value for this option is 132 character positions.
 |  | ;Description | 
|  |  | The '''+''' operator returns its operand. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | The operand must evaluate to a ''[[#Constant-ExpressionType|Constant-ExpressionType]]''. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Examples | 
|  | |Type|Global|Group|File|Default                                           |
 |  |  Value EQU 1  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  |  MOV   AX,+Value  ; move 1 into AX | 
|  | |P   |Yes   |Yes |Yes |-Lwp:132 (the default page width is 132 character |
 |  | 
|  | |    |      |     |    |positions)                                        |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:'''
 |  | 
|  | 
 |  | 
 | 
|  | �[[00065.htm|Lcm* - Specify Left Margin for Individual Columns]] <br />�[[00067.htm|Lcw* - Specify Width of Individual Columns]] <br />
 |  | ==== Primary Expression ==== | 
|  |  | ;Description | 
|  |  | A '''Primary Expression''' is one that returns an expression operand. | 
|  | 
 |  | 
 | 
|  | [[[00085.htm|prev]]][[[00087.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Syntax | 
|  |  | ''Primary-Expression:'' | 
|  |  | :''Literal-Operand'' | 
|  |  | :''Record-Constant'' | 
|  |  | :''Identifier-Operand'' | 
|  |  | :''Register-Operand'' | 
|  |  | :''Integral-TypeName-Operand'' | 
|  |  | :''Value-Substitution-Operand'' | 
|  |  | :LENGTH ''Identifier-Operand'' | 
|  |  | :LENGTHOF ''Identifier-Operand'' | 
|  |  | :MASK ''Identifier-Operand'' | 
|  |  | :SIZE ''Element-Selection-Expression'' | 
|  |  | :SIZEOF ''Element-Selection-Expression'' | 
|  |  | :WIDTH ''Identifier-Operand'' | 
|  |  | :''Parenthesized-Expression'' | 
|  |  | :''Indirected-Expression'' | 
|  |  | :''Compound-Initializer'' | 
|  | 
 |  | 
 | 
|  | === Lwt - Specify Tab Expansion Width === |  | ===== Literal Operand ===== | 
|  |  | ;Syntax | 
|  |  | ''Literal-Operand:'' | 
|  |  | :''Floating-Point-Literal'' | 
|  |  | :''Integer-Literal'' | 
|  |  | :''String-Literal'' | 
|  | 
 |  | 
 | 
|  | This option specifies the width ofa tab character in blank spaces.Tab characters appearing in the source file arealways expanded into blank spaces when output to thelisting file; thedefault behavior is toexpand tab characters to every eighth character position.
 |  | ;Description | 
|  |  | The assembler accepts several types of literal values as operands within expressions. ''Literal-Operands'' are converted to ''[[#ExpressionType]]s'' according to the following table: | 
|  |  | {|class="wikitable" | 
|  |  | |Floating-Point-Literal | 
|  |  | |Floating-Point-ExpressionType | 
|  |  | |- | 
|  |  | |Integer-Literal | 
|  |  | |Absolute-ExpressionType | 
|  |  | |- | 
|  |  | |String-Literal | 
|  |  | |Absolute-ExpressionType if the string length is less than or equal to the current Address Size; a String-ExpressionType otherwise. | 
|  |  | |} | 
|  | 
 |  | 
 | 
|  | <br />
 |  | The context where the expression is used determines whether or not a particular type of literal is legal. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Constraints | 
|  | |Type|Global|Group|File|Default                                           |
 |  | Arithmetic operations cannot be performed on ''[[#Floating-Point-Literal]]s'', thus they cannot be the operand of a unary or binary operator. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-Lwt:8 (tab characters are 8 character positions  |
 |  | 
|  | |    |      |     |    |wide)                                             |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00086.htm|prev]]][[[00088.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Message Control Options === |  | ===== Value Substitution Operand ===== | 
|  |  | ;Syntax | 
|  |  | ''Value-Substitution-Operand:'' | 
|  |  | :''Anonymous-Label-Alias'' | 
|  |  | :''Location-Counter-Alias'' | 
|  |  | :''Indeterminate-Value-Alias'' | 
|  |  | :'''FLAT''' | 
|  | 
 |  | 
 | 
|  | This section describes all options related to theoutput and control of assemblermessages. All Message Control Options begin with the letter '''"M"'''.
 |  | ;Description | 
|  |  | These operands are used to retrieve specialized values that are calculated internally by the assembler. | 
|  | 
 |  | 
 | 
|  | [[[00087.htm|prev]]][[[00089.htm|next]]][[[00087.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | The '''FLAT''' operator returns an expression whose ''[[#Relative Frame]]'' is set to that of the predefined FLAT pseudo-group. | 
|  | 
 |  | 
 | 
|  | === M -Control Individual Messages or Groups ===
 |  | ;Constraints | 
|  |  | The '''FLAT''' operand is only active when a 32-bit processor has been selected. | 
|  | 
 |  | 
 | 
|  | This option controls the types of messages that are displayed by manipulating '''''message group identifier flags''or individual message numbers. Only messages with a severity of '''Warning'''or '''Info'''are controllable with this option. Messages with a severity of '''Error''', '''System''', '''Fatal''', '''Internal''', or '''Usage'''cannot be suppressed.'''
 |  | ===== Record Constant Operand ===== | 
|  |  | ;Syntax | 
|  |  | ''Record-Constant:'' | 
|  |  | :''Identifier-Operand'' '''<''' ''Field-List'' '''>''' | 
|  |  | :''Identifier-Operand'' '''{''' ''Field-List'' '''}''' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ''Field-List:'' | 
|  |  | :''Attribute-Expression'' | 
|  |  | :''Field-List'' ''',''' ''Attribute-Expression'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Description | 
|  | |Type|Global|Group|File|Default                                           |
 |  | A ''Record-Constant'' provides a method of calculating a single numeric result value from a list of ''Record-FieldName'' values, and combining them together according to the definition of the ''Record-TypeName'' given by the ''Identifier-Operand''. The result value is a ''Constant-ExpressionType'' suitable for use as an instruction operand, or for assigning to a record variable. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-M:W+ (all warning messages are enabled)          |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | All assembler messages are assigned a unique message number, and '''Warning'''or '''Info'''messages may belong toone or more message groups.The message group identifier flags are defined as follows:
 |  | 
|  | 
 |  | 
 | 
|  | '''ALL'''All warning and informational messages <br />'''BLK'''Messages regarding block structure violations <br />'''COD'''Messages regarding code generation <br />'''FIL'''File manipulation messages <br />'''I''' All informational messages <br />'''PP''' Preprocessor messages <br />'''SRC'''Source file lexical analyzer messages <br />'''STA'''Assembly statistics <br />'''W'''All warning messages <br /> |  | The ''Record-TypeName'' given by the ''Identifier-operand'' determines how the ''Field-List'' will be evaluated. The ''Attribute-Expression'' entries are position-dependent, and are matched with the corresponding ''Record-FieldName'' entries from the ''Record-TypeName'' definition to determine their width and shift values. ''Attribute-Expression'' entries may be omitted, in which case the default values from the record definition are used in the calculation. | 
|  | 
 |  | 
 | 
|  | Any sequence of message groups or message numbers may be specified in the argument field of the '''M'''option;each argument must be followed by a plus (+ ) or minus (-) character to turn the valueon or off, andno intervening white space characters may appear between arguments.
 |  | ;Constraints | 
|  |  | The ''Identifier-Operand'' must resolve to a ''Record-TypeName''. | 
|  |  | ;Examples | 
|  |  | <pre> | 
|  |  |  DATE_T   record   Year  : 7 = 0,   ; 0 is 1980 | 
|  |  |                    Month : 4 = 1,   ; January | 
|  |  |                    Day   : 5 = 1    ; 1st | 
|  |  |   | 
|  |  |  CODE SEGMENT | 
|  |  |    mov  AX,DATE_T  < >                       ; January 1st, 1980 | 
|  |  |    mov  AX,DATE_T  < 1996 - 1980, 12, 25 >   ; Christmas, 1996 | 
|  |  |    mov  AX,DATE_T  < 10h, 0Ch, 19h >         ; equivalent values in hex | 
|  |  |    mov  AX,DATE_T  < 10000y, 1100y, 11001y > ; equivalent values in binary | 
|  |  |    mov  AX,2199h                             ; equivalent value manually coded | 
|  |  |    mov  AX,0010000110011001y                 ; and in binary | 
|  |  |  ;         YYYYYYYMMMMDDDDD | 
|  |  |  CODE   ENDS | 
|  |  | </pre> | 
|  | 
 |  | 
 | 
|  | See [[02911.htm|Assembler Messages]]for more information on message number values and the messages groups to which they belong.
 |  | ===== Register Operand ===== | 
|  |  | ;Syntax | 
|  |  | ''Register-Operand:'' | 
|  |  | :''Processor-Register'' | 
|  | 
 |  | 
 | 
|  | [[[00088.htm|prev]]][[[00090.htm|next]]][[[00087.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Description | 
|  |  | Processor registers are valid expression operands. The context where the expression is used determines the allowable register operands. | 
|  | 
 |  | 
 | 
|  | === Mb - Control Printing of theAssembler Banner ===
 |  | ;Constraints | 
|  |  | The currently selected processor dictates whether or not a register is visible to the expression evaluator. | 
|  | 
 |  | 
 | 
|  | This switch controls whether or not the assembler start-up banner is printed. This switch is on by default; turn it off to suppress display of the banner.
 |  | ===== Identifier Operand ===== | 
|  |  | ;Syntax | 
|  |  | ''Identifier-Operand:'' | 
|  |  | :''Identifier'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Description | 
|  |  | When an ''Identifier'' is used in an expression, it returns a value according to its ''Identifier-Type'', as shown in the following table: | 
|  |  | {|class="wikitable" | 
|  |  | !width=20%|Identifier-Type | 
|  |  | !VALUE RETURNED | 
|  |  | |- | 
|  |  | |Numeric-EquateName | 
|  |  | |The value originally assigned to the equate. | 
|  |  | |- | 
|  |  | |Structure-FieldName | 
|  |  | |The offset in bytes from the beginning of the structure. | 
|  |  | |- | 
|  |  | |Union-FieldName | 
|  |  | |The offset in bytes from the beginning of the union (always 0). | 
|  |  | |- | 
|  |  | |Record-FieldName | 
|  |  | |The shift-count required to reach the field within the record. | 
|  |  | |- | 
|  |  | |Record-TypeName | 
|  |  | |The mask-value that isolates defined record fields from undefined fields. | 
|  |  | |- | 
|  |  | |Structure-TypeName | 
|  |  | |Zero if mode is M510, otherwise the size of the structure in bytes (the operand size of the structure type). | 
|  |  | |- | 
|  |  | |Union-TypeName | 
|  |  | |The size of the union in bytes (the operand size of the union type). | 
|  |  | |- | 
|  |  | |Typedef-TypeName | 
|  |  | |The operand size of the underlying data-type represented by the Typedef-TypeName. | 
|  |  | |- | 
|  |  | |GroupName | 
|  |  | |A Relative Frame attribute that represents the group, and a Displacement value of zero. | 
|  |  | |- | 
|  |  | |SegmentName | 
|  |  | |A Relative Frame attribute that represents the segment (or the group to which it belongs), and a Displacement value of zero if the mode is M510, or the current segment offset otherwise. | 
|  |  | |- | 
|  |  | |LabelName | 
|  |  | |The Relative Frame attribute where the label is defined, and the segment offset value of the label. | 
|  |  | |} | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Constraints | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The ''Identifier'' must resolve to one of the following ''Identifier-Types:'' | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | * ''Numeric-EquateName'' | 
|  | |S   |Yes   |No   |No  |+Mb (Print the assembler banner)                  |
 |  | * ''FieldName'' | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | * ''GroupName'' | 
|  | [[[00089.htm|prev]]][[[00091.htm|next]]][[[00087.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | * ''LabelName'' | 
|  |  | * ''SegmentName'' | 
|  |  | * ''UserDefined-TypeName'' | 
|  | 
 |  | 
 | 
|  | === Me -Set Number of Errors Before Assembler Aborts === |  | ===== Integral Type-Name Operand ===== | 
|  |  | ;Syntax | 
|  |  | ''Integral-TypeName-Operand:'' | 
|  |  | :''Scalar-TypeName'' | 
|  |  | :''Distance-TypeName'' | 
|  | 
 |  | 
 | 
|  | This option specifies themaximum number oferrors that the assembler will tolerate before ending theassembly.The default value is50.
 |  | ;Description | 
|  |  | When an ''Integral-TypeName-Operand''is used in an expression, it is converted to a ''Type-ExpressionType''. If used in a numeric context, the following numeric values are returned: | 
|  |  | {|class="wikitable" | 
|  |  | !Integral-TypeName-Operand||VALUE RETURNED | 
|  |  | |- | 
|  |  | |Scalar-TypeName||The operand-size of the type in bytes. | 
|  |  | |- | 
|  |  | |Distance-TypeName||If mode is M510, NEAR returns FFFF, and FAR returns FFFE.  Otherwise, NEAR and FAR are resolved and the values returned are:  NEAR16=FF02, NEAR32=FF04, FAR16=FF05, FAR32=FF06. | 
|  |  | |} | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Constraints | 
|  |  | The '''NEAR32''' and '''FAR32''' keywords are only valid if a 32-bit processor has been selected. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ===== Number of Data Elements (LENGTH Operator) ===== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | ;Syntax | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | '''LENGTH''' ''Identifier-Operand'' | 
|  | |P   |Yes   |Yes  |Yes |-Me:50 (abort the assembly after 50 errors are    |
 |  | 
|  | |    |      |     |    |encountered)                                      |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00090.htm|prev]]][[[00092.htm|next]]][[[00087.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Mwe -Treat Warnings as Errors ===
 |  | ;Description | 
|  |  | The '''LENGTH''' operator returns the number of data elements allocated to the operand. When applied to a variable initialized with a series of comma-separated expressions (elements), only the length of the first element is considered. | 
|  | 
 |  | 
 | 
|  | This switch tells the assembler that any Warning messages are to be treated as though they were errors;this causes the assembler toend with anon-zero exit code, and helps prevent any warning conditions from "passing by" unnoticed.
 |  | ;Constraints | 
|  |  | The operand must evaluate to a ''Data-LabelName''. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ===== Number of Data Elements (LENGTHOF Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''LENGTHOF''' ''Identifier-Operand'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Description | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The '''LENGTHOF''' operator returns the number of data elements allocated to the operand. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-Mwe (warnings are not considered tobe errors)   |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00091.htm|prev]]][[[00093.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Object Control Options ===
 |  | ;Constraints | 
|  |  | The operand must evaluate to a ''Data-LabelName''. | 
|  | 
 |  | 
 | 
|  | This section describes all options related to the output and control of object file information. All Object Control Options begin with the letter '''"O"'''. |  | This operator is not available in M510 mode. | 
|  | 
 |  | 
 | 
|  | [[[00092.htm|prev]]][[[00094.htm|next]]][[[00092.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Examples | 
|  |  | <none> | 
|  | 
 |  | 
 | 
|  | === Od -Line Number and Symbolic Debug Information in Object File === |  | ===== Record or Field Bit-Mask (MASK Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''MASK''' ''Identifier-Operand'' | 
|  | 
 |  | 
 | 
|  | This switch controls whether or not all forms of debug information are included in the object file, and is a shorthand method of specifying the options to control '''''line numbering''and '''''symbolic''debug information.''''''
 |  | ;Description | 
|  |  | The '''MASK''' operator returns the bit mask required to isolate a field within a record. | 
|  | 
 |  | 
 | 
|  | The parameterized version of this option may be used tospecify the format of thedebugging information. The setting of this value may be necessary depending on which linker isused to link the object file output, or on the debugger used to debug the executable.The argument must be one of the following keywords: |  | ;Constraints | 
|  |  | The ''Identifier-Operand'' must resolve to a ''Record-TypeName'' or ''Record-FieldName''; otherwise the result is zero. | 
|  | 
 |  | 
 | 
|  | '''IBM32'''Generate debugging information inthe 32-bit IBM (HLL)format. Executable code that is to be debugged with the IBM family of debuggers should use this setting. This is the default value if no parameter is specified. <br />'''MS16'''Generate debugging information in the 16-bit Microsoft (CodeView) format. You may need to use this setting if the object file output will be processed by a 16-bit linker, or if non-IBM debuggers will be utilized on the executable. <br />
 |  | ===== Size of Variable in Bytes (SIZE Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''SIZE''' ''Element-Selection-Expression'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Description | 
|  |  | The '''SIZE''' operator returns the number of bytes allocated to the operand. When applied to a variable initialized with a series of comma-separated expressions (elements), only the size of the first element is considered. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Constraints | 
|  | |Type|Global|Group|File|Default                                           |
 |  | None | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |(see default values for Ods and Odl)              |
 |  | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |P   |Yes   |Yes  |Yes |-Od:IBM32 (use the IBM debug format)              |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:'''
 |  | 
|  | 
 |  | 
 | 
|  | �[[00094.htm|Odl -Line Numbering Information in Object File]] <br />�[[00095.htm|Ods -Symbolic Debug Information in Object File]] <br />
 |  | ===== Size of Variable in Bytes (SIZEOF Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''SIZEOF''' ''Element-Selection-Expression'' | 
|  | 
 |  | 
 | 
|  | [[[00093.htm|prev]]][[[00095.htm|next]]][[[00092.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Description | 
|  |  | The '''SIZEOF''' operator returns the number of bytes allocated to the operand. | 
|  | 
 |  | 
 | 
|  | === Odl - Line Numbering Information inObject File ===
 |  | ;Constraints | 
|  |  | This operator is not available in M510 mode. | 
|  | 
 |  | 
 | 
|  | This switch controls whether ornot line numbering debug information is included in the object file, thus allowing the assembler source file to be viewed from within a source-level debugger.
 |  | ===== Record or Field Width (WIDTH Operator) ===== | 
|  |  | ;Syntax | 
|  |  | '''WIDTH''' ''Identifier-Operand'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Description | 
|  |  | The '''WIDTH'''operator returns the width of a record or a record field name. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ;Constraints | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The ''Identifier-Operand'' must resolve to a  ''Record-TypeName'' or ''Record-FieldName''; otherwise the result is zero. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-Odl (line numbering debug information isnot     |
 |  | 
|  | |    |      |     |    |included in object file)                          |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00094.htm|prev]]][[[00096.htm|next]]][[[00092.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Ods - Symbolic Debug Information in Object File === |  | ===== Precedence (() Operator) ===== | 
|  |  | ;Syntax | 
|  |  | ''Parenthesized-Expression:'' | 
|  |  | :'''(''' ''Attribute-Expression'' ''')''' | 
|  | 
 |  | 
 | 
|  | This switch controls whether or not symbolic debug information is included in theobject file, thus allowing variables, labels, and expressions appearing in the assembler source file to beviewed from within asource- leveldebugger.
 |  | ;Description | 
|  |  | Parentheses forces the ''Attribute-Expression'' operand to be evaluated at a higher precedence level. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Examples | 
|  |  |  Value =   2 + 3   * 4     ; Value = 14  | 
|  |  |  Value = ( 2 + 3 ) * 4     ; Value = 20 | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ===== Indirection ([] Operator) ===== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | ;Syntax | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | ''Indirected-Expression:'' | 
|  | |S   |Yes   |Yes  |Yes |-Ods (symbolic debug information is not included  |
 |  | :'''[''' ''Attribute-Expression'' ''']''' | 
|  | |    |      |     |    |in object file)                                   |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00095.htm|prev]]][[[00097.htm|next]]][[[00092.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | 
|  | 
 |  | 
 | 
|  | === Oug -Convert Global Identifiers toUppercase ===
 |  | ;Description | 
|  |  | During evaluation of the ''Attribute-Expression'', the '''[]'''('''indirection''') operator will convert a ''Register-ExpressionType'' to a ''Indexed-ExpressionType'' by moving the ''Register Value'' attribute to either the ''Base Register'' or ''Index Register'' attribute field as appropriate for the register(s) referenced in the expression. This operation allows values contained in the processor registers to be used during effective address calculation at application run time. | 
|  | 
 |  | 
 | 
|  | This switch controls whether external identifiers (declared with the '''EXTERN''' directive) and public identifiers (declared with the '''PUBLIC'''directive) areconverted to uppercase before writing them to the object file. By default, no conversion is performed and the symbols are written to the object file exactly as they were entered into the symbol table during assembly.
 |  | ;Constraints | 
|  |  | See the ''Indexed-ExpressionType'' section for information on registers that are valid for use in this context. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Examples | 
|  |  |  CODE      SEGMENT  | 
|  |  |            ASSUME   CS : CODE ,   DS : CODE  | 
|  |  |  Value     DW     0  | 
|  |  |            MOV    BX , offset   Value        ; load the address of Value into BX | 
|  |  |            MOV    [ BX ] , BX                ; store the contents of BX into the | 
|  |  |                                              ; memory location addressed by [BX] | 
|  |  |  CODE       ENDS | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\ |  | ===== Compound Initializer List (<> Operator) ===== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | ;Syntax | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | ''Compound-Initializer:'' | 
|  | |S   |Yes   |Yes  |Yes |-Oug (do not convert global identifiers to        |
 |  | :'''<''' ''Initializer-List'' '''>''' | 
|  | |    |      |     |    |uppercase in object file)                         |
 |  | :'''{''' ''Initializer-List'' '''}''' | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:''' |  | 
|  | 
 |  | 
 | 
|  | �[[00101.htm|Scs -Control Case Sensitivity for Symbol Names]] <br />�[[00097.htm|Ous -Convert Group and Segment Names to Uppercase]] <br />
 |  | ''Initializer-List:'' | 
|  |  | :''Duplicative-Expression'' | 
|  |  | :''Initializer-List'' ''',''' ''Duplicative-Expression'' | 
|  | 
 |  | 
 | 
|  | [[[00096.htm|prev]]][[[00098.htm|next]]][[[00092.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Description | 
|  |  | The '''<>''' (or '''{}''') operator provides a way of specifying a list of expressions to be used for initializing complex (multi-field) variables such as records or structures. | 
|  | 
 |  | 
 | 
|  | === Ous -Convert Group and Segment Names toUppercase ===
 |  | The '''<>''' operator encloses a list of comma-separated expressions; individual expressions are optional, but are also positional with respect to the record or structure fields they are intended to initialize. Commas must therefore be used to maintain field positions if empty expressions are encountered in the list. | 
|  | 
 |  | 
 | 
|  | This switch controls whether external group names (declared with the '''GROUP'''directive) and segment names (declared with the '''SEGMENT'''directive)are converted to uppercase before writing them to the object file. By default, no conversion is performed and the names are written to the object file exactly as they were entered into the symbol table during assembly.
 |  | The initializer list itself may also be left out entirely for those cases where a variable allocation will use the default initializers provided in the record or structure definition (the '''<>'''or '''{}''' themselves are still required). | 
|  | 
 |  | 
 | 
|  | <br /> |  | ;Examples | 
|  |  |  Numbers   STRUCT | 
|  |  |    One     DB     0 | 
|  |  |    Two     DW     0 | 
|  |  |    Three   DB     0 | 
|  |  |    Four    DD     0 | 
|  |  |  Numbers   ENDS | 
|  |  |   | 
|  |  |  First    Numbers   < >               ;  empty initializer list | 
|  |  |  Second   Numbers   < 1, 2, 3, 4 >    ;  override all defaults | 
|  |  |  Third    Numbers   < 1 >             ;  override first entry only | 
|  |  |  Fourth   Numbers   < 1, , , 4 >      ;  override first and last entries | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | === Expression Evaluation === | 
|  | |Type|Global|Group|File|Default                                           |
 |  | After an expression is parsed and checked for syntax errors, it is '''evaluated'''. During evaluation, all calculations and conversions are performed on the operands according to the operators that are applied to them. The final result is a collection of ''[[#Expression-Attribute]]s'', to which an ''ExpressionType'' is assigned. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-Ous (do not convert group or segment names to   |
 |  | 
|  | |    |      |     |    |uppercase in object file)                         |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:''' |  | 
|  | 
 |  | 
 | 
|  | �[[00101.htm|Scs -Control Case Sensitivity for Symbol Names]] <br />�[[00096.htm|Oug - Convert Global Identifiers to Uppercase]] <br />
 |  | ==== Expression Attributes ==== | 
|  |  | This section describes the ''Expression-Attributes''that are associated with an expression after it is evaluated. | 
|  | 
 |  | 
 | 
|  | [[[00097.htm|prev]]][[[00099.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | ===== Address Size ===== | 
|  |  | If an expression refers to an effective address, then it also has an associated [[#address size]]. The following ''[[#ExpressionType]]s'' normally reference an effective address, and thus have an associated address size: | 
|  |  | * ''Immediate-ExpressionType'' | 
|  |  | * ''Direct-ExpressionType'' | 
|  |  | * ''Indirect-ExpressionType'' | 
|  |  | * ''Indexed-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | === Source Control Options ===
 |  | The address size can be either 2 ('''USE16''') or 4 ('''USE32'''). For an expression that references a label, the address size of the segment where the label is defined determines the address size of the expression. | 
|  | 
 |  | 
 | 
|  | All options related to parsing orprocessing theinput source stream are described inthis section.All Source ControlOptions begin with the letter '''"S"'''.
 |  | ===== Operand Size ===== | 
|  |  | The ''Operand Size'' of an expression can be set explicitly using the [[#Type Conversion (PTR Operator)]], or it may be a side-effect inherited from the type of data referenced in the expression. The following table describes the operand sizes that will be assigned when an identifier is referenced in an expression: | 
|  |  | {|class="wikitable" | 
|  |  | !REFERENCE||OPERAND SIZE | 
|  |  | |- | 
|  |  | |8-Bit-Register||1 | 
|  |  | |- | 
|  |  | |16-Bit-Register||2 | 
|  |  | |- | 
|  |  | |32-Bit-Register||4 | 
|  |  | |- | 
|  |  | |Segment-Register||2 | 
|  |  | |- | 
|  |  | |Control-Register||4 | 
|  |  | |- | 
|  |  | |Debug-Register||4 | 
|  |  | |- | 
|  |  | |Test-Register||4 | 
|  |  | |- | 
|  |  | |MMX-Register||8 | 
|  |  | |- | 
|  |  | |Floating-Point-Register||10 | 
|  |  | |- | 
|  |  | |BYTE||1 | 
|  |  | |- | 
|  |  | |SBYTE||1 | 
|  |  | |- | 
|  |  | |WORD||2 | 
|  |  | |- | 
|  |  | |SWORD||2 | 
|  |  | |- | 
|  |  | |DWORD||4 | 
|  |  | |- | 
|  |  | |SDWORD||4 | 
|  |  | |- | 
|  |  | |REAL4||4 | 
|  |  | |- | 
|  |  | |FWORD||6 | 
|  |  | |- | 
|  |  | |QWORD||8 | 
|  |  | |- | 
|  |  | |REAL8||8 | 
|  |  | |- | 
|  |  | |TBYTE||10 | 
|  |  | |- | 
|  |  | |REAL10||10 | 
|  |  | |- | 
|  |  | |NEAR||2 or 4 | 
|  |  | |- | 
|  |  | |NEAR16||2 | 
|  |  | |- | 
|  |  | |NEAR32||4 | 
|  |  | |- | 
|  |  | |FAR||4 or 6 | 
|  |  | |- | 
|  |  | |FAR16||4 | 
|  |  | |- | 
|  |  | |FAR32||6 | 
|  |  | |- | 
|  |  | |Numeric-EquateName||Inherited from equate expression | 
|  |  | |- | 
|  |  | |GroupName||2 | 
|  |  | |- | 
|  |  | |SegmentName||2 | 
|  |  | |- | 
|  |  | |Code-LabelName||SIZE (TYPE Code-LabelName) | 
|  |  | |- | 
|  |  | |Data-LabelName||SIZE (TYPE Data-LabelName) | 
|  |  | |- | 
|  |  | |Structure-FieldName||SIZE Structure-FieldName | 
|  |  | |- | 
|  |  | |Record-TypeName||SIZE Record-TypeName | 
|  |  | |- | 
|  |  | |Structure-TypeName||SIZE Structure-TypeName | 
|  |  | |- | 
|  |  | |Union-TypeName||SIZE Union-TypeName | 
|  |  | |} | 
|  |  | The ''Operand Size'' is 0 for all other identifier types. | 
|  | 
 |  | 
 | 
|  | [[[00098.htm|prev]]][[[00100.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ===== Displacement ===== | 
|  |  | The ''Displacement'' value in an expression is the final calculated value of all numeric quantities, and must be a scalar value. It may also be a reference to a relocatable address, in which case the expression will also have a ''Relative Frame'' and/or an ''External Reference'' attribute. A ''Displacement'' may be used in the calculation of an effective address, either alone or in combination with a  ''Base Register'' and/or an ''Index Register''. | 
|  | 
 |  | 
 | 
|  | === Sc - Control Case Sensitivity for All Identifiers === |  | ===== Relative Frame ===== | 
|  |  | The ''Relative Frame'' attribute will be present if the expression contains a direct or indirect reference to any of the following ''[[#Identifier-Type]]s:'' | 
|  |  | * ''GroupName'' | 
|  |  | * ''LabelName'' | 
|  |  | * ''SegmentName'' | 
|  | 
 |  | 
 | 
|  | This switch controls whether or not all identifiers are case sensitive, and isa shorthand method of specifying the options for user identifiers and keywords.
 |  | The ''Relative Frame'' attribute indicates that the expression is relocatable, and specifies the ''GroupName'' or ''SegmentName'' to which the expression is relative. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ===== External Reference ===== | 
|  |  | The ''External Reference'' attribute will be present if the expression references any external identifiers. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ===== Register Value ===== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The ''Register Value'' attribute specifies the value of the ''Processor-Register'' referenced in a ''Register-ExpressionType''. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |(see default values for Sck and Scs)              |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:''' |  | 
|  | 
 |  | 
 | 
|  | �[[00100.htm|Sck -Control Case Sensitivity for Keywords]] <br />�[[00101.htm|Scs - Control Case Sensitivity for Symbol Names]] <br />
 |  | ===== Base Register ===== | 
|  |  | The ''Base Register'' attribute specifies the value for the base register used in an ''Indexed-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | [[[00099.htm|prev]]][[[00101.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ===== Index Register ===== | 
|  |  | The ''Index Register'' attribute specifies the value for the index register used in an ''Indexed-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | === Sck - Control Case Sensitivity for Keywords === |  | ===== Scale Factor ===== | 
|  |  | The ''Scale Factor'' attribute specifies the scaling value used (if any) in an ''Indexed-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | This switch controls whether or not language keywords are case sensitive. By default, this flag is turned off; thus the spellings '''SEGMENT''', '''Segment''', and '''segment'''all refer to thesame keyword.Turning this switch on would render thethree spellings separate and distinct, and only theuppercase variant would be recognized asa keyword.
 |  | ===== Type Declaration ===== | 
|  |  | The ''Type Declaration'' attribute specifies the type of data referenced in the expression. This is the value extracted from the expression when it is used as the left operand of the [[#Type Conversion (PTR Operator)]]. | 
|  | 
 |  | 
 | 
|  | This option has no effect on user identifiers (see [[00101.htm|Scs - Control Case Sensitivity forSymbol Names]]) or processor mnemonics.
 |  | ==== Expression Types ==== | 
|  |  | ;Description | 
|  |  | An ''ExpressionType'' is assigned to every expression during evaluation. The ''ExpressionType'' is used to determine whether or not an expression is legal for the context in which it is used. The type of an expression is influenced primarily by the operands that are used, but the use of expression operators also play an important part in determining the type of an expression. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Definition | 
|  |  | ''ExpressionType:'' | 
|  |  | :''Absolute-ExpressionType'' | 
|  |  | :''Constant-ExpressionType'' | 
|  |  | :''Direct-ExpressionType'' | 
|  |  | :''Floating-Point-ExpressionType'' | 
|  |  | :''Immediate-ExpressionType'' | 
|  |  | :''Indirect-ExpressionType'' | 
|  |  | :''Indexed-ExpressionType'' | 
|  |  | :''Register-ExpressionType'' | 
|  |  | :''String-ExpressionType'' | 
|  |  | :''Type-ExpressionType'' | 
|  |  | :''Duplicated-ExpressionType'' | 
|  |  | :''Compound-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ===== Absolute Expression Type ===== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | An ''Absolute-ExpressionType'' is an expression that evaluates to an integer quantity. Its value must be representable using one of the following types of scalar data: | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | * '''BYTE''' | 
|  | |S   |Yes   |Yes  |Yes |-Sck (All language keywords are case insensitive) |
 |  | * '''SBYTE''' | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | * '''WORD''' | 
|  | [[[00100.htm|prev]]][[[00102.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | * '''SWORD'''  | 
|  |  | * '''DWORD''' | 
|  |  | * '''SDWORD''' | 
|  |  | * '''FWORD''' | 
|  |  | * '''QWORD''' | 
|  |  | * '''TBYTE''' | 
|  | 
 |  | 
 | 
|  | === Scs -Control Case Sensitivity for Symbol Names ===
 |  | The following restrictions apply to an ''Absolute-ExpressionType:'' | 
|  |  | * It cannot be relocatable (it may not contain references to a ''GroupName'', ''SegmentName'' or ''LabelName'').  | 
|  |  | * It cannot reference any external symbols.  | 
|  |  | * It cannot contain any forward references. | 
|  | 
 |  | 
 | 
|  | This switch controls whether or not user identifiers are case sensitive. By default, this flag is turned on; thus the identifiers '''GEORGE''', '''George''', and '''george'''are separate and distinct. Turning this switch off would cause the three spellings to refer to the same identifier.
 |  | ===== Constant Expression Type ===== | 
|  |  | A ''Constant-ExpressionType'' is an ''Absolute-ExpressionType'' with the following restrictions relaxed: | 
|  |  | * It may contain forward references to identifiers defined later in the source stream. | 
|  |  | * It may reference a single external symbol, provided that the symbol was declared in an '''EXTERN''' directive with the '''ABS''' attribute. | 
|  | 
 |  | 
 | 
|  | If a case-insensitive assembly is being performed (-Scs), the actual spelling of the identifier is not altered (e.g., converted to uppercase) when it is entered into the symbol table. The actual symbol definition controls the spelling of theidentifier regardless ofwhether or not acase -insensitive assembly was performed. The only exception tothis rule is when processing a '''PUBLIC'''directive under MASM 5.10 emulation; the identifier spelling, which appears in the '''PUBLIC'''directive is honored over the one appearing in the actual identifier definition.
 |  | ===== Immediate Expression Type ===== | 
|  |  | An ''Immediate-ExpressionType'' has all the properties of a ''Constant-ExpressionType'' with the following restrictions relaxed: | 
|  |  | * It may contain references to a ''GroupName'', ''SegmentName'' or ''LabelName''(it may be relocatable).  | 
|  |  | * It may reference a relocatable external symbol. | 
|  | 
 |  | 
 | 
|  | This option has no effect on language keywords (see [[00100.htm|Sck -Control Case Sensitivity for Keywords]]), processor mnemonics, or register names.
 |  | An ''Immediate-ExpressionType'' must not be larger than 32 bits in magnitude; its value must be representable using one of the following types of scalar data: | 
|  |  | *'''BYTE''' | 
|  |  | *'''SBYTE''' | 
|  |  | *'''WORD''' | 
|  |  | *'''SWORD''' | 
|  |  | *'''DWORD''' | 
|  |  | *'''SDWORD''' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ===== Direct Expression Type ===== | 
|  |  | A ''Direct-ExpressionType'' is an expression that references a ''Code-LabelName''. It can be used directly in code-relative instructions without conversion. There is no data type associated with the address that a ''Direct-ExpressionType'' represents, therefore It may not be used in a data-relative instruction without first being explicitly converted to another expression type. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ===== Indirect Expression Type ===== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | An ''Indirect-ExpressionType'' is an expression that references a ''Data-LabelName''. It can be used directly in data-relative instructions without conversion to another expression type. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |+Scs (All user identifiers are case sensitive)    |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Related Information:''' |  | 
|  | 
 |  | 
 | 
|  | �[[00096.htm|Oug -Convert Global Identifiers toUppercase]] <br />�[[00097.htm|Ous - Convert Group and Segment Names to Uppercase]]<br />
 |  | ===== Indexed Expression Type ===== | 
|  |  | An ''Indexed-ExpressionType'' is an expression that calculates an effective memory address using the contents of a '''Base-Register''', an '''Index-Register''', or both. A ''Processor-Register'' must first be converted to a ''Base-Register'' or ''Index-Register'' by specifying it as the operand of the [[#Indirection ([] Operator)]]before the expression can be converted to an ''Indexed-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | [[[00101.htm|prev]]][[[00103.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | When calculating a 16-bit effective address, only the '''BP''' and '''BX''' registers may be used as ''Base-Registers'', and only the '''DI''' and '''SI''' registers may be used as ''Index-Registers''. | 
|  | 
 |  | 
 | 
|  | === Sk -Control Use of Reserved Words asLabels ===
 |  | When calculating a 32-bit effective address, only the '''EAX, EBX, ECX, EDX, EDI, ESI, EBP, and ESP''' registers may be used as ''Base-Registers'', and only the '''EAX, EBX, ECX, EDX, EDI, ESI, and EBP''' registers may be used as ''Index-Registers''. | 
|  | 
 |  | 
 | 
|  | This switch controls whether or not certain assembler keywords (reserved words) may be used in the context of a code label (for example, '''TEST:'''). By default, this switch is off, andkeywords maynot be usedas labels.
 |  | '''Note:''' Only a single ''Base-Register'' and a single ''Index-Register'' may be used in a given expression. | 
|  | 
 |  | 
 | 
|  | Even when this switch is turned on,there are severe restrictions on this capability. Processor mnemonics classify as theonly "keywords" allowed in this situation, andonly in thecontext of a '''''code label''(a label followed by acolon); using any reserved word as a directive name or data label is illegal.'''
 |  | On 80386 (and higher) processors, the [[#Multiplication (* Operator)]] may be used with an ''Index-Register''operand and an ''Absolute-ExpressionType'' operand to establish a scaling factor that is applied to the ''Index-Register'' during effective address calculation. The scaling factor effectively causes the ''Index-Register'' to be multiplied by a fixed value at run time. The scaling ''Expression'' must evaluate to 1 (no scale factor), 2, 4, or 8. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | A ''Direct-ExpressionType'' or an ''Indirect-ExpressionType'' may be a sub-expression of an ''Indexed-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ===== Register Expression Type ===== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | A ''Register-ExpressionType'' is an expression that specifies a single ''Processor-Register''. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-Sk (Reserved words may not be used as labels)    |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00102.htm|prev]]][[[00104.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Sfs -SHORT isDefault Distance for Forward-Referenced Jumps === |  | ===== String Expression Type ===== | 
|  |  | A ''String-ExpressionType'' is an expression that specifies a single ''String- Literal''. | 
|  | 
 |  | 
 | 
|  | By default, when the assembler encounters an unqualified forward reference as the operand to a jump instruction, it makes a worst-case assumption that the target will not be close enough to allow generating the '''SHORT'''variation of the instruction. Enough space isreserved to generate the '''NEAR'''version, and if it is determined later thatthe target is close enough, the '''SHORT''' variation is generated and extra space is padded with '''NOP'''instructions. This helps insure that source files will assemble without "out of range" errors, but wastes space when the '''NOP'''instructions are generated.
 |  | ===== Floating-Point Expression Type ===== | 
|  |  | A ''Floating-Point-ExpressionType'' is an expression that specifies a single ''Floating-Point-Literal''. | 
|  | 
 |  | 
 | 
|  | Turning this switch on causes the assembler to assume thatunqualified forward referenced jumps will always be reachable with the '''SHORT'''instruction variation; should this not be the case, an error is generated and the user may recode the instruction using the '''NEAR'''override.
 |  | ===== Type Expression Type ===== | 
|  |  | A ''Type-ExpressionType''is an expression that specifies one of the following: | 
|  |  | * A ''Scalar-TypeName'' | 
|  |  | * A ''Distance-TypeName'' | 
|  |  | * A ''UserDefined-TypeName'' | 
|  | 
 |  | 
 | 
|  | <br /> |  | ===== Compound Expression Type ===== | 
|  |  | A ''Compound-ExpressionType'' evaluates to a list of (possibly nested) expressions collected together as a unit by the [[#Compound Initializer List ( <> Operator)]]. A ''Compound-ExpressionType''is used to initialize [[#aggregate]] data types (such as records, structures, and unions) and [[#vector]] data types (arrays). | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ===== Duplicated Expression Type ===== | 
|  | |Type|Global|Group|File|Default                                           |
 |  | A ''Duplicated-ExpressionType'' evaluates to an expression that is to be duplicated (repeated) a specified number of times. This type of expression is created using the [[#Duplicative Initialization (DUP Operator)]]. | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | 
|  | |S   |Yes   |Yes  |Yes |-Sfs (default distance is NEAR)                  |
 |  | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00103.htm|prev]]][[[00105.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  | 
 |  | 
 | 
|  | === Sme -Control Visibility ofMASM 6.00 Extended Mnemonics === |  | ==== Operand Expression Type ==== | 
|  |  | An ''Operand-ExpressionType'' consists of those ''[[#ExpressionType]]s'' that are valid for use as operands in processor instructions. The following ''ExpressionTypes'' are not valid for use as an ''Operand-ExpressionType:'' | 
|  |  | * ''Compound-ExpressionType'' | 
|  |  | * ''Duplicated-ExpressionType'' | 
|  |  | * A ''String-ExpressionType'' is only valid as an ''Operand-ExpressionType'' if it is short enough to be converted to an ''Absolute-ExpressionType'' having an ''Operand Size'' less than or equal to the current ''Address Size'' setting. | 
|  | 
 |  | 
 | 
|  | This option controls whether or not the following processor mnemonics are recognized as keywords: ''''''
 |  | ''Operand-ExpressionType:'' | 
|  |  | :''Absolute-ExpressionType'' | 
|  |  | :''Constant-ExpressionType'' | 
|  |  | :''Immediate-ExpressionType'' | 
|  |  | :''Direct-ExpressionType'' | 
|  |  | :''Indirect-ExpressionType'' | 
|  |  | :''Indexed-ExpressionType'' | 
|  |  | :''Register-ExpressionType'' | 
|  |  | :''String-ExpressionType'' | 
|  |  | :''Floating-Point-ExpressionType'' | 
|  |  | :''Type-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | <br />FLDENVD <br />FLDENVW <br />FNSAVED <br />FNSAVEW <br />FNSTENVD <br />FNSTENVW <br />FRSTORD <br />FRSTORW <br />FSAVED <br />FSAVEW <br />FSTENVD <br />FSTENVW <br />IRETF <br />IRETDF <br />LOOPD <br />LOOPW <br />LOOPED <br />LOOPEW <br />LOOPNED <br />LOOPNEW <br />LOOPNZD <br />LOOPNZW <br />LOOPZD <br />LOOPZW <br />POPD <br />POPW <br />PUSHD <br />PUSHW <br />
 |  | ;Description | 
|  |  | An ''Operand-ExpressionType''consists of those ''[[#ExpressionType]]s'' that are valid for use as operands in processor instructions. The following ''ExpressionTypes'' are not valid for use as an ''Operand-ExpressionType:'' | 
|  |  | *''Compound-ExpressionType'' | 
|  |  | *''Duplicated-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | These mnemonics were introduced in MASM 6.00 to allow explicit word (16-bit ) or double-word (32-bit) operations on 80386 ornewer processors. Although MASM 5.10 supports the 80386 processor, it does not recognize these keywords. To avoid conflicts with preexisting macro libraries, ALP will also refuse torecognize these keywords when operating under MASM 5.10 compatibility mode (-Sv:M510) unless this option is turned on. This option is turned on automatically when the-Sv:M600 option is used.
 |  | A ''String-ExpressionType'' is only valid as an ''Operand-ExpressionType'' if it is short enough to be converted to an ''Absolute-ExpressionType'' having an ''Operand Size'' less than or equal to the current ''Address Size'' setting. | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ;Definition | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | ''Operand-ExpressionType:'' | 
|  | |Type|Global|Group|File|Default                                           |
 |  | :''Absolute-ExpressionType'' | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | :''Constant-ExpressionType'' | 
|  | |S   |Yes   |Yes  |Yes |-Sme (extended mnemonics are not enabled)         |
 |  | :''Immediate-ExpressionType'' | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | :''Direct-ExpressionType'' | 
|  | '''Related Information:''' |  | :''Indirect-ExpressionType'' | 
|  |  | :''Indexed-ExpressionType'' | 
|  |  | :''Register-ExpressionType'' | 
|  |  | :''String-ExpressionType'' | 
|  |  | :''Floating-Point-ExpressionType'' | 
|  |  | :''Type-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | �[[00105.htm|Sv -Set Version Behavior]] <br />
 |  | ==== Initializer Expression Type ==== | 
|  |  | An ''Initializer-ExpressionType'' consists of those ''[[#ExpressionType]]s'' that are valid for use in initializing variables. The following ''ExpressionTypes'' are not valid ''Initializer-ExpressionTypes:'' | 
|  |  | *''Indexed-ExpressionType'' | 
|  |  | *''Register-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | [[[00104.htm|prev]]][[[00106.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ''Initializer-ExpressionType:'' | 
|  |  | :''Scalar-Initializer-ExpressionType'' | 
|  |  | :''Compound-ExpressionType'' | 
|  |  | :''Duplicated-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | === Sv -Set Version Behavior ===
 |  | ''Scalar-Initializer-ExpressionType:'' | 
|  |  | :''Absolute-ExpressionType'' | 
|  |  | :''Constant-ExpressionType'' | 
|  |  | :''Immediate-ExpressionType'' | 
|  |  | :''Direct-ExpressionType'' | 
|  |  | :''Indirect-ExpressionType'' | 
|  |  | :''String-ExpressionType'' | 
|  |  | :''Floating-Point-ExpressionType'' | 
|  |  | :''Type-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | This option controls the various modes ofcompatibility thatthe assembler is designed to emulate. Theargument to the '''Sv'''option must be one of the following keywords:
 |  | ;Description | 
|  |  | An ''Initializer-ExpressionType'' consists of those ''[[#ExpressionType]]s'' that are valid for use in initializing variables. The following ''ExpressionTypes'' are not valid ''Initializer-ExpressionTypes:'' | 
|  |  | *''Indexed-ExpressionType'' | 
|  |  | *''Register-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | '''ALP'''Native operating mode; don't emulate other assemblers <br />'''M510'''Emulate Microsoft MASM Version 5.10 <br />'''M600'''Emulate Microsoft MASM Version 6.00 <br /> |  | ;Definition | 
|  |  | ''Initializer-ExpressionType:'' | 
|  |  | :''Scalar-Initializer-ExpressionType'' | 
|  |  | :''Compound-ExpressionType'' | 
|  |  | :''Duplicated-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | <br />
 |  | ''Scalar-Initializer-ExpressionType:'' | 
|  |  | :''Absolute-ExpressionType'' | 
|  |  | :''Constant-ExpressionType'' | 
|  |  | :''Immediate-ExpressionType'' | 
|  |  | :''Direct-ExpressionType'' | 
|  |  | :''Indirect-ExpressionType'' | 
|  |  | :''String-ExpressionType'' | 
|  |  | :''Floating-Point-ExpressionType'' | 
|  |  | :''Type-ExpressionType'' | 
|  | 
 |  | 
 | 
|  | <pre>/-------------------------------------------------------------------------\
 |  | == Text Preprocessor == | 
|  | |Type|Global|Group|File|Default                                           |
 |  | The text preprocessor is a functional unit within the assembler that performs the '''''text preprocessing''''' translation phase. During text preprocessing, the following actions are performed: | 
|  | |----+------+-----+----+--------------------------------------------------|
 |  | #Language Elements are recognized. | 
|  | |P   |Yes   |Yes  |Yes |+Sv:ALP (do not emulate other assemblers)         |
 |  | #Text equates and macros are expanded. | 
|  | \-------------------------------------------------------------------------/</pre>
 |  | #Macro directives and conditional assembly directives are recognized and processed. | 
|  | '''Related Information:''' |  | #The preprocessed output is passed on to the assembler for final processing. | 
|  | 
 |  | 
 | 
|  | �[[00104.htm|Sme -Control Visibility ofMASM 6.00 Extended Mnemonics]] <br />
 |  | This section also describes the various types of preprocessor directives: | 
|  |  | {|class="wikitable" | 
|  |  | !Type | 
|  |  | !Function | 
|  |  | !Directives | 
|  |  | |- | 
|  |  | |Conditional Assembly | 
|  |  | |Tests for a specified condition and assembles a block of statements if the condition is true. | 
|  |  | |IF IFB IFDEF IFDIFI IFE IFIDN IFNB IFNDEF IF1 IF2 ELSE ENDIF | 
|  |  | |- | 
|  |  | |Text Equate | 
|  |  | |Allows assignment of simple text strings to a symbolic name. Provides functions for expanding and operating on the values. | 
|  |  | |CATSTR EQU INSTR SIZESTR SUBSTR | 
|  |  | |- | 
|  |  | |Macro | 
|  |  | |Provides text processing that is done sequentially at assembly time. By the end of assembly, ALP expands all macros and assembles the resulting text into object code. | 
|  |  | |ENDM EXITM FOR FORC IRP IRPC LOCAL MACRO PURGE REPEAT REPT | 
|  |  | |- | 
|  |  | |Miscellaneous | 
|  |  | |Miscellaneous text processing functions. | 
|  |  | |COMMENT ECHO %OUT INCLUDE | 
|  |  | |} | 
|  | 
 |  | 
 | 
|  | [[[00105.htm|prev]]][[[00107.htm|next]]][[[00025.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | === Text Operators === | 
|  |  | ;Description | 
|  |  | The [[#Text Preprocessor]] recognizes certain punctuator characters as text operators. The programmer may use these operators to force the Text Preprocessor to perform various operations such as delineating text, expanding arguments, and converting expressions into their text representations. | 
|  | 
 |  | 
 | 
|  | === The MASM2ALP Utility ===
 |  | ;Syntax | 
|  |  | ''Text-Operator:'' | 
|  |  | :''Literal-Character-Operator'' | 
|  |  | :''Literal-Text-Operator'' | 
|  |  | :''Text-Expansion-Operator'' | 
|  |  | :''Text-Substitution-Operator'' | 
|  | 
 |  | 
 | 
|  | MASM2ALP is a utility that accepts a MASM 5.10-compatible command line, transforms the command line parameters to the appropriate ALP syntax, and invokes '''alp.exe'''to perform the assembly. This allows the use of ALP instead of MASM in existing build environments without requiring major changes to makefiles or build scripts. You simply replace your existing MASM executable with MASM2ALP and resume operations.
 |  | ==== Literal Character Operator (!) ==== | 
|  |  | ;Syntax | 
|  |  | ''Literal-Character-Operator:'' | 
|  |  | :'''!''' any printable character | 
|  | 
 |  | 
 | 
|  | MASM2ALP accepts thefollowing MASM 5.10-style command line syntax: <br />
 |  | ;Description | 
|  |  | When you use an exclamation point (!) in an operand, ALP treats the next character literally. (!) is typically used to prevent the assembler from recognizing and acting upon special characters such as the semicolon (;) or the ampersand (&), forcing them to appear as normal data characters. | 
|  | 
 |  | 
 | 
|  | <pre>masm2alp   [ Options ]   SourceFile   [ , [ ObjectFile ]   [ , [ ListingFile ]   [ , [ CrossRefFile ] ] ] ]   [ ;] </pre>
 |  | ;Constraints | 
|  | '''Notes:''' |  | The ''Literal-Character-Operator'' has no effect when used inside of a ''String-Literal''. | 
|  | 
 |  | 
 | 
|  | �'''''Options''are normally specified first on thecommand line,but may appear anywhere before the optional semicolon (;) terminator. Options may begin with either a slash (/) or a dash (-),but once the first option is encountered, no further mixing of introductory characters is allowed. Options are not case sensitive. Individual command line options are discussed below.'''
 |  | ;Examples | 
|  |  | In this example, use of the ! in the second macro argument prevents the assembler from interpreting the rest of the line as a comment: | 
|  |  |  MACRONAME   First, !; NonComment, Third              ; Comment | 
|  | 
 |  | 
 | 
|  | �Filename arguments are position-dependent. Commas (,)must be used to separate each argument and to maintain argument position, both when arguments are explicitly specified or when they are skipped (left unspecified). The filename argument descriptions are as follows:
 |  | === Literal Text Operator (<>) === | 
|  |  | ;Syntax | 
|  |  | ''Literal-Text-Operator:'' | 
|  |  | :'''<''' ''Char-Sequence'' '''>''' | 
|  | 
 |  | 
 | 
|  | '''''SourceFile''This argument is mandatory, and specifies the name of the assembly language source file to be processed. If no filename suffix is supplied, a default value of ".asm" is assumed.''' |  | ''Char-Sequence'' | 
|  |  | :any printable character | 
|  |  | :''Char-Sequence'' any printable character | 
|  | 
 |  | 
 | 
|  | '''''ObjectFile''Theoptional name of theobject-code output file tobe produced. If no filename suffix is supplied, a default value of ".obj" is assumed. If no '''''ObjectFile''argument is given,the root portion of the '''''SourceFile'' argument is used asthe name of the object file.'''''''''
 |  | ;Description | 
|  |  | The literal-text operator directs the assembler to treat ''Char-Sequence'' as a single literal element regardless of whether it contains commas, spaces, or other separators. The operator is most often used with macro calls and the FOR directive to ensure that values in a parameter list are treated as a single parameter. | 
|  | 
 |  | 
 | 
|  | '''''ListingFile''Theoptional name of thelisting output file to be produced. If no filename suffix is supplied, a default value of ".lst" is assumed.If no '''''ListingFile''argument or '''-L'''option is given,then no listing file is produced; otherwise theroot portion of the '''''SourceFile''argument is used as the name of the listing file.'''''''''
 |  | The literal-text operator can also be used to force ALP to treat other special characters such as the semicolon (;) or the ampersand (&) literally. For example, the semicolon inside angle brackets (<>) becomes a semicolon, not a comment indicator. | 
|  | 
 |  | 
 | 
|  | '''''CrossRefFile''The optional name of thecross-reference output file.Since ALP does not support the creation ofa cross-reference file, MASM2ALP ignores this argument.'''
 |  | ALP removes one set of angle brackets each time the parameter is used in a macro. When using nested macros, you will need to supply as many sets of angle brackets as there are levels of nesting. The assembler recognizes nested occurrences of text literals. | 
|  | 
 |  | 
 | 
|  | �The trailing semicolon (;) operator may be used when no more filename arguments are tobe specified and the default values are tobe utilized for the remaining arguments. Any arguments or command line options that follow the semicolon will be ignored.
 |  | ;Examples | 
|  |  | The following example illustrates how to pass arbitrary text to a macro as a single parameter: | 
|  |  |  MACRONAME   First, <Second Argument>, <Third, <Nested>, Argument> | 
|  | 
 |  | 
 | 
|  | �MASM2ALP does not support the "prompting" behavior of Microsoft MASM when insufficient command line argumentsare supplied. A syntax error is issued in this event. <br />
 |  | The macro will receive three separate arguments: | 
|  |  | # First  | 
|  |  | # Second Argument | 
|  |  | # Third, <Nested>, Argument | 
|  | 
 |  | 
 | 
|  | '''Options:'''
 |  | Notice that the outermost set of angle brackets were removed from the second and third arguments. | 
|  | 
 |  | 
 | 
|  | MASM2ALP accepts the following command lineoptions:
 |  | ==== Text Expansion Operator (%) ==== | 
|  |  | ;Syntax | 
|  |  | ''Text-Expansion-Operator:'' | 
|  |  | :'''%''' 2nd through Nth token on line | 
|  |  | :'''%''' ''Text-EquateName'' | 
|  |  | :'''%''' ''Expression'' | 
|  | 
 |  | 
 | 
|  | '''-A'''Forces MASM to write segments to theobject file inalphabetical order.MASM normally writes segments insource code order. MASM2ALP ignores this option. |  | ;Description | 
|  |  | The '''%''' ''Text-Expansion-Operator'' has different effects depending upon the context in which it is used. Its primary purpose is convert various sources of information into text literals that may in turn be passed to macros as arguments. | 
|  | 
 |  | 
 | 
|  | '''-B'''''number''Sets thesize ofthe source file read buffer in 1K increments. MASM2ALP ignores this option. |  | The '''%''' ''Text-Expansion-Operator'' causes the following types of conversions: | 
|  | 
 |  | 
 | 
|  | '''-C'''Tells MASM tocreate a cross-reference file. MASM2ALP ignores thisoption. |  | ;Line Expansion | 
|  |  | When used as the first token on the line, the '''%''' operator forces expansion of ''Text-EquateNames'' in contexts where they would otherwise be left unexpanded. ''Text-EquateNames'' passed as arguments to macros are not automatically expanded; this is one context where the '''%''' operator is useful. | 
|  | 
 |  | 
 | 
|  | '''-d'''Causes theassembler togenerate listing file information during both pass 1 and 2.By default, theassembler only generates listing file information during pass 2. |  | ;Expansion of a Text Equate Operand | 
|  |  | As with '''''Line Expansion''''', the '''%''' operator may be used within the body of a line to expand individual ''Text-EquateNames''. This can be useful when expansion of all ''Text-EquateNames'' on the line is not desired. | 
|  | 
 |  | 
 | 
|  | '''-D'''''symbol[=value]''Defines a symbol visible during assembly. An optional text valuemay also be specified for thesymbol. |  | ;Conversion of Numeric Expression to Text | 
|  |  | If the ''Text-Expansion-Operator''is not the first token on the line or immediately followed by a ''Text-EquateName'', then the argument of the '''%''' operator is assumed to be an ''Expression'', which is evaluated and converted to the text representation of its value. This is useful when the need arises to pass the text representation of a number to a macro. | 
|  | 
 |  | 
 | 
|  | '''-E'''Tells MASM togenerate code compatible with floating-point emulation libraries. MASM2ALP ignores this option. |  | ;Constraints | 
|  |  | When the '''%''' ''Expression'' form of the expansion operator is used, the ''Expression'' must evaluate to an ''Immediate-ExpressionType''. | 
|  | 
 |  | 
 | 
|  | '''-H'''Prints the help information panel for the command line syntax. |  | ;Examples | 
|  |  |  MakErr       MACRO       X  | 
|  |  |  LB           =           0  | 
|  |  |               REPEAT      X  | 
|  |  |  LB           =           LB + 1  | 
|  |  |               MakLib      % LB  | 
|  |  |               ENDM        ; ; End of REPEAT | 
|  |  |               ENDM        ; ; End of MACRO | 
|  |  |  MakLib       MACRO       Y  | 
|  |  |  Err & Y :    DB     ' Error    & Y ' ,0  | 
|  |  |               ENDM  | 
|  |  |   | 
|  |  |               MakErr   3  | 
|  |  |  Err1 :    DB    ' Error   1 ' ,0 | 
|  |  |  Err2 :    DB    ' Error   2 ' ,0 | 
|  |  |  Err3 :    DB    ' Error   3 ' ,0 | 
|  | 
 |  | 
 | 
|  | '''-I'''''path''Specifies an INCLUDE file search path. |  | ==== Text Substitution Operator (&) ==== | 
|  |  | ;Syntax | 
|  |  | ''Text-Substitution-Operator:'' | 
|  |  | :''Macro-ParameterName'' '''&''' | 
|  |  | :'''&''' ''Macro-ParameterName'' | 
|  | 
 |  | 
 | 
|  | '''-L[A]'''Forces thecreation of alisting output file. The '''-LA'''option is an abbreviation for "list all", which forces macroexpansions and false conditionals to also be included in the listing output.
 |  | ;Description | 
|  |  | An ampersand (&) is used in the body of a macro to force the substitution of a ''Macro-ParameterName'' with the value of its argument during expansion of the macro. | 
|  | 
 |  | 
 | 
|  | '''-ML'''Directs the assembler to perform acase-sensitive assembly, and to preserve the case of external identifiers when writing them to theobject file. |  | ;Constraints | 
|  |  | The assembler does not substitute a ''Macro-ParameterName'' that is in a quoted string or not preceded by a delimiter in the expansion unless it is immediately preceded by an ampersand (&). | 
|  | 
 |  | 
 | 
|  | '''-MU'''Directs the assembler to perform a case-insensitive assembly, and to convert the names of external identifiers to uppercase when writing them to the object file. This is the default mode of operation for Microsoft MASM. |  | It is necessary to separate a ''Macro-ParameterName'' from other ''Identifer-Characters'' with an ampersand (&) before any substitution or paste operations are performed. | 
|  | 
 |  | 
 | 
|  | '''-MX'''Directs the assembler to perform a case-insensitive assembly,yet preserve the case of external identifiers when writing them to the object file.
 |  | ;Examples | 
|  |  |  ErrGen    MACRO     X  | 
|  |  |  Error &X: push      bx  | 
|  |  |  ABX       mov       BX, "A";  | 
|  |  |  AB &X     mp        ERROR  | 
|  |  |            ENDM | 
|  | 
 |  | 
 | 
|  | '''-N'''Prevents the symbol table summary from being printed in the listing file . |  | The statement '''ErrGen A''' produces this code: | 
|  |  |  ErrorA :   push     bx  | 
|  |  |  ABX        mov      BX , "A";  | 
|  |  |  ABA        jmp      ERROR  | 
|  | 
 |  | 
 | 
|  | '''-P'''Causes MASM to check for inpure code operations when assembling for a privileged mode processor. This feature is not supported by ALP, thus MASM2ALP ignores this option. |  | === Preprocessor Tokens === | 
|  |  | ;Syntax | 
|  |  | ''Preprocessing-Token:'' | 
|  |  | :''Identifier'' | 
|  |  | :''Text-Literal'' | 
|  |  | :''FileName'' | 
|  |  | :''Comment'' | 
|  | 
 |  | 
 | 
|  | '''-S'''Forces MASM towrite segments to the object file in source code order, nullifying theeffects of any previously encountered '''-A'''option. MASM2ALP ignores this option. |  | ;Description | 
|  |  | During the text preprocessing translation phase, certain conditions will cause the preprocessor to convert raw [[#Language Elements]] (''[[#Token]]s'') into ''Preprocessing-Tokens''. The act of text preprocessing typically causes ''Preprocessing-Tokens'' to either be removed from the input stream or converted back into ''Tokens'' before being passed on to the assembler for final processing. | 
|  | 
 |  | 
 | 
|  | '''-X'''Forces false conditionals to be included in the listing file output. |  | ==== Text Literals ==== | 
|  |  | ;Syntax | 
|  |  | ''Text-Literal:'' | 
|  |  | :operand of ''Literal-Character-Operator'' | 
|  |  | :operand of ''Literal-Text-Operator'' | 
|  | 
 |  | 
 | 
|  | '''-Z'''Causes MASM toprint the source line ofany statement causing an assembly error to thestandard output device. MASM2ALP ignores this option . |  | ;Description | 
|  |  | A ''Text-Literal'' is a single unit of text that is used by the [[#Text Preprocessor]] in many different text handling contexts. In some contexts ( such as the processing of arguments to be passed to a macro), normal language ''[[#Token]]s'' are implicitly treated as ''Text-Literals'', provided they are not a delimiter character such as a comma or a blank. In other contexts, it may be necessary to explicitly convert a unit of text to a ''Text-Literal'' using the ''Literal-Text-Operator''. | 
|  | 
 |  | 
 | 
|  | '''-ZD'''Causes line number debugging information to be included in theobject file output. |  | ;Constraints | 
|  |  | A normal language ''Token'' is never implicitly considered to be a ''Text-Literal'' if a ''Text-Literal'' is explicitly required in the syntax of the construct being parsed. | 
|  | 
 |  | 
 | 
|  | '''-ZI'''Causes both line number and symbolic debugging information to be included in the object file output. <br /> |  | === File Names === | 
|  |  | ;Syntax | 
|  |  | ''FileName:'' | 
|  |  | :''FileName-Text'' | 
|  |  | :''Text-Literal'' | 
|  | 
 |  | 
 | 
|  | [[[00106.htm|prev]]][[[00108.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ''FileName-Text:'' | 
|  |  | :''FileName-Character'' | 
|  |  | :''FileName-Text FileName-Character'' | 
|  | 
 |  | 
 | 
|  | === Language Elements ===
 |  | ''FileName-Character:'' | 
|  |  | :any printable character except blank (ASCII 32) | 
|  | 
 |  | 
 | 
|  |  | ;Description  | 
|  |  | ''FileName'' arguments may be coded as an arbitrary sequence of printable characters, or as a ''Text-Literal''; use the ''Text-Literal'' form if the ''FileName'' is to contain embedded spaces or other special characters. | 
|  | 
 |  | 
 | 
|  | -----
 |  | If path information is included in the ''FileName'', you can separate the individual directory names with either the back slash (\) or the forward slash (/) and they will be treated identically by the assembler. | 
|  | 
 |  | 
 | 
|  | The following sections describe the elements you use to build an ALP program source file.
 |  | ;Examples | 
|  |  |    INCLUDE      <inc\macros.inc>  | 
|  |  |    INCLUDELIB   os2386.lib | 
|  | 
 |  | 
 | 
|  | '''Character Set''' |  | === Comments === | 
|  |  | '''''Comments''''' are language elements that have significance only to the programmer and not to the assembler. Comments are effectively removed from the input stream during the text preprocessing phase. | 
|  | 
 |  | 
 | 
|  | All elements in an assembler language source file arebuilt from collections ofcharacters contained in the '''character set''', which are defined as:
 |  | There are two classes of comments recognized by ALP: | 
|  | 
 |  | 
 | 
|  | �The uppercase andlowercase letters of theEnglish alphabet <br />�The decimal digits 0 through 9 <br />�The following graphic characters: <br />
 |  | * Comments that start with a character sequence and continue to the end of the line (''EndOfLine-Comment'') | 
|  | 
 |  | 
 | 
|  | <pre>~   !   "   #   $   %   ^   &   '  (   )  | 
 |  | * Comments that start with a character sequence and continue until the occurrence of another character sequence (''Block-Comment''). See the [[#COMMENT]] directive for a description of ''[[#Block-Comment]]s''. | 
|  | *   +   ,   -   .  /   :   ;   =   <   >   ? 
 |  | 
|  | [   \   ]  _   {   }   @ </pre> |  | 
|  | <br />�The space and horizontal tab characters <br />�The end ofline character(s)
 |  | 
|  | 
 |  | 
 | 
|  | '''White Space''' |  | There are two types of ''EndOfLine-Comments:'' | 
|  | 
 |  | 
 | 
|  | White space is a character or contiguous stream of characters that is ignored or removed from the input stream by the ALP preprocessor.
 |  | '''''Macro-Comment''''' | 
|  | 
 |  | 
 | 
|  | '''White space characters'''are any contiguous sequence of one or more space or tab characters notenclosed insingle or double quotes.White space characters are significant only in that they serve to separate language tokens from one another; they are removed from theinput stream by thescanner.<br /> |  | '''''Macro-Comments''''' (beginning with two semicolons) do not appear in the listing output even when the .LALL directive is used. Use of ''Macro-Comments'' can significantly reduce the amount of memory workspace used by the definition of a macro. As a macro definition is read, ''Macro-Comments'' are discarded and not entered into the macro definition, whereas ''NonMacro-Comments'' are treated as normal text and are retained. | 
|  | 
 |  | 
 | 
|  |  | '''''NonMacro-Comment''''' | 
|  | 
 |  | 
 | 
|  | ----- |  | '''''NonMacro-Comment''''' (beginning with a single semicolon) are preserved in macro definitions and appear in the listing output during macro expansions. | 
|  | 
 |  | 
 | 
|  | ''Token'''':'' <br />[[00110.htm|''Reserved-Word'']] <br />[[00149.htm|''Identifier'']] <br />[[00199.htm|''Literal'']] <br />[[00246.htm|''Punctuator'']] <br /> <br />
 |  | ;Syntax | 
|  | 
 |  | 
 | 
|  | [[[00107.htm|prev]]][[[00109.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ''Comment:'' | 
|  |  | :''EndOfLine-Comment'' | 
|  |  | :''Block-Comment'' | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | ''EndOfLine-Comment:'' | 
|  |  | :''NonMacro-Comment'' | 
|  |  | :''Macro-Comment'' | 
|  | 
 |  | 
 | 
|  | The following sections describe the elements you use to build an ALP program source file.
 |  | ''NonMacro-Comment:'' | 
|  |  | :''';''' ''Char-Sequence'' | 
|  | 
 |  | 
 | 
|  | '''Character Set''' |  | ''Macro-Comment:'' | 
|  |  | :''';;''' ''Char-Sequence'' | 
|  | 
 |  | 
 | 
|  | All elements in an assembler language source file are built from collections of characters contained in the '''characterset''', which are defined as:
 |  | ''Char-Sequence:'' | 
|  |  | :any printable character | 
|  |  | :''Char-Sequence'' any printable character | 
|  | 
 |  | 
 | 
|  | �The uppercase and lowercase letters of theEnglish alphabet <br />�The decimal digits 0 through 9 <br />�The following graphic characters: <br />
 |  | ''[[#Block-Comment]]:'' | 
|  |  | :See the [[#COMMENT]] directive  | 
|  | 
 |  | 
 | 
|  | <pre>~   !   "  #   $   %   ^   &   '   (   )   | 
 |  | ;Description | 
|  | *   +   ,   -   .   /   :   ;   =   <   >   ? 
 |  | 
|  | [   \   ]   _   {   }   @ </pre>
 |  | 
|  | <br />�The space and horizontal tab characters <br />�The end of line character(s)
 |  | 
|  | 
 |  | 
 | 
|  | '''White Space''' |  | '''''Comments''''' are language elements that have significance only to the programmer and not to the assembler. Comments are effectively removed from the input stream during the text preprocessing phase. | 
|  | 
 |  | 
 | 
|  | White space is a characteror contiguous stream ofcharacters thatis ignored or removed from theinput stream by theALP preprocessor.
 |  | There are two classes of comments recognized by ALP: | 
|  |  | * Comments that start with a character sequence and continue to the end of the line (''EndOfLine-Comment'') | 
|  |  | * Comments that start with a character sequence and continue until the occurrence of another character sequence (''Block-Comment''). See the [[#COMMENT]] directive for a description of ''[[#Block-Comment]]s''. | 
|  | 
 |  | 
 | 
|  | '''White space characters'''are any contiguous sequence of one or more space or tab characters not enclosed in single or double quotes. White space characters are significant only in that they serve to separate language tokens from one another; they are removed from the input stream by the scanner. <br /> |  | There are two types of ''EndOfLine-Comments:'' | 
|  | 
 |  | 
 | 
|  | [[[00108.htm|prev]]][[[00110.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | '''''Macro-Comment''''' | 
|  | 
 |  | 
 | 
|  | === Syntax ===
 |  | '''''Macro-Comments''''' (beginning with two semicolons) do not appear in the listing output even when the .LALL directive is used. Use of ''Macro-Comments'' can significantly reduce the amount of memory workspace used by the definition of a macro. As a macro definition is read, ''Macro-Comments'' are discarded and not entered into the macro definition, whereas ''NonMacro-Comments'' are treated as normal text and are retained. | 
|  | 
 |  | 
 | 
|  | ''Token'''':'' <br />[[00110.htm|''Reserved-Word'']] <br />[[00149.htm|''Identifier'']] <br />[[00199.htm|''Literal'']] <br />[[00246.htm|''Punctuator'']] <br /> <br /> |  | '''''NonMacro-Comment''''' | 
|  | 
 |  | 
 | 
|  | [[[00109.htm|prev]]][[[00111.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | '''''NonMacro-Comment''''' (beginning with a single semicolon) are preserved in macro definitions and appear in the listing output during macro expansions. | 
|  | 
 |  | 
 | 
|  | === Reserved Words ===
 |  | ;Example | 
|  | 
 |  | 
 | 
|  |  | The following are examples of ''EndOfLine-Comments:'' | 
|  | 
 |  | 
 | 
|  | -----
 |  |  ; Comments may be on a line all by themselves. They can be empty ... | 
|  |  |  ;  | 
|  |  |                          ; They don't have to start in the first column | 
|  |  |  BumpCount MACRO Amount  ; They can appear to the right of statements | 
|  |  |    Count = Count + Amount       ; This appears in macro expansions | 
|  |  |    $Total = $Total + Amount     ;; This does not, discarded during definition | 
|  |  |  ENDM | 
|  | 
 |  | 
 | 
|  | This section describes all of theassembler reserved words.
 |  | === Text Arguments === | 
|  |  | Many preprocessing directives operate on sequences of raw text characters called ''Text-Arguments''. A ''Text-Argument''may be specified using any one of several methods: | 
|  |  | * Specifying the text directly using a raw ''Text-Literal''. | 
|  |  | * Using the ''Text-Expansion-Operator'' to convert a numeric expression to its text representation. | 
|  |  | * Using a ''Text-EquateName'' in those contexts where a ''Text-Argument''is expected. In this case the preprocessor will automatically resolve the ''Text-EquateName'' and use its value as the ''Text-Argument''. | 
|  | 
 |  | 
 | 
|  |  | ''Text-Argument:'' | 
|  |  | :''Text-Literal'' | 
|  |  | :'''%''' ''Expression'' | 
|  |  | :''Text-EquateName'' | 
|  | 
 |  | 
 | 
|  | ----- |  | ;Description | 
|  |  | Many preprocessing directives operate on sequences of raw text characters called ''Text-Arguments''. A ''Text-Argument''may be specified using any one of several methods: | 
|  | 
 |  | 
 | 
|  | ''Reserved-Word'''':'' <br />[[00113.htm|''Preprocessor-Directive'']] <br />[[00116.htm|''Assembler-Directive'']] <br />[[00119.htm|''Processor-Mnemonic'']] <br />[[00122.htm|''Processor-Register'']] <br />[[00125.htm|''Scalar-TypeName'']] <br />[[00128.htm|''Distance-TypeName'']] <br />[[00131.htm|''Language-Name'']] <br />[[00134.htm|''Anonymous-Label-Alias'']] <br />[[00137.htm|''Location-Counter-Alias'']] <br />[[00140.htm|''Indeterminate-Value-Alias'']] <br />[[00143.htm|''Directive-Keyword'']] <br />[[00146.htm|''Operator-Keyword'']] <br /> <br /> |  | * Specifying the text directly using a raw ''Text-Literal''. | 
|  |  | * Using the ''Text-Expansion-Operator'' to convert a numeric expression to its text representation. | 
|  |  | * Using a ''Text-EquateName'' in those contexts where a ''Text-Argument'' is expected. In this case the preprocessor will automatically resolve the ''Text-EquateName'' and use its value as the ''Text-Argument''. | 
|  | 
 |  | 
 | 
|  | [[[00110.htm|prev]]][[[00112.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Syntax | 
|  |  | ''Text-Argument:'' | 
|  |  | :''Text-Literal'' | 
|  |  | :'''%''' ''Expression'' | 
|  |  | :''Text-EquateName'' | 
|  | 
 |  | 
 | 
|  | === Description === |  | === Conditional Assembly Directives === | 
|  |  | At assembly time, ALP evaluates conditional assembly directives, assembling if the conditions are true. You can use conditional assembly directives when you want to test for a specified condition and assemble a block of statements if the condition is true. The [[#IFxx]] and [[#ENDIF]] directives enclose the statements to be considered for conditional assembly. The optional [[#ELSEIFxx]] and [[#ELSE]] blocks follow the [[#IFxx]] directive. There are many forms of the [[#IFxx]] and [[#ELSEIFxx]] directives. | 
|  | 
 |  | 
 | 
|  | This section describes all of theassembler reserved words. |  | This section describes the following conditional assembly directives: | 
|  |  | :[[#IF]] | 
|  |  | :[[#IFB]] | 
|  |  | :[[#IFDEF]] | 
|  |  | :[[#IFDIF]] | 
|  |  | :[[#IFDIFI]] | 
|  |  | :[[#IFE]] | 
|  |  | :[[#IFIDN]] | 
|  |  | :[[#IFIDNI]] | 
|  |  | :[[#IFNB]] | 
|  |  | :[[#IFNDEF]] | 
|  |  | :[[#IF1]] | 
|  |  | :[[#IF2]] | 
|  |  | :[[#ELSE]] | 
|  |  | :[[#ENDIF]] | 
|  | 
 |  | 
 | 
|  | [[[00111.htm|prev]]][[[00113.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | === IFxx (Begin Primary Conditional Block) === | 
|  |  | You can use each '''IFxx'''conditional directive with the [[#ELSExx]], [[#ELSE]] and [[#ENDIF]] directives to provide the statements to be considered for conditional assembly. ALP assembles the statements following the [[#IFxx]] directive only if this condition is true. | 
|  | 
 |  | 
 | 
|  | === Syntax===
 |  | '''Syntax''' | 
|  |  |  IFxx   operand | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  |  [ ELSEIFxx ]   ( optional ) | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  |  [ ELSE ]   ( optional ) | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  |  ENDIF | 
|  | 
 |  | 
 | 
|  | ''Reserved-Word'''':'' <br />[[00113.htm|''Preprocessor-Directive'']] <br />[[00116.htm|''Assembler-Directive'']] <br />[[00119.htm|''Processor-Mnemonic'']] <br />[[00122.htm|''Processor-Register'']] <br />[[00125.htm|''Scalar-TypeName'']] <br />[[00128.htm|''Distance-TypeName'']] <br />[[00131.htm|''Language-Name'']] <br />[[00134.htm|''Anonymous-Label-Alias'']] <br />[[00137.htm|''Location-Counter-Alias'']] <br />[[00140.htm|''Indeterminate-Value-Alias'']] <br />[[00143.htm|''Directive-Keyword'']] <br />[[00146.htm|''Operator-Keyword'']] <br /> <br /> |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | [[[00112.htm|prev]]][[[00114.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | The following directives are members of the '''IFxx''' family: | 
|  |  | * IF | 
|  |  | * IFB | 
|  |  | * IFDEF | 
|  |  | * IFDIF | 
|  |  | * IFDIFI | 
|  |  | * IFE | 
|  |  | * IFIDN | 
|  |  | * IFIDNI | 
|  |  | * IFNB | 
|  |  | * IFNDEF | 
|  |  | * IF1 | 
|  |  | * IF2 | 
|  | 
 |  | 
 | 
|  | === Preprocessor Directives ===
 |  | You can nest the conditional directives to any level. They are not limited to use within a macro. The assembler must know any operand to a conditional on pass one to avoid errors and incorrect evaluation. | 
|  | 
 |  | 
 | 
|  |  | === IF (If Expression is True) === | 
|  |  | '''IF''' starts a conditional assembly statement, which is ended by the corresponding [[#ENDIF]] conditional assembly directive. Each '''IF''' directive must be ended by a matching ENDIF directive. | 
|  | 
 |  | 
 | 
|  | -----
 |  | '''Syntax''' | 
|  |  | <pre> | 
|  |  | IF Expression  | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  | [ ELSEIFxx ]   (optional) | 
|  |  |     .  | 
|  |  |     .  | 
|  |  |     . | 
|  |  | [ ELSE ]   (optional) | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  | ENDIF | 
|  |  | </pre> | 
|  | 
 |  | 
 | 
|  | '''''Preprocessor Directives''are symbolic names that describe the various assembly-time text processing instructions interpreted by the preprocessor phase of the assembler.''' |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  |  | If the [[#IFxx]] conditional assembly statement is not ended by an [[#ENDIF]] directive, an ''unterminated conditional''  message is produced by the assembler. An ENDIF without a matching '''IF''' causes an error. ENDIF does not have an operand. | 
|  | 
 |  | 
 | 
|  | -----
 |  | '''Note:''' The conditional directives can be nested to any level. They are not limited to use within a macro. Any operand to a conditional must be known on pass 1 to avoid errors and incorrect evaluation. | 
|  | 
 |  | 
 | 
|  | ''Preprocessor-Directive'''':'' one of <br />'''<br />''' |  | '''Example''' | 
|  |  |  IF   debug | 
|  |  |       EXTERN   dump:FAR | 
|  |  |       EXTERN   trace:FAR | 
|  |  |       EXTERN   breakpoint:FAR | 
|  |  |  ENDIF | 
|  | 
 |  | 
 | 
|  | <pre>CATSTR      COMMENT     ELSE        ELSEIF
 |  | === IFB (If Argument is Blank) === | 
|  | ELSEIF1     ELSEIF2     ELSEIFB     ELSEIFDEF
 |  | This is true if ''[[#Text-Argument]]'' is blank (contains no characters). | 
|  | ELSEIFDIF   ELSEIFDIFI  ELSEIFE     ELSEIFIDN
 |  | 
|  | ELSEIFIDNI  ELSEIFNB    ELSEIFNDEF  ENDIF
 |  | 
|  | ENDM        EQU         EXITM       FOR
 |  | 
|  | FORC        IF          IF1         IF2
 |  | 
|  | IFB         IFDEF       IFDIF       IFDIFI |  | 
|  | IFE         IFIDN       IFIDNI      IFNB
 |  | 
|  | IFNDEF      INCLUDE     INSTR       IRP
 |  | 
|  | IRPC        LOCAL       MACRO       PURGE
 |  | 
|  | REPEAT      REPT        SIZESTR     SUBSTR</pre>
 |  | 
|  | <br /> <br />
 |  | 
|  | 
 |  | 
 | 
|  | [[[00113.htm|prev]]][[[00115.htm|next]]][[[00113.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Syntax | 
|  |  |  IFB Text-Argument | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | ;Remarks | 
|  |  | A ''[[#Text-Argument]]'' must be specified, the contents of which are checked for the presence of characters. An error is generated if a ''Text-Argument'' is not supplied. | 
|  | 
 |  | 
 | 
|  | ''Preprocessor Directives''are symbolic names that describe the various assembly-time text processing instructions interpreted by the preprocessor phase of the assembler. |  | === IFDEF (If Identifier is Defined) === | 
|  |  | This is true if ''[[#Identifier]]'' has been defined as a label, variable, or symbol. | 
|  | 
 |  | 
 | 
|  | [[[00114.htm|prev]]][[[00116.htm|next]]][[[00113.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Syntax | 
|  |  |  IFDEF Identifier | 
|  | 
 |  | 
 | 
|  | === Syntax === |  | === IFDIF (If Arguments Are Different) === | 
|  |  | This is true if ''[[#Text-Argument]]-1'' and ''Text-Argument-2'' are different in a case-sensitive comparison. | 
|  | 
 |  | 
 | 
|  | ''Preprocessor-Directive'''':'' one of <br />'''<br />'''
 |  | ;Syntax | 
|  |  |  IFDIF Text-Argument-1, Text-Argument-2 | 
|  | 
 |  | 
 | 
|  | <pre>CATSTR      COMMENT     ELSE        ELSEIF
 |  | ;Remarks | 
|  | ELSEIF1     ELSEIF2     ELSEIFB     ELSEIFDEF
 |  | Both ''Text-Argument'' arguments must be specified. An error is generated if a either argument is not supplied. | 
|  | ELSEIFDIF   ELSEIFDIFI  ELSEIFE     ELSEIFIDN
 |  | 
|  | ELSEIFIDNI  ELSEIFNB    ELSEIFNDEF  ENDIF
 |  | 
|  | ENDM        EQU         EXITM       FOR
 |  | 
|  | FORC        IF          IF1         IF2
 |  | 
|  | IFB         IFDEF       IFDIF       IFDIFI
 |  | 
|  | IFE         IFIDN       IFIDNI      IFNB
 |  | 
|  | IFNDEF      INCLUDE     INSTR       IRP
 |  | 
|  | IRPC        LOCAL       MACRO       PURGE
 |  | 
|  | REPEAT      REPT        SIZESTR     SUBSTR</pre>
 |  | 
|  | <br /> <br />
 |  | 
|  | 
 |  | 
 | 
|  | [[[00115.htm|prev]]][[[00117.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Example | 
|  |  | In the following example: | 
|  |  |  IFDIF <EAGLES>,<Eagles>; | 
|  |  |    value = 1 | 
|  |  |  ENDIF | 
|  |  | the condition would be true; the arguments are different because they are compared with a case-sensitive algorithm. | 
|  | 
 |  | 
 | 
|  | === Assembler Directives === |  | === IFDIFI (If Arguments Are Spelled Differently) === | 
|  |  | This is true if ''[[#Text-Argument]]-1'' and ''Text-Argument-2'' are different in a case-insensitive comparison. | 
|  | 
 |  | 
 | 
|  |  | ;Syntax | 
|  |  |  IFDIFI Text-Argument-1, Text-Argument-2 | 
|  | 
 |  | 
 | 
|  | ----- |  | ;Remarks | 
|  |  | Both ''Text-Argument'' arguments must be specified. An error is generated if a either argument is not supplied. | 
|  | 
 |  | 
 | 
|  | '''''Assembler Directives''are symbolic names that describe thevarious assembly- time instructions interpreted by the assembler itself.'''
 |  | ;Example | 
|  |  | In the following example: | 
|  |  |  IFDIFI <EAGLES>, <Eagles> | 
|  |  |    value = 1 | 
|  |  |  ENDIF | 
|  | 
 |  | 
 | 
|  |  | the condition would be false; the arguments are not different because they are compared using a case-insensitive algorithm. | 
|  | 
 |  | 
 | 
|  | -----
 |  | === IFE (If Expression is Not True) === | 
|  |  | This is true if ''expression'' is 0. | 
|  | 
 |  | 
 | 
|  | ''Assembler-Directive'''':'' one of <br />'''<br />''' |  | '''Syntax''' | 
|  | 
 |  | 
 | 
|  | <pre>.186          .286          .286C         .286P
 |  |   IFE   Expression  | 
|  | .287          .386          .386C         .386P
 |  | 
|  | .387          .486          .486C         .486P
 |  | 
|  | .586          .586P         .686          .686P
 |  | 
|  | .8086         .8087          ALIGN        .ALPHA
 |  | 
|  |   ASSUME       %BIN          .CODE          COMM |  | 
|  | .CONST        .CREF         .DATA         .DATA?
 |  | 
|  |  DB            DD            DF            DOSSEG
 |  | 
|  | .DOSSEG        DQ            DT            DW
 |  | 
|  |  ECHO          END           ENDP          ENDS
 |  | 
|  |  EQU          .ERR          .ERR1         .ERR2
 |  | 
|  | .ERRB         .ERRDEF       .ERRDIF       .ERRDIFI
 |  | 
|  | .ERRE         .ERRIDN       .ERRIDNI      .ERRNB
 |  | 
|  | .ERRNDEF      .ERRNZ         EVEN          EXTERN
 |  | 
|  |  EXTERNDEF     EXTRN        .FARDATA      .FARDATA?
 |  | 
|  |  GROUP         INCLUDELIB    LABEL        .LALL
 |  | 
|  | .LFCOND       .LIST         .LISTALL      .LISTIF
 |  | 
|  | .LISTMACRO    .LISTMACROALL  LOCAL        .MMX
 |  | 
|  | .MODEL         NAME         .NOCREF       .NOLIST
 |  | 
|  | .NOLISTIF     .NOLISTMACRO  .NOMMX         OPTION
 |  | 
|  |  ORG          %OUT           PAGE          PROC
 |  | 
|  |  PUBLIC       .RADIX         RECORD       .SALL
 |  | 
|  |  SEGMENT      .SEQ          .SFCOND       .STACK
 |  | 
|  |  STRUC         STRUCT        SUBTITLE      SUBTTL
 |  | 
|  | .TFCOND        TITLE         TYPEDEF       UNION
 |  | 
|  | .XALL         .XCREF        .XLIST</pre>
 |  | 
|  | <br /> <br />
 |  | 
|  | 
 |  | 
 | 
|  | [[[00116.htm|prev]]][[[00118.htm|next]]][[[00116.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | === IFIDN (If Arguments Are Identical) === | 
|  |  | This is true if ''[[#Text-Argument]]-1'' and ''Text-Argument-2'' are identical in a case -sensitive comparison. | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | '''Syntax''' | 
|  |  |  IFIDN   Text-Argument - 1, Text-Argument - 2 | 
|  | 
 |  | 
 | 
|  | ''Assembler Directives''are symbolic names that describe the various assembly- time instructions interpreted by the assembler itself. |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | [[[00117.htm|prev]]][[[00119.htm|next]]][[[00116.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | Both ''Text-Argument'' arguments must be specified. An error is generated if a either argument is not supplied. | 
|  | 
 |  | 
 | 
|  | === Syntax ===
 |  | '''Example''' | 
|  | 
 |  | 
 | 
|  | ''Assembler-Directive'''':'' one of <br />'''<br />'''
 |  | In the following example: | 
|  | 
 |  | 
 | 
|  | <pre>.186          .286          .286C         .286P |  |  IFIDN   <EAGLES>, <Eagles>;  | 
|  | .287          .386          .386C         .386P
 |  |     value   =   1  | 
|  | .387          .486          .486C         .486P
 |  |   ENDIF | 
|  | .586          .586P         .686          .686P
 |  | the condition would be false; the arguments are not identical because they are compared using a case-insensitive algorithm. | 
|  | .8086         .8087          ALIGN        .ALPHA
 |  | 
|  |  ASSUME       %BIN          .CODE          COMM
 |  | 
|  | .CONST        .CREF         .DATA         .DATA?
 |  | 
|  |  DB            DD            DF            DOSSEG
 |  | 
|  | .DOSSEG        DQ            DT            DW
 |  | 
|  |  ECHO          END           ENDP          ENDS
 |  | 
|  |  EQU          .ERR          .ERR1         .ERR2
 |  | 
|  | .ERRB         .ERRDEF       .ERRDIF       .ERRDIFI
 |  | 
|  | .ERRE         .ERRIDN       .ERRIDNI      .ERRNB
 |  | 
|  | .ERRNDEF      .ERRNZ         EVEN          EXTERN
 |  | 
|  |  EXTERNDEF     EXTRN        .FARDATA      .FARDATA?
 |  | 
|  |  GROUP         INCLUDELIB LABEL        .LALL
 |  | 
|  | .LFCOND       .LIST         .LISTALL      .LISTIF
 |  | 
|  | .LISTMACRO    .LISTMACROALL LOCAL        .MMX
 |  | 
|  | .MODEL         NAME         .NOCREF       .NOLIST |  | 
|  | .NOLISTIF     .NOLISTMACRO  .NOMMX         OPTION
 |  | 
|  |  ORG          %OUT           PAGE          PROC
 |  | 
|  |  PUBLIC       .RADIX         RECORD       .SALL
 |  | 
|  |  SEGMENT      .SEQ          .SFCOND       .STACK
 |  | 
|  |  STRUC         STRUCT        SUBTITLE      SUBTTL
 |  | 
|  | .TFCOND        TITLE         TYPEDEF       UNION
 |  | 
|  | .XALL         .XCREF        .XLIST</pre>
 |  | 
|  | <br /> <br />
 |  | 
|  | 
 |  | 
 | 
|  | [[[00118.htm|prev]]][[[00120.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | === IFIDNI (If Arguments Are Spelled Identically) === | 
|  |  | This is true if ''[[#Text-Argument]]-1'' and ''Text-Argument-2'' are identical in a case -insensitive comparison. | 
|  | 
 |  | 
 | 
|  | === Processor Mnemonics ===
 |  | '''Syntax''' | 
|  |  |  IFIDNI   Text-Argument - 1, Text-Argument - 2 | 
|  | 
 |  | 
 | 
|  |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | ----- |  | Both ''Text-Argument'' arguments must be specified. An error is generated if a either argument is not supplied. | 
|  | 
 |  | 
 | 
|  | '''''Processor Mnemonics''are symbolic names given to the various instructions in the processor instruction set.''' |  | '''Example''' | 
|  | 
 |  | 
 | 
|  |  | In the following example: | 
|  |  |  IFIDNI <EAGLES>, <Eagles> | 
|  |  |    value = 1 | 
|  |  |  ENDIF | 
|  |  | the condition would be true; the arguments are identical because they are compared using a case-insensitive algorithm. | 
|  | 
 |  | 
 | 
|  | ----- |  | === IFNB (If Argument is Not Blank) === | 
|  |  | This is true if ''Text-Argument'' is not blank (characters are present). | 
|  | 
 |  | 
 | 
|  | ''Processor-Mnemonic'''':'' one of <br />'''<br />''' |  | '''Syntax''' | 
|  |  |  IFNB Text-Argument | 
|  |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | <pre>AAA        AAD        AAM        AAS        ADC
 |  | A ''Text-Argument'' must be specified, the contents of which are checked for the presence of characters. An error is generated if a ''Text-Argument'' is not supplied. | 
|  | ADD        AND        ARPL       BOUND      BSF
 |  | 
|  | BSR        BSWAP      BT         BTC        BTR
 |  | 
|  | BTS        CALL       CBW        CDQ        CLC
 |  | 
|  | CLD        CLI        CLTS       CMC        CMOVA
 |  | 
|  | CMOVAE     CMOVB      CMOVBE     CMOVC      CMOVE
 |  | 
|  | CMOVG      CMOVGE     CMOVL      CMOVLE     CMOVNA
 |  | 
|  | CMOVNAE    CMOVNB     CMOVNBE    CMOVNC     CMOVNE
 |  | 
|  | CMOVNG     CMOVNGE    CMOVNL     CMOVNLE    CMOVNO
 |  | 
|  | CMOVNP     CMOVNS     CMOVNZ     CMOVO      CMOVP
 |  | 
|  | CMOVPE     CMOVPO     CMOVS      CMOVZ      CMP
 |  | 
|  | CMPS       CMPSB      CMPSD      CMPSW      CMPXCHG
 |  | 
|  | CMPXCHG8B  CPUID      CWD        CWDE       DAA
 |  | 
|  | DAS        DEC        DIV        EMMS       ENTER
 |  | 
|  | ESC        F2XM1      FABS       FADD       FADDP
 |  | 
|  | FBLD       FBSTP      FCHS       FCLEX      FCMOVB
 |  | 
|  | FCMOVBE    FCMOVE     FCMOVNB    FCMOVNBE   FCMOVNE
 |  | 
|  | FCMOVNU    FCMOVU     FCOM       FCOMI      FCOMIP
 |  | 
|  | FCOMP      FCOMPP     FCOS       FDECSTP    FDISI
 |  | 
|  | FDIV       FDIVP      FDIVR      FDIVRP     FENI
 |  | 
|  | FFREE      FIADD      FICOM      FICOMP     FIDIV
 |  | 
|  | FIDIVR     FILD       FIMUL      FINCSTP    FINIT
 |  | 
|  | FIST       FISTP      FISUB      FISUBR     FLD
 |  | 
|  | FLD1       FLDCW      FLDENV     FLDENVD    FLDENVW
 |  | 
|  | FLDL2E     FLDL2T     FLDLG2     FLDLN2     FLDPI
 |  | 
|  | FLDZ       FMUL       FMULP      FNCLEX     FNDISI
 |  | 
|  | FNENI      FNINIT     FNOP       FNSAVE     FNSAVED
 |  | 
|  | FNSAVEW    FNSTCW     FNSTENV    FNSTENVD   FNSTENVW
 |  | 
|  | FNSTSW     FPATAN     FPREM      FPREM1     FPTAN
 |  | 
|  | FRNDINT    FRSTOR     FRSTORD    FRSTORW    FSAVE
 |  | 
|  | FSAVED     FSAVEW     FSCALE     FSETPM     FSIN
 |  | 
|  | FSINCOS    FSQRT      FST        FSTCW      FSTENV
 |  | 
|  | FSTENVD    FSTENVW    FSTP       FSTSW      FSUB
 |  | 
|  | FSUBP      FSUBR      FSUBRP     FTST       FUCOM
 |  | 
|  | FUCOMI     FUCOMIP    FUCOMP     FUCOMPP    FWAIT
 |  | 
|  | FXAM       FXCH       FXTRACT    FYL2X      FYL2XP1
 |  | 
|  | HLT        IDIV       IMUL       IN         INC
 |  | 
|  | INS        INSB       INSD       INSW       INT
 |  | 
|  | INTO       INVD       INVLPG     IRET       IRETD
 |  | 
|  | IRETDF     IRETF      JA         JAE        JB
 |  | 
|  | JBE        JC         JCXZ       JE         JECXZ
 |  | 
|  | JG         JGE        JL         JLE        JMP
 |  | 
|  | JNA        JNAE       JNB        JNBE       JNC
 |  | 
|  | JNE        JNG        JNGE       JNL        JNLE
 |  | 
|  | JNO        JNP        JNS        JNZ        JO
 |  | 
|  | JP         JPE        JPO        JS         JZ
 |  | 
|  | LAHF       LAR          LDS          LEA          LEAVE 
 |  | 
|  | LES          LFS          LGDT         LGS          LIDT 
 |  | 
|  | LLDT         LMSW         LOCK         LODS         LODSB 
 |  | 
|  | LODSD        LODSW        LOOP         LOOPD        LOOPE 
 |  | 
|  | LOOPED       LOOPEW       LOOPNE       LOOPNED      LOOPNEW 
 |  | 
|  | LOOPNZ       LOOPNZD      LOOPNZW      LOOPW        LOOPZ 
 |  | 
|  | LOOPZD       LOOPZW       LSL          LSS          LTR 
 |  | 
|  | MOV          MOVD         MOVQ         MOVS         MOVSB 
 |  | 
|  | MOVSD        MOVSW        MOVSX        MOVZX        MUL 
 |  | 
|  | NEG          NOP          NOT          OR           OUT 
 |  | 
|  | OUTS         OUTSB        OUTSD        OUTSW        PACKSSDW 
 |  | 
|  | PACKSSWB     PACKUSWB     PADDB        PADDD        PADDSB 
 |  | 
|  | PADDSW       PADDUSB      PADDUSW      PADDW        PAND 
 |  | 
|  | PANDN        PCMPEQB      PCMPEQD      PCMPEQW      PCMPGTB 
 |  | 
|  | PCMPGTD      PCMPGTW      PMADDWD      PMULHW       PMULLW 
 |  | 
|  | POP          POPA         POPAD        POPD         POPF 
 |  | 
|  | POPFD        POPW         POR          PSLLD        PSLLQ 
 |  | 
|  | PSLLW        PSRAD        PSRAW        PSRLD        PSRLQ 
 |  | 
|  | PSRLW        PSUBB        PSUBD        PSUBSB       PSUBSW 
 |  | 
|  | PSUBUSB      PSUBUSW      PSUBW        PUNPCKHBW    PUNPCKHDQ 
 |  | 
|  | PUNPCKHWD    PUNPCKLBW    PUNPCKLDQ    PUNPCKLWD    PUSH 
 |  | 
|  | PUSHA        PUSHAD       PUSHD        PUSHF        PUSHFD 
 |  | 
|  | PUSHW        PXOR         RCL          RCR          RDMSR 
 |  | 
|  | RDPMC        RDTSC        REP          REPE         REPNE 
 |  | 
|  | REPNZ        REPZ         RET          RETF         RETN 
 |  | 
|  | ROL          ROR          RSM          SAHF         SAL 
 |  | 
|  | SAR          SBB          SCAS         SCASB        SCASD 
 |  | 
|  | SCASW        SETA         SETAE        SETB         SETBE 
 |  | 
|  | SETC         SETE         SETG         SETGE        SETL 
 |  | 
|  | SETLE        SETNA        SETNAE       SETNB        SETNBE 
 |  | 
|  | SETNC        SETNE        SETNG        SETNGE       SETNL 
 |  | 
|  | SETNLE       SETNO        SETNP        SETNS        SETNZ 
 |  | 
|  | SETO         SETP         SETPE        SETPO        SETS 
 |  | 
|  | SETZ         SGDT         SHL          SHLD         SHR 
 |  | 
|  | SHRD         SIDT         SLDT         SMSW         STC 
 |  | 
|  | STD          STI          STOS         STOSB        STOSD 
 |  | 
|  | STOSW        STR          SUB          TEST         UC2 
 |  | 
|  | VERR         VERW         WAIT         WBINVD       WRMSR 
 |  | 
|  | XADD         XCHG         XLAT         XLATB        XOR </pre>
 |  | 
|  | <br /> <br />
 |  | 
|  | 
 |  | 
 | 
|  | [[[00119.htm|prev]]][[[00121.htm|next]]][[[00119.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | === IFNDEF (If Identifier is Not Defined) === | 
|  |  | This is true if ''symbol'' has not yet been defined as a label, variable, or symbol. | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | '''Syntax''' | 
|  |  |  IFNDEF symbol | 
|  | 
 |  | 
 | 
|  | ''Processor Mnemonics''are symbolic names given to the various instructions in the processor instruction set.
 |  | === IF1 (If Assembling On Pass 1) === | 
|  |  | This is true on pass one. | 
|  | 
 |  | 
 | 
|  | [[[00120.htm|prev]]][[[00122.htm|next]]][[[00119.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | '''Syntax''' | 
|  |  |  IF1 | 
|  | 
 |  | 
 | 
|  | === Syntax ===
 |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | ''Processor-Mnemonic'''':'' one of <br />'''<br />''' |  | '''IF1''' does not have an operand. | 
|  | 
 |  | 
 | 
|  | <pre>AAA        AAD        AAM        AAS        ADC
 |  | === IF2 (If Assembling On Pass 2) === | 
|  | ADD        AND        ARPL       BOUND      BSF
 |  | 
|  | BSR        BSWAP      BT         BTC        BTR
 |  | 
|  | BTS        CALL       CBW        CDQ        CLC
 |  | 
|  | CLD        CLI        CLTS       CMC        CMOVA
 |  | 
|  | CMOVAE     CMOVB      CMOVBE     CMOVC      CMOVE
 |  | 
|  | CMOVG      CMOVGE     CMOVL      CMOVLE     CMOVNA
 |  | 
|  | CMOVNAE    CMOVNB     CMOVNBE    CMOVNC     CMOVNE
 |  | 
|  | CMOVNG     CMOVNGE    CMOVNL     CMOVNLE    CMOVNO
 |  | 
|  | CMOVNP     CMOVNS     CMOVNZ     CMOVO      CMOVP
 |  | 
|  | CMOVPE     CMOVPO     CMOVS      CMOVZ      CMP
 |  | 
|  | CMPS       CMPSB      CMPSD      CMPSW      CMPXCHG
 |  | 
|  | CMPXCHG8B  CPUID      CWD        CWDE       DAA
 |  | 
|  | DAS        DEC        DIV        EMMS       ENTER
 |  | 
|  | ESC        F2XM1      FABS       FADD       FADDP
 |  | 
|  | FBLD       FBSTP      FCHS       FCLEX      FCMOVB
 |  | 
|  | FCMOVBE    FCMOVE     FCMOVNB    FCMOVNBE   FCMOVNE
 |  | 
|  | FCMOVNU    FCMOVU     FCOM       FCOMI      FCOMIP
 |  | 
|  | FCOMP      FCOMPP     FCOS       FDECSTP    FDISI
 |  | 
|  | FDIV       FDIVP      FDIVR      FDIVRP     FENI
 |  | 
|  | FFREE      FIADD      FICOM      FICOMP     FIDIV
 |  | 
|  | FIDIVR     FILD       FIMUL      FINCSTP    FINIT
 |  | 
|  | FIST       FISTP      FISUB      FISUBR     FLD
 |  | 
|  | FLD1       FLDCW      FLDENV     FLDENVD    FLDENVW
 |  | 
|  | FLDL2E     FLDL2T     FLDLG2     FLDLN2     FLDPI
 |  | 
|  | FLDZ       FMUL       FMULP      FNCLEX     FNDISI
 |  | 
|  | FNENI      FNINIT     FNOP       FNSAVE     FNSAVED
 |  | 
|  | FNSAVEW    FNSTCW     FNSTENV    FNSTENVD   FNSTENVW
 |  | 
|  | FNSTSW     FPATAN     FPREM      FPREM1     FPTAN
 |  | 
|  | FRNDINT    FRSTOR     FRSTORD    FRSTORW    FSAVE
 |  | 
|  | FSAVED     FSAVEW     FSCALE     FSETPM     FSIN
 |  | 
|  | FSINCOS    FSQRT      FST        FSTCW      FSTENV
 |  | 
|  | FSTENVD    FSTENVW    FSTP       FSTSW      FSUB
 |  | 
|  | FSUBP      FSUBR      FSUBRP     FTST       FUCOM
 |  | 
|  | FUCOMI     FUCOMIP    FUCOMP     FUCOMPP    FWAIT
 |  | 
|  | FXAM       FXCH       FXTRACT    FYL2X      FYL2XP1
 |  | 
|  | HLT        IDIV       IMUL       IN         INC
 |  | 
|  | INS        INSB       INSD       INSW       INT
 |  | 
|  | INTO       INVD       INVLPG     IRET       IRETD
 |  | 
|  | IRETDF     IRETF      JA         JAE        JB
 |  | 
|  | JBE        JC         JCXZ       JE         JECXZ
 |  | 
|  | JG         JGE        JL         JLE        JMP
 |  | 
|  | JNA        JNAE       JNB        JNBE       JNC
 |  | 
|  | JNE        JNG        JNGE       JNL        JNLE
 |  | 
|  | JNO        JNP        JNS        JNZ        JO
 |  | 
|  | JP         JPE        JPO        JS         JZ
 |  | 
|  | LAHF       LAR          LDS          LEA          LEAVE 
 |  | 
|  | LES          LFS          LGDT         LGS          LIDT 
 |  | 
|  | LLDT         LMSW         LOCK         LODS         LODSB 
 |  | 
|  | LODSD        LODSW        LOOP         LOOPD        LOOPE 
 |  | 
|  | LOOPED       LOOPEW       LOOPNE       LOOPNED      LOOPNEW 
 |  | 
|  | LOOPNZ       LOOPNZD      LOOPNZW      LOOPW        LOOPZ 
 |  | 
|  | LOOPZD       LOOPZW       LSL          LSS          LTR 
 |  | 
|  | MOV          MOVD         MOVQ         MOVS         MOVSB 
 |  | 
|  | MOVSD        MOVSW        MOVSX        MOVZX        MUL 
 |  | 
|  | NEG          NOP          NOT          OR           OUT 
 |  | 
|  | OUTS         OUTSB        OUTSD        OUTSW        PACKSSDW 
 |  | 
|  | PACKSSWB     PACKUSWB     PADDB        PADDD        PADDSB 
 |  | 
|  | PADDSW       PADDUSB      PADDUSW      PADDW        PAND 
 |  | 
|  | PANDN        PCMPEQB      PCMPEQD      PCMPEQW      PCMPGTB 
 |  | 
|  | PCMPGTD      PCMPGTW      PMADDWD      PMULHW       PMULLW 
 |  | 
|  | POP          POPA         POPAD        POPD         POPF 
 |  | 
|  | POPFD        POPW         POR          PSLLD        PSLLQ 
 |  | 
|  | PSLLW        PSRAD        PSRAW        PSRLD        PSRLQ 
 |  | 
|  | PSRLW        PSUBB        PSUBD        PSUBSB       PSUBSW 
 |  | 
|  | PSUBUSB      PSUBUSW      PSUBW        PUNPCKHBW    PUNPCKHDQ 
 |  | 
|  | PUNPCKHWD    PUNPCKLBW    PUNPCKLDQ    PUNPCKLWD    PUSH 
 |  | 
|  | PUSHA        PUSHAD       PUSHD        PUSHF        PUSHFD 
 |  | 
|  | PUSHW        PXOR         RCL          RCR          RDMSR 
 |  | 
|  | RDPMC        RDTSC        REP          REPE         REPNE 
 |  | 
|  | REPNZ        REPZ         RET          RETF         RETN 
 |  | 
|  | ROL          ROR          RSM          SAHF         SAL 
 |  | 
|  | SAR          SBB          SCAS         SCASB        SCASD 
 |  | 
|  | SCASW        SETA         SETAE        SETB         SETBE 
 |  | 
|  | SETC         SETE         SETG         SETGE        SETL 
 |  | 
|  | SETLE        SETNA        SETNAE       SETNB        SETNBE 
 |  | 
|  | SETNC        SETNE        SETNG        SETNGE       SETNL 
 |  | 
|  | SETNLE       SETNO        SETNP        SETNS        SETNZ 
 |  | 
|  | SETO         SETP         SETPE        SETPO        SETS 
 |  | 
|  | SETZ         SGDT         SHL          SHLD         SHR 
 |  | 
|  | SHRD         SIDT         SLDT         SMSW         STC 
 |  | 
|  | STD          STI          STOS         STOSB        STOSD 
 |  | 
|  | STOSW        STR          SUB          TEST         UC2 
 |  | 
|  | VERR         VERW         WAIT         WBINVD       WRMSR 
 |  | 
|  | XADD         XCHG         XLAT         XLATB        XOR </pre>
 |  | 
|  | <br /> <br />
 |  | 
|  | 
 |  | 
 | 
|  | [[[00121.htm|prev]]][[[00123.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | This is true on pass two. | 
|  | 
 |  | 
 | 
|  | === Processor Registers ===
 |  | '''Syntax''' | 
|  | 
 |  | 
 | 
|  |  | <pre class="western">IF2 </pre> | 
|  |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | -----
 |  | '''IF2'''does not have an operand. | 
|  | 
 |  | 
 | 
|  | '''''Processor Registers''are the symbolic names assigned to thevarious internal processor registers. They are normally used as operands toprocessor instructions.''' |  | === ELSEIFxx/ELSE (Begin Alternate Conditional Block) === | 
|  |  | Each conditional directive can be used with the '''ELSE''' directive to provide the statements to be considered for conditional assembly. The '''ELSE''' directive allows the assembly of the statements following it when the [[#IFxx]] condition or intervening '''ELSEIFxx''' conditions are false. | 
|  | 
 |  | 
 | 
|  |  | '''Syntax''' | 
|  |  | <pre> | 
|  |  | IFxx  | 
|  |  |     . | 
|  |  |     . | 
|  |  |     .  | 
|  |  | [ ELSEIFxx ]   ( optional )  | 
|  |  |     . | 
|  |  |     . | 
|  |  |     .  | 
|  |  | [ ELSE ]   ( optional )  | 
|  |  |     . | 
|  |  |     .  | 
|  |  |     .  | 
|  |  | ENDIF </pre> | 
|  |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | -----
 |  | There is a corresponding '''ELSEIFxx''' directive to match all forms of the [[#IFxx]] family of directives: | 
|  |   |  | *[[#ELSEIF]] | 
|  | ''Processor-Register'''':'' <br />''General-Purpose-Register'' <br />''Segment-Register'' <br />''Control-Register'' <br />''Debug-Register'' <br />''Test-Register'' <br />''MMX-Register'' <br />''Floating-Point-Register'' <br /> <br />''General-Purpose-Register'''':''<br />''8-Bit-Register'' <br />''16-Bit-Register'' <br />''32-Bit-Register'' <br /> <br />''8-Bit-Register'''':'' one of<br />'''AL AH BL BH CL CH DL DH''' <br /> <br />''16-Bit-Register'''':'' one of<br />'''AX BX CX DX DI SI BP SP''' <br /> <br />''32-Bit-Register'''':'' one of <br />'''EAX EBX ECX EDX EDI ESI EBP ESP''' <br /> <br />''Segment-Register'''':'' one of <br />'''CS DS ES FS GS SS''' <br /> <br />''Control-Register'''':'' one of <br />'''CR0 CR2 CR3 CR4''' <br /> <br />''Debug-Register'''':'' one of <br />'''DR0 DR1 DR2 DR3 DR4 DR5 DR6 DR7''' <br /> <br />''Test-Register'''':'' one of <br />'''TR3 TR4 TR5 TR6 TR7''' <br /> <br />''MMX-Register'''':'' one of <br />'''MM0 MM1 MM2 MM3 MM4 MM5 MM6 MM7''' <br /> <br />''Floating-Point-Register'''':'' <br />'''ST''' <br /> <br />
 |  | *[[#ELSEIFB]] | 
|  |  | *[[#ELSEIFDEF]] | 
|  |  | *[[#ELSEIFDIF]] | 
|  |  | *[[#ELSEIFDIFI]] | 
|  |  | *[[#ELSEIFE]] | 
|  |  | *[[#ELSEIFIDN]] | 
|  |  | *[[#ELSEIFIDNI]] | 
|  |  | *[[#ELSEIFNB]] | 
|  |  | *[[#ELSEIFNDEF]] | 
|  |  | *[[#ELSEIF1]] | 
|  |  | *[[#ELSEIF2]] | 
|  | 
 |  | 
 | 
|  | [[[00122.htm|prev]]][[[00124.htm|next]]][[[00122.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | For information about the meaning of the conditional tests performed by the '''ELSEIFxx''' directives, refer to the definitions for the corresponding [[#IFxx]] directives. | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | Any number of '''ELSEIFxx''' blocks may be used within a given IFxx statement. Only one '''ELSE''' block is permitted for a given IFxx. A conditional directive with more than one '''ELSE''' or an '''ELSE''' without a conditional directive causes an error. '''ELSE''' does not have an operand. | 
|  | 
 |  | 
 | 
|  | ''Processor Registers''are the symbolic names assigned tothe various internal processor registers. They arenormally used as operands toprocessor instructions. |  | '''Note:''' The conditional directives can be nested to any level. They are not limited to use within a macro. Any operand to a conditional must be known on pass 1 to avoid errors and incorrect evaluation. | 
|  | 
 |  | 
 | 
|  | [[[00123.htm|prev]]][[[00125.htm|next]]][[[00122.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | '''Example''' | 
|  |  | <pre> | 
|  |  | IF DEFBUF | 
|  |  |   BUF DB 100 DUP(0) | 
|  |  | ELSE  | 
|  |  |   EXTERN BUF:BYTE | 
|  |  | ENDIF | 
|  |  | </pre> | 
|  | 
 |  | 
 | 
|  | === Syntax === |  | === ENDIF (End a Conditional Assembly Statement) === | 
|  |  | '''ENDIF''' ends the conditional assembly statement begun by the corresponding [[#IFxx]] conditional assembly directive. Each IFxx directive must be ended by a matching '''ENDIF''' directive. | 
|  | 
 |  | 
 | 
|  | ''Processor-Register'''':'' <br />''General-Purpose-Register'' <br />''Segment-Register'' <br />''Control-Register'' <br />''Debug-Register'' <br />''Test-Register'' <br />''MMX-Register'' <br />''Floating-Point-Register'' <br /> <br />''General-Purpose-Register'''':'' <br />''8-Bit-Register'' <br />''16-Bit-Register'' <br />''32-Bit-Register'' <br /> <br />''8-Bit-Register'''':'' one of <br />'''AL AH BL BH CL CH DL DH''' <br /> <br />''16-Bit-Register'''':'' one of <br />'''AX BX CX DX DI SI BP SP''' <br /> <br />''32-Bit-Register'''':'' one of <br />'''EAX EBX ECX EDX EDI ESI EBP ESP''' <br /> <br />''Segment-Register'''':'' one of <br />'''CS DS ES FS GS SS''' <br /> <br />''Control-Register'''':'' one of <br />'''CR0 CR2 CR3 CR4''' <br /> <br />''Debug-Register'''':'' one of <br />'''DR0 DR1 DR2 DR3 DR4 DR5 DR6 DR7''' <br /> <br />''Test-Register'''':'' one of <br />'''TR3 TR4 TR5 TR6 TR7''' <br /> <br />''MMX-Register'''':'' one of <br />'''MM0 MM1 MM2 MM3 MM4 MM5 MM6 MM7''' <br /> <br />''Floating-Point-Register'''':'' <br />'''ST''' <br /> <br /> |  | '''Syntax''' | 
|  |  | <pre> | 
|  |  | IFxx  | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  | [ ELSEIFxx ]   ( optional )  | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  | [ ELSE ]   ( optional )  | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  | ENDIF</pre> | 
|  | 
 |  | 
 | 
|  | [[[00124.htm|prev]]][[[00126.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | === Scalar Type Names ===
 |  | If the [[#IFxx]] conditional assembly statement is not ended by an '''ENDIF''' directive, an '''unterminated conditional''' message is produced by the assembler. An '''ENDIF''' without a matching IFxx causes an error. '''ENDIF''' does not have an operand. | 
|  | 
 |  | 
 | 
|  |  | '''Note:''' The conditional directives can be nested to any level. They are not limited to use within a macro. Any operand to a conditional must be known on pass 1 to avoid errors and incorrect evaluation. | 
|  | 
 |  | 
 | 
|  | -----
 |  | '''Example''' | 
|  |  |  IF  debug | 
|  |  |     EXTERN   dump:FAR | 
|  |  |     EXTERN   trace:FAR | 
|  |  |     EXTERN   breakpoint:FAR | 
|  |  |  ENDIF | 
|  | 
 |  | 
 | 
|  | '''''Scalar Type Names''are the symbolicnames given tothe integral data types.These arethe fundamental types of data upon which the processor can directly operate.''' |  | === Text Equate Directives === | 
|  |  | A '''''Text Equate''''' is a symbolic name you give to a series of characters. Text equates are used to expand text within a source statement. The directives described in this section create and manipulate text equates. | 
|  | 
 |  | 
 | 
|  |  | EQU <br />CATSTR <br />INSTR <br />SIZESTR <br />SUBSTR | 
|  | 
 |  | 
 | 
|  | -----
 |  | ==== CATSTR (Concatenate Strings) ==== | 
|  |  | '''CATSTR''' concatenates a list of text values specified by ''string'' into a single text value and assigns it to ''Name''. | 
|  | 
 |  | 
 | 
|  | ''Scalar-TypeName'''':'' <br />'''BYTE''' <br />'''SBYTE''' <br />'''WORD''' <br />'''SWORD''' <br />'''DWORD''' <br />'''SDWORD''' <br />'''REAL4''' <br />'''FWORD''' <br />'''QWORD''' <br />'''REAL8''' <br />'''TBYTE''' <br />'''REAL10''' <br /> <br /> |  | '''Syntax''' | 
|  |  |  Name CATSTR string[, string] ... | 
|  | 
 |  | 
 | 
|  | [[[00125.htm|prev]]][[[00127.htm|next]]][[[00125.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ==== EQU Directive (Assign Text to a Symbolic Constant) ==== | 
|  |  | The '''EQU''' directive assigns the contents of a text literal to ''Name''. | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | '''Syntax''' | 
|  |  |  Name EQU   Text - Literal | 
|  |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | ''Scalar Type Names''are thesymbolic names given to theintegral data types. These are thefundamental types of data upon which theprocessor can directly operate. |  | The value of the ''Text-Literal'' is assigned to the ''Name'' entry. In normal contexts, subsequent references to ''Name'' will cause the preprocessor to replace ''Name'' with the value specified by the ''Text-Literal'' entry. This is a simple text substitution operation. | 
|  | 
 |  | 
 | 
|  | [[[00126.htm|prev]]][[[00128.htm|next]]][[[00125.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | The ''Name'' entry is a globally-scoped ''Identifier'' that is converted to a ''Text-EquateName''. The ''Name'' cannot have been previously defined as a different ''Identifier-Type''. However, the ''Name'' entry can be redefined as many times as desired with different values for the ''Text-Literal'' entry. | 
|  | 
 |  | 
 | 
|  | === Syntax === |  | See also [[#EQU]] and [[#=]]. | 
|  | 
 |  | 
 | 
|  | ''Scalar-TypeName'''':'' <br />'''BYTE''' <br />'''SBYTE''' <br />'''WORD''' <br />'''SWORD''' <br />'''DWORD''' <br />'''SDWORD''' <br />'''REAL4''' <br />'''FWORD''' <br />'''QWORD''' <br />'''REAL8''' <br />'''TBYTE''' <br />'''REAL10''' <br /> <br /> |  | '''Example''' | 
|  |  |  A   EQU  < BP + >    ; explicit text literal, A is a text equate | 
|  |  |  A   EQU  < 3 >       ; redefinition of A with different value | 
|  | 
 |  | 
 | 
|  | [[[00127.htm|prev]]][[[00129.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ==== INSTR (Search In String For Value) ==== | 
|  |  | '''INSTR'''searches a specified ''String'' for an occurrence of a given ''Sub-String'' and assigns its position (1-based) to ''Name''. The search is case sensitive. ''Start''is the position in ''String'' to start the search for ''Sub-String''. If ''Start''is not given, it is assumed to be 1 (the start of the string). If ''Sub-String'' is not found, the position assigned to ''Name'' is 0. | 
|  | 
 |  | 
 | 
|  | === Distance Type Names ===
 |  | '''Syntax''' | 
|  |  |  Name   INSTR   [ Start , ] String , Sub-String | 
|  |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  |  | '''INSTR'''assigns the position value to a name as if it were a numeric equate. | 
|  | 
 |  | 
 | 
|  | -----
 |  | '''Example''' | 
|  |  |  pos   INSTR   < person > , < son > | 
|  | 
 |  | 
 | 
|  | '''''Distance Type Names''are thesymbolic names givento the integral types of pointers directly supported by theprocessor. Their names reflect a fundamental property of the Intel processor architecture known as ''distance''. The type of pointer is defined by the ''distance''required to reach the information to which it points.'''
 |  | ==== SIZESTR (Return Size Of String) ==== | 
|  |  | Assigns the number of characters given by the ''Text-Argument'' to ''Name''. | 
|  | 
 |  | 
 | 
|  |  | '''Syntax''' | 
|  |  |  Name  SIZESTR  Text-Argument | 
|  | 
 |  | 
 | 
|  | ----- |  | ==== SUBSTR (Extract a Sub-string From a String) ==== | 
|  |  | Assigns a substring of ''Text-Argument'' starting at ''Position'' to the symbol given by ''Name.''. | 
|  | 
 |  | 
 | 
|  | ''Distance-TypeName'''':'' <br />'''NEAR''' <br />'''NEAR16''' <br />'''NEAR32''' <br />'''FAR''' <br />'''FAR16''' <br />'''FAR32''' <br /> <br /> |  | '''Syntax''' | 
|  |  |  Name SUBSTR Text-Argument,Position[,Length] | 
|  | 
 |  | 
 | 
|  | [[[00128.htm|prev]]][[[00130.htm|next]]][[[00128.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | The ''Position'' parameter indicates the starting character of the substring to extract from the ''Text-Argument'', and must be 1 or greater. If specified, the ''Length'' parameter indicates how many characters are desired, otherwise the remainder of the string is extracted. | 
|  | 
 |  | 
 | 
|  | ''Distance Type Names''are the symbolic names given to the integral types of pointers directly supported by the processor. Their names reflect a fundamental property of the Intel processor architecture known as ''distance''. The type ofpointer is defined by the ''distance''required to reach the information to which it points. |  | === Macro Directives === | 
|  |  | '''A macro procedure or function''', which is comprised of one or more statements. | 
|  | 
 |  | 
 | 
|  | [[[00129.htm|prev]]][[[00131.htm|next]]][[[00128.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | Macro processing is text processing that is done sequentially at assembly time. By the end of assembly, ALP expands all macros and assembles the resulting text into object code. | 
|  | 
 |  | 
 | 
|  | === Syntax ===
 |  | This section describes the following types of macros: | 
|  |  | * Macro procedures, which expand to one or more complete statements and can optionally take parameters | 
|  |  | * Repeat blocks, which generate a group of statements a specified number of times or until a condition becomes true | 
|  | 
 |  | 
 | 
|  | ''Distance-TypeName'''':'' <br />'''NEAR''' <br />'''NEAR16''' <br />'''NEAR32''' <br />'''FAR''' <br />'''FAR16''' <br />'''FAR32''' <br /> <br />
 |  | This section describes the following macro directives: | 
|  |  | :ENDM | 
|  |  | :EXITM | 
|  |  | :FOR/IRP | 
|  |  | :FORC/IRPC | 
|  |  | :LOCAL | 
|  |  | :MACRO | 
|  |  | :PURGE | 
|  |  | :REPEAT/REPT | 
|  | 
 |  | 
 | 
|  | [[[00130.htm|prev]]][[[00132.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | ==== ENDM (End Current Macro Definition) ==== | 
|  |  | End each [[#MACRO]], [[#REPEAT/REPT]], [[#FOR/IRP]], and [[#FORC/IRPC]] directive with the '''ENDM'''directive. | 
|  | 
 |  | 
 | 
|  | === Language Names ===
 |  | ;Syntax | 
|  |  |  ENDM | 
|  | 
 |  | 
 | 
|  |  | ;Remarks | 
|  |  | If the '''ENDM''' directive is not used with the [[#MACRO]], [[#REPEAT/REPT]], [[#FOR/IRP]], and [[#FORC/IRPC]] directives, an error occurs. An unmatched '''ENDM''' also causes an error. | 
|  | 
 |  | 
 | 
|  | ----- |  | If the assembler produces an error message stating that it found the end-of -file on the source and cannot find an [[#END]] statement when there was an END, the likely cause is a missing '''ENDM''' or ENDIF statement. Without '''ENDM''', the assembler treats the rest of the source as part of the [[#MACRO]] definition. | 
|  | 
 |  | 
 | 
|  | '''''Language Names''refer to thevarious high level programming languages (or more specifically, the calling conventions used by such languages) withwhich theassembler has theability to interface.''' |  | '''Note:''' The ''name field'' is not allowed. Do not confuse the '''ENDM''' directive with other ending directives that do require the name of the block being ended, such as ENDP or ENDS. | 
|  | 
 |  | 
 | 
|  |  | '''Example''' | 
|  |  |  addup   MACRO     ad1, ad2, ad3 | 
|  |  |          MOV       AX, ad1         ;; first parameter in AX | 
|  |  |          ADD       AX, ad2         ;; add next two parameters  | 
|  |  |          ADD       AX, ad3         ;; leave sum in AX | 
|  |  |          ENDM | 
|  | 
 |  | 
 | 
|  | -----
 |  | === EXITM (End Current Macro Expansion) === | 
|  |  | Use the '''EXITM''' directive when a block contains a directive that tests for some condition and you want to end the current macro expansion when the test proves that the remainder of the expansion is not required. When an '''EXITM''' directive is run, the expansion is stopped immediately, and any remaining expansion or repetition is not produced. | 
|  | 
 |  | 
 | 
|  | ''Language-Name'''':'' <br />'''C''' <br />'''SYSCALL''' <br />'''STDCALL''' <br />'''PASCAL''' <br />'''FORTRAN''' <br />'''BASIC''' <br />'''OPTLINK''' <br /> <br /> |  | '''Syntax''' | 
|  |  |  EXITM | 
|  | 
 |  | 
 | 
|  | [[[00131.htm|prev]]][[[00133.htm|next]]][[[00131.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Remarks | 
|  |  | Only the block containing the '''EXITM''' directive is ended; outer levels of a nested macro expansion continue unaffected. | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | '''EXITM''' is executed at macro expansion time and is not a substitute for the [[#ENDM]] directive, which marks the end of the macro body and is recognized at macro definition time. | 
|  | 
 |  | 
 | 
|  | ''Language Names''refer to the various high level programming languages (or more specifically, the calling conventions used by such languages)with which the assembler has the ability tointerface. |  | '''Example''' | 
|  |  | <pre> | 
|  |  | DSEG   SEGMENT  | 
|  |  |       . | 
|  |  |       . | 
|  |  |       . | 
|  |  | SYM   =   0  | 
|  |  |     REPEAT 16 | 
|  |  | ; ; Check for paragraph boundary | 
|  |  |       IF   ( $ - DSEG ) MOD 16 EQ 0 | 
|  |  |       EXITM   ; ; quit if padded to boundary | 
|  |  |       ENDIF  | 
|  |  | SYM = SYM + 1  | 
|  |  |       DB   SYM   ; ; produce numbered padding | 
|  |  |       ENDM </pre> | 
|  | 
 |  | 
 | 
|  | [[[00132.htm|prev]]][[[00134.htm|next]]][[[00131.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | === FOR/IRP (Iterative Macro Expansion Using List of Arguments) === | 
|  |  | The '''FOR''' directive, used in combination with the [[#ENDM]] directive, designates a block of statements to be repeated, once for each argument in the list enclosed by angle brackets. Each repetition substitutes the next item in the <''Argument-List''> entry for every occurrence of ''Parameter'' in the block. | 
|  | 
 |  | 
 | 
|  | === Syntax===
 |  | '''Syntax''' | 
|  |  | <pre> | 
|  |  | FOR  Parameter , < Argument-List > | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  | ENDM</pre> | 
|  | 
 |  | 
 | 
|  | ''Language-Name'''':''<br />'''C''' <br />'''SYSCALL''' <br />'''STDCALL''' <br />'''PASCAL''' <br />'''FORTRAN''' <br />'''BASIC''' <br />'''OPTLINK''' <br /> <br /> |  | ;Remarks | 
|  |  | The obsolete spelling for the '''FOR''' directive is '''IRP'''. | 
|  | 
 |  | 
 | 
|  | [[[00133.htm|prev]]][[[00135.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | You must enclose the <''Argument-List''> entry in angle brackets. It has the following format: | 
|  |  |  < [ Argument   [ ,   Argument   . . . ] ] > | 
|  | 
 |  | 
 | 
|  | === Anonymous Label Aliases ===
 |  | If an empty (<>) ''Argument'' is found in <''Argument-List''>, the ''Parameter'' name is replaced by a null value. If the argument list is empty, the '''FOR'''directive is ignored and no statements are copied. The assembler processes the block once for each ''Argument''in the <''Argument-List''>, replacing each occurrence of ''Parameter''in the macro body with the current ''Argument'' value. | 
|  | 
 |  | 
 | 
|  |  | The [[#FOR/IRP]]-[[#ENDM]] block does not have to be within a macro definition. | 
|  | 
 |  | 
 | 
|  | -----
 |  | '''Example''' | 
|  | 
 |  | 
 | 
|  | The '''''Anonymous Label Aliases''are reserved symbolic names that return a context-sensitive value when referenced in expressions.'''
 |  | In this example, the assembler produces the code '''DB'''1 through '''DB'''10. | 
|  |  | <pre>FOR     X ,   < 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 >  | 
|  |  | DB      X  | 
|  |  | ENDM </pre> | 
|  |  | In the next example: | 
|  |  | <pre>FOR      ARGUMENT , < " first   line " , 13 , 10 ,  | 
|  |  | " second   line " , 13 , 10 >  | 
|  |  | DB      ARGUMENT  | 
|  |  | ENDM </pre> | 
|  |  | The assembler produces the code: | 
|  |  | <pre>DB     " first   line "  | 
|  |  | DB     13  | 
|  |  | DB     10  | 
|  |  | DB     " second   line "  | 
|  |  | DB     13  | 
|  |  | DB     10 </pre> | 
|  | 
 |  | 
 | 
|  | The reserved name '''@B'''(backward reference)returns theinternally generated name representing thenearest '''@@:'''code label appearing before the current location in theinput stream.
 |  | === FORC/IRPC (Iterative Macro Expansion Using List of Characters) === | 
|  |  | The assembler repeats the statements in the block once for each character in the string. Each repetition substitutes the next character in the string for every occurrence of ''Parameter''in the block. | 
|  | 
 |  | 
 | 
|  | The reserved name '''@F'''(forward reference)returns the internally generated name representing the nearest '''@@:'''code label appearing after the current location in the input stream.
 |  | '''Syntax''' | 
|  |  | <pre> | 
|  |  | FORC   Parameter ,  String ( or < String > )   | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  | ENDM </pre> | 
|  |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  |  | The obsolete spelling for the '''FORC'''directive is '''IRPC'''. | 
|  | 
 |  | 
 | 
|  | ----- |  | The '''FORC'''directive is similar to the [[#FOR/IRP]] directive except that a ''String'' is used instead of <''Argument-List''>, and the angle brackets around the string are optional. The string should be enclosed with angle brackets (<>) if it contains spaces, commas, or other separating characters. | 
|  | 
 |  | 
 | 
|  | ''Anonymous-Label-Alias'''':'' <br />'''@B''' <br />'''@F''' <br /> <br />
 |  | The FORC/IRPC-[[#ENDM]] block does not have to be within a macro definition. | 
|  | 
 |  | 
 | 
|  | [[[00134.htm|prev]]][[[00136.htm|next]]][[[00134.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | '''Example''' | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | In this example, the assembler produces the code '''DB''' 1 through '''DB''' 8: | 
|  |  |  FORC      X, 12345678 | 
|  |  |  DB        X | 
|  |  |  ENDM | 
|  | 
 |  | 
 | 
|  | The '''''Anonymous Label Aliases''arereserved symbolic names that return acontext-sensitive value whenreferenced in expressions.''' |  | === LOCAL (Identify Names Local to a Macro Definition) === | 
|  |  | The '''LOCAL''' directive is used inside the body of a macro definition, and provides a method of automatically generating unique assembler labels each time the macro is expanded. The names appearing in the argument list of the '''LOCAL''' directive are known only to the enclosing macro, and each time they are referenced during a macro expansion a unique symbol is created. This prevents the assembler from issuing duplicate definition errors when the macro is expanded more than once and symbols contained therein are being used to create assembler labels. | 
|  | 
 |  | 
 | 
|  | The reserved name '''@B'''(backward reference) returns the internally generated name representing the nearest '''@@:'''code label appearing before the current location in the input stream.
 |  | ;Syntax | 
|  |  |  LOCAL Name [, Name .... ] | 
|  | 
 |  | 
 | 
|  | The reserved name '''@F'''(forward reference) returns theinternally generated name representing thenearest '''@@:'''code label appearing after the current location in theinput stream. |  | ;Remarks | 
|  |  | The '''LOCAL''' directive is recognized only within the body of a macro given by a [[#MACRO]], [[#FOR/IRP]], [[#FORC/IRPC]], or [[#REPEAT/REPT]] definition. The symbols created by the preprocessor are of the form '''??nnnn''', where '''nnnn''' is a hexadecimal number in the range 0000 through FFFF. You must avoid using identifiers of this form for your own purposes, because doing so can cause duplicate definition errors. | 
|  | 
 |  | 
 | 
|  | [[[00135.htm|prev]]][[[00137.htm|next]]][[[00134.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | To insure that they have the proper effect, '''LOCAL''' statements should appear in the body of the macro before any other directives are used. It is acceptable for blank lines or comments to precede any '''LOCAL''' statements. | 
|  | 
 |  | 
 | 
|  | === Syntax ===
 |  | You can use multiple '''LOCAL''' statements if the argument list is too long to fit on one line, or if you want a vertical list of '''LOCAL''' symbols. | 
|  | 
 |  | 
 | 
|  | ''Anonymous-Label-Alias'''':'' <br />'''@B''' <br />'''@F''' <br /> <br />
 |  | ;Example | 
|  |  |  DISPLAY MACRO TT  | 
|  | 
 |  | 
 | 
|  | [[[00136.htm|prev]]][[[00138.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  |  ; Blank lines and comments are ok here | 
|  |  |        LOCAL AGAIN  | 
|  |  |   | 
|  |  |  ;; DOS macro to display message addressed by BX TT times | 
|  |  |        MOV     CX, TT | 
|  |  |        MOV     AH, 9 | 
|  |  |        MOV     DX, BX | 
|  |  |  ; Generate a unique label for AGAIN | 
|  |  |  AGAIN: | 
|  |  |        INT     21H  | 
|  |  |        LOOP    AGAIN  | 
|  |  |        ENDM | 
|  | 
 |  | 
 | 
|  | === Location Counter Alias === |  | === MACRO (Assign a Body of Text to a Name) === | 
|  |  | This directive produces a given sequence of statements from various places in your program, even though different parameters may be required each time you call the sequence. | 
|  | 
 |  | 
 | 
|  |  | Macro processing consists of two separate and distinct phases: [[#Macro Definition]] and [[#Macro Expansion]]. | 
|  | 
 |  | 
 | 
|  | ----- |  | === Macro Definition === | 
|  |  | A macro definition consists of three essential parts: | 
|  |  | *The '''MACRO''' directive, defining the ''Name'' and the ''Parameter-List'' | 
|  |  | *The body of the macro, containing the prototypes of statements to produce when you invoke the macro for expansion. | 
|  |  | *The [[#ENDM]] directive, ending the definition of the macro. | 
|  | 
 |  | 
 | 
|  | The '''''Location Counter Alias''is a reserved name used in expressions to return the offset within the current segment or structure being assembled.'''
 |  | ;Syntax | 
|  |  |  Name MACRO [Parameter [, Parameter ...]] | 
|  |  |    . | 
|  |  |    . | 
|  |  |    . | 
|  |  |  ENDM | 
|  | 
 |  | 
 | 
|  |  | ;Remarks | 
|  |  | The ''Name'' field must be a valid preprocessor identifier and specifies the symbolic name that the user will refer to when invoking the macro for expansion. If ''Name'' is already defined, it must be that of a previous macro definition, otherwise an error message is issued. Macros may be redefined to have a different ''Parameter-Lists'' or macro body text; doing so causes the previous definition to be lost. | 
|  | 
 |  | 
 | 
|  | ----- |  | The optional ''Parameter-List'' is the complete comma-separated list of all ''Parameter'' valuess given in the macro definition statement. A parameter must be a valid symbol name according to the rules for naming preprocessor and assembler identifiers. Each parameter becomes a symbol that is local to the macro being defined and is recognized during macro expansion prior to searching the global name space. Thus, macro parameters need not have names unique from identifiers defined elsewhere in the program. | 
|  | 
 |  | 
 | 
|  | ''Location-Counter-Alias'''':''<br />'''$'''<br /> <br /> |  | === Macro Expansion === | 
|  |  | To expand the macro, the macro ''Name'' (defined in the ''Name'' field of the '''MACRO''' definition statement) is coded as you would any other assembler directive, followed by the list of arguments (if any) that you want to pass to the macro. | 
|  | 
 |  | 
 | 
|  | [[[00137.htm|prev]]][[[00139.htm|next]]][[[00137.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | ;Syntax | 
|  |  |  Name [Argument [, Argument ...]] | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | ;Remarks | 
|  |  | The ''Name'' field must be the name of a macro defined previously with a '''MACRO''' directive. | 
|  | 
 |  | 
 | 
|  | The ''Location Counter Alias''isa reserved name used inexpressions toreturn theoffset within thecurrent segment or structure being assembled. |  | Each ''Argument'' field denotes a text value that you want to pass to the macro. The relative positions of the elements are important, because each ''Argument'' is associated in left-to-right fashion with the corresponding ''Parameter'' as defined in the ''Parameter-List'' during the macro definition. | 
|  | 
 |  | 
 | 
|  | [[[00138.htm|prev]]][[[00140.htm|next]]][[[00137.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | The number of ''Argument'' entries given when the macro is invoked need not be the same as the number of ''Parameter'' entries. If you pass extra ''Argument''s to the macro, they are ignored; if too few are supplied, empty text values are associated with the remaining ''Parameter''s. You may also associate an empty text value with a ''Parameter'' by passing an explicitly empty text literal <> as an ''Argument''. | 
|  | 
 |  | 
 | 
|  | === Syntax ===
 |  | Commas are normally used to separate arguments, although blanks or tabs are also considered to be argument separators. For this reason, any argument that must contain an argument separator character (commas, blanks, or tabs) should be enclosed in angle brackets <>. For example: | 
|  |  |  PUSHVEC   MACRO   PARM1, PARM2 | 
|  |  |            MOV     AX, PARM1 | 
|  |  |            PUSH    AX | 
|  |  |            MOV     AX, PARM2 | 
|  |  |            PUSH    AX | 
|  |  |            ENDM | 
|  |  |            . | 
|  |  |            . | 
|  |  |            . | 
|  |  |            PUSHVEC   DS, <OFFSET VARNAME> | 
|  |  |   ; PUSH DWORD VECTOR OF VARNAME ONTO STACK | 
|  |  | You can also use angle brackets to produce variable lengths of results. For example: | 
|  |  |  STRING   MACRO     NUMBERS | 
|  |  |           DB        NUMBERS | 
|  |  |           ENDM | 
|  |  |             . | 
|  |  |             . | 
|  |  |             . | 
|  |  |           STRING   <1,2,3,4> | 
|  |  |           ; PRODUCE 4 BYTES OF INTEGER NUMBERS | 
|  | 
 |  | 
 | 
|  | ''Location-Counter-Alias'''':''<br />'''$'''<br /> <br /> |  | ;Remarks | 
|  |  | Each time a macro is invoked (expanded) by specifying its name, the preprocessor emits the statements contained in the body of the macro and passes them to the assembler for processing. During the expansion process, any replacement parameters encountered in the macro body (as named in the ''Parameter-List'' of the macro definition) are replaced with the corresponding ''Argument'' (if any) passed through the ''argument-list'' at the time the macro was invoked. | 
|  | 
 |  | 
 | 
|  | [[[00139.htm|prev]]][[[00141.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Example | 
|  |  |  GEN   MACRO   XX, YY, ZZ | 
|  |  |        MOV     AX, XX | 
|  |  |        ADD     AX, YY | 
|  |  |        MOV     ZZ, AX | 
|  |  |        ENDM | 
|  |  | When the call is made, for example: | 
|  |  |  GEN   ED, KISER, SUM | 
|  |  | The assembler produces the following code: | 
|  |  |  MOV     AX, ED | 
|  |  |  ADD     AX, KISER  | 
|  |  |  MOV     SUM, AX | 
|  | 
 |  | 
 | 
|  | === Indeterminate Value Alias === |  | === PURGE (Remove Macro Definition) === | 
|  |  | The '''PURGE''' directive deletes the definition of a specified macro entry, letting you reuse space. | 
|  | 
 |  | 
 | 
|  |  | ;Syntax | 
|  |  |  PURGE Macro-Name [, ...] | 
|  | 
 |  | 
 | 
|  | ----- |  | ;Remarks | 
|  |  | It is not necessary to purge a macro before redefining it. You may use '''PURGE''' to recover memory during assembly by deleting the contents of unreferenced macros. An '''Out of Memory''' condition can occur if a large, general-purpose macro library is included. | 
|  | 
 |  | 
 | 
|  | The '''''Indeterminate Value Alias''is a reserved name used in expressions to represent an uninitialized value.''' |  | ;Example | 
|  |  | The directive: | 
|  |  |  PURGE     MACRONAME | 
|  | 
 |  | 
 | 
|  |  | performs the same function as redefining the macro with no contents, as in: | 
|  |  |  MACRONAME MACRO | 
|  |  |            ENDM | 
|  | 
 |  | 
 | 
|  | -----
 |  | In the following example, assume that MAC1 is a macro included in MACRO.LIB: | 
|  |  |  INCLUDE   MACRO.LIB | 
|  |  |  PURGE     MAC1 | 
|  |  |  MAC1      ; Calls the purged macro | 
|  |  |            ; but produces nothing | 
|  | 
 |  | 
 | 
|  | ''Indeterminate-Value-Alias'''':'' <br />'''?'''<br /> <br />
 |  | === REPEAT/REPT (Iterative Macro Expansion Using a Count Expression) === | 
|  |  | '''REPEAT''' specifies the number of times to generate the statements inside the macro. | 
|  | 
 |  | 
 | 
|  | [[[00140.htm|prev]]][[[00142.htm|next]]][[[00140.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ;Syntax | 
|  |  |  REPEAT Expression | 
|  |  |   Statements | 
|  |  |  ENDM | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | ;Remarks | 
|  |  | The ''Expression'' field must evaluate to an ''Absolute-ExpressionType'' (it cannot contain forward references). Because the repeat block will be expanded at assembler time, the number of iterations must be known then. | 
|  | 
 |  | 
 | 
|  | The ''Indeterminate Value Alias''is areserved name used in expressions to represent an uninitialized value. |  | === ECHO Directive (Display Message on Standard Output Device) === | 
|  |  | The '''ECHO''' directive displays progress through a long assembly or displays the value of conditional assembly parameters. | 
|  | 
 |  | 
 | 
|  | [[[00141.htm|prev]]][[[00143.htm|next]]][[[00140.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | '''Syntax''' | 
|  |  |  ECHO Text | 
|  |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | === Syntax ===
 |  | The assembler lists the ''Text'' entry on the standard output device during assembly when the assembler encounters the '''ECHO''' directive. | 
|  | 
 |  | 
 | 
|  | ''Indeterminate-Value-Alias'''':''<br />'''?'''<br /> <br /> |  | '''ECHO''' is not available under MASM 5.10 emulation; you must use '''%OUT,''' which is the obsolete spelling for the '''ECHO''' directive. | 
|  | 
 |  | 
 | 
|  | [[[00142.htm|prev]]][[[00144.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | '''Example''' | 
|  | 
 |  | 
 | 
|  | === Directive Keywords ===
 |  | '''Example 1:''' | 
|  |  |  IF IBM | 
|  |  |    ECHO IBM VERSION | 
|  |  |  ENDIF  | 
|  | 
 |  | 
 | 
|  |  |  IF2 | 
|  |  |    ECHO STARTING SECOND PASS | 
|  |  |     . | 
|  |  |     . | 
|  |  |     . | 
|  |  |    ENDIF | 
|  | 
 |  | 
 | 
|  | ----- |  | '''Example 2:''' | 
|  |  |  INNER   MACRO    TEXT, VAL | 
|  |  |          ECHO     TEXT  VAL  | 
|  |  |          ENDM | 
|  |  |          . | 
|  |  |          . | 
|  |  |          . | 
|  |  |  HERE    =  $ - CSEG  | 
|  |  |          INNER <CURRENT LOCATION>,%HERE  | 
|  | 
 |  | 
 | 
|  | '''''Directive Keywords''are symbolic names recognized andused in thebody of various assembler directives.''' |  | === INCLUDE Directive (Insert File Contents into Input Stream) === | 
|  |  | The '''INCLUDE''' directive "stacks" the current source file and begins reading tokens from the source file given by the ''FileName'' argument. If you use the '''INCLUDE''' directive, you need not repeat a sequence of statements that are common to several source files. | 
|  | 
 |  | 
 | 
|  |  | '''Syntax''' | 
|  |  |  INCLUDE FileName | 
|  |  | '''Remarks''' | 
|  | 
 |  | 
 | 
|  | ----- |  | The assembler uses the following search order when attempting to open the '''INCLUDE''' file: | 
|  |  | # If the  ''FileName'' argument contains a fully qualified path name (one that begins with a back slash or forward slash), then the assembler attempts to open the file exactly as specified, and no other search is performed if the file is not found. | 
|  |  | # If the ''FileName'' begins with a relative path name or contains no path information, the assembler begins searching for the '''INCLUDE''' file by looking in the directory of the source file that issued the '''INCLUDE''' directive. | 
|  |  | # The assembler searches for ''FileName'' in the list of directories given by any [[#-Fdi]] or [[#-I]] options found on the command line. | 
|  |  | # The assembler searches for ''FileName'' in the list of directories given by the <BaseEXE>_INCLUDE environment variable. | 
|  |  | # The assembler searches for ''FileName'' in the list of directories given by the INCLUDE environment variable. | 
|  |  | # Lastly, the assembler searches for ''FileName'' in the current directory. If the named file is not found, the assembler issues a fatal error message and the assembler is ended. | 
|  | 
 |  | 
 | 
|  | ''Directive-Keyword'''':'' <br />'''<br />''' |  | In no case does the assembler strip relative path information from the ''FileName'' when performing search steps 2 through 6. | 
|  | 
 |  | 
 | 
|  | <pre>ABS         AT            BASIC         C
 |  | When the file named in the '''INCLUDE''' directive is located, the assembler opens it and assembles all of the statements contained therein until the end of the file is reached. The file is then closed and assembler resumes in the original module at the line following the '''INCLUDE''' directive. | 
|  | CASEMAP     CODE          COMMON        DOTNAME
 |  | 
|  | EMULATOR    EPILOGUE      ERROR         EXPORT
 |  | 
|  | EXPR16      EXPR32        FARSTACK      FLAT
 |  | 
|  | FORTRAN     HUGE          LANGUAGE      LARGE
 |  | 
|  | LJMP        MEDIUM        NEARSTACK     NODOTNAME
 |  | 
|  | NOEMULATOR  NOKEYWORD     NOLANGUAGE    NOLJMP
 |  | 
|  | NONE        NOOLDMACROS   NOOLDSTRUCTS  NOREADONLY
 |  | 
|  | NOSCOPED    NOSIGNEXTEND  NOTHING       NOTPUBLIC
 |  | 
|  | OLDMACROS   OLDSTRUCTS    OPTLINK       OS_DOS
 |  | 
|  | OS_OS2      PAGE          PARA          PASCAL
 |  | 
|  | PRIVATE     PROC          PROLOGUE      PUBLIC
 |  | 
|  | READONLY    SCOPED        SEGMENT       SIGNEXTEND
 |  | 
|  | SMALL       STACK         STDCALL       SYSCALL
 |  | 
|  | TINY        USE16         USE32         USES</pre>
 |  | 
|  | <br /> <br />
 |  | 
|  | 
 |  | 
 | 
|  | [[[00143.htm|prev]]][[[00145.htm|next]]][[[00143.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | An '''INCLUDE''' file should not contain an [[#END]] assembler directive to denote the end of the included module; the assembler closes the included module when its physical end of file is reached. | 
|  | 
 |  | 
 | 
|  | === Description ===
 |  | '''INCLUDE''' files may be nested to any reasonable level, and is limited only by the operating system's ability to provide the necessary resources. | 
|  | 
 |  | 
 | 
|  | ''Directive Keywords''are symbolic names recognized and used in the body of various assembler directives.
 |  | ;Example | 
|  |  |  INCLUDE OS2.INC | 
|  | 
 |  | 
 | 
|  | [[[00144.htm|prev]]][[[00146.htm|next]]][[[00143.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | === COMMENT Directive (Program Information Block) === | 
|  |  | '''COMMENT''' lets you enter comments about your program without having to enter semicolons (;) for each line. | 
|  | 
 |  | 
 | 
|  | === Syntax===
 |  | ;Syntax | 
|  |  |  COMMENT   Delimiter   Text   Delimiter | 
|  | 
 |  | 
 | 
|  | ''Directive-Keyword'''':''<br />'''<br />''' |  | ;Remarks | 
|  |  | The first non-blank character after '''COMMENT''' is the first delimiter. The '''COMMENT''' directive causes the assembler to treat all ''Text'' between ''Delimiter'' and ''Delimiter'' as a comment. The text must not contain the delimiter character. This directive is used for multiple-line comments. A '''COMMENT''' defined in the body of a macro does not appear unless '''.LALL''' is requested. | 
|  | 
 |  | 
 | 
|  | <pre>ABS         AT            BASIC         C
 |  | '''Example''' | 
|  | CASEMAP     CODE          COMMON        DOTNAME
 |  |  COMMENT *You can enter as many lines | 
|  | EMULATOR    EPILOGUE      ERROR         EXPORT
 |  |  of text between the delimiters | 
|  | EXPR16      EXPR32        FARSTACK      FLAT
 |  |     . | 
|  | FORTRAN     HUGE          LANGUAGE      LARGE
 |  |     . | 
|  | LJMP        MEDIUM        NEARSTACK     NODOTNAME
 |  |     . | 
|  | NOEMULATOR  NOKEYWORD     NOLANGUAGE    NOLJMP
 |  |  as you need to describe your program.* | 
|  | NONE        NOOLDMACROS   NOOLDSTRUCTS  NOREADONLY
 |  | 
|  | NOSCOPED    NOSIGNEXTEND  NOTHING       NOTPUBLIC
 |  | 
|  | OLDMACROS   OLDSTRUCTS    OPTLINK       OS_DOS
 |  | 
|  | OS_OS2      PAGE          PARA          PASCAL
 |  | 
|  | PRIVATE     PROC          PROLOGUE      PUBLIC
 |  | 
|  | READONLY    SCOPED        SEGMENT       SIGNEXTEND
 |  | 
|  | SMALL       STACK         STDCALL       SYSCALL
 |  | 
|  | TINY        USE16         USE32         USES</pre>
 |  | 
|  | <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00145.htm|prev]]][[[00147.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operator Keywords ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''''Operator Keywords''are symbolic names used in expressions to denote an operation to be performed on one or more operands.''' |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Operator-Keyword'''':'' <br />'''<br />'''
 |  | 
|  |   |  | 
|  | <pre>AND         DUP         EQ          GE
 |  | 
|  | GT          HIGH        HIGHWORD    LE
 |  | 
|  | LENGTH      LENGTHOF    LOW         LOWWORD
 |  | 
|  | LT          MASK        MOD         NE
 |  | 
|  | NOT         OFFSET      OPATTR      OR
 |  | 
|  | PTR         SEG         SHL         SHORT
 |  | 
|  | SHR         SIZE        SIZEOF      THIS
 |  | 
|  | .TYPE       TYPE        WIDTH       XOR</pre> |  | 
|  | <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00146.htm|prev]]][[[00148.htm|next]]][[[00146.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | ''Operator Keywords''are symbolic names used in expressions to denote an operation to be performed on one or more operands.
 |  | 
|  |   |  | 
|  | [[[00147.htm|prev]]][[[00149.htm|next]]][[[00146.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Operator-Keyword'''':'' <br />'''<br />'''
 |  | 
|  |   |  | 
|  | <pre>AND         DUP         EQ          GE
 |  | 
|  | GT          HIGH        HIGHWORD    LE
 |  | 
|  | LENGTH      LENGTHOF    LOW         LOWWORD
 |  | 
|  | LT          MASK        MOD         NE
 |  | 
|  | NOT         OFFSET      OPATTR      OR
 |  | 
|  | PTR         SEG         SHL         SHORT
 |  | 
|  | SHR         SIZE        SIZEOF      THIS
 |  | 
|  | .TYPE       TYPE        WIDTH       XOR</pre>
 |  | 
|  | <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00148.htm|prev]]][[[00150.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Identifiers ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | This section describes the syntax for identifiers and the various types of information they can be made to represent.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Identifier'''':'' <br />''Normal-Identifier'' <br />''Dot-Identifier'' <br /> <br />''Normal-Identifier'' <br />''NonDigit'' <br />''Normal-Identifier Identifer-Character'' <br /> <br />''Dot-Identifier'' <br />''. Normal-Identifier'' <br /> <br />''Identifier-Character'' <br />''NonDigit'' <br />''Digit'' <br /> <br />''NonDigit:'' one of <br />'''<br />'''
 |  | 
|  |   |  | 
|  | <pre> _ $ @ ?
 |  | 
|  |   |  | 
|  |  a b c d e f g h i j k l m
 |  | 
|  |   |  | 
|  |  n o p q r s t u v w x y z
 |  | 
|  |   |  | 
|  |  A B C D E F G H I J K L M
 |  | 
|  |   |  | 
|  |  N O P Q R S T U V W X Y Z
 |  | 
|  | </pre>
 |  | 
|  | <br />''Digit:'' one of <br />'''<br />'''
 |  | 
|  |   |  | 
|  | <pre> 0 1 2 3 4 5 6 7 8 9
 |  | 
|  | </pre>
 |  | 
|  | <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00149.htm|prev]]][[[00151.htm|next]]][[[00149.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | This section describes the syntax for identifiers and the various types of information they can be made to represent.
 |  | 
|  |   |  | 
|  | [[[00150.htm|prev]]][[[00152.htm|next]]][[[00149.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Identifier'''':'' <br />''Normal-Identifier'' <br />''Dot-Identifier'' <br /> <br />''Normal-Identifier'' <br />''NonDigit'' <br />''Normal-Identifier Identifer-Character'' <br /> <br />''Dot-Identifier'' <br />''. Normal-Identifier'' <br /> <br />''Identifier-Character'' <br />''NonDigit'' <br />''Digit'' <br /> <br />''NonDigit:'' one of <br />'''<br />'''
 |  | 
|  |   |  | 
|  | <pre> _ $ @ ?
 |  | 
|  |   |  | 
|  |  a b c d e f g h i j k l m
 |  | 
|  |   |  | 
|  |  n o p q r s t u v w x y z
 |  | 
|  |   |  | 
|  |  A B C D E F G H I J K L M
 |  | 
|  |   |  | 
|  |  N O P Q R S T U V W X Y Z
 |  | 
|  | </pre>
 |  | 
|  | <br />''Digit:'' one of <br />'''<br />'''
 |  | 
|  |   |  | 
|  | <pre> 0 1 2 3 4 5 6 7 8 9
 |  | 
|  | </pre>
 |  | 
|  | <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00151.htm|prev]]][[[00153.htm|next]]][[[00149.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Identifier Types ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | This section describes the various types of identifiers that the assembler will create and manipulate.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Identifier-Type'''':'' <br />[[00155.htm|''EquateName'']] <br />[[00158.htm|''FieldName'']] <br />[[00162.htm|''GroupName'']] <br />[[00163.htm|''LabelName'']] <br />[[00168.htm|''MacroName'']] <br />[[00170.htm|''SegmentName'']] <br />[[00171.htm|''UserDefined-TypeName'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00152.htm|prev]]][[[00154.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | This section describes the various types of identifiers that the assembler will create and manipulate.
 |  | 
|  |   |  | 
|  | [[[00153.htm|prev]]][[[00155.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Definition ===
 |  | 
|  |   |  | 
|  | ''Identifier-Type'''':'' <br />[[00155.htm|''EquateName'']] <br />[[00158.htm|''FieldName'']] <br />[[00162.htm|''GroupName'']] <br />[[00163.htm|''LabelName'']] <br />[[00168.htm|''MacroName'']] <br />[[00170.htm|''SegmentName'']] <br />[[00171.htm|''UserDefined-TypeName'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00154.htm|prev]]][[[00156.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Equate Name ===
 |  | 
|  |   |  | 
|  | '''Definition'''
 |  | 
|  |   |  | 
|  | ''EquateName'''':'' <br />[[00156.htm|''Numeric-EquateName'']] <br />[[00157.htm|''Text-EquateName'']] <br />
 |  | 
|  |   |  | 
|  | '''Description'''
 |  | 
|  |   |  | 
|  | An ''EquateName''is a symbolic identifier that is associated with an expression or a body of text. The assembler substitutes the value of the ''EquateName''at the point of reference. <br />
 |  | 
|  |   |  | 
|  | [[[00155.htm|prev]]][[[00157.htm|next]]][[[00155.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Numeric Equate Name ===
 |  | 
|  |   |  | 
|  | An identifier becomes a ''Numeric-EquateName''when it is defined in a [[00791.htm|EQU]]or [[00786.htm|=]] directive. Procedure [[00742.htm|parameter]]names and [[00743.htm|local variable]]names are also created as ''Numeric-EquateName''''s'', but are visible only from within the procedure where they are defined. All other ''Numeric-EquateName''''s''are globally-scoped identifiers visible across the entire module.
 |  | 
|  |   |  | 
|  | A ''Numeric-EquateName''may only be referenced from within [[00254.htm|expressions]], as its replacement value is itself an expression.
 |  | 
|  |   |  | 
|  | [[[00156.htm|prev]]][[[00158.htm|next]]][[[00155.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Text Equate Name ===
 |  | 
|  |   |  | 
|  | A ''Text-EquateName''is a globally-scoped identifier created during the processing of a [[00683.htm|EQU]]preprocessor directive. A ''Text-EquateName''is associated with a body of text whose content may not span across line breaks. In certain contexts the assembler replaces the ''Text-EquateName'' with the text that it represents and recursively evaluates the result.
 |  | 
|  |   |  | 
|  | [[[00157.htm|prev]]][[[00159.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Field Name ===
 |  | 
|  |   |  | 
|  | '''Definition'''
 |  | 
|  |   |  | 
|  | ''FieldName'''':'' <br />[[00159.htm|''Record-FieldName'']] <br />[[00160.htm|''Structure-FieldName'']] <br />[[00161.htm|''Union-FieldName'']] <br />
 |  | 
|  |   |  | 
|  | '''Description'''
 |  | 
|  |   |  | 
|  | An identifier becomes a ''FieldName''when it is defined within a [[00781.htm|RECORD]], [[00782.htm|STRUCT]], or [[00784.htm|UNION]]directive. <br />
 |  | 
|  |   |  | 
|  | [[[00158.htm|prev]]][[[00160.htm|next]]][[[00158.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Record Field Name ===
 |  | 
|  |   |  | 
|  | A ''Record-FieldName''is a globally-scoped identifier created during the processing of a [[00781.htm|RECORD]]directive. It is a special variation of a [[00156.htm|''Numeric- EquateName'']]and can be used in the same contexts.
 |  | 
|  |   |  | 
|  | [[[00159.htm|prev]]][[[00161.htm|next]]][[[00158.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Structure Field Name ===
 |  | 
|  |   |  | 
|  | An identifier becomes a ''Structure-FieldName''when it is defined in a [[00782.htm|STRUCT]] directive. If the assembler is operating in [[00105.htm|M510]]mode, or if the [[00793.htm|OPTION OLDSTRUCTS]]directive has been specified, then a ''Structure-FieldName''is a globally-scoped identifier treated as a special variation of a [[00156.htm|''Numeric- EquateName'']]and can be used in the same contexts. Otherwise, a ''Structure- FieldName''is private to the defining structure and is only accessible in expressions through use of the [[00482.htm|Structure/Union Field Selection (. Operator)]] .
 |  | 
|  |   |  | 
|  | [[[00160.htm|prev]]][[[00162.htm|next]]][[[00158.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Union Field Name ===
 |  | 
|  |   |  | 
|  | An identifier becomes a ''Union-FieldName''when it is defined in a [[00784.htm|UNION]] directive. A ''Union-FieldName''is private to the defining union and is only accessible in expressions through use of the [[00482.htm|Structure/Union Field Selection (. Operator)]].
 |  | 
|  |   |  | 
|  | [[[00161.htm|prev]]][[[00163.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Group Name ===
 |  | 
|  |   |  | 
|  | A ''GroupName''is a globally-scoped identifier created during the processing of a [[00774.htm|GROUP]]directive. It is referenced from within expressions.
 |  | 
|  |   |  | 
|  | [[[00162.htm|prev]]][[[00164.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Label Name ===
 |  | 
|  |   |  | 
|  | '''Definition'''
 |  | 
|  |   |  | 
|  | ''LabelName'''':'' <br />[[00164.htm|''Code-LabelName'']] <br />[[00167.htm|''Data-LabelName'']] <br />
 |  | 
|  |   |  | 
|  | '''Description'''
 |  | 
|  |   |  | 
|  | A ''LabelName''is globally-scoped identifier that is associated with a program address at application run-time. It has an explicit or inherited [[00250.htm|''Type-Declaration'']], and an optional ''Language-Attribute''. These attributes are described in the following sections.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Type Declaration'''
 |  | 
|  |   |  | 
|  | The type declaration associated with a label name depends on how the label was defined. See the [[00164.htm|''Code-LabelName'']]and [[00167.htm|''Data-LabelName'']]sections for descriptions on how this attribute is assigned.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Language Attribute'''
 |  | 
|  |   |  | 
|  | A ''LabelName''can have an assigned ''Language-Attribute'', set either implicitly through the use of a [[00131.htm|''Language-Name'']]keyword in the body of a [[00775.htm|.MODEL]]or [[00793.htm|OPTION]]directive, or explicitly through the use of an overriding [[00131.htm|''Language- Name'']]keyword in the body of a [[00716.htm|EXTERN/EXTRN]], [[00717.htm|EXTERNDEF]], [[00739.htm|PROC]], or [[00720.htm|PUBLIC]] directive. The ''Language-Attribute''determines the exact spelling of the ''LabelName''identifier when it is written to the object file. According to the ''Language-Attribute'', identifier spellings are modified from their appearance in the assembly language source module as follow: <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------------------------------------------\
 |  | 
|  | |LANGUAGE ATTRIBUTE|IDENTIFIER SPELLING                     |
 |  | 
|  | |------------------+----------------------------------------|
 |  | 
|  | |OPTLINK, SYSCALL  |No modifications are made to the        |
 |  | 
|  | |                  |identifier when written to the object   |
 |  | 
|  | |                  |file.                                   |
 |  | 
|  | |------------------+----------------------------------------|
 |  | 
|  | |C, STDCALL        |A leading underscore character is       |
 |  | 
|  | |                  |appended to the front of the name.      |
 |  | 
|  | |------------------+----------------------------------------|
 |  | 
|  | |BASIC, FORTRAN,   |All characters in the identifier are    |
 |  | 
|  | |PASCAL            |converted to uppercase.                 |
 |  | 
|  | \-----------------------------------------------------------/</pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00163.htm|prev]]][[[00165.htm|next]]][[[00163.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Code Label Name ===
 |  | 
|  |   |  | 
|  | '''Definition'''
 |  | 
|  |   |  | 
|  | ''Code-LabelName'''':'' <br />[[00165.htm|''Target-LabelName'']] <br />[[00166.htm|''Procedure-LabelName'']] <br />
 |  | 
|  |   |  | 
|  | '''Description'''
 |  | 
|  |   |  | 
|  | A ''Code-LabelName''is an identifier that is associated with an executable code address at application run-time. There are two types of ''Code- LabelName''''s'''':''[[00165.htm|''Target-LabelName'']]''s''and [[00166.htm|''Procedure-LabelName'']]''s''. <br />
 |  | 
|  |   |  | 
|  | [[[00164.htm|prev]]][[[00166.htm|next]]][[[00164.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Target Label Name ===
 |  | 
|  |   |  | 
|  | An identifier becomes a ''Target-LabelName''when it is defined with a [[00792.htm|:]], [[00792.htm|::]], or [[00792.htm|LABEL]]directive.
 |  | 
|  |   |  | 
|  | If a ''Target-LabelName''created with a single colon (:) is defined within the body of a [[00739.htm|procedure]], then the name is visible only from within that procedure unless operating in [[00105.htm|M510]]mode (and no [[00775.htm|.MODEL]]directive with a [[00131.htm|''Language-Name'']]has been specified), or unless the [[00793.htm|OPTION NOSCOPED]]directive has been specified.
 |  | 
|  |   |  | 
|  | A ''Target-LabelName''defined outside the body of a procedure is visible to the entire module, and may also be given [[00720.htm|PUBLIC]]visibility.
 |  | 
|  |   |  | 
|  | [[[00165.htm|prev]]][[[00167.htm|next]]][[[00164.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Procedure Label Name ===
 |  | 
|  |   |  | 
|  | An identifier becomes a ''Procedure-LabelName''when it is defined in a '''PROC''' directive.
 |  | 
|  |   |  | 
|  | [[[00166.htm|prev]]][[[00168.htm|next]]][[[00163.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Data Label Name ===
 |  | 
|  |   |  | 
|  | A ''Data-LabelName''is an identifier that is the address of a program variable at application run-time. An identifier becomes a ''Data-LabelName''when it is named in a data allocation statement, or when a scalar, aggregate, or vector type is associated with the identifier named in a [[00792.htm|LABEL]], [[00716.htm|EXTERN/ EXTRN]], [[00717.htm|EXTERNDEF]], or [[00714.htm|COMM]]directive.
 |  | 
|  |   |  | 
|  | [[[00167.htm|prev]]][[[00169.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Macro Name ===
 |  | 
|  |   |  | 
|  | A ''MacroName''is a globally-scoped identifier created during the processing of a '''MACRO'''directive. It is associated with a multi-line body of text. A ''MacroName''may only be used in contexts where a normal assembler directive is expected.
 |  | 
|  |   |  | 
|  | [[[00168.htm|prev]]][[[00170.htm|next]]][[[00168.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Macro Parameter Name ===
 |  | 
|  |   |  | 
|  | An identifier becomes a ''Macro-ParameterName''when it is named as a parameter to a macro in a '''MACRO'''directive. It is associated with a body of text whose content may not span across line breaks. It is only recognized and acted upon from within the body of a macro expansion.
 |  | 
|  |   |  | 
|  | [[[00169.htm|prev]]][[[00171.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Segment Name ===
 |  | 
|  |   |  | 
|  | A ''SegmentName''is a globally-scoped identifier created during the processing of a [[00777.htm|SEGMENT]]directive. It may be referenced from within expressions or in the body of a [[00774.htm|GROUP]]directive.
 |  | 
|  |   |  | 
|  | [[[00170.htm|prev]]][[[00172.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === User-Defined Type Name ===
 |  | 
|  |   |  | 
|  | '''Definition'''
 |  | 
|  |   |  | 
|  | ''UserDefined-TypeName'''':'' <br />[[00172.htm|''Record-TypeName'']] <br />[[00173.htm|''Structure-TypeName'']] <br />[[00174.htm|''Typedef-TypeName'']] <br />[[00175.htm|''Union-TypeName'']] <br />
 |  | 
|  |   |  | 
|  | '''Description'''
 |  | 
|  |   |  | 
|  | An identifier becomes a ''UserDefined-TypeName''when it is defined within a [[00781.htm|RECORD]], [[00782.htm|STRUCT]], [[00783.htm|TYPEDEF]], or [[00784.htm|UNION]]directive. <br />
 |  | 
|  |   |  | 
|  | [[[00171.htm|prev]]][[[00173.htm|next]]][[[00171.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Record Type Name ===
 |  | 
|  |   |  | 
|  | A ''Record-TypeName''is a globally-scoped identifier created during the processing of a [[00781.htm|RECORD]]directive. It is recognized from within [[00255.htm|''Expression'']]''s'' , [[00250.htm|''Type-Declaration'']]''s'', or as a pseudo-directive in a [[00709.htm|data allocation statement]].
 |  | 
|  |   |  | 
|  | [[[00172.htm|prev]]][[[00174.htm|next]]][[[00171.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Structure Type Name ===
 |  | 
|  |   |  | 
|  | A ''Structure-TypeName''is a globally-scoped identifier created during the processing of a [[00782.htm|STRUCT]]directive. It is recognized from within [[00255.htm|''Expression'']]''s'' , [[00250.htm|''Type-Declaration'']]''s'', or as a pseudo-directive in a [[00709.htm|data allocation statement]].
 |  | 
|  |   |  | 
|  | [[[00173.htm|prev]]][[[00175.htm|next]]][[[00171.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Typedef Type Name ===
 |  | 
|  |   |  | 
|  | A ''Typedef-TypeName''is a globally-scoped identifier created during the processing of a [[00783.htm|TYPEDEF]]directive. It is recognized from within [[00255.htm|''Expression'']]''s'', [[00250.htm|''Type-Declaration'']]''s'', or as a pseudo-directive in a [[00709.htm|data allocation statement]].
 |  | 
|  |   |  | 
|  | [[[00174.htm|prev]]][[[00176.htm|next]]][[[00171.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Union Type Name ===
 |  | 
|  |   |  | 
|  | A ''Union-TypeName''is a globally-scoped identifier created during the processing of a [[00784.htm|UNION]]directive. It is recognized from within [[00255.htm|''Expression'']]''s'', [[00250.htm|''Type-Declaration'']]''s'', or as a pseudo-directive in a [[00709.htm|data allocation statement]].
 |  | 
|  |   |  | 
|  | [[[00175.htm|prev]]][[[00177.htm|next]]][[[00149.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Predefined Identifiers ===
 |  | 
|  |   |  | 
|  | The following sections describe the predefined identifiers created by the assembler. When a case-sensitive assembly is being performed, the predefined identifiers must be spelled exactly as they appear in the following descriptions with respect to uppercase and lowercase characters.
 |  | 
|  |   |  | 
|  | [[[00176.htm|prev]]][[[00178.htm|next]]][[[00176.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Segment Information ===
 |  | 
|  |   |  | 
|  | The following sections describe the predefined identifiers created by the assembler in support of segment manipulation.
 |  | 
|  |   |  | 
|  | [[[00177.htm|prev]]][[[00179.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @code ===
 |  | 
|  |   |  | 
|  | The '''@code'''identifier is a [[00157.htm|''Text-EquateName'']]created by the assembler when a [[00775.htm|. MODEL]]directive is encountered, at which time the assembler performs an automatic '''ASSUME CS:'''@code''''''operation. The '''@code'''symbol is not defined if a [[00775.htm|.MODEL]]directive has not been issued.
 |  | 
|  |   |  | 
|  | Under MASM 5.10 emulation, the '''@code'''symbol is set to the name of the implicitly-defined default code segment (the segment opened when a [[00765.htm|.CODE]] directive is used) and its value is never changed. In other modes, the '''@ code'''symbol is updated to reflect whatever segment is opened by using [[00765.htm|.CODE]] , whether defined implicitly or as an explicit parameter to the [[00765.htm|.CODE]] directive.
 |  | 
|  |   |  | 
|  | The value assigned to the '''@code'''symbol when the default code segment is opened is determined by the memory model as follows:
 |  | 
|  |   |  | 
|  | '''Memory Model''''''Value for @code''' <br />TINY DGROUP <br />SMALL _TEXT <br />MEDIUM ''module''_TEXT <br />COMPACT_TEXT <br />LARGE ''module''_TEXT <br />HUGE ''module''_TEXT <br />FLAT CODE32 <br />
 |  | 
|  |   |  | 
|  | The ''module''entry is replaced with base file name of the top-level module being assembled.
 |  | 
|  |   |  | 
|  | [[[00178.htm|prev]]][[[00180.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @CodeSize ===
 |  | 
|  |   |  | 
|  | The '''@CodeSize'''identifier is a [[00156.htm|''Numeric-EquateName'']]created by the assembler when a [[00775.htm|.MODEL]]directive is encountered. '''@CodeSize'''indicates whether code segments created by the [[00765.htm|.CODE]]directive are named such that the linker will combine them into a single (NEAR) segment or into multiple (FAR) segments. The '''@CodeSize'''symbol is set to 0 (NEAR) for the '''TINY, SMALL, COMPACT,'''and '''FLAT'''memory models, and to 1 (FAR) for the '''MEDIUM, LARGE,'''and '''HUGE'''memory models. The '''@CodeSize'''symbol is not defined if a [[00775.htm|.MODEL]]directive has not been issued.
 |  | 
|  |   |  | 
|  | [[[00179.htm|prev]]][[[00181.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @CurSeg ===
 |  | 
|  |   |  | 
|  | The '''@CurSeg'''identifier is a [[00157.htm|''Text-EquateName'']]defined by the assembler to hold the name of the currently opened segment. If no segment is currently open, '''@CurSeg'''will expand into an empty string.
 |  | 
|  |   |  | 
|  | [[[00180.htm|prev]]][[[00182.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @data ===
 |  | 
|  |   |  | 
|  | The '''@data'''identifier is a [[00157.htm|''Text-EquateName'']]created by the assembler when a [[00775.htm|. MODEL]]directive is encountered. It expands to the group name shared by all of the near data segments. If a '''.MODEL FLAT'''has been issued, the '''@data''' identifier expands to FLAT. For all other memory models, it expands to DGROUP.
 |  | 
|  |   |  | 
|  | [[[00181.htm|prev]]][[[00183.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @DataSize ===
 |  | 
|  |   |  | 
|  | The '''@DataSize'''identifier is a [[00156.htm|''Numeric-EquateName'']]created by the assembler when a [[00775.htm|.MODEL]]directive is encountered, and represents the default data distance. Depending on the currently selected memory model, the '''@DataSize''' identifier is set to the following values: ''''''
 |  | 
|  |   |  | 
|  | <br />TINY 0 <br />SMALL 0 <br />COMPACT1 <br />MEDIUM 1 <br />LARGE 1 <br />HUGE 2 <br />FLAT 0 <br />
 |  | 
|  |   |  | 
|  | [[[00182.htm|prev]]][[[00184.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @Model ===
 |  | 
|  |   |  | 
|  | The '''@Model'''identifier is a [[00156.htm|''Numeric-EquateName'']]created by the assembler when a [[00775.htm|.MODEL]]directive is encountered, and is set to a unique value for each memory model. The values are as follows: ''''''
 |  | 
|  |   |  | 
|  | <br />TINY 1 <br />SMALL 2 <br />COMPACT3 <br />MEDIUM 4 <br />LARGE 5 <br />HUGE 6 <br />FLAT 7 <br />
 |  | 
|  |   |  | 
|  | [[[00183.htm|prev]]][[[00185.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @WordSize ===
 |  | 
|  |   |  | 
|  | The '''@WordSize'''identifier is a [[00156.htm|''Numeric-EquateName'']]that reflects the address size attribute of the current segment. It is set to 2 for a '''USE16'''segment, and 4 for a '''USE32'''segment. If no segment is currently open, it reflects the default address size as determined by the currently selected processor.
 |  | 
|  |   |  | 
|  | [[[00184.htm|prev]]][[[00186.htm|next]]][[[00176.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Version Information ===
 |  | 
|  |   |  | 
|  | These identifiers offer methods of testing the various operating modes of the assembler to determine what features are activated or disabled, or how the assembler will behave under various conditions.
 |  | 
|  |   |  | 
|  | [[[00185.htm|prev]]][[[00187.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @Alp ===
 |  | 
|  |   |  | 
|  | The '''@Alp'''identifier is a [[00157.htm|''Text-EquateName'']]that can be tested to determine if ALP is assembling the source file (versus some other assembler). It is always set to the string '''100'''.
 |  | 
|  |   |  | 
|  | [[[00186.htm|prev]]][[[00188.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @AlpMajor ===
 |  | 
|  |   |  | 
|  | The '''@AlpMajor'''identifier is a [[00157.htm|''Text-EquateName'']]that reflects the ''major'' portion of the three-part assembler version number. It is padded on the right with zeros to allow major version number comparisions independant of the minor version and revisions numbers. See [[00190.htm|@AlpVersion]]for more information.
 |  | 
|  |   |  | 
|  | This identifier is only defined in [[00105.htm|ALP]]mode.
 |  | 
|  |   |  | 
|  | [[[00187.htm|prev]]][[[00189.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @AlpMinor ===
 |  | 
|  |   |  | 
|  | The '''@AlpMinor'''identifier is a [[00157.htm|''Text-EquateName'']]that reflects the ''minor'' portion of the three-part assembler version number. It is padded on the right with zeros to allow minor version number comparisions independant of the major version and revisions numbers. See [[00190.htm|@AlpVersion]]for more information.
 |  | 
|  |   |  | 
|  | This identifier is only defined in [[00105.htm|ALP]]mode.
 |  | 
|  |   |  | 
|  | [[[00188.htm|prev]]][[[00190.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @AlpRevision ===
 |  | 
|  |   |  | 
|  | The '''@AlpRevision'''identifier is a [[00157.htm|''Text-EquateName'']]that reflects the ''revision'' portion of the three-part assembler version number. It allows revision number comparisions independant of the major and minor version numbers. See [[00190.htm|@AlpVersion]]for more information.
 |  | 
|  |   |  | 
|  | This identifier is only defined in [[00105.htm|ALP]]mode.
 |  | 
|  |   |  | 
|  | [[[00189.htm|prev]]][[[00191.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @AlpVersion ===
 |  | 
|  |   |  | 
|  | The '''@AlpVersion'''identifier is a [[00157.htm|''Text-EquateName'']]that reflects the full three-part assembler version number. This is an encoding of the version number printed in the program banner when the assembler is invoked. This number and its requisite parts may be tested to determine the presence or absence of features provided by the assembler.
 |  | 
|  |   |  | 
|  | The assembler version number consists of three parts:
 |  | 
|  |   |  | 
|  | 1.The major version number (one digit) <br /> 2.The minor version number (two digits) <br /> 3.The revision number (three digits) <br />
 |  | 
|  |   |  | 
|  | In the assembler banner, the numbers are separated by the period (.) character; the period is removed from the text defined by the predefined identifiers.
 |  | 
|  |   |  | 
|  | For example, if the major version number is '''1''', the minor version number is '''2''', and the revision number is '''3''', then the full version number is printed in the assembler banner as '''1.02.003''', and the various predefined version identifers would be set as follows: '''<br />'''
 |  | 
|  |   |  | 
|  | <pre>    @AlpVersion   102003
 |  | 
|  |     @AlpMajor     100000
 |  | 
|  |     @AlpMinor       2000
 |  | 
|  |     @AlpRevision     003</pre>
 |  | 
|  | This identifier is only defined in [[00105.htm|ALP]]mode.
 |  | 
|  |   |  | 
|  | [[[00190.htm|prev]]][[[00192.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @Cpu ===
 |  | 
|  |   |  | 
|  | The '''@Cpu'''identifier is a [[00156.htm|''Numeric-EquateName'']]that reflects the currently selected processor for which ALP is assembling instructions. This value is affected by issuing a [[00745.htm|''Processor-Control-Directive'']], and is a bit map that indicates the currently active processor instruction set(s). <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------\
 |  | 
|  | |B|A|9|8|7|6|5|4|3|2|1|0|BIT SET IF ASSEMBLING FOR:    |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | | | | | | | | | | | |1|8086/8088                     |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | | | | | | | | | | |1| |80186                         |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | | | | | | | | | |1| | |80286                         |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | | | | | | | | |1| | | |80386                         |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | | | | | | | |1| | | | |80486                         |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | | | | | | |1| | | | | |80586 (Pentium)               |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | | | | | |1| | | | | | |80686 (Pentium Pro)           |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | | | | |1| | | | | | | |Privileged mode               |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | | | |1| | | | | | | | |8087                          |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | | |1| | | | | | | | | |MMX Extensions                |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | | |1| | | | | | | | | | |80287                         |
 |  | 
|  | |-+-+-+-+-+-+-+-+-+-+-+-+------------------------------|
 |  | 
|  | |1| | | | | | | | | | | |80387                         |
 |  | 
|  | \------------------------------------------------------/</pre>
 |  | 
|  | [[[00191.htm|prev]]][[[00193.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @Version ===
 |  | 
|  |   |  | 
|  | The '''@Version'''identifier is a [[00157.htm|''Text-EquateName'']]that reflects the MASM- compatible version number. The current emulation mode of the assembler affects the value of this symbol as follows:
 |  | 
|  |   |  | 
|  | <br />[[00105.htm|M510]]510 <br />[[00105.htm|M600]]600 <br />[[00105.htm|ALP]]4294967295 (the highest possible value for an unsigned 32-bit integer) <br />
 |  | 
|  |   |  | 
|  | [[[00192.htm|prev]]][[[00194.htm|next]]][[[00176.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Date and Time Information ===
 |  | 
|  |   |  | 
|  | These identifiers allow the programmer to query the system date or time during the assembly. Each time they are referenced, a new system request for the current date and time is made and the values held in the identifiers are refreshed.
 |  | 
|  |   |  | 
|  | [[[00193.htm|prev]]][[[00195.htm|next]]][[[00193.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @Date ===
 |  | 
|  |   |  | 
|  | The '''@Date'''identifier is a [[00157.htm|''Text-EquateName'']]that is set to the current system date. If the current operating mode is [[00105.htm|M600]], the date is returned in the MM/DD/YY format. In native [[00105.htm|ALP]]mode, the date is returned in the MM/DD/ YYYY format.
 |  | 
|  |   |  | 
|  | The '''@Date'''identifier is not available in [[00105.htm|M510]]mode.
 |  | 
|  |   |  | 
|  | [[[00194.htm|prev]]][[[00196.htm|next]]][[[00193.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @Time ===
 |  | 
|  |   |  | 
|  | The '''@Time'''identifier is a [[00157.htm|''Text-EquateName'']]that is set to the current system time in 24-hour HH:MM:SS format.
 |  | 
|  |   |  | 
|  | The '''@Time'''identifier is not available in [[00105.htm|M510]]mode.
 |  | 
|  |   |  | 
|  | [[[00195.htm|prev]]][[[00197.htm|next]]][[[00176.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === File Information ===
 |  | 
|  |   |  | 
|  | These identifiers return information about the file(s) being assembled.
 |  | 
|  |   |  | 
|  | [[[00196.htm|prev]]][[[00198.htm|next]]][[[00196.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @FileName ===
 |  | 
|  |   |  | 
|  | The '''@FileName'''identifier is a [[00157.htm|''Text-EquateName'']]that is set to the base name of the main file being assembled (as it appears on the command line).
 |  | 
|  |   |  | 
|  | [[[00197.htm|prev]]][[[00199.htm|next]]][[[00196.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === @Line ===
 |  | 
|  |   |  | 
|  | The '''@Line'''identifier is a [[00156.htm|''Numeric-EquateName'']]that is set to the current source line number in the file currently being assembled.
 |  | 
|  |   |  | 
|  | The '''@Line'''identifier is not available in [[00105.htm|M510]]mode.
 |  | 
|  |   |  | 
|  | [[[00198.htm|prev]]][[[00200.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''''Literals''are the notational method whereby numeric values or strings of character data are represented in the source stream. Literals are also commonly referred to as '''''constants''(especially in the context of high level languages) because they typically represent objects whose values do not change throughout the life of the assembly or compilation. However, literals should not be confused with run-time "constants" ("read-only" data items allocated by the programmer); they are assembly-time tokens used by the assembler to represent numeric values or character strings.''''''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Literal'''':'' <br />[[00226.htm|''Floating-Point-Literal'']] <br />[[00202.htm|''Integer-Literal'']] <br />[[00241.htm|''String-Literal'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00199.htm|prev]]][[[00201.htm|next]]][[[00199.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | ''Literals''are the notational method whereby numeric values or strings of character data are represented in the source stream. Literals are also commonly referred to as ''constants''(especially in the context of high level languages) because they typically represent objects whose values do not change throughout the life of the assembly or compilation. However, literals should not be confused with run-time "constants" ("read-only" data items allocated by the programmer); they are assembly-time tokens used by the assembler to represent numeric values or character strings.
 |  | 
|  |   |  | 
|  | [[[00200.htm|prev]]][[[00202.htm|next]]][[[00199.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Literal'''':'' <br />[[00226.htm|''Floating-Point-Literal'']] <br />[[00202.htm|''Integer-Literal'']] <br />[[00241.htm|''String-Literal'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00201.htm|prev]]][[[00203.htm|next]]][[[00199.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Integer Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | An '''''integer literal''represents a fixed-point numeric value. An integer literal must begin with one of the numeric digits 0 - 9, and may be optionally terminated with a suffix character called a '''''radix specifier''. The radix specifier tells the assembler whether the literal is to be interpreted as a base 2 (binary), 8 (octal), 10 (decimal), or 16 ( hexadecimal) number. If the literal is not suffixed with a radix specifier , the assembler uses the value of the current radix to determine the base of the number. The default radix is 10 (decimal), but the '''''.RADIX''directive can be used to specify an alternate radix.'''''''''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Integer-Literal'''':'' <br />[[00205.htm|''Binary-Integer-Literal'']] <br />[[00210.htm|''Octal-Integer-Literal'']] <br />[[00215.htm|''Decimal-Integer-Literal'']] <br />[[00220.htm|''Hexadecimal-Integer-Literal'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00202.htm|prev]]][[[00204.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | An ''integer literal''represents a fixed-point numeric value. An integer literal must begin with one of the numeric digits 0 - 9, and may be optionally terminated with a suffix character called a ''radix specifier''. The radix specifier tells the assembler whether the literal is to be interpreted as a base 2 (binary), 8 (octal), 10 (decimal), or 16 ( hexadecimal) number. If the literal is not suffixed with a radix specifier , the assembler uses the value of the current radix to determine the base of the number. The default radix is 10 (decimal), but the ''.RADIX''directive can be used to specify an alternate radix.
 |  | 
|  |   |  | 
|  | [[[00203.htm|prev]]][[[00205.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Integer-Literal'''':'' <br />[[00205.htm|''Binary-Integer-Literal'']] <br />[[00210.htm|''Octal-Integer-Literal'']] <br />[[00215.htm|''Decimal-Integer-Literal'']] <br />[[00220.htm|''Hexadecimal-Integer-Literal'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00204.htm|prev]]][[[00206.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Binary Integer Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00208.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00209.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A base-2 number containing either of the digits '''''0''and '''''1''.''''''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Binary-Integer-Literal'''':'' <br />''Unqualified-Binary-Integer-Literal'' <br />''Qualified-Binary-Integer-Literal'' <br /> <br />''Unqualified-Binary-Integer-Literal:'' <br />''Binary-Digit'' <br />''Binary-Integer-Literal''''Binary-Digit'' <br /> <br />''Qualified-Binary-Integer-Literal:'' <br />''Unqualified-Binary-Integer-Literal Binary-Radix'' <br /> <br />''Binary-Digit:'' <br />'''0''' <br />'''1''' <br /> <br />''Binary-Radix:'' <br />'''b''' <br />'''B''' <br />'''y''' <br />'''Y''' <br />
 |  | 
|  |   |  | 
|  | [[[00205.htm|prev]]][[[00207.htm|next]]][[[00205.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00208.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00209.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00206.htm|prev]]][[[00208.htm|next]]][[[00205.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Binary-Integer-Literal'''':'' <br />''Unqualified-Binary-Integer-Literal'' <br />''Qualified-Binary-Integer-Literal'' <br /> <br />''Unqualified-Binary-Integer-Literal:'' <br />''Binary-Digit'' <br />''Binary-Integer-Literal''''Binary-Digit'' <br /> <br />''Qualified-Binary-Integer-Literal:'' <br />''Unqualified-Binary-Integer-Literal Binary-Radix'' <br /> <br />''Binary-Digit:'' <br />'''0''' <br />'''1''' <br /> <br />''Binary-Radix:'' <br />'''b''' <br />'''B''' <br />'''y''' <br />'''Y''' <br />
 |  | 
|  |   |  | 
|  | [[[00207.htm|prev]]][[[00209.htm|next]]][[[00205.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A base-2 number containing either of the digits ''0''and ''1''.
 |  | 
|  |   |  | 
|  | [[[00208.htm|prev]]][[[00210.htm|next]]][[[00205.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | The following are examples of unqualified binary integer literals:
 |  | 
|  |   |  | 
|  | 10101 <br />0 <br />000001 <br />1111000010101010 <br />
 |  | 
|  |   |  | 
|  | The following are examples of qualified binary integer literals:
 |  | 
|  |   |  | 
|  | 00001111b <br />1111Y <br />00y <br />1111000010101010B <br />
 |  | 
|  |   |  | 
|  | [[[00209.htm|prev]]][[[00211.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Octal Integer Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00213.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00214.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A base-8 number containing any of the digits '''''0''through '''''7''.''''''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Octal-Integer-Literal'''':'' <br />''Unqualified-Octal-Integer-Literal'' <br />''Qualified-Octal-Integer-Literal'' <br /> <br />''Unqualified-Octal-Integer-Literal:'' <br />''Octal-Digit'' <br />''Octal-Integer-Literal Octal-Digit'' <br /> <br />''Qualified-Octal-Integer-Literal:'' <br />''Unqualified-Octal-Integer-Literal Octal-Radix'' <br /> <br />''Octal-Digit:'' one of: '''<br />0 1 2 3 4 5 6 7 <br />''' <br />''Octal-Radix:'' <br />'''o''' <br />'''O''' <br />'''q''' <br />'''Q''' <br />
 |  | 
|  |   |  | 
|  | [[[00210.htm|prev]]][[[00212.htm|next]]][[[00210.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00213.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00214.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00211.htm|prev]]][[[00213.htm|next]]][[[00210.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Octal-Integer-Literal'''':'' <br />''Unqualified-Octal-Integer-Literal'' <br />''Qualified-Octal-Integer-Literal'' <br /> <br />''Unqualified-Octal-Integer-Literal:'' <br />''Octal-Digit'' <br />''Octal-Integer-Literal Octal-Digit'' <br /> <br />''Qualified-Octal-Integer-Literal:'' <br />''Unqualified-Octal-Integer-Literal Octal-Radix'' <br /> <br />''Octal-Digit:'' one of: '''<br />0 1 2 3 4 5 6 7 <br />''' <br />''Octal-Radix:'' <br />'''o''' <br />'''O''' <br />'''q''' <br />'''Q''' <br />
 |  | 
|  |   |  | 
|  | [[[00212.htm|prev]]][[[00214.htm|next]]][[[00210.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A base-8 number containing any of the digits ''0''through ''7''.
 |  | 
|  |   |  | 
|  | [[[00213.htm|prev]]][[[00215.htm|next]]][[[00210.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | The following are examples of unqualified octal integer literals:
 |  | 
|  |   |  | 
|  | 01234567 <br />27 <br />765 <br />
 |  | 
|  |   |  | 
|  | The following are examples of qualified octal integer literals:
 |  | 
|  |   |  | 
|  | 27q <br />013o <br />567O <br />01234567Q <br />
 |  | 
|  |   |  | 
|  | [[[00214.htm|prev]]][[[00216.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Decimal Integer Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00218.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00219.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A base-10 number containing any of the digits '''''0''through '''''9''.''''''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Decimal-Integer-Literal'''':'' <br />''Unqualified-Decimal-Integer-Literal'' <br />''Qualified-Decimal-Integer-Literal'' <br /> <br />''Unqualified-Decimal-Integer-Literal:'' <br />''Decimal-Digit'' <br />''Decimal-Integer-Literal Decimal-Digit'' <br /> <br />''Qualified-Decimal-Integer-Literal:'' <br />''Unqualified-Decimal-Integer-Literal Decimal-Radix'' <br /> <br />''Decimal-Digit:'' one of: '''<br />0 1 2 3 4 5 6 7 8 9 <br />''' <br />''Decimal-Radix:'' <br />'''d''' <br />'''D''' <br />'''t''' <br />'''T''' <br />
 |  | 
|  |   |  | 
|  | [[[00215.htm|prev]]][[[00217.htm|next]]][[[00215.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00218.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00219.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00216.htm|prev]]][[[00218.htm|next]]][[[00215.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Decimal-Integer-Literal'''':'' <br />''Unqualified-Decimal-Integer-Literal'' <br />''Qualified-Decimal-Integer-Literal'' <br /> <br />''Unqualified-Decimal-Integer-Literal:'' <br />''Decimal-Digit'' <br />''Decimal-Integer-Literal Decimal-Digit'' <br /> <br />''Qualified-Decimal-Integer-Literal:'' <br />''Unqualified-Decimal-Integer-Literal Decimal-Radix'' <br /> <br />''Decimal-Digit:'' one of: '''<br />0 1 2 3 4 5 6 7 8 9 <br />''' <br />''Decimal-Radix:'' <br />'''d''' <br />'''D''' <br />'''t''' <br />'''T''' <br />
 |  | 
|  |   |  | 
|  | [[[00217.htm|prev]]][[[00219.htm|next]]][[[00215.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A base-10 number containing any of the digits ''0''through ''9''.
 |  | 
|  |   |  | 
|  | [[[00218.htm|prev]]][[[00220.htm|next]]][[[00215.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | The following are examples of unqualified decimal integer literals:
 |  | 
|  |   |  | 
|  | 0123456789 <br />19 <br />090 <br />
 |  | 
|  |   |  | 
|  | The following are examples of qualified decimal integer literals:
 |  | 
|  |   |  | 
|  | 01d <br />89t <br />4567D <br />0123456789T <br />
 |  | 
|  |   |  | 
|  | [[[00219.htm|prev]]][[[00221.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Hexadecimal Integer Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00223.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00224.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00225.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A base-16 number using any combination of the digits '''0'''through '''9'''and the lowercase letters '''a'''through '''f'''or the uppercase letters '''A'''through '''F'''. The lowercase and uppercase representations of any given hexadecimal letter are equivalent.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Hexadecimal-Integer-Literal'''':'' <br />''Unqualified-Hexadecimal-Integer-Literal'' <br />''Qualified-Hexadecimal-Integer-Literal'' <br /> <br />''Unqualified-Hexadecimal-Integer-Literal:'' <br />''Decimal-Digit'' <br />''Hexadecimal-Integer-Literal Decimal-Digit'' <br />''Hexadecimal-Integer-Literal Hexadecimal-Digit'' <br /> <br />''Qualified-Hexadecimal-Integer-Literal:'' <br />''Unqualified-Hexadecimal-Integer-Literal Hexadecimal-Radix'' <br /> <br />''Decimal-Digit:'' one of: '''<br />0 1 2 3 4 5 6 7 8 9 <br />''' <br />''Hexadecimal-Digit:'' one of: '''<br />a b c d e f <br />A B C D E F <br />''' <br />''Hexadecimal-Radix:'' <br />'''h''' <br />'''H''' <br />
 |  | 
|  |   |  | 
|  | [[[00220.htm|prev]]][[[00222.htm|next]]][[[00220.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00223.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00224.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00225.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00221.htm|prev]]][[[00223.htm|next]]][[[00220.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Hexadecimal-Integer-Literal'''':'' <br />''Unqualified-Hexadecimal-Integer-Literal'' <br />''Qualified-Hexadecimal-Integer-Literal'' <br /> <br />''Unqualified-Hexadecimal-Integer-Literal:'' <br />''Decimal-Digit'' <br />''Hexadecimal-Integer-Literal Decimal-Digit'' <br />''Hexadecimal-Integer-Literal Hexadecimal-Digit'' <br /> <br />''Qualified-Hexadecimal-Integer-Literal:'' <br />''Unqualified-Hexadecimal-Integer-Literal Hexadecimal-Radix'' <br /> <br />''Decimal-Digit:'' one of: '''<br />0 1 2 3 4 5 6 7 8 9 <br />''' <br />''Hexadecimal-Digit:'' one of: '''<br />a b c d e f <br />A B C D E F <br />''' <br />''Hexadecimal-Radix:'' <br />'''h''' <br />'''H''' <br />
 |  | 
|  |   |  | 
|  | [[[00222.htm|prev]]][[[00224.htm|next]]][[[00220.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A base-16 number using any combination of the digits '''0'''through '''9'''and the lowercase letters '''a'''through '''f'''or the uppercase letters '''A'''through '''F'''. The lowercase and uppercase representations of any given hexadecimal letter are equivalent.
 |  | 
|  |   |  | 
|  | [[[00223.htm|prev]]][[[00225.htm|next]]][[[00220.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | A hexadecimal integer literal may not begin with any of the alphabetic hexadecimal characters or it will be interpreted as an identifier; such numbers must be prefixed with the ''0''digit.
 |  | 
|  |   |  | 
|  | [[[00224.htm|prev]]][[[00226.htm|next]]][[[00220.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | The following are examples of unqualified hexadecimal integer literals:
 |  | 
|  |   |  | 
|  | 01BD <br />9A <br />0AB <br />
 |  | 
|  |   |  | 
|  | The following are examples of qualified hexadecimal integer literals:
 |  | 
|  |   |  | 
|  | 1234ABCDh <br />01DH <br />0bh <br />1111FFFFH <br />
 |  | 
|  |   |  | 
|  | [[[00225.htm|prev]]][[[00227.htm|next]]][[[00199.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Floating-Point Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''floating-point literal''is a notation for representing real numbers. The assembler provides both decimal and hexadecimal floating-point notations for representing real numbers.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Floating-Point-Literal'''':'' <br />[[00229.htm|''Decimal-Floating-Point-Literal'']] <br />[[00235.htm|''Hexadecimal-Floating-Point-Literal'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00226.htm|prev]]][[[00228.htm|next]]][[[00226.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''floating-point literal''is a notation for representing real numbers. The assembler provides both decimal and hexadecimal floating-point notations for representing real numbers.
 |  | 
|  |   |  | 
|  | [[[00227.htm|prev]]][[[00229.htm|next]]][[[00226.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Floating-Point-Literal'''':'' <br />[[00229.htm|''Decimal-Floating-Point-Literal'']] <br />[[00235.htm|''Hexadecimal-Floating-Point-Literal'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00228.htm|prev]]][[[00230.htm|next]]][[[00226.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Decimal Floating-Point Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00232.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00233.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00234.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A decimal floating-point literal has a ''significand part''that may be followed by an ''exponent part''. The significand part consists of a digit sequence representing the whole-number part, followed by a period (.), followed by a digit sequence representing the fraction part. The exponent part consists of an introductory character ('''e'''or '''E'''), followed by an optional sign character ('''+'''or '''-'''), followed by a digit sequence representing the exponent.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Decimal-Floating-Point-Literal'''':'' <br />''Significand-Part'' <br />''Significand-Part Exponent-Part'' <br /> <br />''Significand-Part:'' <br />''Digit-Sequence'''''.'''''Digit-Sequence'' <br />''Digit-Sequence'''''.''' <br /> <br />''Exponent-Part:'' <br />''E-Character Digit-Sequence'' <br />''E-Character Sign Digit-Sequence'' <br /> <br />''E-Character:'' <br />'''e''' <br />'''E''' <br /> <br />''Sign:'' <br />'''-''' <br />'''+''' <br /> <br />''Digit-Sequence:'' <br />''Digit'' <br />''Digit-Sequence Digit'' <br /> <br />''Digit:'' one of: '''<br />0 1 2 3 4 5 6 7 8 9 <br />''' <br />
 |  | 
|  |   |  | 
|  | [[[00229.htm|prev]]][[[00231.htm|next]]][[[00229.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00232.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00233.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00234.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00230.htm|prev]]][[[00232.htm|next]]][[[00229.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Decimal-Floating-Point-Literal'''':'' <br />''Significand-Part'' <br />''Significand-Part Exponent-Part'' <br /> <br />''Significand-Part:'' <br />''Digit-Sequence'''''.'''''Digit-Sequence'' <br />''Digit-Sequence'''''.''' <br /> <br />''Exponent-Part:'' <br />''E-Character Digit-Sequence'' <br />''E-Character Sign Digit-Sequence'' <br /> <br />''E-Character:'' <br />'''e''' <br />'''E''' <br /> <br />''Sign:'' <br />'''-''' <br />'''+''' <br /> <br />''Digit-Sequence:'' <br />''Digit'' <br />''Digit-Sequence Digit'' <br /> <br />''Digit:'' one of: '''<br />0 1 2 3 4 5 6 7 8 9 <br />''' <br />
 |  | 
|  |   |  | 
|  | [[[00231.htm|prev]]][[[00233.htm|next]]][[[00229.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A decimal floating-point literal has a ''significand part''that may be followed by an ''exponent part''. The significand part consists of a digit sequence representing the whole-number part, followed by a period (.), followed by a digit sequence representing the fraction part. The exponent part consists of an introductory character ('''e'''or '''E'''), followed by an optional sign character ('''+'''or '''-'''), followed by a digit sequence representing the exponent.
 |  | 
|  |   |  | 
|  | [[[00232.htm|prev]]][[[00234.htm|next]]][[[00229.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The introductory ''Digit-Sequence''in the ''Significand-Part''must be specified ( the literal cannot begin with a ".").
 |  | 
|  |   |  | 
|  | [[[00233.htm|prev]]][[[00235.htm|next]]][[[00229.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   25 . 23 
 |  | 
|  |    2 . 523E1 
 |  | 
|  |    2523 . 0E - 2 </pre>
 |  | 
|  | [[[00234.htm|prev]]][[[00236.htm|next]]][[[00226.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Hexadecimal Floating-Point Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00238.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00239.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00240.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A hexadecimal floating-point literal provides a means of initializing floating point values using a notation more closely tied to the internal machine representation than that of the [[00229.htm|''Decimal-Floating-Point-Literal'']]. Such literals are coded in a fashion similar to that of a normal [[00220.htm|''Hexadecimal-Integer-Literal'']], but a different radix suffix is used to inform the assembler that the value is to be used in the allocation of real numbers rather than integers.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Hexadecimal-Floating-Point-Literal'''':'' <br />''Hexadecimal-Literal Float-Radix'' <br /> <br />''Hexadecimal-Literal:'' <br />''Decimal-Digit'' <br />''Hexadecimal-Literal Decimal-Digit'' <br />''Hexadecimal-Literal Hexadecimal-Digit'' <br /> <br />''Decimal-Digit:'' one of: '''<br />0 1 2 3 4 5 6 7 8 9 <br />''' <br />''Hexadecimal-Digit:'' one of: '''<br />a b c d e f <br />A B C D E F <br />''' <br />''Float-Radix:'' <br />'''r''' <br />'''R''' <br />
 |  | 
|  |   |  | 
|  | [[[00235.htm|prev]]][[[00237.htm|next]]][[[00235.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00238.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00239.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00240.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00236.htm|prev]]][[[00238.htm|next]]][[[00235.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Hexadecimal-Floating-Point-Literal'''':'' <br />''Hexadecimal-Literal Float-Radix'' <br /> <br />''Hexadecimal-Literal:'' <br />''Decimal-Digit'' <br />''Hexadecimal-Literal Decimal-Digit'' <br />''Hexadecimal-Literal Hexadecimal-Digit'' <br /> <br />''Decimal-Digit:'' one of: '''<br />0 1 2 3 4 5 6 7 8 9 <br />''' <br />''Hexadecimal-Digit:'' one of: '''<br />a b c d e f <br />A B C D E F <br />''' <br />''Float-Radix:'' <br />'''r''' <br />'''R''' <br />
 |  | 
|  |   |  | 
|  | [[[00237.htm|prev]]][[[00239.htm|next]]][[[00235.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A hexadecimal floating-point literal provides a means of initializing floating point values using a notation more closely tied to the internal machine representation than that of the [[00229.htm|''Decimal-Floating-Point-Literal'']]. Such literals are coded in a fashion similar to that of a normal [[00220.htm|''Hexadecimal-Integer-Literal'']], but a different radix suffix is used to inform the assembler that the value is to be used in the allocation of real numbers rather than integers.
 |  | 
|  |   |  | 
|  | [[[00238.htm|prev]]][[[00240.htm|next]]][[[00235.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | A hexadecimal floating-point literal may not begin with any of the alphabetic hexadecimal characters or it will be interpreted as an identifier; such numbers must be prefixed with the '''''0''digit.'''
 |  | 
|  |   |  | 
|  | The literal must specify the correct number of hexadecimal digits according to the size of the real-number data-type to which it will be assigned. For '''REAL4''', '''REAL8''', and '''REAL10'''variables, the respective number of digits in the literal must be 8, 16, and 20. For literals encoded with a leading zero, the respective number of digits must be 9, 17, and 21.
 |  | 
|  |   |  | 
|  | [[[00239.htm|prev]]][[[00241.htm|next]]][[[00235.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>3F800000r </pre>
 |  | 
|  | [[[00240.htm|prev]]][[[00242.htm|next]]][[[00199.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === String Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00244.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00245.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''string literal''contains a sequence of zero or more characters enclosed in quotation mark symbols. Either a single (') or double (") quotation mark symbol may be used as the '''''quote character''that opens and closes the string literal. If a single quotation mark symbol is used as the quote character, then double quotation mark symbols may appear as data characters within the string literal, and vice versa. If the quote character must also appear as a character within the string literal, use two adjacent quote characters; this will allow a single occurrence of the quote character to be inserted into the string literal.''''''
 |  | 
|  |   |  | 
|  | A quote character must be used to terminate the string literal before the end of the line is reached, otherwise an error message is issued and the literal is terminated by the end of line character. A string literal may span multiple lines only if a backslash (\) appears as the last non- whitespace character on the line, in which case the backslash, all surrounding whitespace characters, and the end of line character are deleted and the literal is continued with the first character on the next line.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''String-Literal'''':'' <br />''D-String'' <br />''S-String'' <br /> <br />''D-String'''':'' <br />''D-Quote D-Quote'' <br />''D-Quote D-Char-Sequence D-Quote'' <br /> <br />''S-String'''':'' <br />''S-Quote S-Quote'' <br />''S-Quote S-Char-Sequence S-Quote'' <br /> <br />''D-Char-Sequence'''':'' <br />any printable character except ''D-Quote'' <br />''D-Quote D-Quote'' <br /> <br />''S-Char-Sequence'''':'' <br />any printable character except ''S-Quote'' <br />''S-Quote S-Quote'' <br /> <br />''D-Quote'''':'' <br />'''"''' <br /> <br />''S-Quote'''':'' <br />''''''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00241.htm|prev]]][[[00243.htm|next]]][[[00241.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00244.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00245.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00242.htm|prev]]][[[00244.htm|next]]][[[00241.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''String-Literal'''':'' <br />''D-String'' <br />''S-String'' <br /> <br />''D-String'''':'' <br />''D-Quote D-Quote'' <br />''D-Quote D-Char-Sequence D-Quote'' <br /> <br />''S-String'''':'' <br />''S-Quote S-Quote'' <br />''S-Quote S-Char-Sequence S-Quote'' <br /> <br />''D-Char-Sequence'''':'' <br />any printable character except ''D-Quote'' <br />''D-Quote D-Quote'' <br /> <br />''S-Char-Sequence'''':'' <br />any printable character except ''S-Quote'' <br />''S-Quote S-Quote'' <br /> <br />''D-Quote'''':'' <br />'''"''' <br /> <br />''S-Quote'''':'' <br />''''''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00243.htm|prev]]][[[00245.htm|next]]][[[00241.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A '''''string literal''contains a sequence of zero or more characters enclosed in quotation mark symbols. Either a single (') or double (") quotation mark symbol may be used as the '''''quote character''that opens and closes the string literal. If a single quotation mark symbol is used as the quote character, then double quotation mark symbols may appear as data characters within the string literal, and vice versa. If the quote character must also appear as a character within the string literal, use two adjacent quote characters; this will allow a single occurrence of the quote character to be inserted into the string literal.''''''
 |  | 
|  |   |  | 
|  | A quote character must be used to terminate the string literal before the end of the line is reached, otherwise an error message is issued and the literal is terminated by the end of line character. A string literal may span multiple lines only if a backslash (\) appears as the last non- whitespace character on the line, in which case the backslash, all surrounding whitespace characters, and the end of line character are deleted and the literal is continued with the first character on the next line.
 |  | 
|  |   |  | 
|  | [[[00244.htm|prev]]][[[00246.htm|next]]][[[00241.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>'Hello, world'
 |  | 
|  | "That's the way it is"
 |  | 
|  | 'Unless it''s not'
 |  | 
|  | "SuperStringCon \
 |  | 
|  | catenated"</pre>
 |  | 
|  | [[[00245.htm|prev]]][[[00247.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Punctuators ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | Punctuators are used as operators and separator characters.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Punctuator'''':'' one of '''<br />[ ] ( ) { } * , : = ; %''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00246.htm|prev]]][[[00248.htm|next]]][[[00246.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | Punctuators are used as operators and separator characters.
 |  | 
|  |   |  | 
|  | [[[00247.htm|prev]]][[[00249.htm|next]]][[[00246.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Punctuator'''':'' one of '''<br />[ ] ( ) { } * , : = ; %''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00248.htm|prev]]][[[00250.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Declarations ===
 |  | 
|  |   |  | 
|  | A ''Type Declaration''is a language construct that specifies the characteristics of code and data objects used in a program.
 |  | 
|  |   |  | 
|  | [[[00249.htm|prev]]][[[00251.htm|next]]][[[00249.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Type Declarations ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A ''Type-Declaration''is a common construct used in various assembler directives to establish type attribute information for a program object. A ''Type-Declaration''is needed to determine the data type of a variable or labeled address. The [[00783.htm|TYPEDEF]]directive offers a method of assigning a name to a ''Type-Declaration''.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Type-Declaration'''':'' <br />''TypeName'' <br />''TypeName''''Array-Spec'' <br />''Pointer-Spec'' <br />''Pointer-Spec''''TypeName'' <br />''Pointer-Spec''''TypeName''''Array-Spec'' <br /> <br />''Pointer-Spec'''':'' <br />'''PTR''' <br />[[00128.htm|''Distance-TypeName'']]'''PTR''' <br />''Pointer-Spec''''Array-Spec'' <br /> <br />''Array-Spec'''':'' <br />'''['''[[00255.htm|''Expression'']]''']''' <br />''Array-Spec'''''['''[[00255.htm|''Expression'']]''']''' <br /> <br />''TypeName'''':'' <br />[[00128.htm|''Distance-TypeName'']] <br />[[00125.htm|''Scalar-TypeName'']] <br />[[00171.htm|''UserDefined-TypeName'']] <br /> <br />
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''TYPEDEF'''directive is used to illustrate the type declaration syntax: <br />
 |  | 
|  |   |  | 
|  | <pre>CHAR        typedef   byte               ;   Alias   of   intrinsic   TypeName 
 |  | 
|  | PBYTE       typedef   ptr   byte          ;   Pointer   to   intrinsic   TypeName 
 |  | 
|  | PCHAR       typedef   ptr   CHAR          ;   Pointer   to   TypeDef - TypeName 
 |  | 
|  | PPCHAR      typedef   ptr   PCHAR         ;   Pointer   to   a   pointer   to   a   CHAR 
 |  | 
|  | PPBYTE      typedef   ptr   ptr   byte      ;   Similar   to   PPCHAR 
 |  | 
|  | PVOID       typedef   ptr                ;   Pointer   to   nothing   ( pointer   to   code ) 
 |  | 
|  | PCODE       typedef   ptr   PROC          ;   Similar   to   PVOID 
 |  | 
|  | PFCODE      typedef   far   ptr   far       ;   Far   pointer   to   far   code   address 
 |  | 
|  |   |  | 
|  | ;   vector   declarations 
 |  | 
|  |   |  | 
|  | ACHAR       typedef   CHAR [ 16 ]          ;   Array   of   16   characters 
 |  | 
|  | AAWORD      typedef   word [ 2 ] [ 2 ]        ;   multi - dimensional   array 
 |  | 
|  | APBYTE      typedef   ptr [ 8 ]   byte       ;   Array   of   8   pointers   to   byte 
 |  | 
|  | APACHAR     typedef   ptr [ 4 ]   ACHAR      ;   Array   of   4   ptrs   to   arrays   of   16   chars 
 |  | 
|  |   |  | 
|  | SIZES _ T     struct                     ;   define   an   intrinsic   structure   type 
 |  | 
|  |    little    byte      ? 
 |  | 
|  |    Medium    word      ? 
 |  | 
|  |    BIG       dword     ? 
 |  | 
|  | SIZES _ T     ends 
 |  | 
|  |   |  | 
|  | SIZES       typedef   SIZES _ T           ;   alias   for   intrinsic   structure   type 
 |  | 
|  | PSIZES      typedef   ptr   SIZES _ T       ;   and   a   type   to   point   to   it 
 |  | 
|  |   |  | 
|  | PFORWARD    typedef   ptr   FORWARD       ;   Pointers   to   forward - referenced   types 
 |  | 
|  | FORWARD     struct                     ;   are   assumed   to   be   pointers   to   structs 
 |  | 
|  |    blah      word      ? 
 |  | 
|  | FORWARD     ends </pre>
 |  | 
|  | [[[00250.htm|prev]]][[[00252.htm|next]]][[[00250.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Type-Declaration''is a common construct used in various assembler directives to establish type attribute information for a program object. A ''Type-Declaration''is needed to determine the data type of a variable or labeled address. The [[00783.htm|TYPEDEF]]directive offers a method of assigning a name to a ''Type-Declaration''.
 |  | 
|  |   |  | 
|  | [[[00251.htm|prev]]][[[00253.htm|next]]][[[00250.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Type-Declaration'''':'' <br />''TypeName'' <br />''TypeName''''Array-Spec'' <br />''Pointer-Spec'' <br />''Pointer-Spec''''TypeName'' <br />''Pointer-Spec''''TypeName''''Array-Spec'' <br /> <br />''Pointer-Spec'''':'' <br />'''PTR''' <br />[[00128.htm|''Distance-TypeName'']]'''PTR''' <br />''Pointer-Spec''''Array-Spec'' <br /> <br />''Array-Spec'''':'' <br />'''['''[[00255.htm|''Expression'']]''']''' <br />''Array-Spec'''''['''[[00255.htm|''Expression'']]''']''' <br /> <br />''TypeName'''':'' <br />[[00128.htm|''Distance-TypeName'']] <br />[[00125.htm|''Scalar-TypeName'']] <br />[[00171.htm|''UserDefined-TypeName'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00252.htm|prev]]][[[00254.htm|next]]][[[00250.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | The '''TYPEDEF'''directive is used to illustrate the type declaration syntax: <br />
 |  | 
|  |   |  | 
|  | <pre>CHAR        typedef   byte               ;   Alias   of   intrinsic   TypeName 
 |  | 
|  | PBYTE       typedef   ptr   byte          ;   Pointer   to   intrinsic   TypeName 
 |  | 
|  | PCHAR       typedef   ptr   CHAR          ;   Pointer   to   TypeDef - TypeName 
 |  | 
|  | PPCHAR      typedef   ptr   PCHAR         ;   Pointer   to   a   pointer   to   a   CHAR 
 |  | 
|  | PPBYTE      typedef   ptr   ptr   byte      ;   Similar   to   PPCHAR 
 |  | 
|  | PVOID       typedef   ptr                ;   Pointer   to   nothing   ( pointer   to   code ) 
 |  | 
|  | PCODE       typedef   ptr   PROC          ;   Similar   to   PVOID 
 |  | 
|  | PFCODE      typedef   far   ptr   far       ;   Far   pointer   to   far   code   address 
 |  | 
|  |   |  | 
|  | ;   vector   declarations 
 |  | 
|  |   |  | 
|  | ACHAR       typedef   CHAR [ 16 ]          ;   Array   of   16   characters 
 |  | 
|  | AAWORD      typedef   word [ 2 ] [ 2 ]        ;   multi - dimensional   array 
 |  | 
|  | APBYTE      typedef   ptr [ 8 ]   byte       ;   Array   of   8   pointers   to   byte 
 |  | 
|  | APACHAR     typedef   ptr [ 4 ]   ACHAR      ;   Array   of   4   ptrs   to   arrays   of   16   chars 
 |  | 
|  |   |  | 
|  | SIZES _ T     struct                     ;   define   an   intrinsic   structure   type 
 |  | 
|  |    little    byte      ? 
 |  | 
|  |    Medium    word      ? 
 |  | 
|  |    BIG       dword     ? 
 |  | 
|  | SIZES _ T     ends 
 |  | 
|  |   |  | 
|  | SIZES       typedef   SIZES _ T           ;   alias   for   intrinsic   structure   type 
 |  | 
|  | PSIZES      typedef   ptr   SIZES _ T       ;   and   a   type   to   point   to   it 
 |  | 
|  |   |  | 
|  | PFORWARD    typedef   ptr   FORWARD       ;   Pointers   to   forward - referenced   types 
 |  | 
|  | FORWARD     struct                     ;   are   assumed   to   be   pointers   to   structs 
 |  | 
|  |    blah      word      ? 
 |  | 
|  | FORWARD     ends </pre>
 |  | 
|  | [[[00253.htm|prev]]][[[00255.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Expressions ===
 |  | 
|  |   |  | 
|  | An expression is a sequence of ''operators''and ''operands''that are evaluated to derive a numeric result, an effective address, or a register operand.
 |  | 
|  |   |  | 
|  | Expressions are specified using standard infix notation, which is recursive in nature, ie., expressions may be nested within other expressions. The evaluation of an expression occurs in a left to right manner, and is influenced by the rules of operator ''precedence''and ''associativity''. The order in which expressions are evaluated can be controlled by grouping operands and operators together using parentheses ().
 |  | 
|  |   |  | 
|  | [[[00254.htm|prev]]][[[00256.htm|next]]][[[00254.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Expression Syntax ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | This section describes the complete expression syntax.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Expression'''':'' <br />[[00258.htm|''Duplicative-Expression'']] <br /> <br />[[00258.htm|''Duplicative-Expression'']]'':'' <br />[[00267.htm|''Attribute-Expression'']] <br />[[00267.htm|''Attribute-Expression'']][[00261.htm|DUP]]'''('''''Initializer-List''''')''' <br /> <br />[[00267.htm|''Attribute-Expression'']]'':'' <br />[[00287.htm|''OR-Expression'']] <br />[[00281.htm|SHORT]][[00359.htm|''Additive-Expression'']] <br />[[00270.htm|.TYPE]][[00287.htm|''OR-Expression'']] <br />[[00275.htm|OPATTR]][[00287.htm|''OR-Expression'']] <br /> <br />[[00287.htm|''OR-Expression'']]'':'' <br />[[00302.htm|''AND-Expression'']] <br />[[00287.htm|''OR-Expression'']][[00290.htm|OR]][[00302.htm|''AND-Expression'']] <br />[[00287.htm|''OR-Expression'']][[00296.htm|XOR]][[00302.htm|''AND-Expression'']] <br /> <br />[[00302.htm|''AND-Expression'']]'':'' <br />[[00311.htm|''NOT-Expression'']] <br />[[00302.htm|''AND-Expression'']][[00305.htm|AND]][[00311.htm|''NOT-Expression'']] <br /> <br />[[00311.htm|''NOT-Expression'']]'':'' <br />[[00320.htm|''Relational-Expression'']] <br />[[00314.htm|NOT]][[00320.htm|''Relational-Expression'']] <br /> <br />[[00320.htm|''Relational-Expression'']]'':'' <br />[[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00323.htm|EQ]][[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00329.htm|NE]][[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00335.htm|GT]][[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00341.htm|GE]][[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00347.htm|LT]][[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00353.htm|LE]][[00359.htm|''Additive-Expression'']] <br /> <br />[[00359.htm|''Additive-Expression'']]'':'' <br />[[00374.htm|''Multiplicative-Expression'']] <br />[[00359.htm|''Additive-Expression'']][[00362.htm|+]][[00374.htm|''Multiplicative-Expression'']] <br />[[00359.htm|''Additive-Expression'']][[00368.htm|-]][[00374.htm|''Multiplicative-Expression'']] <br /> <br />[[00374.htm|''Multiplicative-Expression'']]'':'' <br />[[00407.htm|''Narrowed-Expression'']] <br />[[00374.htm|''Multiplicative-Expression'']][[00377.htm|*]][[00407.htm|''Narrowed-Expression'']] <br />[[00374.htm|''Multiplicative-Expression'']][[00383.htm|/]][[00407.htm|''Narrowed-Expression'']] <br />[[00374.htm|''Multiplicative-Expression'']][[00389.htm|MOD]][[00407.htm|''Narrowed-Expression'']] <br />[[00374.htm|''Multiplicative-Expression'']][[00395.htm|SHL]][[00407.htm|''Narrowed-Expression'']] <br />[[00374.htm|''Multiplicative-Expression'']][[00401.htm|SHR]][[00407.htm|''Narrowed-Expression'']] <br /> <br />[[00407.htm|''Narrowed-Expression'']]'':'' <br />[[00434.htm|''Cast-Expression'']] <br />[[00410.htm|HIGH]][[00434.htm|''Cast-Expression'']] <br />[[00416.htm|HIGHWORD]][[00434.htm|''Cast-Expression'']] <br />[[00422.htm|LOW]][[00434.htm|''Cast-Expression'']] <br />[[00428.htm|LOWWORD]][[00434.htm|''Cast-Expression'']] <br /> <br />[[00434.htm|''Cast-Expression'']]'':'' <br />[[00473.htm|''Element-Selection-Expression'']] <br />[[00437.htm|OFFSET]][[00434.htm|''Cast-Expression'']] <br />[[00443.htm|SEG]][[00434.htm|''Cast-Expression'']] <br />[[00449.htm|THIS]][[00473.htm|''Element-Selection-Expression'']] <br />[[00455.htm|TYPE]][[00473.htm|''Element-Selection-Expression'']] <br />[[00434.htm|''Cast-Expression'']][[00461.htm|PTR]][[00434.htm|''Cast-Expression'']] <br />[[00434.htm|''Cast-Expression'']][[00467.htm|:]][[00434.htm|''Cast-Expression'']] <br /> <br />[[00473.htm|''Element-Selection-Expression'']]'':'' <br />[[00488.htm|''Sign-Expression'']] <br />[[00473.htm|''Element-Selection-Expression'']][[00476.htm|[]][[00488.htm|''Sign-Expression'']][[00476.htm|00476.htm]]] <br />[[00473.htm|''Element-Selection-Expression'']][[00482.htm|.]][[00488.htm|''Sign-Expression'']] <br /> <br />[[00488.htm|''Sign-Expression'']]'':'' <br />[[00503.htm|''Primary-Expression'']] <br />[[00491.htm|-]][[00503.htm|''Primary-Expression'']] <br />[[00497.htm|+]][[00503.htm|''Primary-Expression'']] <br /> <br />[[00503.htm|''Primary-Expression'']]'':'' <br />[[00506.htm|''Literal-Operand'']] <br />[[00516.htm|''Record-Constant'']] <br />[[00527.htm|''Identifier-Operand'']] <br />[[00522.htm|''Register-Operand'']] <br />[[00532.htm|''Integral-TypeName-Operand'']] <br />[[00511.htm|''Value-Substitution-Operand'']] <br />[[00537.htm|LENGTH]][[00527.htm|''Identifier-Operand'']] <br />[[00542.htm|LENGTHOF]][[00527.htm|''Identifier-Operand'']] <br />[[00548.htm|MASK]][[00527.htm|''Identifier-Operand'']] <br />[[00553.htm|SIZE]][[00473.htm|''Element-Selection-Expression'']] <br />[[00558.htm|SIZEOF]][[00473.htm|''Element-Selection-Expression'']] <br />[[00563.htm|WIDTH]][[00527.htm|''Identifier-Operand'']] <br />[[00568.htm|''Parenthesized-Expression'']] <br />[[00573.htm|''Indirected-Expression'']] <br />[[00579.htm|''Compound-Initializer'']] <br /> <br />[[00506.htm|''Literal-Operand'']]'':'' <br />[[00226.htm|''Floating-Point-Literal'']] <br />[[00202.htm|''Integer-Literal'']] <br />[[00241.htm|''String-Literal'']] <br /> <br />[[00516.htm|''Record-Constant'']]'':'' <br />[[00527.htm|''Identifier-Operand'']]'''<'''''Field-List'''''>''' <br />[[00527.htm|''Identifier-Operand'']]'''{'''''Field-List'''''}''' <br /> <br />''Field-List:'' <br />[[00267.htm|''Attribute-Expression'']] <br />''Field-List''''','''[[00267.htm|''Attribute-Expression'']] <br /> <br />[[00527.htm|''Identifier-Operand'']]'':'' <br />[[00149.htm|''Identifier'']] <br /> <br />[[00522.htm|''Register-Operand'']]'':'' <br />[[00122.htm|''Processor-Register'']] <br /> <br />[[00532.htm|''Integral-TypeName-Operand'']]'':'' <br />[[00125.htm|''Scalar-TypeName'']] <br />[[00128.htm|''Distance-TypeName'']] <br /> <br />[[00511.htm|''Value-Substitution-Operand'']]'':'' <br />[[00134.htm|''Anonymous-Label-Alias'']] <br />[[00137.htm|''Location-Counter-Alias'']] <br />[[00140.htm|''Indeterminate-Value-Alias'']] <br />'''FLAT''' <br /> <br />[[00568.htm|''Parenthesized-Expression'']]'':'' <br />'''('''[[00267.htm|''Attribute-Expression'']]''')''' <br /> <br />[[00573.htm|''Indirected-Expression'']]'':'' <br />'''['''[[00267.htm|''Attribute-Expression'']]''']''' <br /> <br />[[00579.htm|''Compound-Initializer'']]'':'' <br />'''<'''''Initializer-List'''''>''' <br />'''{'''''Initializer-List'''''}''' <br /> <br />''Initializer-List:'' <br />[[00258.htm|''Duplicative-Expression'']] <br />''Initializer-List''''','''[[00258.htm|''Duplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00255.htm|prev]]][[[00257.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | This section describes the complete expression syntax.
 |  | 
|  |   |  | 
|  | [[[00256.htm|prev]]][[[00258.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Expression'''':'' <br />[[00258.htm|''Duplicative-Expression'']] <br /> <br />[[00258.htm|''Duplicative-Expression'']]'':'' <br />[[00267.htm|''Attribute-Expression'']] <br />[[00267.htm|''Attribute-Expression'']][[00261.htm|DUP]]'''('''''Initializer-List''''')''' <br /> <br />[[00267.htm|''Attribute-Expression'']]'':'' <br />[[00287.htm|''OR-Expression'']] <br />[[00281.htm|SHORT]][[00359.htm|''Additive-Expression'']] <br />[[00270.htm|.TYPE]][[00287.htm|''OR-Expression'']] <br />[[00275.htm|OPATTR]][[00287.htm|''OR-Expression'']] <br /> <br />[[00287.htm|''OR-Expression'']]'':'' <br />[[00302.htm|''AND-Expression'']] <br />[[00287.htm|''OR-Expression'']][[00290.htm|OR]][[00302.htm|''AND-Expression'']] <br />[[00287.htm|''OR-Expression'']][[00296.htm|XOR]][[00302.htm|''AND-Expression'']] <br /> <br />[[00302.htm|''AND-Expression'']]'':'' <br />[[00311.htm|''NOT-Expression'']] <br />[[00302.htm|''AND-Expression'']][[00305.htm|AND]][[00311.htm|''NOT-Expression'']] <br /> <br />[[00311.htm|''NOT-Expression'']]'':'' <br />[[00320.htm|''Relational-Expression'']] <br />[[00314.htm|NOT]][[00320.htm|''Relational-Expression'']] <br /> <br />[[00320.htm|''Relational-Expression'']]'':'' <br />[[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00323.htm|EQ]][[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00329.htm|NE]][[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00335.htm|GT]][[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00341.htm|GE]][[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00347.htm|LT]][[00359.htm|''Additive-Expression'']] <br />[[00320.htm|''Relational-Expression'']][[00353.htm|LE]][[00359.htm|''Additive-Expression'']] <br /> <br />[[00359.htm|''Additive-Expression'']]'':'' <br />[[00374.htm|''Multiplicative-Expression'']] <br />[[00359.htm|''Additive-Expression'']][[00362.htm|+]][[00374.htm|''Multiplicative-Expression'']] <br />[[00359.htm|''Additive-Expression'']][[00368.htm|-]][[00374.htm|''Multiplicative-Expression'']] <br /> <br />[[00374.htm|''Multiplicative-Expression'']]'':'' <br />[[00407.htm|''Narrowed-Expression'']] <br />[[00374.htm|''Multiplicative-Expression'']][[00377.htm|*]][[00407.htm|''Narrowed-Expression'']] <br />[[00374.htm|''Multiplicative-Expression'']][[00383.htm|/]][[00407.htm|''Narrowed-Expression'']] <br />[[00374.htm|''Multiplicative-Expression'']][[00389.htm|MOD]][[00407.htm|''Narrowed-Expression'']] <br />[[00374.htm|''Multiplicative-Expression'']][[00395.htm|SHL]][[00407.htm|''Narrowed-Expression'']] <br />[[00374.htm|''Multiplicative-Expression'']][[00401.htm|SHR]][[00407.htm|''Narrowed-Expression'']] <br /> <br />[[00407.htm|''Narrowed-Expression'']]'':'' <br />[[00434.htm|''Cast-Expression'']] <br />[[00410.htm|HIGH]][[00434.htm|''Cast-Expression'']] <br />[[00416.htm|HIGHWORD]][[00434.htm|''Cast-Expression'']] <br />[[00422.htm|LOW]][[00434.htm|''Cast-Expression'']] <br />[[00428.htm|LOWWORD]][[00434.htm|''Cast-Expression'']] <br /> <br />[[00434.htm|''Cast-Expression'']]'':'' <br />[[00473.htm|''Element-Selection-Expression'']] <br />[[00437.htm|OFFSET]][[00434.htm|''Cast-Expression'']] <br />[[00443.htm|SEG]][[00434.htm|''Cast-Expression'']] <br />[[00449.htm|THIS]][[00473.htm|''Element-Selection-Expression'']] <br />[[00455.htm|TYPE]][[00473.htm|''Element-Selection-Expression'']] <br />[[00434.htm|''Cast-Expression'']][[00461.htm|PTR]][[00434.htm|''Cast-Expression'']] <br />[[00434.htm|''Cast-Expression'']][[00467.htm|:]][[00434.htm|''Cast-Expression'']] <br /> <br />[[00473.htm|''Element-Selection-Expression'']]'':'' <br />[[00488.htm|''Sign-Expression'']] <br />[[00473.htm|''Element-Selection-Expression'']][[00476.htm|[]][[00488.htm|''Sign-Expression'']][[00476.htm|00476.htm]]] <br />[[00473.htm|''Element-Selection-Expression'']][[00482.htm|.]][[00488.htm|''Sign-Expression'']] <br /> <br />[[00488.htm|''Sign-Expression'']]'':'' <br />[[00503.htm|''Primary-Expression'']] <br />[[00491.htm|-]][[00503.htm|''Primary-Expression'']] <br />[[00497.htm|+]][[00503.htm|''Primary-Expression'']] <br /> <br />[[00503.htm|''Primary-Expression'']]'':'' <br />[[00506.htm|''Literal-Operand'']] <br />[[00516.htm|''Record-Constant'']] <br />[[00527.htm|''Identifier-Operand'']] <br />[[00522.htm|''Register-Operand'']] <br />[[00532.htm|''Integral-TypeName-Operand'']] <br />[[00511.htm|''Value-Substitution-Operand'']] <br />[[00537.htm|LENGTH]][[00527.htm|''Identifier-Operand'']] <br />[[00542.htm|LENGTHOF]][[00527.htm|''Identifier-Operand'']] <br />[[00548.htm|MASK]][[00527.htm|''Identifier-Operand'']] <br />[[00553.htm|SIZE]][[00473.htm|''Element-Selection-Expression'']] <br />[[00558.htm|SIZEOF]][[00473.htm|''Element-Selection-Expression'']] <br />[[00563.htm|WIDTH]][[00527.htm|''Identifier-Operand'']] <br />[[00568.htm|''Parenthesized-Expression'']] <br />[[00573.htm|''Indirected-Expression'']] <br />[[00579.htm|''Compound-Initializer'']] <br /> <br />[[00506.htm|''Literal-Operand'']]'':'' <br />[[00226.htm|''Floating-Point-Literal'']] <br />[[00202.htm|''Integer-Literal'']] <br />[[00241.htm|''String-Literal'']] <br /> <br />[[00516.htm|''Record-Constant'']]'':'' <br />[[00527.htm|''Identifier-Operand'']]'''<'''''Field-List'''''>''' <br />[[00527.htm|''Identifier-Operand'']]'''{'''''Field-List'''''}''' <br /> <br />''Field-List:'' <br />[[00267.htm|''Attribute-Expression'']] <br />''Field-List''''','''[[00267.htm|''Attribute-Expression'']] <br /> <br />[[00527.htm|''Identifier-Operand'']]'':'' <br />[[00149.htm|''Identifier'']] <br /> <br />[[00522.htm|''Register-Operand'']]'':'' <br />[[00122.htm|''Processor-Register'']] <br /> <br />[[00532.htm|''Integral-TypeName-Operand'']]'':'' <br />[[00125.htm|''Scalar-TypeName'']] <br />[[00128.htm|''Distance-TypeName'']] <br /> <br />[[00511.htm|''Value-Substitution-Operand'']]'':'' <br />[[00134.htm|''Anonymous-Label-Alias'']] <br />[[00137.htm|''Location-Counter-Alias'']] <br />[[00140.htm|''Indeterminate-Value-Alias'']] <br />'''FLAT''' <br /> <br />[[00568.htm|''Parenthesized-Expression'']]'':'' <br />'''('''[[00267.htm|''Attribute-Expression'']]''')''' <br /> <br />[[00573.htm|''Indirected-Expression'']]'':'' <br />'''['''[[00267.htm|''Attribute-Expression'']]''']''' <br /> <br />[[00579.htm|''Compound-Initializer'']]'':'' <br />'''<'''''Initializer-List'''''>''' <br />'''{'''''Initializer-List'''''}''' <br /> <br />''Initializer-List:'' <br />[[00258.htm|''Duplicative-Expression'']] <br />''Initializer-List''''','''[[00258.htm|''Duplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00257.htm|prev]]][[[00259.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Duplicative Initialization Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Duplicative Initialization Expression''is one that can be optionally used during the initialization of variables such that the operand is duplicated a specified number of times.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Duplicative-Expression'''':'' <br />[[00267.htm|''Attribute-Expression'']] <br />[[00267.htm|''Attribute-Expression'']][[00261.htm|DUP]]'''('''''Initializer-List''''')''' <br /> <br />''Initializer-List:'' <br />''Duplicative-Expression'' <br />''Initializer-List''''','''''Duplicative-Expression'' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00258.htm|prev]]][[[00260.htm|next]]][[[00258.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Duplicative Initialization Expression''is one that can be optionally used during the initialization of variables such that the operand is duplicated a specified number of times.
 |  | 
|  |   |  | 
|  | [[[00259.htm|prev]]][[[00261.htm|next]]][[[00258.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Duplicative-Expression'''':'' <br />[[00267.htm|''Attribute-Expression'']] <br />[[00267.htm|''Attribute-Expression'']][[00261.htm|DUP]]'''('''''Initializer-List''''')''' <br /> <br />''Initializer-List:'' <br />''Duplicative-Expression'' <br />''Initializer-List''''','''''Duplicative-Expression'' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00260.htm|prev]]][[[00262.htm|next]]][[[00258.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Duplicative Initialization (DUP Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00264.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00265.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00266.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''DUP'''operator creates a [[00610.htm|''Duplicated-ExpressionType'']]from the ''Initializer- List''enclosed in parentheses. This construct can be used to create arrays of information during data allocation.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00267.htm|''Attribute-Expression'']]'''DUP ('''''Initializer-List''''')''' <br /> <br />''Initializer-List:'' <br />[[00258.htm|''Duplicative-Expression'']] <br />''Initializer-List''''','''[[00258.htm|''Duplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00261.htm|prev]]][[[00263.htm|next]]][[[00261.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00264.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00265.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00266.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00262.htm|prev]]][[[00264.htm|next]]][[[00261.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00267.htm|''Attribute-Expression'']]'''DUP ('''''Initializer-List''''')''' <br /> <br />''Initializer-List:'' <br />[[00258.htm|''Duplicative-Expression'']] <br />''Initializer-List''''','''[[00258.htm|''Duplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00263.htm|prev]]][[[00265.htm|next]]][[[00261.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''DUP'''operator creates a [[00610.htm|''Duplicated-ExpressionType'']]from the ''Initializer- List''enclosed in parentheses. This construct can be used to create arrays of information during data allocation.
 |  | 
|  |   |  | 
|  | [[[00264.htm|prev]]][[[00266.htm|next]]][[[00261.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The left hand operand of the '''DUP'''operator must evaluate to an [[00599.htm|''Absolute- ExpressionType'']].
 |  | 
|  |   |  | 
|  | Each [[00258.htm|''Duplicative-Expression'']]in the ''Initializer-List''must evaluate to an [[00614.htm|''Initializer-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00265.htm|prev]]][[[00267.htm|next]]][[[00261.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>STR   STRUCT 
 |  | 
|  |    One   BYTE   0 
 |  | 
|  |    Two   BYTE   0 
 |  | 
|  | STR   ENDS 
 |  | 
|  |   |  | 
|  | Array1    WORD    4   DUP   ( 1 ,   2 ,   3 ,   4 )         ;   allocates   16   words 
 |  | 
|  | Array2    STR     8   DUP   ( < 1 ,   2 > )              ;   8   structures </pre>
 |  | 
|  | [[[00266.htm|prev]]][[[00268.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Attribute Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | An '''''Attribute Expression''is one that optionally extracts or modifies one or more of the basic properties of its operand.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Attribute-Expression'''':'' <br />[[00287.htm|''OR-Expression'']] <br />[[00281.htm|SHORT]][[00359.htm|''Additive-Expression'']] <br />[[00270.htm|.TYPE]][[00287.htm|''OR-Expression'']] <br />[[00275.htm|OPATTR]][[00287.htm|''OR-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00267.htm|prev]]][[[00269.htm|next]]][[[00267.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | An ''Attribute Expression''is one that optionally extracts or modifies one or more of the basic properties of its operand.
 |  | 
|  |   |  | 
|  | [[[00268.htm|prev]]][[[00270.htm|next]]][[[00267.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Attribute-Expression'''':'' <br />[[00287.htm|''OR-Expression'']] <br />[[00281.htm|SHORT]][[00359.htm|''Additive-Expression'']] <br />[[00270.htm|.TYPE]][[00287.htm|''OR-Expression'']] <br />[[00275.htm|OPATTR]][[00287.htm|''OR-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00269.htm|prev]]][[[00271.htm|next]]][[[00267.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Expression Descriptor Bitmap (.TYPE Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00273.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00274.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''.TYPE'''operator is considered obsolete. The [[00275.htm|OPATTR]]operator should be used instead.
 |  | 
|  |   |  | 
|  | The '''.TYPE'''operator returns a byte value bitmap that describes various attributes of its operand. The return value is 0 if the expression could not be correctly parsed or evaluated, otherwise the bitmap returned is formatted according to the following table: <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------\
 |  | 
|  | |7|6|5|4|3|2|1|0|BIT SET IF EXPRESSION                             |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | | | | | | |1|Is a Direct-ExpressionType                        |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | | | | | |1| |Is a Indirect-ExpressionType, an                  |
 |  | 
|  | | | | | | | | | |Indexed-ExpressionType, or a combination of both  |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | | | | |1| | |Is an Immediate-ExpressionType                    |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | | | |1| | | |Is an Indirect-ExpressionType                     |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | | |1| | | | |Is a Register-ExpressionType                      |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | |1| | | | | |Was parsed and evaluated without error (no        |
 |  | 
|  | | | | | | | | | |undefined symbols, etc.)                          |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | |1| | | | | | |Is relative to the SS Segment-Register            |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |1| | | | | | | |Contains an External Reference                    |
 |  | 
|  | \------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''.TYPE'''[[00287.htm|''OR-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00270.htm|prev]]][[[00272.htm|next]]][[[00270.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00273.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00274.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00271.htm|prev]]][[[00273.htm|next]]][[[00270.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''.TYPE'''[[00287.htm|''OR-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00272.htm|prev]]][[[00274.htm|next]]][[[00270.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''.TYPE'''operator is considered obsolete. The [[00275.htm|OPATTR]]operator should be used instead.
 |  | 
|  |   |  | 
|  | The '''.TYPE'''operator returns a byte value bitmap that describes various attributes of its operand. The return value is 0 if the expression could not be correctly parsed or evaluated, otherwise the bitmap returned is formatted according to the following table: <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------\
 |  | 
|  | |7|6|5|4|3|2|1|0|BIT SET IF EXPRESSION                             |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | | | | | | |1|Is a Direct-ExpressionType                        |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | | | | | |1| |Is a Indirect-ExpressionType, an                  |
 |  | 
|  | | | | | | | | | |Indexed-ExpressionType, or a combination of both  |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | | | | |1| | |Is an Immediate-ExpressionType                    |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | | | |1| | | |Is an Indirect-ExpressionType                     |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | | |1| | | | |Is a Register-ExpressionType                      |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | | |1| | | | | |Was parsed and evaluated without error (no        |
 |  | 
|  | | | | | | | | | |undefined symbols, etc.)                          |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | | |1| | | | | | |Is relative to the SS Segment-Register            |
 |  | 
|  | |-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |1| | | | | | | |Contains an External Reference                    |
 |  | 
|  | \------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00273.htm|prev]]][[[00275.htm|next]]][[[00270.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>BumpCounter   macro   bump 
 |  | 
|  |    if   ( ( ( . TYPE   ( bump ) )   and   07h )   eq   04h ) 
 |  | 
|  |       Counter   =   Counter   +   bump 
 |  | 
|  |    else 
 |  | 
|  |       . err   < Non - constant   value   passed   to   BumpCounter > 
 |  | 
|  |    endif 
 |  | 
|  | endm </pre>
 |  | 
|  | [[[00274.htm|prev]]][[[00276.htm|next]]][[[00267.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Extended Descriptor Bitmap (OPATTR Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00278.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00279.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00280.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''OPATTR'''operator returns a superset of the information returned by the [[00270.htm|. TYPE]]operator, which should be considered obsolete.
 |  | 
|  |   |  | 
|  | The '''OPATTR'''operator returns a word value bitmap that describes various attributes of its operand. The return value is 0 if the expression could not be correctly parsed or evaluated, otherwise the bitmap returned is formatted according to the following table: <br />
 |  | 
|  |   |  | 
|  | <pre>/----------------------------------------------------------------------\
 |  | 
|  | |A98|7|6|5|4|3|2|1|0|BIT SET IF EXPRESSION                             |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | | | | | | |1|Is a Direct-ExpressionType                        |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | | | | | |1| |Is a Indirect-ExpressionType, an                  |
 |  | 
|  | |   | | | | | | | | |Indexed-ExpressionType, or a combination of both  |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | | | | |1| | |Is an Immediate-ExpressionType                    |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | | | |1| | | |Is an Indirect-ExpressionType                     |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | | |1| | | | |Is a Register-ExpressionType                      |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | |1| | | | | |Was parsed and evaluated without error (no        |
 |  | 
|  | |   | | | | | | | | |undefined symbols, etc.)                          |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | |1| | | | | | |Is relative to the SS Segment-Register            |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   |1| | | | | | | |Contains an External Reference                    |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |LLL| | | | | | | | |Language encoding (described below)               |
 |  | 
|  | \----------------------------------------------------------------------/</pre>
 |  | 
|  | The '''LLL'''field (bits 8, 9, and A) comprise an enumerated value that describes the language attribute assigned to the expression as follows:
 |  | 
|  |   |  | 
|  | ''''''
 |  | 
|  |   |  | 
|  | 000No language attribute used in expression <br />001C <br />010SYSCALL <br />011STDCALL <br />100PASCAL <br />101FORTRAN <br />110BASIC <br />111OPTLINK <br />
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''OPATTR'''[[00287.htm|''OR-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00275.htm|prev]]][[[00277.htm|next]]][[[00275.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00278.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00279.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00280.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00276.htm|prev]]][[[00278.htm|next]]][[[00275.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''OPATTR'''[[00287.htm|''OR-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00277.htm|prev]]][[[00279.htm|next]]][[[00275.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''OPATTR'''operator returns a superset of the information returned by the [[00270.htm|. TYPE]]operator, which should be considered obsolete.
 |  | 
|  |   |  | 
|  | The '''OPATTR'''operator returns a word value bitmap that describes various attributes of its operand. The return value is 0 if the expression could not be correctly parsed or evaluated, otherwise the bitmap returned is formatted according to the following table: <br />
 |  | 
|  |   |  | 
|  | <pre>/----------------------------------------------------------------------\
 |  | 
|  | |A98|7|6|5|4|3|2|1|0|BIT SET IF EXPRESSION                             |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | | | | | | |1|Is a Direct-ExpressionType                        |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | | | | | |1| |Is a Indirect-ExpressionType, an                  |
 |  | 
|  | |   | | | | | | | | |Indexed-ExpressionType, or a combination of both  |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | | | | |1| | |Is an Immediate-ExpressionType                    |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | | | |1| | | |Is an Indirect-ExpressionType                     |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | | |1| | | | |Is a Register-ExpressionType                      |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | | |1| | | | | |Was parsed and evaluated without error (no        |
 |  | 
|  | |   | | | | | | | | |undefined symbols, etc.)                          |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   | |1| | | | | | |Is relative to the SS Segment-Register            |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |   |1| | | | | | | |Contains an External Reference                    |
 |  | 
|  | |---+-+-+-+-+-+-+-+-+--------------------------------------------------|
 |  | 
|  | |LLL| | | | | | | | |Language encoding (described below)               |
 |  | 
|  | \----------------------------------------------------------------------/</pre>
 |  | 
|  | The '''LLL'''field (bits 8, 9, and A) comprise an enumerated value that describes the language attribute assigned to the expression as follows:
 |  | 
|  |   |  | 
|  | ''''''
 |  | 
|  |   |  | 
|  | 000No language attribute used in expression <br />001C <br />010SYSCALL <br />011STDCALL <br />100PASCAL <br />101FORTRAN <br />110BASIC <br />111OPTLINK <br />
 |  | 
|  |   |  | 
|  | [[[00278.htm|prev]]][[[00280.htm|next]]][[[00275.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | This operator is not available in [[00105.htm|M510]]mode.
 |  | 
|  |   |  | 
|  | [[[00279.htm|prev]]][[[00281.htm|next]]][[[00275.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>L _ MASK      equ   011100000000y               ;   mask   to   isolate   language   bits 
 |  | 
|  | L _ OPTLINK   equ   011100000000y               ;   setting   for   OptLink   calling   convention 
 |  | 
|  | VerifyCallBack   macro   ProcName 
 |  | 
|  |    if   ( ( ( OPATTR   ( ProcName ) )   and   L _ MASK )   ne   L _ OPTLINK ) 
 |  | 
|  |       . err   < Call - back   routine   must   have   OptLink   linkage > 
 |  | 
|  |    endif 
 |  | 
|  | endm </pre>
 |  | 
|  | [[[00280.htm|prev]]][[[00282.htm|next]]][[[00267.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Force Short Relative Address (SHORT Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00284.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00285.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00286.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''SHORT'''operator forces the assembler to calculate the distance from the start of the next instruction to the target specified by the operand (given by [[00359.htm|''Additive-Expression'']]) to be less than 128 bytes away. This can cause the assembler to generate more efficient control transfer instructions when the target is a forward reference. By default, the assembler assumes that the code-relative target is of '''NEAR'''distance when the target is an unqualified forward reference.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''SHORT'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00281.htm|prev]]][[[00283.htm|next]]][[[00281.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00284.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00285.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00286.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00282.htm|prev]]][[[00284.htm|next]]][[[00281.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''SHORT'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00283.htm|prev]]][[[00285.htm|next]]][[[00281.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''SHORT'''operator forces the assembler to calculate the distance from the start of the next instruction to the target specified by the operand (given by [[00359.htm|''Additive-Expression'']]) to be less than 128 bytes away. This can cause the assembler to generate more efficient control transfer instructions when the target is a forward reference. By default, the assembler assumes that the code-relative target is of '''NEAR'''distance when the target is an unqualified forward reference.
 |  | 
|  |   |  | 
|  | [[[00284.htm|prev]]][[[00286.htm|next]]][[[00281.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The [[00359.htm|''Additive-Expression'']]must evaluate to a [[00602.htm|''Direct-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00285.htm|prev]]][[[00287.htm|next]]][[[00281.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   JMP     Forward                 ;   target   unknown ,   NEAR   jump   generated 
 |  | 
|  |    JMP     SHORT   Forward          ;   force   SHORT   encoding 
 |  | 
|  |    . 
 |  | 
|  |    .                      ;   fewer   than   128   bytes   of   instructions 
 |  | 
|  |    . 
 |  | 
|  | Forward :                         ;   definition   of   target </pre>
 |  | 
|  | [[[00286.htm|prev]]][[[00288.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Bitwise OR Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Bitwise OR Expression''is one where an optional binary bitwise '''OR''' operation between the left and right operands is performed and the result returned.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''OR-Expression'''':'' <br />[[00302.htm|''AND-Expression'']] <br />''OR-Expression''[[00290.htm|OR]][[00302.htm|''AND-Expression'']] <br />''OR-Expression''[[00296.htm|XOR]][[00302.htm|''AND-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00287.htm|prev]]][[[00289.htm|next]]][[[00287.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Bitwise OR Expression''is one where an optional binary bitwise '''OR''' operation between the left and right operands is performed and the result returned.
 |  | 
|  |   |  | 
|  | [[[00288.htm|prev]]][[[00290.htm|next]]][[[00287.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''OR-Expression'''':'' <br />[[00302.htm|''AND-Expression'']] <br />''OR-Expression''[[00290.htm|OR]][[00302.htm|''AND-Expression'']] <br />''OR-Expression''[[00296.htm|XOR]][[00302.htm|''AND-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00289.htm|prev]]][[[00291.htm|next]]][[[00287.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Bitwise Inclusive OR (OR Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00293.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00294.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00295.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''OR'''operator performs a binary bitwise OR operation on the left and right hand operands.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00287.htm|''OR-Expression'']]'''OR'''[[00302.htm|''AND-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00290.htm|prev]]][[[00292.htm|next]]][[[00290.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00293.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00294.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00295.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00291.htm|prev]]][[[00293.htm|next]]][[[00290.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00287.htm|''OR-Expression'']]'''OR'''[[00302.htm|''AND-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00292.htm|prev]]][[[00294.htm|next]]][[[00290.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''OR'''operator performs a binary bitwise OR operation on the left and right hand operands.
 |  | 
|  |   |  | 
|  | [[[00293.htm|prev]]][[[00295.htm|next]]][[[00290.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00294.htm|prev]]][[[00296.htm|next]]][[[00290.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   One    EQU    1 
 |  | 
|  |    Two    EQU    2 
 |  | 
|  |   |  | 
|  |    MOV    AX ,   One   OR   Two          ;   moves   3   into   AX </pre>
 |  | 
|  | [[[00295.htm|prev]]][[[00297.htm|next]]][[[00287.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Bitwise Exclusive OR (XOR Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00299.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00300.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00301.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''XOR'''operator performs a binary bitwise XOR operation on the left and right hand operands.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00287.htm|''OR-Expression'']]'''XOR'''[[00302.htm|''AND-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00296.htm|prev]]][[[00298.htm|next]]][[[00296.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00299.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00300.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00301.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00297.htm|prev]]][[[00299.htm|next]]][[[00296.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00287.htm|''OR-Expression'']]'''XOR'''[[00302.htm|''AND-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00298.htm|prev]]][[[00300.htm|next]]][[[00296.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''XOR'''operator performs a binary bitwise XOR operation on the left and right hand operands.
 |  | 
|  |   |  | 
|  | [[[00299.htm|prev]]][[[00301.htm|next]]][[[00296.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00300.htm|prev]]][[[00302.htm|next]]][[[00296.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   Lower    EQU    0101y            ;   7h   -   binary   radix   suffix 
 |  | 
|  |    Upper    EQU    1100y            ;   Eh   -   binary   radix   suffix 
 |  | 
|  |   |  | 
|  |    MOV    AX ,   Upper   XOR   Lower     ;   moves   1001   into   AX </pre>
 |  | 
|  | [[[00301.htm|prev]]][[[00303.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Bitwise AND Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Bitwise AND Expression''is one where an optional binary bitwise '''AND''' operation between the left and right operands is performed and the result returned.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''AND-Expression'''':'' <br />[[00311.htm|''NOT-Expression'']] <br />''AND-Expression''[[00305.htm|AND]][[00311.htm|''NOT-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00302.htm|prev]]][[[00304.htm|next]]][[[00302.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Bitwise AND Expression''is one where an optional binary bitwise '''AND''' operation between the left and right operands is performed and the result returned.
 |  | 
|  |   |  | 
|  | [[[00303.htm|prev]]][[[00305.htm|next]]][[[00302.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''AND-Expression'''':'' <br />[[00311.htm|''NOT-Expression'']] <br />''AND-Expression''[[00305.htm|AND]][[00311.htm|''NOT-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00304.htm|prev]]][[[00306.htm|next]]][[[00302.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Bitwise AND (AND Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00308.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00309.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00310.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''AND'''operator performs a binary bitwise AND operation on the left and right hand operands.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00302.htm|''AND-Expression'']]'''AND'''[[00311.htm|''NOT-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00305.htm|prev]]][[[00307.htm|next]]][[[00305.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00308.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00309.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00310.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00306.htm|prev]]][[[00308.htm|next]]][[[00305.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00302.htm|''AND-Expression'']]'''AND'''[[00311.htm|''NOT-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00307.htm|prev]]][[[00309.htm|next]]][[[00305.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''AND'''operator performs a binary bitwise AND operation on the left and right hand operands.
 |  | 
|  |   |  | 
|  | [[[00308.htm|prev]]][[[00310.htm|next]]][[[00305.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00309.htm|prev]]][[[00311.htm|next]]][[[00305.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   Lower    EQU    0111y            ;   7h   -   binary   radix   suffix 
 |  | 
|  |    Upper    EQU    1110y            ;   Eh   -   binary   radix   suffix 
 |  | 
|  |   |  | 
|  |    MOV    AX ,   Upper   XOR   Lower     ;   moves   0110   into   AX </pre>
 |  | 
|  | [[[00310.htm|prev]]][[[00312.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Bitwise One's Complement Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Bitwise One's Complement Expression''is one that performs an optional unary bitwise negation of its operand and returns the result.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''NOT-Expression'''':'' <br />[[00320.htm|''Relational-Expression'']] <br />[[00314.htm|NOT]][[00320.htm|''Relational-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00311.htm|prev]]][[[00313.htm|next]]][[[00311.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Bitwise One's Complement Expression''is one that performs an optional unary bitwise negation of its operand and returns the result.
 |  | 
|  |   |  | 
|  | [[[00312.htm|prev]]][[[00314.htm|next]]][[[00311.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''NOT-Expression'''':'' <br />[[00320.htm|''Relational-Expression'']] <br />[[00314.htm|NOT]][[00320.htm|''Relational-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00313.htm|prev]]][[[00315.htm|next]]][[[00311.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Bitwise One's Complement (NOT Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00317.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00318.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00319.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''NOT'''operator performs a unary bitwise negation on its operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''NOT'''[[00320.htm|''Relational-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00314.htm|prev]]][[[00316.htm|next]]][[[00314.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00317.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00318.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00319.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00315.htm|prev]]][[[00317.htm|next]]][[[00314.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''NOT'''[[00320.htm|''Relational-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00316.htm|prev]]][[[00318.htm|next]]][[[00314.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''NOT'''operator performs a unary bitwise negation on its operand.
 |  | 
|  |   |  | 
|  | [[[00317.htm|prev]]][[[00319.htm|next]]][[[00314.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00318.htm|prev]]][[[00320.htm|next]]][[[00314.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   Value    EQU    0111y            ;   7h   -   binary   radix   suffix 
 |  | 
|  |   |  | 
|  |    MOV    EAX ,   NOT   Value          ;   moves   FFFFFFF8   into   EAX </pre>
 |  | 
|  | [[[00319.htm|prev]]][[[00321.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Relational Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Relational Expression''is one where an optional binary comparision operation between the left and right operands is performed and the result returned.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Relational-Expression'''':'' <br />[[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00323.htm|EQ]][[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00329.htm|NE]][[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00335.htm|GT]][[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00341.htm|GE]][[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00347.htm|LT]][[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00353.htm|LE]][[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00320.htm|prev]]][[[00322.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Relational Expression''is one where an optional binary comparision operation between the left and right operands is performed and the result returned.
 |  | 
|  |   |  | 
|  | [[[00321.htm|prev]]][[[00323.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Relational-Expression'''':'' <br />[[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00323.htm|EQ]][[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00329.htm|NE]][[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00335.htm|GT]][[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00341.htm|GE]][[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00347.htm|LT]][[00359.htm|''Additive-Expression'']] <br />''Relational-Expression''[[00353.htm|LE]][[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00322.htm|prev]]][[[00324.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Equal To (EQ Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00326.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00327.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00328.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''EQ'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if they are equal, and false (all bits off) if they are not equal.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''EQ'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00323.htm|prev]]][[[00325.htm|next]]][[[00323.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00326.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00327.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00328.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00324.htm|prev]]][[[00326.htm|next]]][[[00323.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''EQ'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00325.htm|prev]]][[[00327.htm|next]]][[[00323.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''EQ'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if they are equal, and false (all bits off) if they are not equal.
 |  | 
|  |   |  | 
|  | [[[00326.htm|prev]]][[[00328.htm|next]]][[[00323.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00327.htm|prev]]][[[00329.htm|next]]][[[00323.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   IF   1234   EQ   5678 
 |  | 
|  |        TRUE   =   1 
 |  | 
|  |    ELSE 
 |  | 
|  |        TRUE   =   0                  ;   Sets   TRUE   to   0 
 |  | 
|  |    ENDIF </pre>
 |  | 
|  | [[[00328.htm|prev]]][[[00330.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Not Equal To (NE Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00332.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00333.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00334.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''NE'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if they are not equal, and false (all bits off) if they are equal.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''NE'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00329.htm|prev]]][[[00331.htm|next]]][[[00329.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00332.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00333.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00334.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00330.htm|prev]]][[[00332.htm|next]]][[[00329.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''NE'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00331.htm|prev]]][[[00333.htm|next]]][[[00329.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''NE'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if they are not equal, and false (all bits off) if they are equal.
 |  | 
|  |   |  | 
|  | [[[00332.htm|prev]]][[[00334.htm|next]]][[[00329.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00333.htm|prev]]][[[00335.htm|next]]][[[00329.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   IF   1234   NE   5678 
 |  | 
|  |        TRUE   =   1                  ;   Sets   TRUE   to   1 
 |  | 
|  |    ELSE 
 |  | 
|  |        TRUE   =   0 
 |  | 
|  |    ENDIF </pre>
 |  | 
|  | [[[00334.htm|prev]]][[[00336.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Greater Than (GT Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00338.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00339.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00340.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''GT'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is greater than the right operand, and false (all bits off) if it is not.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''GT'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00335.htm|prev]]][[[00337.htm|next]]][[[00335.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00338.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00339.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00340.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00336.htm|prev]]][[[00338.htm|next]]][[[00335.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''GT'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00337.htm|prev]]][[[00339.htm|next]]][[[00335.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''GT'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is greater than the right operand, and false (all bits off) if it is not.
 |  | 
|  |   |  | 
|  | [[[00338.htm|prev]]][[[00340.htm|next]]][[[00335.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00339.htm|prev]]][[[00341.htm|next]]][[[00335.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   IF   1234   GT   5678 
 |  | 
|  |        TRUE   =   1 
 |  | 
|  |    ELSE 
 |  | 
|  |        TRUE   =   0                  ;   Sets   TRUE   to   0 
 |  | 
|  |    ENDIF </pre>
 |  | 
|  | [[[00340.htm|prev]]][[[00342.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Greater Than or Equal To (GE Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00344.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00345.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00346.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''GE'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is greater than or equal to the right operand, and false (all bits off) if it is not.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''GE'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00341.htm|prev]]][[[00343.htm|next]]][[[00341.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00344.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00345.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00346.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00342.htm|prev]]][[[00344.htm|next]]][[[00341.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''GE'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00343.htm|prev]]][[[00345.htm|next]]][[[00341.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''GE'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is greater than or equal to the right operand, and false (all bits off) if it is not.
 |  | 
|  |   |  | 
|  | [[[00344.htm|prev]]][[[00346.htm|next]]][[[00341.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00345.htm|prev]]][[[00347.htm|next]]][[[00341.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   IF   1234   GE   1234 
 |  | 
|  |        TRUE   =   1                  ;   Sets   TRUE   to   1 
 |  | 
|  |    ELSE 
 |  | 
|  |        TRUE   =   0 
 |  | 
|  |    ENDIF </pre>
 |  | 
|  | [[[00346.htm|prev]]][[[00348.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Less Than (LT Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00350.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00351.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00352.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''LT'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is less than the right operand, and false (all bits off) if it is not.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''LT'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00347.htm|prev]]][[[00349.htm|next]]][[[00347.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00350.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00351.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00352.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00348.htm|prev]]][[[00350.htm|next]]][[[00347.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''LT'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00349.htm|prev]]][[[00351.htm|next]]][[[00347.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''LT'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is less than the right operand, and false (all bits off) if it is not.
 |  | 
|  |   |  | 
|  | [[[00350.htm|prev]]][[[00352.htm|next]]][[[00347.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00351.htm|prev]]][[[00353.htm|next]]][[[00347.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   IF   1234   LT   5678 
 |  | 
|  |        TRUE   =   1                  ;   Sets   TRUE   to   1 
 |  | 
|  |    ELSE 
 |  | 
|  |        TRUE   =   0 
 |  | 
|  |    ENDIF </pre>
 |  | 
|  | [[[00352.htm|prev]]][[[00354.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Less Than or Equal To (LE Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00356.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00357.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00358.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''LE'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is less than or equal to the right operand, and false (all bits off) if it is not.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''LE'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00353.htm|prev]]][[[00355.htm|next]]][[[00353.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00356.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00357.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00358.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00354.htm|prev]]][[[00356.htm|next]]][[[00353.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00320.htm|''Relational-Expression'']]'''LE'''[[00359.htm|''Additive-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00355.htm|prev]]][[[00357.htm|next]]][[[00353.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''LE'''operator performs a binary logical comparision on the left and right hand operands. It returns true (all bits on) if the left operand is less than or equal to the right operand, and false (all bits off) if it is not.
 |  | 
|  |   |  | 
|  | [[[00356.htm|prev]]][[[00358.htm|next]]][[[00353.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00357.htm|prev]]][[[00359.htm|next]]][[[00353.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   IF   1234   LE   1234 
 |  | 
|  |        TRUE   =   1                  ;   Sets   TRUE   to   1 
 |  | 
|  |    ELSE 
 |  | 
|  |        TRUE   =   0 
 |  | 
|  |    ENDIF </pre>
 |  | 
|  | [[[00358.htm|prev]]][[[00360.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Additive Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Additive Expression''is one where an optional binary additive arithmetic operation between the left and right operands is performed and the result returned.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Additive-Expression'''':'' <br />[[00374.htm|''Multiplicative-Expression'']] <br />''Additive-Expression''[[00362.htm|+]][[00374.htm|''Multiplicative-Expression'']] <br />''Additive-Expression''[[00368.htm|-]][[00374.htm|''Multiplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00359.htm|prev]]][[[00361.htm|next]]][[[00359.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Additive Expression''is one where an optional binary additive arithmetic operation between the left and right operands is performed and the result returned.
 |  | 
|  |   |  | 
|  | [[[00360.htm|prev]]][[[00362.htm|next]]][[[00359.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Additive-Expression'''':'' <br />[[00374.htm|''Multiplicative-Expression'']] <br />''Additive-Expression''[[00362.htm|+]][[00374.htm|''Multiplicative-Expression'']] <br />''Additive-Expression''[[00368.htm|-]][[00374.htm|''Multiplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00361.htm|prev]]][[[00363.htm|next]]][[[00359.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Addition (+ Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00365.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00366.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00367.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''+'''operator performs a binary addition operation on the left and right hand operands, and returns the result.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00359.htm|''Additive-Expression'']]'''+'''[[00374.htm|''Multiplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00362.htm|prev]]][[[00364.htm|next]]][[[00362.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00365.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00366.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00367.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00363.htm|prev]]][[[00365.htm|next]]][[[00362.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00359.htm|''Additive-Expression'']]'''+'''[[00374.htm|''Multiplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00364.htm|prev]]][[[00366.htm|next]]][[[00362.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''+'''operator performs a binary addition operation on the left and right hand operands, and returns the result.
 |  | 
|  |   |  | 
|  | [[[00365.htm|prev]]][[[00367.htm|next]]][[[00362.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | One of the operands must evaluate to a [[00600.htm|''Constant-ExpressionType'']]. If one of the operands references an external identifier, then the other operand must be a [[00600.htm|''Constant-ExpressionType'']]without an external reference. Both operands must be of scalar type.
 |  | 
|  |   |  | 
|  | [[[00366.htm|prev]]][[[00368.htm|next]]][[[00362.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   VALUE   =   100   +   11              ;   sets   VALUE   to   111 </pre>
 |  | 
|  | [[[00367.htm|prev]]][[[00369.htm|next]]][[[00359.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Subtraction (- Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00371.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00372.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00373.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''-'''operator performs a binary subtraction operation on the left and right hand operands, and returns the result.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00359.htm|''Additive-Expression'']]'''-'''[[00374.htm|''Multiplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00368.htm|prev]]][[[00370.htm|next]]][[[00368.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00371.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00372.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00373.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00369.htm|prev]]][[[00371.htm|next]]][[[00368.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00359.htm|''Additive-Expression'']]'''-'''[[00374.htm|''Multiplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00370.htm|prev]]][[[00372.htm|next]]][[[00368.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''-'''operator performs a binary subtraction operation on the left and right hand operands, and returns the result.
 |  | 
|  |   |  | 
|  | [[[00371.htm|prev]]][[[00373.htm|next]]][[[00368.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The right operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']]and reference no external identifiers. If both operands are relocatable, they must reside within the same segment, in which case the result is converted to a [[00599.htm|''Absolute-ExpressionType'']]. Both operands must be of scalar type.
 |  | 
|  |   |  | 
|  | [[[00372.htm|prev]]][[[00374.htm|next]]][[[00368.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   VALUE   =   111   -   11              ;   sets   VALUE   to   100 </pre>
 |  | 
|  | [[[00373.htm|prev]]][[[00375.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Multiplicative Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Multiplicative Expression''is one where an optional binary multiplicative arithmetic operation between the left and right operands is performed and the result returned.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Multiplicative-Expression'''':'' <br />[[00407.htm|''Narrowed-Expression'']] <br />''Multiplicative-Expression''[[00377.htm|*]][[00407.htm|''Narrowed-Expression'']] <br />''Multiplicative-Expression''[[00383.htm|/]][[00407.htm|''Narrowed-Expression'']] <br />''Multiplicative-Expression''[[00389.htm|MOD]][[00407.htm|''Narrowed-Expression'']] <br />''Multiplicative-Expression''[[00395.htm|SHL]][[00407.htm|''Narrowed-Expression'']] <br />''Multiplicative-Expression''[[00401.htm|SHR]][[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00374.htm|prev]]][[[00376.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Multiplicative Expression''is one where an optional binary multiplicative arithmetic operation between the left and right operands is performed and the result returned.
 |  | 
|  |   |  | 
|  | [[[00375.htm|prev]]][[[00377.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Multiplicative-Expression'''':'' <br />[[00407.htm|''Narrowed-Expression'']] <br />''Multiplicative-Expression''[[00377.htm|*]][[00407.htm|''Narrowed-Expression'']] <br />''Multiplicative-Expression''[[00383.htm|/]][[00407.htm|''Narrowed-Expression'']] <br />''Multiplicative-Expression''[[00389.htm|MOD]][[00407.htm|''Narrowed-Expression'']] <br />''Multiplicative-Expression''[[00395.htm|SHL]][[00407.htm|''Narrowed-Expression'']] <br />''Multiplicative-Expression''[[00401.htm|SHR]][[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00376.htm|prev]]][[[00378.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Multiplication (* Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00380.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00381.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00382.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''*'''operator performs a binary multiplication operation on the left and right hand operands, and returns the result.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00374.htm|''Multiplicative-Expression'']]'''*'''[[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00377.htm|prev]]][[[00379.htm|next]]][[[00377.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00380.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00381.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00382.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00378.htm|prev]]][[[00380.htm|next]]][[[00377.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00374.htm|''Multiplicative-Expression'']]'''*'''[[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00379.htm|prev]]][[[00381.htm|next]]][[[00377.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''*'''operator performs a binary multiplication operation on the left and right hand operands, and returns the result.
 |  | 
|  |   |  | 
|  | [[[00380.htm|prev]]][[[00382.htm|next]]][[[00377.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00381.htm|prev]]][[[00383.htm|next]]][[[00377.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   VALUE   =   9   *   3                 ;   sets   VALUE   to   27 </pre>
 |  | 
|  | [[[00382.htm|prev]]][[[00384.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Division (/ Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00386.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00387.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00388.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''/'''operator performs a binary division operation on the left and right hand operands, and returns the result.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00374.htm|''Multiplicative-Expression'']]'''/'''[[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00383.htm|prev]]][[[00385.htm|next]]][[[00383.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00386.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00387.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00388.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00384.htm|prev]]][[[00386.htm|next]]][[[00383.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00374.htm|''Multiplicative-Expression'']]'''/'''[[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00385.htm|prev]]][[[00387.htm|next]]][[[00383.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''/'''operator performs a binary division operation on the left and right hand operands, and returns the result.
 |  | 
|  |   |  | 
|  | [[[00386.htm|prev]]][[[00388.htm|next]]][[[00383.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00387.htm|prev]]][[[00389.htm|next]]][[[00383.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   VALUE   =   27   /   9                ;   sets   VALUE   to   3 </pre>
 |  | 
|  | [[[00388.htm|prev]]][[[00390.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Remainder (MOD Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00392.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00393.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00394.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''MOD'''operator performs a binary modulus division operation on the left and right hand operands, and returns the remainder as the result.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00374.htm|''Multiplicative-Expression'']]'''MOD'''[[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00389.htm|prev]]][[[00391.htm|next]]][[[00389.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00392.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00393.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00394.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00390.htm|prev]]][[[00392.htm|next]]][[[00389.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00374.htm|''Multiplicative-Expression'']]'''MOD'''[[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00391.htm|prev]]][[[00393.htm|next]]][[[00389.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''MOD'''operator performs a binary modulus division operation on the left and right hand operands, and returns the remainder as the result.
 |  | 
|  |   |  | 
|  | [[[00392.htm|prev]]][[[00394.htm|next]]][[[00389.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00393.htm|prev]]][[[00395.htm|next]]][[[00389.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   VALUE   =   18   MOD   4              ;   sets   VALUE   to   2 </pre>
 |  | 
|  | [[[00394.htm|prev]]][[[00396.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Bitwise Left Shift (SHL Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00398.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00399.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00400.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''SHL'''operator shifts the bits in the left hand operand to the left by the number of bits specified in the right hand operand, and returns the result.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00374.htm|''Multiplicative-Expression'']]'''SHL'''[[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00395.htm|prev]]][[[00397.htm|next]]][[[00395.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00398.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00399.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00400.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00396.htm|prev]]][[[00398.htm|next]]][[[00395.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00374.htm|''Multiplicative-Expression'']]'''SHL'''[[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00397.htm|prev]]][[[00399.htm|next]]][[[00395.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''SHL'''operator shifts the bits in the left hand operand to the left by the number of bits specified in the right hand operand, and returns the result.
 |  | 
|  |   |  | 
|  | [[[00398.htm|prev]]][[[00400.htm|next]]][[[00395.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00399.htm|prev]]][[[00401.htm|next]]][[[00395.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   VALUE   =   1111y   SHL   4          ;   sets   VALUE   to   11110000y </pre>
 |  | 
|  | [[[00400.htm|prev]]][[[00402.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Bitwise Right Shift (SHR Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00404.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00405.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00406.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''SHR'''operator shifts the bits in the left hand operand to the right by the number of bits specified in the right hand operand, and returns the result.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00374.htm|''Multiplicative-Expression'']]'''SHR'''[[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00401.htm|prev]]][[[00403.htm|next]]][[[00401.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00404.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00405.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00406.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00402.htm|prev]]][[[00404.htm|next]]][[[00401.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00374.htm|''Multiplicative-Expression'']]'''SHR'''[[00407.htm|''Narrowed-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00403.htm|prev]]][[[00405.htm|next]]][[[00401.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''SHR'''operator shifts the bits in the left hand operand to the right by the number of bits specified in the right hand operand, and returns the result.
 |  | 
|  |   |  | 
|  | [[[00404.htm|prev]]][[[00406.htm|next]]][[[00401.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Each operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00405.htm|prev]]][[[00407.htm|next]]][[[00401.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   VALUE   =   11110000y   SHR   4           ;   sets   VALUE   to   00001111y </pre>
 |  | 
|  | [[[00406.htm|prev]]][[[00408.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Narrowed Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Narrowed Expression''is one that performs an optional unary narrowing operation on its operand and returns the result.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Narrowed-Expression'''':'' <br />[[00434.htm|''Cast-Expression'']] <br />[[00410.htm|HIGH]][[00434.htm|''Cast-Expression'']] <br />[[00416.htm|HIGHWORD]][[00434.htm|''Cast-Expression'']] <br />[[00422.htm|LOW]][[00434.htm|''Cast-Expression'']] <br />[[00428.htm|LOWWORD]][[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00407.htm|prev]]][[[00409.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Narrowed Expression''is one that performs an optional unary narrowing operation on its operand and returns the result.
 |  | 
|  |   |  | 
|  | [[[00408.htm|prev]]][[[00410.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Narrowed-Expression'''':'' <br />[[00434.htm|''Cast-Expression'']] <br />[[00410.htm|HIGH]][[00434.htm|''Cast-Expression'']] <br />[[00416.htm|HIGHWORD]][[00434.htm|''Cast-Expression'']] <br />[[00422.htm|LOW]][[00434.htm|''Cast-Expression'']] <br />[[00428.htm|LOWWORD]][[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00409.htm|prev]]][[[00411.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Upper 8 Bits of WORD Expression (HIGH Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00413.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00414.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00415.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''HIGH'''operator returns the upper 8 bits of a 16-bit expression. Only bits 8-15 are returned, even if the magnitude of the operand exceeds 16 bits.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''HIGH'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00410.htm|prev]]][[[00412.htm|next]]][[[00410.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00413.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00414.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00415.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00411.htm|prev]]][[[00413.htm|next]]][[[00410.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''HIGH'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00412.htm|prev]]][[[00414.htm|next]]][[[00410.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''HIGH'''operator returns the upper 8 bits of a 16-bit expression. Only bits 8-15 are returned, even if the magnitude of the operand exceeds 16 bits.
 |  | 
|  |   |  | 
|  | [[[00413.htm|prev]]][[[00415.htm|next]]][[[00410.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00414.htm|prev]]][[[00416.htm|next]]][[[00410.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   FIRST    =   1234h 
 |  | 
|  |    SECOND   =   HIGH   FIRST          ;   Sets   SECOND   to   12h </pre>
 |  | 
|  | [[[00415.htm|prev]]][[[00417.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Upper 16 Bits of DWORD Expression (HIGHWORD Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00419.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00420.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00421.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''HIGHWORD'''operator returns the upper 16 bits of a 32-bit expression. Only bits 16-31 are returned, even if the magnitude of the operand exceeds 32 bits.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''HIGHWORD'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00416.htm|prev]]][[[00418.htm|next]]][[[00416.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00419.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00420.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00421.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00417.htm|prev]]][[[00419.htm|next]]][[[00416.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''HIGHWORD'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00418.htm|prev]]][[[00420.htm|next]]][[[00416.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''HIGHWORD'''operator returns the upper 16 bits of a 32-bit expression. Only bits 16-31 are returned, even if the magnitude of the operand exceeds 32 bits.
 |  | 
|  |   |  | 
|  | [[[00419.htm|prev]]][[[00421.htm|next]]][[[00416.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | This operator is not available in [[00105.htm|M510]]mode.
 |  | 
|  |   |  | 
|  | [[[00420.htm|prev]]][[[00422.htm|next]]][[[00416.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   FIRST    =   12345678h 
 |  | 
|  |    SECOND   =   HIGHWORD   FIRST      ;   Sets   SECOND   to   1234h </pre>
 |  | 
|  | [[[00421.htm|prev]]][[[00423.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Lower 8 Bits of WORD Expression (LOW Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00425.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00426.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00427.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''LOW'''operator returns the lower 8 bits of its operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''LOW'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00422.htm|prev]]][[[00424.htm|next]]][[[00422.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00425.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00426.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00427.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00423.htm|prev]]][[[00425.htm|next]]][[[00422.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''LOW'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00424.htm|prev]]][[[00426.htm|next]]][[[00422.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''LOW'''operator returns the lower 8 bits of its operand.
 |  | 
|  |   |  | 
|  | [[[00425.htm|prev]]][[[00427.htm|next]]][[[00422.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00426.htm|prev]]][[[00428.htm|next]]][[[00422.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   FIRST    =   1234h 
 |  | 
|  |    SECOND   =   LOW   FIRST           ;   Sets   SECOND   to   34h </pre>
 |  | 
|  | [[[00427.htm|prev]]][[[00429.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Lower 16 Bits of DWORD Expression (LOWWORD Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00431.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00432.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00433.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''LOWWORD'''operator returns the lower 16 bits of its operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''LOWWORD'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00428.htm|prev]]][[[00430.htm|next]]][[[00428.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00431.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00432.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00433.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00429.htm|prev]]][[[00431.htm|next]]][[[00428.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''LOWWORD'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00430.htm|prev]]][[[00432.htm|next]]][[[00428.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''LOWWORD'''operator returns the lower 16 bits of its operand.
 |  | 
|  |   |  | 
|  | [[[00431.htm|prev]]][[[00433.htm|next]]][[[00428.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | This operator is not available in [[00105.htm|M510]]mode.
 |  | 
|  |   |  | 
|  | [[[00432.htm|prev]]][[[00434.htm|next]]][[[00428.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   FIRST    =   12345678h 
 |  | 
|  |    SECOND   =   LOWWORD   FIRST       ;   Sets   SECOND   to   5678h </pre>
 |  | 
|  | [[[00433.htm|prev]]][[[00435.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Type Conversion Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Type Conversion Expression''is one that performs an optional type conversion operation on its operand and returns the result.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Cast-Expression'''':'' <br />[[00473.htm|''Element-Selection-Expression'']] <br />[[00437.htm|OFFSET]]''Cast-Expression'' <br />[[00443.htm|SEG]]''Cast-Expression'' <br />[[00449.htm|THIS]][[00473.htm|''Element-Selection-Expression'']] <br />[[00455.htm|TYPE]][[00473.htm|''Element-Selection-Expression'']] <br />''Cast-Expression''[[00461.htm|PTR]]''Cast-Expression'' <br />''Cast-Expression''[[00467.htm|:]]''Cast-Expression'' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00434.htm|prev]]][[[00436.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Type Conversion Expression''is one that performs an optional type conversion operation on its operand and returns the result.
 |  | 
|  |   |  | 
|  | [[[00435.htm|prev]]][[[00437.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Cast-Expression'''':'' <br />[[00473.htm|''Element-Selection-Expression'']] <br />[[00437.htm|OFFSET]]''Cast-Expression'' <br />[[00443.htm|SEG]]''Cast-Expression'' <br />[[00449.htm|THIS]][[00473.htm|''Element-Selection-Expression'']] <br />[[00455.htm|TYPE]][[00473.htm|''Element-Selection-Expression'']] <br />''Cast-Expression''[[00461.htm|PTR]]''Cast-Expression'' <br />''Cast-Expression''[[00467.htm|:]]''Cast-Expression'' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00436.htm|prev]]][[[00438.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Address Offset (OFFSET Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00440.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00441.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00442.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''OFFSET'''operator returns the offset portion of its operand. For relocatable values, this is the offset into the segment or group to which the expression is relative.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''OFFSET'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00437.htm|prev]]][[[00439.htm|next]]][[[00437.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00440.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00441.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00442.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00438.htm|prev]]][[[00440.htm|next]]][[[00437.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''OFFSET'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00439.htm|prev]]][[[00441.htm|next]]][[[00437.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''OFFSET'''operator returns the offset portion of its operand. For relocatable values, this is the offset into the segment or group to which the expression is relative.
 |  | 
|  |   |  | 
|  | [[[00440.htm|prev]]][[[00442.htm|next]]][[[00437.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand may evaluate to any one of the following [[00596.htm|''ExpressionType'']]''s'''':''
 |  | 
|  |   |  | 
|  | �[[00599.htm|''Absolute-ExpressionType'']] <br />�[[00600.htm|''Constant-ExpressionType'']] <br />�[[00601.htm|''Immediate-ExpressionType'']] <br />�[[00602.htm|''Direct-ExpressionType'']] <br />�[[00603.htm|''Indirect-ExpressionType'']] <br />
 |  | 
|  |   |  | 
|  | [[[00441.htm|prev]]][[[00443.htm|next]]][[[00437.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   CodeLabel : 
 |  | 
|  |                MOV   AX , CodeLabel            ;   illegal ,   no   data   at   address 
 |  | 
|  |                MOV   AX , OFFSET   CodeLabel     ;   we   want   the   address   itself </pre>
 |  | 
|  | [[[00442.htm|prev]]][[[00444.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Address Segment (SEG Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00446.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00447.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00448.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''SEG'''operator returns the segment or group to which a relocatable expression is relative.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''SEG'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00443.htm|prev]]][[[00445.htm|next]]][[[00443.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00446.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00447.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00448.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00444.htm|prev]]][[[00446.htm|next]]][[[00443.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''SEG'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00445.htm|prev]]][[[00447.htm|next]]][[[00443.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''SEG'''operator returns the segment or group to which a relocatable expression is relative.
 |  | 
|  |   |  | 
|  | [[[00446.htm|prev]]][[[00448.htm|next]]][[[00443.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to one of the following [[00596.htm|''ExpressionType'']]''s'''':''
 |  | 
|  |   |  | 
|  | �[[00601.htm|''Immediate-ExpressionType'']] <br />�[[00602.htm|''Direct-ExpressionType'']] <br />�[[00603.htm|''Indirect-ExpressionType'']] <br />�[[00604.htm|''Indexed-ExpressionType'']] <br />
 |  | 
|  |   |  | 
|  | [[[00447.htm|prev]]][[[00449.htm|next]]][[[00443.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>DATA      SEGMENT 
 |  | 
|  | Stuff     DB      ? 
 |  | 
|  |          MOV     AX ,   SEG   Stuff    ;   This   construct   is 
 |  | 
|  |          MOV     AX ,   DATA         ;   equivalent   to   this 
 |  | 
|  | DATA      ENDS </pre>
 |  | 
|  | [[[00448.htm|prev]]][[[00450.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Address Alias (THIS Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00452.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00453.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00454.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''THIS'''operator returns an operand whose:
 |  | 
|  |   |  | 
|  | �[[00589.htm|''Relative Frame'']]attribute is set to that of the current segment <br />�[[00588.htm|''Displacement'']]attribute is set to the current location counter <br />�[[00595.htm|''Type Declaration'']]attribute is set to that of the expression given by the [[00473.htm|''Element-Selection-Expression'']]operand. <br />
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''THIS'''[[00473.htm|''Element-Selection-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00449.htm|prev]]][[[00451.htm|next]]][[[00449.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00452.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00453.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00454.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00450.htm|prev]]][[[00452.htm|next]]][[[00449.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''THIS'''[[00473.htm|''Element-Selection-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00451.htm|prev]]][[[00453.htm|next]]][[[00449.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''THIS'''operator returns an operand whose:
 |  | 
|  |   |  | 
|  | �[[00589.htm|''Relative Frame'']]attribute is set to that of the current segment <br />�[[00588.htm|''Displacement'']]attribute is set to the current location counter <br />�[[00595.htm|''Type Declaration'']]attribute is set to that of the expression given by the [[00473.htm|''Element-Selection-Expression'']]operand. <br />
 |  | 
|  |   |  | 
|  | [[[00452.htm|prev]]][[[00454.htm|next]]][[[00449.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to a [[00608.htm|''Type-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00453.htm|prev]]][[[00455.htm|next]]][[[00449.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>DATA      SEGMENT 
 |  | 
|  |   |  | 
|  | ALIAS     EQU     THIS   BYTE        ;   reference   this   address   as   a   byte 
 |  | 
|  | Stuff     DB      ? 
 |  | 
|  |   |  | 
|  |          MOV     AL ,   ALIAS        ;   This   construct   is 
 |  | 
|  |          MOV     AL ,   Stuff        ;   equivalent   to   this 
 |  | 
|  |   |  | 
|  | DATA      ENDS </pre>
 |  | 
|  | [[[00454.htm|prev]]][[[00456.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Datatype Extraction (TYPE Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00458.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00459.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00460.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''TYPE'''operator returns the [[00608.htm|''Type-ExpressionType'']]attribute of its operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''TYPE'''[[00473.htm|''Element-Selection-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00455.htm|prev]]][[[00457.htm|next]]][[[00455.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00458.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00459.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00460.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00456.htm|prev]]][[[00458.htm|next]]][[[00455.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''TYPE'''[[00473.htm|''Element-Selection-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00457.htm|prev]]][[[00459.htm|next]]][[[00455.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''TYPE'''operator returns the [[00608.htm|''Type-ExpressionType'']]attribute of its operand.
 |  | 
|  |   |  | 
|  | [[[00458.htm|prev]]][[[00460.htm|next]]][[[00455.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | None
 |  | 
|  |   |  | 
|  | [[[00459.htm|prev]]][[[00461.htm|next]]][[[00455.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CODE      SEGMENT 
 |  | 
|  |          ASSUME   CS : CODE , DS : CODE 
 |  | 
|  | Stuff     DB      ?                                 ;   TYPE   Stuff   is   BYTE 
 |  | 
|  |          MOV     [ BX ] ,   ( TYPE   Stuff )   PTR   1        ;   stores   1   as   a   BYTE   at   [ BX ] 
 |  | 
|  | CODE      ENDS </pre>
 |  | 
|  | [[[00460.htm|prev]]][[[00462.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Type Conversion (PTR Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00464.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00465.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00466.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''PTR'''operator converts the right operand to the type specified by the left operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00434.htm|''Cast-Expression'']]'''PTR'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00461.htm|prev]]][[[00463.htm|next]]][[[00461.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00464.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00465.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00466.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00462.htm|prev]]][[[00464.htm|next]]][[[00461.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00434.htm|''Cast-Expression'']]'''PTR'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00463.htm|prev]]][[[00465.htm|next]]][[[00461.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''PTR'''operator converts the right operand to the type specified by the left operand.
 |  | 
|  |   |  | 
|  | [[[00464.htm|prev]]][[[00466.htm|next]]][[[00461.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The left operand must be a [[00608.htm|''Type-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00465.htm|prev]]][[[00467.htm|next]]][[[00461.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CODE      SEGMENT 
 |  | 
|  |          MOV     BYTE   PTR   [ BX ] ,   1      ;   stores   1   as   a   BYTE   at   [ BX ] 
 |  | 
|  | CODE      ENDS </pre>
 |  | 
|  | [[[00466.htm|prev]]][[[00468.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Segment Override (: Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00470.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00471.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00472.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The ''':'''(colon) operator forces the right operand to have the [[00589.htm|''Relative Frame'']] attribute of the left operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00434.htm|''Cast-Expression'']]''':'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00467.htm|prev]]][[[00469.htm|next]]][[[00467.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00470.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00471.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00472.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00468.htm|prev]]][[[00470.htm|next]]][[[00467.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00434.htm|''Cast-Expression'']]''':'''[[00434.htm|''Cast-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00469.htm|prev]]][[[00471.htm|next]]][[[00467.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The ''':'''(colon) operator forces the right operand to have the [[00589.htm|''Relative Frame'']] attribute of the left operand.
 |  | 
|  |   |  | 
|  | [[[00470.htm|prev]]][[[00472.htm|next]]][[[00467.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The left operand must evaluate to one of the following [[00596.htm|''ExpressionType'']]''s'''':''
 |  | 
|  |   |  | 
|  | �[[00605.htm|''Register-ExpressionType'']]where the [[00591.htm|''Register Value'']]attribute is that of a [[00122.htm|''Segment-Register'']] <br />�[[00601.htm|''Immediate-ExpressionType'']]where the [[00589.htm|''Relative Frame'']]attribute is that of a [[00162.htm|''GroupName'']]or [[00170.htm|''SegmentName'']]. <br />
 |  | 
|  |   |  | 
|  | [[[00471.htm|prev]]][[[00473.htm|next]]][[[00467.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>DATA       SEGMENT 
 |  | 
|  | Variable   DW      ? 
 |  | 
|  | DATA       ENDS 
 |  | 
|  |   |  | 
|  | DGROUP     GROUP   DATA ,   CODE 
 |  | 
|  |   |  | 
|  | CODE       SEGMENT 
 |  | 
|  |    ASSUME   CS : CODE ,   DS : DGROUP 
 |  | 
|  |    MOV      AX ,   DGROUP : Variable         ;   insure   Variable   is   relative   to   DGROUP 
 |  | 
|  |    ASSUME   DS : NOTHING 
 |  | 
|  |    MOV      BX ,   CS : Variable              ;   access   Variable   through   CS   register 
 |  | 
|  | CODE       ENDS </pre>
 |  | 
|  | [[[00472.htm|prev]]][[[00474.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Element Selection Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Element Selection Expression''is one that optionally selects a specific element of its operand and returns a reference to it.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Element-Selection-Expression'''':'' <br />[[00488.htm|''Sign-Expression'']] <br />''Element-Selection-Expression''[[00476.htm|[]]''Sign-Expression''[[00476.htm|00476.htm]]] <br />''Element-Selection-Expression''[[00482.htm|.]]''Sign-Expression'' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00473.htm|prev]]][[[00475.htm|next]]][[[00473.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Element Selection Expression''is one that optionally selects a specific element of its operand and returns a reference to it.
 |  | 
|  |   |  | 
|  | [[[00474.htm|prev]]][[[00476.htm|next]]][[[00473.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Element-Selection-Expression'''':'' <br />[[00488.htm|''Sign-Expression'']] <br />''Element-Selection-Expression''[[00476.htm|[]]''Sign-Expression''[[00476.htm|00476.htm]]] <br />''Element-Selection-Expression''[[00482.htm|.]]''Sign-Expression'' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00475.htm|prev]]][[[00477.htm|next]]][[[00473.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Subscript ([] Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00479.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00480.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00481.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''[]'''binary operator performs a subscripting (or ''indexing'') operation between the operand to the left of the brackets and the operand enclosed within the brackets. This is a simple additive operation of '''BYTE''' granularity; the arithmetic performed is not influenced by the [[00587.htm|''Operand Size'']] of either operand.
 |  | 
|  |   |  | 
|  | The syntax for this operator describes a binary operation between the left hand expression and the bracketed expression. The bracketed expression is also subject to the same operations performed during the processing of a standalone [[00573.htm|''Indirected-Expression'']]as described in the section on [[00503.htm|''Primary- Expression'']]''s''.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00473.htm|''Element-Selection-Expression'']]'''['''[[00488.htm|''Sign-Expression'']]''']''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00476.htm|prev]]][[[00478.htm|next]]][[[00476.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00479.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00480.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00481.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00477.htm|prev]]][[[00479.htm|next]]][[[00476.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00473.htm|''Element-Selection-Expression'']]'''['''[[00488.htm|''Sign-Expression'']]''']''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00478.htm|prev]]][[[00480.htm|next]]][[[00476.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''[]'''binary operator performs a subscripting (or ''indexing'') operation between the operand to the left of the brackets and the operand enclosed within the brackets. This is a simple additive operation of '''BYTE''' granularity; the arithmetic performed is not influenced by the [[00587.htm|''Operand Size'']] of either operand.
 |  | 
|  |   |  | 
|  | The syntax for this operator describes a binary operation between the left hand expression and the bracketed expression. The bracketed expression is also subject to the same operations performed during the processing of a standalone [[00573.htm|''Indirected-Expression'']]as described in the section on [[00503.htm|''Primary- Expression'']]''s''.
 |  | 
|  |   |  | 
|  | [[[00479.htm|prev]]][[[00481.htm|next]]][[[00476.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Only one of the operands may specify a relocatable value.
 |  | 
|  |   |  | 
|  | [[[00480.htm|prev]]][[[00482.htm|next]]][[[00476.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CODE       SEGMENT 
 |  | 
|  |           ASSUME   CS : CODE ,   DS : CODE 
 |  | 
|  |   |  | 
|  | Value      DB    0                         ;   Value [ 0 ] 
 |  | 
|  |           DB    1                         ;   Value [ 1 ] 
 |  | 
|  |           DB    2                         ;   Value [ 2 ] 
 |  | 
|  |           DB    3                         ;   Value [ 3 ] 
 |  | 
|  |           DB    4                         ;   Value [ 4 ] 
 |  | 
|  |   |  | 
|  |    MOV      AL ,   Value [ 3 ]                 ;   load   AL   with   the   fourth   byte   at   Value   ( 3 ) 
 |  | 
|  |    MOV      BX ,   offset   Value            ;   get   address   of   Value 
 |  | 
|  |    MOV      AL ,   [ BX ] [ 1 ] [ 2 ]               ;   also   gets   the   fourth   byte   ( 3 ) 
 |  | 
|  |   |  | 
|  | CODE       ENDS </pre>
 |  | 
|  | [[[00481.htm|prev]]][[[00483.htm|next]]][[[00473.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Structure/Union Field Selection (. Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00485.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00486.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00487.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''.'''(period) operator selects a structure or union field entry. It adds the left and right hand operands together and returns the result. The left operand should be an [[00603.htm|''Indirect-ExpressionType'']], [[00604.htm|''Indexed-ExpressionType'']], or [[00608.htm|''Type-ExpressionType'']]whose [[00595.htm|''Type Declaration'']]attribute resolves to that of a [[00173.htm|''Structure-TypeName'']]or [[00175.htm|''Union-TypeName'']]. The right operand should refer to a [[00158.htm|''FieldName'']]defined within the referenced type.
 |  | 
|  |   |  | 
|  | The [[00587.htm|''Operand Size'']]attribute of the result depends on the operands involved. If both operands have an operand size, a [[00160.htm|''Structure-FieldName'']]appearing as the right hand operand would override the operand size of the left operand and would dictate the operand size of the resulting expression.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00473.htm|''Element-Selection-Expression'']]'''.'''[[00488.htm|''Sign-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00482.htm|prev]]][[[00484.htm|next]]][[[00482.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00485.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00486.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00487.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00483.htm|prev]]][[[00485.htm|next]]][[[00482.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | [[00473.htm|''Element-Selection-Expression'']]'''.'''[[00488.htm|''Sign-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00484.htm|prev]]][[[00486.htm|next]]][[[00482.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''.'''(period) operator selects a structure or union field entry. It adds the left and right hand operands together and returns the result. The left operand should be an [[00603.htm|''Indirect-ExpressionType'']], [[00604.htm|''Indexed-ExpressionType'']], or [[00608.htm|''Type-ExpressionType'']]whose [[00595.htm|''Type Declaration'']]attribute resolves to that of a [[00173.htm|''Structure-TypeName'']]or [[00175.htm|''Union-TypeName'']]. The right operand should refer to a [[00158.htm|''FieldName'']]defined within the referenced type.
 |  | 
|  |   |  | 
|  | The [[00587.htm|''Operand Size'']]attribute of the result depends on the operands involved. If both operands have an operand size, a [[00160.htm|''Structure-FieldName'']]appearing as the right hand operand would override the operand size of the left operand and would dictate the operand size of the resulting expression.
 |  | 
|  |   |  | 
|  | [[[00485.htm|prev]]][[[00487.htm|next]]][[[00482.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Only one of the operands may specify a relocatable value.
 |  | 
|  |   |  | 
|  | [[[00486.htm|prev]]][[[00488.htm|next]]][[[00482.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Number   STRUC 
 |  | 
|  |    One    DB   1 
 |  | 
|  |    Two    DW   2 
 |  | 
|  | Number   ENDS 
 |  | 
|  |   |  | 
|  |    ;   The   following   line   is   only   allowed   in   MASM   5 . 10   mode   ( OPTION   OLDSTRUCTS ) 
 |  | 
|  |   |  | 
|  |    MOV   AX , [ BX ] . Two         ;   BX   points   to   a   " Number " ,   get   the   " Two "   entry 
 |  | 
|  |   |  | 
|  |    ;   In   other   modes ,   " Two "   is   private   to   the   " Number "   structure   type ,   so 
 |  | 
|  |    ;   one   of   the   following   methods   are   required : 
 |  | 
|  |   |  | 
|  |    MOV   AX , ( Number   PTR   [ BX ] ) . Two           ;   Explicit   override 
 |  | 
|  |    MOV   AX , [ BX ]   +   Number . Two                ;   Fully   qualified   reference 
 |  | 
|  |    ASSUME   BX : Number                         ;   Associate   BX   with   " Number " 
 |  | 
|  |    MOV   AX , [ BX ] . Two                          ;     then   original   syntax   is   allowed 
 |  | 
|  | </pre>
 |  | 
|  | [[[00487.htm|prev]]][[[00489.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Unary Arithmetic Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Unary Arithmetic Expression''is one that optionally alters the sign of its operand and returns the result.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Sign-Expression'''':'' <br />[[00503.htm|''Primary-Expression'']] <br />[[00491.htm|-]][[00503.htm|''Primary-Expression'']] <br />[[00497.htm|+]][[00503.htm|''Primary-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00488.htm|prev]]][[[00490.htm|next]]][[[00488.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Unary Arithmetic Expression''is one that optionally alters the sign of its operand and returns the result.
 |  | 
|  |   |  | 
|  | [[[00489.htm|prev]]][[[00491.htm|next]]][[[00488.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Sign-Expression'''':'' <br />[[00503.htm|''Primary-Expression'']] <br />[[00491.htm|-]][[00503.htm|''Primary-Expression'']] <br />[[00497.htm|+]][[00503.htm|''Primary-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00490.htm|prev]]][[[00492.htm|next]]][[[00488.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Unary Minus (- Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00494.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00495.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00496.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''-'''operator makes its operand into a negative number and returns the result.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''-'''[[00503.htm|''Primary-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00491.htm|prev]]][[[00493.htm|next]]][[[00491.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00494.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00495.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00496.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00492.htm|prev]]][[[00494.htm|next]]][[[00491.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''-'''[[00503.htm|''Primary-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00493.htm|prev]]][[[00495.htm|next]]][[[00491.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''-'''operator makes its operand into a negative number and returns the result.
 |  | 
|  |   |  | 
|  | [[[00494.htm|prev]]][[[00496.htm|next]]][[[00491.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00495.htm|prev]]][[[00497.htm|next]]][[[00491.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   Value    EQU    1 
 |  | 
|  |   |  | 
|  |    MOV    AX , - Value     ;   move   - 1   into   AX </pre>
 |  | 
|  | [[[00496.htm|prev]]][[[00498.htm|next]]][[[00488.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Unary Plus (+ Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00500.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00501.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00502.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''+'''operator returns its operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''+'''[[00503.htm|''Primary-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00497.htm|prev]]][[[00499.htm|next]]][[[00497.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00500.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00501.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00502.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00498.htm|prev]]][[[00500.htm|next]]][[[00497.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''+'''[[00503.htm|''Primary-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00499.htm|prev]]][[[00501.htm|next]]][[[00497.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''+'''operator returns its operand.
 |  | 
|  |   |  | 
|  | [[[00500.htm|prev]]][[[00502.htm|next]]][[[00497.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to a [[00600.htm|''Constant-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00501.htm|prev]]][[[00503.htm|next]]][[[00497.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   Value    EQU    1 
 |  | 
|  |    MOV    AX , + Value     ;   move   1   into   AX </pre>
 |  | 
|  | [[[00502.htm|prev]]][[[00504.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Primary Expression ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A '''''Primary Expression''is one that returns an expression operand.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Primary-Expression'''':'' <br />[[00506.htm|''Literal-Operand'']] <br />[[00516.htm|''Record-Constant'']] <br />[[00527.htm|''Identifier-Operand'']] <br />[[00522.htm|''Register-Operand'']] <br />[[00532.htm|''Integral-TypeName-Operand'']] <br />[[00511.htm|''Value-Substitution-Operand'']] <br />[[00537.htm|LENGTH]][[00527.htm|''Identifier-Operand'']] <br />[[00542.htm|LENGTHOF]][[00527.htm|''Identifier-Operand'']] <br />[[00548.htm|MASK]][[00527.htm|''Identifier-Operand'']] <br />[[00553.htm|SIZE]][[00473.htm|''Element-Selection-Expression'']] <br />[[00558.htm|SIZEOF]][[00473.htm|''Element-Selection-Expression'']] <br />[[00563.htm|WIDTH]][[00527.htm|''Identifier-Operand'']] <br />[[00568.htm|''Parenthesized-Expression'']] <br />[[00573.htm|''Indirected-Expression'']] <br />[[00579.htm|''Compound-Initializer'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00503.htm|prev]]][[[00505.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Primary Expression''is one that returns an expression operand.
 |  | 
|  |   |  | 
|  | [[[00504.htm|prev]]][[[00506.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Primary-Expression'''':'' <br />[[00506.htm|''Literal-Operand'']] <br />[[00516.htm|''Record-Constant'']] <br />[[00527.htm|''Identifier-Operand'']] <br />[[00522.htm|''Register-Operand'']] <br />[[00532.htm|''Integral-TypeName-Operand'']] <br />[[00511.htm|''Value-Substitution-Operand'']] <br />[[00537.htm|LENGTH]][[00527.htm|''Identifier-Operand'']] <br />[[00542.htm|LENGTHOF]][[00527.htm|''Identifier-Operand'']] <br />[[00548.htm|MASK]][[00527.htm|''Identifier-Operand'']] <br />[[00553.htm|SIZE]][[00473.htm|''Element-Selection-Expression'']] <br />[[00558.htm|SIZEOF]][[00473.htm|''Element-Selection-Expression'']] <br />[[00563.htm|WIDTH]][[00527.htm|''Identifier-Operand'']] <br />[[00568.htm|''Parenthesized-Expression'']] <br />[[00573.htm|''Indirected-Expression'']] <br />[[00579.htm|''Compound-Initializer'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00505.htm|prev]]][[[00507.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Literal Operand ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00509.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00510.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The assembler accepts several types of literal values as operands within expressions. ''Literal-Operand''''s''are converted to [[00596.htm|''ExpressionType'']]''s''according to the following table: <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------------------------------------------------------------\
 |  | 
|  | |Floating-Point-Literal  |Floating-Point-ExpressionType                         |
 |  | 
|  | |------------------------+------------------------------------------------------|
 |  | 
|  | |Integer-Literal         |Absolute-ExpressionType                               |
 |  | 
|  | |------------------------+------------------------------------------------------|
 |  | 
|  | |String-Literal          |Absolute-ExpressionType if the string length is less  |
 |  | 
|  | |                        |than or equal to the current Address Size; a          |
 |  | 
|  | |                        |String-ExpressionType otherwise.                      |
 |  | 
|  | \-------------------------------------------------------------------------------/</pre>
 |  | 
|  | The context where the expression is used determines whether or not a particular type of literal is legal.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Literal-Operand'''':'' <br />[[00226.htm|''Floating-Point-Literal'']] <br />[[00202.htm|''Integer-Literal'']] <br />[[00241.htm|''String-Literal'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00506.htm|prev]]][[[00508.htm|next]]][[[00506.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00509.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00510.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00507.htm|prev]]][[[00509.htm|next]]][[[00506.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Literal-Operand'''':'' <br />[[00226.htm|''Floating-Point-Literal'']] <br />[[00202.htm|''Integer-Literal'']] <br />[[00241.htm|''String-Literal'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00508.htm|prev]]][[[00510.htm|next]]][[[00506.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The assembler accepts several types of literal values as operands within expressions. ''Literal-Operand''''s''are converted to [[00596.htm|''ExpressionType'']]''s''according to the following table: <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------------------------------------------------------------\
 |  | 
|  | |Floating-Point-Literal  |Floating-Point-ExpressionType                         |
 |  | 
|  | |------------------------+------------------------------------------------------|
 |  | 
|  | |Integer-Literal         |Absolute-ExpressionType                               |
 |  | 
|  | |------------------------+------------------------------------------------------|
 |  | 
|  | |String-Literal          |Absolute-ExpressionType if the string length is less  |
 |  | 
|  | |                        |than or equal to the current Address Size; a          |
 |  | 
|  | |                        |String-ExpressionType otherwise.                      |
 |  | 
|  | \-------------------------------------------------------------------------------/</pre>
 |  | 
|  | The context where the expression is used determines whether or not a particular type of literal is legal.
 |  | 
|  |   |  | 
|  | [[[00509.htm|prev]]][[[00511.htm|next]]][[[00506.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | Arithmetic operations cannot be performed on [[00226.htm|''Floating-Point-Literal'']]''s'', thus they cannot be the operand of a unary or binary operator.
 |  | 
|  |   |  | 
|  | [[[00510.htm|prev]]][[[00512.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Value Substitution Operand ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00514.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00515.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | These operands are used to retrieve specialized values that are calculated internally by the assembler.
 |  | 
|  |   |  | 
|  | The '''FLAT'''operator returns an expression whose [[00589.htm|''Relative Frame'']]is set to that of the predefined FLAT pseudo-group.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Value-Substitution-Operand'''':'' <br />[[00134.htm|''Anonymous-Label-Alias'']] <br />[[00137.htm|''Location-Counter-Alias'']] <br />[[00140.htm|''Indeterminate-Value-Alias'']] <br />'''FLAT''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00511.htm|prev]]][[[00513.htm|next]]][[[00511.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00514.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00515.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00512.htm|prev]]][[[00514.htm|next]]][[[00511.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Value-Substitution-Operand'''':'' <br />[[00134.htm|''Anonymous-Label-Alias'']] <br />[[00137.htm|''Location-Counter-Alias'']] <br />[[00140.htm|''Indeterminate-Value-Alias'']] <br />'''FLAT''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00513.htm|prev]]][[[00515.htm|next]]][[[00511.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | These operands are used to retrieve specialized values that are calculated internally by the assembler.
 |  | 
|  |   |  | 
|  | The '''FLAT'''operator returns an expression whose [[00589.htm|''Relative Frame'']]is set to that of the predefined FLAT pseudo-group.
 |  | 
|  |   |  | 
|  | [[[00514.htm|prev]]][[[00516.htm|next]]][[[00511.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The '''FLAT'''operand is only active when a 32-bit processor has been selected.
 |  | 
|  |   |  | 
|  | [[[00515.htm|prev]]][[[00517.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Record Constant Operand ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00519.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00520.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00521.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A ''Record-Constant''provides a method of calculating a single numeric result value from a list of [[00159.htm|''Record-FieldName'']]values, and combining them together according to the definition of the [[00172.htm|''Record-TypeName'']]given by the [[00527.htm|''Identifier- Operand'']]. The result value is a [[00600.htm|''Constant-ExpressionType'']]suitable for use as an instruction operand, or for assigning to a record variable.
 |  | 
|  |   |  | 
|  | The [[00172.htm|''Record-TypeName'']]given by the [[00527.htm|''Identifier-Operand'']]determines how the ''Field-List''will be evaluated. The [[00267.htm|''Attribute-Expression'']]entries are position-dependent, and are matched with the corresponding [[00159.htm|''Record-FieldName'']] entries from the [[00172.htm|''Record-TypeName'']]definition to determine their width and shift values. [[00267.htm|''Attribute-Expression'']]entries may be omitted, in which case the default values from the record definition are used in the calculation.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Record-Constant'''':'' <br />[[00527.htm|''Identifier-Operand'']]'''<'''''Field-List'''''>''' <br />[[00527.htm|''Identifier-Operand'']]'''{'''''Field-List'''''}''' <br /> <br />''Field-List:'' <br />[[00267.htm|''Attribute-Expression'']] <br />''Field-List''''','''[[00267.htm|''Attribute-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00516.htm|prev]]][[[00518.htm|next]]][[[00516.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00519.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00520.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00521.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00517.htm|prev]]][[[00519.htm|next]]][[[00516.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Record-Constant'''':'' <br />[[00527.htm|''Identifier-Operand'']]'''<'''''Field-List'''''>''' <br />[[00527.htm|''Identifier-Operand'']]'''{'''''Field-List'''''}''' <br /> <br />''Field-List:'' <br />[[00267.htm|''Attribute-Expression'']] <br />''Field-List''''','''[[00267.htm|''Attribute-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00518.htm|prev]]][[[00520.htm|next]]][[[00516.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Record-Constant''provides a method of calculating a single numeric result value from a list of [[00159.htm|''Record-FieldName'']]values, and combining them together according to the definition of the [[00172.htm|''Record-TypeName'']]given by the [[00527.htm|''Identifier- Operand'']]. The result value is a [[00600.htm|''Constant-ExpressionType'']]suitable for use as an instruction operand, or for assigning to a record variable.
 |  | 
|  |   |  | 
|  | The [[00172.htm|''Record-TypeName'']]given by the [[00527.htm|''Identifier-Operand'']]determines how the ''Field-List''will be evaluated. The [[00267.htm|''Attribute-Expression'']]entries are position-dependent, and are matched with the corresponding [[00159.htm|''Record-FieldName'']] entries from the [[00172.htm|''Record-TypeName'']]definition to determine their width and shift values. [[00267.htm|''Attribute-Expression'']]entries may be omitted, in which case the default values from the record definition are used in the calculation.
 |  | 
|  |   |  | 
|  | [[[00519.htm|prev]]][[[00521.htm|next]]][[[00516.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The [[00527.htm|''Identifier-Operand'']]must resolve to a [[00172.htm|''Record-TypeName'']].
 |  | 
|  |   |  | 
|  | [[[00520.htm|prev]]][[[00522.htm|next]]][[[00516.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>DATE _ T   record   Year   : 7   =   0 ,    ;   0   is   1980 
 |  | 
|  |                 Month : 4   =   1 ,    ;   January 
 |  | 
|  |                 Day    : 5   =   1     ;   1st 
 |  | 
|  |   |  | 
|  | CODE   SEGMENT 
 |  | 
|  |    mov   AX ,   DATE _ T   < >                            ;   January   1st ,   1980 
 |  | 
|  |    mov   AX ,   DATE _ T   < 1996 - 1980 ,   12 ,   25 >         ;   Christmas ,   1996 
 |  | 
|  |    mov   AX ,   DATE _ T   < 10h ,   0Ch ,   19h >              ;   equivalent   values   in   hex 
 |  | 
|  |    mov   AX ,   DATE _ T   < 10000y ,   1100y ,   11001y >     ;   equivalent   values   in   binary 
 |  | 
|  |    mov   AX ,   2199h                                ;   equivalent   value   manually   coded 
 |  | 
|  |    mov   AX ,   0010000110011001y                   ;   and   in   binary 
 |  | 
|  | ;           YYYYYYYMMMMDDDDD 
 |  | 
|  | CODE   ENDS </pre>
 |  | 
|  | [[[00521.htm|prev]]][[[00523.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Register Operand ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00525.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00526.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | Processor registers are valid expression operands. The context where the expression is used determines the allowable register operands.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Register-Operand'''':'' <br />[[00122.htm|''Processor-Register'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00522.htm|prev]]][[[00524.htm|next]]][[[00522.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00525.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00526.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00523.htm|prev]]][[[00525.htm|next]]][[[00522.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Register-Operand'''':'' <br />[[00122.htm|''Processor-Register'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00524.htm|prev]]][[[00526.htm|next]]][[[00522.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | Processor registers are valid expression operands. The context where the expression is used determines the allowable register operands.
 |  | 
|  |   |  | 
|  | [[[00525.htm|prev]]][[[00527.htm|next]]][[[00522.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The currently selected processor dictates whether or not a register is visible to the expression evaluator.
 |  | 
|  |   |  | 
|  | [[[00526.htm|prev]]][[[00528.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Identifier Operand ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00530.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00531.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | When an [[00149.htm|''Identifier'']]is used in an expression, it returns a value according to its [[00152.htm|''Identifier-Type'']], as shown in the following table: <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------------------------------------------------------------\
 |  | 
|  | |Identifier-Type     |VALUE RETURNED                                            |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Numeric-EquateName  |The value originally assigned to the equate.              |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Structure-FieldName |The offset in bytes from the beginning of the structure.  |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Union-FieldName     |The offset in bytes from the beginning of the union       |
 |  | 
|  | |                    |(always 0).                                               |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Record-FieldName    |The shift-count required to reach the field within the    |
 |  | 
|  | |                    |record.                                                   |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Record-TypeName     |The mask-value that isolates defined record fields from   |
 |  | 
|  | |                    |undefined fields.                                         |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Structure-TypeName  |Zero if mode is M510, otherwise the size of the structure |
 |  | 
|  | |                    |in bytes (the operand size of the structure type).        |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Union-TypeName      |The size of the union in bytes (the operand size of the   |
 |  | 
|  | |                    |union type).                                              |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Typedef-TypeName    |The operand size of the underlying data-type represented  |
 |  | 
|  | |                    |by the Typedef-TypeName.                                  |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |GroupName           |A Relative Frame attribute that represents the group, and |
 |  | 
|  | |                    |a Displacement value of zero.                             |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |SegmentName         |A Relative Frame attribute that represents the segment (or|
 |  | 
|  | |                    |the group to which it belongs), and a Displacement value  |
 |  | 
|  | |                    |of zero if the mode is M510, or the current segment offset|
 |  | 
|  | |                    |otherwise.                                                |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |LabelName           |The Relative Frame attribute where the label is defined,  |
 |  | 
|  | |                    |and the segment offset value of the label.                |
 |  | 
|  | \-------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Identifier-Operand'''':'' <br />[[00149.htm|''Identifier'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00527.htm|prev]]][[[00529.htm|next]]][[[00527.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00530.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00531.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00528.htm|prev]]][[[00530.htm|next]]][[[00527.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Identifier-Operand'''':'' <br />[[00149.htm|''Identifier'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00529.htm|prev]]][[[00531.htm|next]]][[[00527.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | When an [[00149.htm|''Identifier'']]is used in an expression, it returns a value according to its [[00152.htm|''Identifier-Type'']], as shown in the following table: <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------------------------------------------------------------\
 |  | 
|  | |Identifier-Type     |VALUE RETURNED                                            |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Numeric-EquateName  |The value originally assigned to the equate.              |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Structure-FieldName |The offset in bytes from the beginning of the structure.  |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Union-FieldName     |The offset in bytes from the beginning of the union       |
 |  | 
|  | |                    |(always 0).                                               |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Record-FieldName    |The shift-count required to reach the field within the    |
 |  | 
|  | |                    |record.                                                   |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Record-TypeName     |The mask-value that isolates defined record fields from   |
 |  | 
|  | |                    |undefined fields.                                         |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Structure-TypeName  |Zero if mode is M510, otherwise the size of the structure |
 |  | 
|  | |                    |in bytes (the operand size of the structure type).        |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Union-TypeName      |The size of the union in bytes (the operand size of the   |
 |  | 
|  | |                    |union type).                                              |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |Typedef-TypeName    |The operand size of the underlying data-type represented  |
 |  | 
|  | |                    |by the Typedef-TypeName.                                  |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |GroupName           |A Relative Frame attribute that represents the group, and |
 |  | 
|  | |                    |a Displacement value of zero.                             |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |SegmentName         |A Relative Frame attribute that represents the segment (or|
 |  | 
|  | |                    |the group to which it belongs), and a Displacement value  |
 |  | 
|  | |                    |of zero if the mode is M510, or the current segment offset|
 |  | 
|  | |                    |otherwise.                                                |
 |  | 
|  | |--------------------+----------------------------------------------------------|
 |  | 
|  | |LabelName           |The Relative Frame attribute where the label is defined,  |
 |  | 
|  | |                    |and the segment offset value of the label.                |
 |  | 
|  | \-------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00530.htm|prev]]][[[00532.htm|next]]][[[00527.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The [[00149.htm|''Identifier'']]must resolve to one of the following [[00152.htm|''Identifier-Type'']]''s'''':''
 |  | 
|  |   |  | 
|  | �[[00156.htm|''Numeric-EquateName'']] <br />�[[00158.htm|''FieldName'']] <br />�[[00162.htm|''GroupName'']] <br />�[[00163.htm|''LabelName'']] <br />�[[00170.htm|''SegmentName'']] <br />�[[00171.htm|''UserDefined-TypeName'']] <br />
 |  | 
|  |   |  | 
|  | [[[00531.htm|prev]]][[[00533.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Integral Type-Name Operand ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00535.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00536.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | When an ''Integral-TypeName-Operand''is used in an expression, it is converted to a [[00608.htm|''Type-ExpressionType'']]. If used in a numeric context, the following numeric values are returned: <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------------------------------------------------------------\
 |  | 
|  | |Integral-TypeName-Operand|VALUE RETURNED                                       |
 |  | 
|  | |-------------------------+-----------------------------------------------------|
 |  | 
|  | |Scalar-TypeName          |The operand-size of the type in bytes.               |
 |  | 
|  | |-------------------------+-----------------------------------------------------|
 |  | 
|  | |Distance-TypeName        |If mode is M510, NEAR returns FFFF, and FAR returns  |
 |  | 
|  | |                         |FFFE.  Otherwise, NEAR and FAR are resolved and the  |
 |  | 
|  | |                         |values returned are:  NEAR16=FF02, NEAR32=FF04,      |
 |  | 
|  | |                         |FAR16=FF05, FAR32=FF06.                              |
 |  | 
|  | \-------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Integral-TypeName-Operand'''':'' <br />[[00125.htm|''Scalar-TypeName'']] <br />[[00128.htm|''Distance-TypeName'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00532.htm|prev]]][[[00534.htm|next]]][[[00532.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00535.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00536.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00533.htm|prev]]][[[00535.htm|next]]][[[00532.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Integral-TypeName-Operand'''':'' <br />[[00125.htm|''Scalar-TypeName'']] <br />[[00128.htm|''Distance-TypeName'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00534.htm|prev]]][[[00536.htm|next]]][[[00532.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | When an ''Integral-TypeName-Operand''is used in an expression, it is converted to a [[00608.htm|''Type-ExpressionType'']]. If used in a numeric context, the following numeric values are returned: <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------------------------------------------------------------\
 |  | 
|  | |Integral-TypeName-Operand|VALUE RETURNED                                       |
 |  | 
|  | |-------------------------+-----------------------------------------------------|
 |  | 
|  | |Scalar-TypeName          |The operand-size of the type in bytes.               |
 |  | 
|  | |-------------------------+-----------------------------------------------------|
 |  | 
|  | |Distance-TypeName        |If mode is M510, NEAR returns FFFF, and FAR returns  |
 |  | 
|  | |                         |FFFE.  Otherwise, NEAR and FAR are resolved and the  |
 |  | 
|  | |                         |values returned are:  NEAR16=FF02, NEAR32=FF04,      |
 |  | 
|  | |                         |FAR16=FF05, FAR32=FF06.                              |
 |  | 
|  | \-------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00535.htm|prev]]][[[00537.htm|next]]][[[00532.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The '''NEAR32'''and '''FAR32'''keywords are only valid if a 32-bit processor has been selected.
 |  | 
|  |   |  | 
|  | [[[00536.htm|prev]]][[[00538.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Number of Data Elements (LENGTH Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00540.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00541.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''LENGTH'''operator returns the number of data elements allocated to the operand. When applied to a variable initialized with a series of comma- separated expressions (elements), only the length of the first element is considered.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''LENGTH'''[[00527.htm|''Identifier-Operand'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00537.htm|prev]]][[[00539.htm|next]]][[[00537.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00540.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00541.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00538.htm|prev]]][[[00540.htm|next]]][[[00537.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''LENGTH'''[[00527.htm|''Identifier-Operand'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00539.htm|prev]]][[[00541.htm|next]]][[[00537.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''LENGTH'''operator returns the number of data elements allocated to the operand. When applied to a variable initialized with a series of comma- separated expressions (elements), only the length of the first element is considered.
 |  | 
|  |   |  | 
|  | [[[00540.htm|prev]]][[[00542.htm|next]]][[[00537.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to a [[00167.htm|''Data-LabelName'']].
 |  | 
|  |   |  | 
|  | [[[00541.htm|prev]]][[[00543.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Number of Data Elements (LENGTHOF Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00545.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00546.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''LENGTHOF'''operator returns the number of data elements allocated to the operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''LENGTHOF'''[[00527.htm|''Identifier-Operand'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00542.htm|prev]]][[[00544.htm|next]]][[[00542.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00545.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00546.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00543.htm|prev]]][[[00545.htm|next]]][[[00542.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''LENGTHOF'''[[00527.htm|''Identifier-Operand'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00544.htm|prev]]][[[00546.htm|next]]][[[00542.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''LENGTHOF'''operator returns the number of data elements allocated to the operand.
 |  | 
|  |   |  | 
|  | [[[00545.htm|prev]]][[[00547.htm|next]]][[[00542.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The operand must evaluate to a [[00167.htm|''Data-LabelName'']].
 |  | 
|  |   |  | 
|  | This operator is not available in [[00105.htm|M510]]mode.
 |  | 
|  |   |  | 
|  | [[[00546.htm|prev]]][[[00548.htm|next]]][[[00542.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <none>
 |  | 
|  |   |  | 
|  | [[[00547.htm|prev]]][[[00549.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Record or Field Bit-Mask (MASK Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00551.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00552.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''MASK'''operator returns the bit mask required to isolate a field within a record.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''MASK'''[[00527.htm|''Identifier-Operand'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00548.htm|prev]]][[[00550.htm|next]]][[[00548.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00551.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00552.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00549.htm|prev]]][[[00551.htm|next]]][[[00548.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''MASK'''[[00527.htm|''Identifier-Operand'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00550.htm|prev]]][[[00552.htm|next]]][[[00548.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''MASK'''operator returns the bit mask required to isolate a field within a record.
 |  | 
|  |   |  | 
|  | [[[00551.htm|prev]]][[[00553.htm|next]]][[[00548.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The [[00527.htm|''Identifier-Operand'']]must resolve to a [[00172.htm|''Record-TypeName'']]or [[00159.htm|''Record- FieldName'']]; otherwise the result is zero.
 |  | 
|  |   |  | 
|  | [[[00552.htm|prev]]][[[00554.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Size of Variable in Bytes (SIZE Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00556.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00557.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''SIZE'''operator returns the number of bytes allocated to the operand. When applied to a variable initialized with a series of comma-separated expressions (elements), only the size of the first element is considered.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''SIZE'''[[00473.htm|''Element-Selection-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00553.htm|prev]]][[[00555.htm|next]]][[[00553.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00556.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00557.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00554.htm|prev]]][[[00556.htm|next]]][[[00553.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''SIZE'''[[00473.htm|''Element-Selection-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00555.htm|prev]]][[[00557.htm|next]]][[[00553.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''SIZE'''operator returns the number of bytes allocated to the operand. When applied to a variable initialized with a series of comma-separated expressions (elements), only the size of the first element is considered.
 |  | 
|  |   |  | 
|  | [[[00556.htm|prev]]][[[00558.htm|next]]][[[00553.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | None
 |  | 
|  |   |  | 
|  | [[[00557.htm|prev]]][[[00559.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Size of Variable in Bytes (SIZEOF Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00561.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00562.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''SIZEOF'''operator returns the number of bytes allocated to the operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''SIZEOF'''[[00473.htm|''Element-Selection-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00558.htm|prev]]][[[00560.htm|next]]][[[00558.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00561.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00562.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00559.htm|prev]]][[[00561.htm|next]]][[[00558.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''SIZEOF'''[[00473.htm|''Element-Selection-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00560.htm|prev]]][[[00562.htm|next]]][[[00558.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''SIZEOF'''operator returns the number of bytes allocated to the operand.
 |  | 
|  |   |  | 
|  | [[[00561.htm|prev]]][[[00563.htm|next]]][[[00558.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | This operator is not available in [[00105.htm|M510]]mode.
 |  | 
|  |   |  | 
|  | [[[00562.htm|prev]]][[[00564.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Record or Field Width (WIDTH Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00566.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00567.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''WIDTH'''operator returns the width of a record or a record field name.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''WIDTH'''[[00527.htm|''Identifier-Operand'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00563.htm|prev]]][[[00565.htm|next]]][[[00563.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00566.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00567.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00564.htm|prev]]][[[00566.htm|next]]][[[00563.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | '''WIDTH'''[[00527.htm|''Identifier-Operand'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00565.htm|prev]]][[[00567.htm|next]]][[[00563.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''WIDTH'''operator returns the width of a record or a record field name.
 |  | 
|  |   |  | 
|  | [[[00566.htm|prev]]][[[00568.htm|next]]][[[00563.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The [[00527.htm|''Identifier-Operand'']]must resolve to a [[00172.htm|''Record-TypeName'']]or [[00159.htm|''Record- FieldName'']]; otherwise the result is zero.
 |  | 
|  |   |  | 
|  | [[[00567.htm|prev]]][[[00569.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Precedence (() Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00571.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00572.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | Parentheses forces the [[00267.htm|''Attribute-Expression'']]operand to be evaluated at a higher precedence level.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Parenthesized-Expression'''':'' <br />'''('''[[00267.htm|''Attribute-Expression'']]''')''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00568.htm|prev]]][[[00570.htm|next]]][[[00568.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00571.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00572.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00569.htm|prev]]][[[00571.htm|next]]][[[00568.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Parenthesized-Expression'''':'' <br />'''('''[[00267.htm|''Attribute-Expression'']]''')''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00570.htm|prev]]][[[00572.htm|next]]][[[00568.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | Parentheses forces the [[00267.htm|''Attribute-Expression'']]operand to be evaluated at a higher precedence level.
 |  | 
|  |   |  | 
|  | [[[00571.htm|prev]]][[[00573.htm|next]]][[[00568.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   Value   =   2   +   3   *   4       ;   Value   =   14 
 |  | 
|  |    Value   =   ( 2   +   3 )   *   4     ;   Value   =   20 </pre>
 |  | 
|  | [[[00572.htm|prev]]][[[00574.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Indirection ([] Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00576.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00577.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00578.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | During evaluation of the [[00267.htm|''Attribute-Expression'']], the '''[]'''('''''indirection'') operator will convert a [[00605.htm|''Register-ExpressionType'']]to a [[00604.htm|''Indexed-ExpressionType'']] by moving the [[00591.htm|''Register Value'']]attribute to either the [[00592.htm|''Base Register'']]or [[00593.htm|''Index Register'']]attribute field as appropriate for the register(s) referenced in the expression. This operation allows values contained in the processor registers to be used during effective address calculation at application run time.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Indirected-Expression'''':'' <br />'''['''[[00267.htm|''Attribute-Expression'']]''']''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00573.htm|prev]]][[[00575.htm|next]]][[[00573.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00576.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00577.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00578.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00574.htm|prev]]][[[00576.htm|next]]][[[00573.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Indirected-Expression'''':'' <br />'''['''[[00267.htm|''Attribute-Expression'']]''']''' <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00575.htm|prev]]][[[00577.htm|next]]][[[00573.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | During evaluation of the [[00267.htm|''Attribute-Expression'']], the '''[]'''(''indirection'') operator will convert a [[00605.htm|''Register-ExpressionType'']]to a [[00604.htm|''Indexed-ExpressionType'']] by moving the [[00591.htm|''Register Value'']]attribute to either the [[00592.htm|''Base Register'']]or [[00593.htm|''Index Register'']]attribute field as appropriate for the register(s) referenced in the expression. This operation allows values contained in the processor registers to be used during effective address calculation at application run time.
 |  | 
|  |   |  | 
|  | [[[00576.htm|prev]]][[[00578.htm|next]]][[[00573.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | See the [[00604.htm|''Indexed-ExpressionType'']]section for information on registers that are valid for use in this context.
 |  | 
|  |   |  | 
|  | [[[00577.htm|prev]]][[[00579.htm|next]]][[[00573.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CODE       SEGMENT 
 |  | 
|  |           ASSUME   CS : CODE ,   DS : CODE 
 |  | 
|  | Value      DW     0 
 |  | 
|  |           MOV    BX , offset   Value            ;   load   the   address   of   Value   into   BX 
 |  | 
|  |           MOV    [ BX ] , BX                     ;   store   the   contents   of   BX   into   the 
 |  | 
|  |                                            ;   memory   location   addressed   by   [ BX ] 
 |  | 
|  | CODE       ENDS </pre>
 |  | 
|  | [[[00578.htm|prev]]][[[00580.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Compound Initializer List (<> Operator) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00582.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00583.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''<>'''(or '''{}''') operator provides a way of specifying a list of expressions to be used for initializing complex (multi-field) variables such as records or structures.
 |  | 
|  |   |  | 
|  | The '''<>'''operator encloses a list of comma-separated expressions; individual expressions are optional, but are also positional with respect to the record or structure fields they are intended to initialize. Commas must therefore be used to maintain field positions if empty expressions are encountered in the list.
 |  | 
|  |   |  | 
|  | The initializer list itself may also be left out entirely for those cases where a variable allocation will use the default initializers provided in the record or structure definition (the '''<>'''or '''{}'''themselves are still required).
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Compound-Initializer'''':'' <br />'''<'''''Initializer-List'''''>''' <br />'''{'''''Initializer-List'''''}''' <br /> <br />''Initializer-List:'' <br />[[00258.htm|''Duplicative-Expression'']] <br />''Initializer-List''''','''[[00258.htm|''Duplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00579.htm|prev]]][[[00581.htm|next]]][[[00579.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00582.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00583.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00580.htm|prev]]][[[00582.htm|next]]][[[00579.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Compound-Initializer'''':'' <br />'''<'''''Initializer-List'''''>''' <br />'''{'''''Initializer-List'''''}''' <br /> <br />''Initializer-List:'' <br />[[00258.htm|''Duplicative-Expression'']] <br />''Initializer-List''''','''[[00258.htm|''Duplicative-Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00581.htm|prev]]][[[00583.htm|next]]][[[00579.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''<>'''(or '''{}''') operator provides a way of specifying a list of expressions to be used for initializing complex (multi-field) variables such as records or structures.
 |  | 
|  |   |  | 
|  | The '''<>'''operator encloses a list of comma-separated expressions; individual expressions are optional, but are also positional with respect to the record or structure fields they are intended to initialize. Commas must therefore be used to maintain field positions if empty expressions are encountered in the list.
 |  | 
|  |   |  | 
|  | The initializer list itself may also be left out entirely for those cases where a variable allocation will use the default initializers provided in the record or structure definition (the '''<>'''or '''{}'''themselves are still required).
 |  | 
|  |   |  | 
|  | [[[00582.htm|prev]]][[[00584.htm|next]]][[[00579.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   Numbers   STRUCT 
 |  | 
|  |      One     DB     0 
 |  | 
|  |      Two     DW     0 
 |  | 
|  |      Three   DB     0 
 |  | 
|  |      Four    DD     0 
 |  | 
|  |    Numbers   ENDS 
 |  | 
|  |   |  | 
|  | First    Numbers   < >               ;   empty   initializer   list 
 |  | 
|  | Second   Numbers   < 1 ,   2 ,   3 ,   4 >    ;   override   all   defaults 
 |  | 
|  | Third    Numbers   < 1 >              ;   override   first   entry   only 
 |  | 
|  | Fourth   Numbers   < 1 , , , 4 >         ;   override   first   and   last   entries </pre>
 |  | 
|  | [[[00583.htm|prev]]][[[00585.htm|next]]][[[00254.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Expression Evaluation ===
 |  | 
|  |   |  | 
|  | After an expression is parsed and checked for syntax errors, it is ''evaluated''. During evaluation, all calculations and conversions are performed on the operands according to the operators that are applied to them. The final result is a collection of [[00585.htm|''Expression-Attribute'']]''s'', to which an [[00596.htm|''ExpressionType'']]is assigned.
 |  | 
|  |   |  | 
|  | [[[00584.htm|prev]]][[[00586.htm|next]]][[[00584.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Expression Attributes ===
 |  | 
|  |   |  | 
|  | This section describes the ''Expression-Attribute''''s''that are associated with an expression after it is evaluated.
 |  | 
|  |   |  | 
|  | [[[00585.htm|prev]]][[[00587.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Address Size ===
 |  | 
|  |   |  | 
|  | If an expression refers to an effective address, then it also has an associated [[00797.htm|address size]]. The following [[00596.htm|''ExpressionType'']]''s''normally reference an effective address, and thus have an associated address size:
 |  | 
|  |   |  | 
|  | �[[00601.htm|''Immediate-ExpressionType'']] <br />�[[00602.htm|''Direct-ExpressionType'']] <br />�[[00603.htm|''Indirect-ExpressionType'']] <br />�[[00604.htm|''Indexed-ExpressionType'']] <br />
 |  | 
|  |   |  | 
|  | The address size can be either 2 ('''USE16''') or 4 ('''USE32'''). For an expression that references a label, the address size of the segment where the label is defined determines the address size of the expression.
 |  | 
|  |   |  | 
|  | [[[00586.htm|prev]]][[[00588.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operand Size ===
 |  | 
|  |   |  | 
|  | The ''Operand Size''of an expression can be set explicitly using the [[00461.htm|Type Conversion (PTR Operator)]], or it may be a side-effect inherited from the type of data referenced in the expression. The following table describes the operand sizes that will be assigned when an identifier is referenced in an expression: <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------------------------------------------\
 |  | 
|  | |REFERENCE                |OPERAND SIZE                       |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |8-Bit-Register           |1                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |16-Bit-Register          |2                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |32-Bit-Register          |4                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Segment-Register         |2                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Control-Register         |4                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Debug-Register           |4                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Test-Register            |4                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |MMX-Register             |8                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Floating-Point-Register  |10                                 |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |BYTE                     |1                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |SBYTE                    |1                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |WORD                     |2                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |SWORD                    |2                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |DWORD                    |4                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |SDWORD                   |4                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |REAL4                    |4                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |FWORD                    |6                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |QWORD                    |8                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |REAL8                    |8                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |TBYTE                    |10                                 |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |REAL10                   |10                                 |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |NEAR                     |2 or 4                             |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |NEAR16                   |2                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |NEAR32                   |4                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |FAR                      |4 or 6                             |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |FAR16                    |4                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |FAR32                    |6                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Numeric-EquateName       |Inherited from equate expression   |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |GroupName                |2                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |SegmentName              |2                                  |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Code-LabelName           |SIZE (TYPE Code-LabelName)         |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Data-LabelName           |SIZE (TYPE Data-LabelName)         |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Structure-FieldName      |SIZE Structure-FieldName           |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Record-TypeName          |SIZE Record-TypeName               |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Structure-TypeName       |SIZE Structure-TypeName            |
 |  | 
|  | |-------------------------+-----------------------------------|
 |  | 
|  | |Union-TypeName           |SIZE Union-TypeName                |
 |  | 
|  | \-------------------------------------------------------------/</pre>
 |  | 
|  | The ''Operand Size''is 0 for all other identifier types.
 |  | 
|  |   |  | 
|  | [[[00587.htm|prev]]][[[00589.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Displacement ===
 |  | 
|  |   |  | 
|  | The ''Displacement''value in an expression is the final calculated value of all numeric quantities, and must be a scalar value. It may also be a reference to a relocatable address, in which case the expression will also have a [[00589.htm|''Relative Frame'']]and/or an [[00590.htm|''External Reference'']]attribute. A ''Displacement''may be used in the calculation of an effective address, either alone or in combination with a [[00592.htm|''Base Register'']]and/or an [[00593.htm|''Index Register'']].
 |  | 
|  |   |  | 
|  | [[[00588.htm|prev]]][[[00590.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Relative Frame ===
 |  | 
|  |   |  | 
|  | The ''Relative Frame''attribute will be present if the expression contains a direct or indirect reference to any of the following [[00152.htm|''Identifier-Type'']]''s'''':''
 |  | 
|  |   |  | 
|  | �[[00162.htm|''GroupName'']] <br />�[[00163.htm|''LabelName'']] <br />�[[00170.htm|''SegmentName'']] <br />
 |  | 
|  |   |  | 
|  | The ''Relative Frame''attribute indicates that the expression is relocatable, and specifies the [[00162.htm|''GroupName'']]or [[00170.htm|''SegmentName'']]to which the expression is relative.
 |  | 
|  |   |  | 
|  | [[[00589.htm|prev]]][[[00591.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === External Reference ===
 |  | 
|  |   |  | 
|  | The ''External Reference''attribute will be present if the expression references any external identifiers.
 |  | 
|  |   |  | 
|  | [[[00590.htm|prev]]][[[00592.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Register Value ===
 |  | 
|  |   |  | 
|  | The ''Register Value''attribute specifies the value of the [[00122.htm|''Processor-Register'']] referenced in a [[00605.htm|''Register-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00591.htm|prev]]][[[00593.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Base Register ===
 |  | 
|  |   |  | 
|  | The ''Base Register''attribute specifies the value for the base register used in an [[00604.htm|''Indexed-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00592.htm|prev]]][[[00594.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Index Register ===
 |  | 
|  |   |  | 
|  | The ''Index Register''attribute specifies the value for the index register used in an [[00604.htm|''Indexed-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00593.htm|prev]]][[[00595.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Scale Factor ===
 |  | 
|  |   |  | 
|  | The ''Scale Factor''attribute specifies the scaling value used (if any) in an [[00604.htm|''Indexed-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00594.htm|prev]]][[[00596.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Type Declaration ===
 |  | 
|  |   |  | 
|  | The ''Type Declaration''attribute specifies the type of data referenced in the expression. This is the value extracted from the expression when it is used as the left operand of the [[00461.htm|Type Conversion (PTR Operator)]].
 |  | 
|  |   |  | 
|  | [[[00595.htm|prev]]][[[00597.htm|next]]][[[00584.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Expression Types ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | An ''ExpressionType''is assigned to every expression during evaluation. The ''ExpressionType''is used to determine whether or not an expression is legal for the context in which it is used. The type of an expression is influenced primarily by the operands that are used, but the use of expression operators also play an important part in determining the type of an expression.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''ExpressionType'''':'' <br />[[00599.htm|''Absolute-ExpressionType'']] <br />[[00600.htm|''Constant-ExpressionType'']] <br />[[00602.htm|''Direct-ExpressionType'']] <br />[[00607.htm|''Floating-Point-ExpressionType'']] <br />[[00601.htm|''Immediate-ExpressionType'']] <br />[[00603.htm|''Indirect-ExpressionType'']] <br />[[00604.htm|''Indexed-ExpressionType'']] <br />[[00605.htm|''Register-ExpressionType'']] <br />[[00606.htm|''String-ExpressionType'']] <br />[[00608.htm|''Type-ExpressionType'']] <br />[[00610.htm|''Duplicated-ExpressionType'']] <br />[[00609.htm|''Compound-ExpressionType'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00596.htm|prev]]][[[00598.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | An ''ExpressionType''is assigned to every expression during evaluation. The ''ExpressionType''is used to determine whether or not an expression is legal for the context in which it is used. The type of an expression is influenced primarily by the operands that are used, but the use of expression operators also play an important part in determining the type of an expression.
 |  | 
|  |   |  | 
|  | [[[00597.htm|prev]]][[[00599.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Definition ===
 |  | 
|  |   |  | 
|  | ''ExpressionType'''':'' <br />[[00599.htm|''Absolute-ExpressionType'']] <br />[[00600.htm|''Constant-ExpressionType'']] <br />[[00602.htm|''Direct-ExpressionType'']] <br />[[00607.htm|''Floating-Point-ExpressionType'']] <br />[[00601.htm|''Immediate-ExpressionType'']] <br />[[00603.htm|''Indirect-ExpressionType'']] <br />[[00604.htm|''Indexed-ExpressionType'']] <br />[[00605.htm|''Register-ExpressionType'']] <br />[[00606.htm|''String-ExpressionType'']] <br />[[00608.htm|''Type-ExpressionType'']] <br />[[00610.htm|''Duplicated-ExpressionType'']] <br />[[00609.htm|''Compound-ExpressionType'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00598.htm|prev]]][[[00600.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Absolute Expression Type ===
 |  | 
|  |   |  | 
|  | An ''Absolute-ExpressionType''is an expression that evaluates to an integer quantity. Its value must be representable using one of the following types of scalar data:
 |  | 
|  |   |  | 
|  | �'''BYTE''' <br />�'''SBYTE''' <br />�'''WORD''' <br />�'''SWORD''' <br />�'''DWORD''' <br />�'''SDWORD''' <br />�'''FWORD''' <br />�'''QWORD''' <br />�'''TBYTE''' <br />
 |  | 
|  |   |  | 
|  | The following restrictions apply to an ''Absolute-ExpressionType'''':''
 |  | 
|  |   |  | 
|  | �It cannot be relocatable (it may not contain references to a [[00162.htm|''GroupName'']], [[00170.htm|''SegmentName'']]or [[00163.htm|''LabelName'']]). <br />�It cannot reference any [[00590.htm|external]]symbols. <br />�It cannot contain any forward references. <br />
 |  | 
|  |   |  | 
|  | [[[00599.htm|prev]]][[[00601.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constant Expression Type ===
 |  | 
|  |   |  | 
|  | A ''Constant-ExpressionType''is an [[00599.htm|''Absolute-ExpressionType'']]with the following restrictions relaxed:
 |  | 
|  |   |  | 
|  | �It may contain forward references to identifiers defined later in the source stream. <br />�It may reference a single [[00590.htm|external]]symbol, provided that the symbol was declared in an '''EXTERN'''directive with the '''ABS'''attribute. <br />
 |  | 
|  |   |  | 
|  | [[[00600.htm|prev]]][[[00602.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Immediate Expression Type ===
 |  | 
|  |   |  | 
|  | An ''Immediate-ExpressionType''has all the properties of a [[00600.htm|''Constant- ExpressionType'']]with the following restrictions relaxed:
 |  | 
|  |   |  | 
|  | �It may contain references to a [[00162.htm|''GroupName'']], [[00170.htm|''SegmentName'']]or [[00163.htm|''LabelName'']](it may be relocatable). <br />�It may reference a relocatable [[00590.htm|external]]symbol. <br />
 |  | 
|  |   |  | 
|  | An ''Immediate-ExpressionType''must not be larger than 32 bits in magnitude; its value must be representable using one of the following types of scalar data:
 |  | 
|  |   |  | 
|  | �'''BYTE''' <br />�'''SBYTE''' <br />�'''WORD''' <br />�'''SWORD''' <br />�'''DWORD''' <br />�'''SDWORD''' <br />
 |  | 
|  |   |  | 
|  | [[[00601.htm|prev]]][[[00603.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Direct Expression Type ===
 |  | 
|  |   |  | 
|  | A ''Direct-ExpressionType''is an expression that references a [[00164.htm|''Code-LabelName'']]. It can be used directly in code-relative instructions without conversion. There is no data type associated with the address that a ''Direct- ExpressionType''represents, therefore It may not be used in a data-relative instruction without first being explicitly converted to another expression type.
 |  | 
|  |   |  | 
|  | [[[00602.htm|prev]]][[[00604.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Indirect Expression Type ===
 |  | 
|  |   |  | 
|  | An ''Indirect-ExpressionType''is an expression that references a [[00167.htm|''Data- LabelName'']]. It can be used directly in data-relative instructions without conversion to another expression type.
 |  | 
|  |   |  | 
|  | [[[00603.htm|prev]]][[[00605.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Indexed Expression Type ===
 |  | 
|  |   |  | 
|  | An ''Indexed-ExpressionType''is an expression that calculates an effective memory address using the contents of a '''''Base-Register'', an '''''Index-Register'', or both. A [[00122.htm|''Processor-Register'']]must first be converted to a ''Base-Register''or ''Index-Register''by specifying it as the operand of the [[00573.htm|Indirection ([] Operator)]]before the expression can be converted to an ''Indexed- ExpressionType''.''''''
 |  | 
|  |   |  | 
|  | When calculating a 16-bit effective address, only the '''BP'''and '''BX'''registers may be used as ''Base-Registers'', and only the '''DI'''and '''SI'''registers may be used as ''Index-Registers''.
 |  | 
|  |   |  | 
|  | When calculating a 32-bit effective address, only the '''EAX, EBX, ECX, EDX, EDI, ESI, EBP, and ESP'''registers may be used as ''Base-Registers'', and only the '''EAX, EBX, ECX, EDX, EDI, ESI, and EBP'''registers may be used as ''Index- Registers''.
 |  | 
|  |   |  | 
|  | '''Note:'''Only a single ''Base-Register''and a single ''Index-Register''may be used in a given expression.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | On 80386 (and higher) processors, the [[00377.htm|Multiplication (* Operator)]]may be used with an ''Index-Register''operand and an [[00599.htm|''Absolute-ExpressionType'']]operand to establish a scaling factor that is applied to the ''Index-Register''during effective address calculation. The scaling factor effectively causes the ''Index-Register''to be multiplied by a fixed value at run time. The scaling [[00255.htm|''Expression'']]must evaluate to 1 (no scale factor), 2, 4, or 8.
 |  | 
|  |   |  | 
|  | A [[00602.htm|''Direct-ExpressionType'']]or an [[00603.htm|''Indirect-ExpressionType'']]may be a sub- expression of an ''Indexed-ExpressionType''.
 |  | 
|  |   |  | 
|  | [[[00604.htm|prev]]][[[00606.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Register Expression Type ===
 |  | 
|  |   |  | 
|  | A ''Register-ExpressionType''is an expression that specifies a single [[00122.htm|''Processor-Register'']].
 |  | 
|  |   |  | 
|  | [[[00605.htm|prev]]][[[00607.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === String Expression Type ===
 |  | 
|  |   |  | 
|  | A ''String-ExpressionType''is an expression that specifies a single [[00241.htm|''String- Literal'']].
 |  | 
|  |   |  | 
|  | [[[00606.htm|prev]]][[[00608.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Floating-Point Expression Type ===
 |  | 
|  |   |  | 
|  | A ''Floating-Point-ExpressionType''is an expression that specifies a single [[00226.htm|''Floating-Point-Literal'']].
 |  | 
|  |   |  | 
|  | [[[00607.htm|prev]]][[[00609.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Type Expression Type ===
 |  | 
|  |   |  | 
|  | A ''Type-ExpressionType''is an expression that specifies one of the following:
 |  | 
|  |   |  | 
|  | �A [[00125.htm|''Scalar-TypeName'']] <br />�A [[00128.htm|''Distance-TypeName'']] <br />�A [[00171.htm|''UserDefined-TypeName'']] <br />
 |  | 
|  |   |  | 
|  | [[[00608.htm|prev]]][[[00610.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Compound Expression Type ===
 |  | 
|  |   |  | 
|  | A ''Compound-ExpressionType''evaluates to a list of (possibly nested) expressions collected together as a unit by the [[00579.htm|Compound Initializer List ( <> Operator)]]. A ''Compound-ExpressionType''is used to initialize [[00711.htm|aggregate]] data types (such as records, structures, and unions) and [[00712.htm|vector]]data types (arrays).
 |  | 
|  |   |  | 
|  | [[[00609.htm|prev]]][[[00611.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Duplicated Expression Type ===
 |  | 
|  |   |  | 
|  | A ''Duplicated-ExpressionType''evaluates to an expression that is to be duplicated (repeated) a specified number of times. This type of expression is created using the [[00261.htm|Duplicative Initialization (DUP Operator)]].
 |  | 
|  |   |  | 
|  | [[[00610.htm|prev]]][[[00612.htm|next]]][[[00584.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operand Expression Type ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | An ''Operand-ExpressionType''consists of those [[00596.htm|''ExpressionType'']]''s''that are valid for use as operands in processor instructions. The following [[00596.htm|''ExpressionType'']]''s''are not valid for use as an ''Operand-ExpressionType'''':''
 |  | 
|  |   |  | 
|  | �[[00609.htm|''Compound-ExpressionType'']] <br />�[[00610.htm|''Duplicated-ExpressionType'']] <br />
 |  | 
|  |   |  | 
|  | A [[00606.htm|''String-ExpressionType'']]is only valid as an ''Operand-ExpressionType''if it is short enough to be converted to an [[00599.htm|''Absolute-ExpressionType'']]having an [[00587.htm|''Operand Size'']]less than or equal to the current [[00586.htm|''Address Size'']]setting.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Operand-ExpressionType'''':'' <br />[[00599.htm|''Absolute-ExpressionType'']] <br />[[00600.htm|''Constant-ExpressionType'']] <br />[[00601.htm|''Immediate-ExpressionType'']] <br />[[00602.htm|''Direct-ExpressionType'']] <br />[[00603.htm|''Indirect-ExpressionType'']] <br />[[00604.htm|''Indexed-ExpressionType'']] <br />[[00605.htm|''Register-ExpressionType'']] <br />[[00606.htm|''String-ExpressionType'']] <br />[[00607.htm|''Floating-Point-ExpressionType'']] <br />[[00608.htm|''Type-ExpressionType'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00611.htm|prev]]][[[00613.htm|next]]][[[00611.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | An ''Operand-ExpressionType''consists of those [[00596.htm|''ExpressionType'']]''s''that are valid for use as operands in processor instructions. The following [[00596.htm|''ExpressionType'']]''s''are not valid for use as an ''Operand-ExpressionType'''':''
 |  | 
|  |   |  | 
|  | �[[00609.htm|''Compound-ExpressionType'']] <br />�[[00610.htm|''Duplicated-ExpressionType'']] <br />
 |  | 
|  |   |  | 
|  | A [[00606.htm|''String-ExpressionType'']]is only valid as an ''Operand-ExpressionType''if it is short enough to be converted to an [[00599.htm|''Absolute-ExpressionType'']]having an [[00587.htm|''Operand Size'']]less than or equal to the current [[00586.htm|''Address Size'']]setting.
 |  | 
|  |   |  | 
|  | [[[00612.htm|prev]]][[[00614.htm|next]]][[[00611.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Definition ===
 |  | 
|  |   |  | 
|  | ''Operand-ExpressionType'''':'' <br />[[00599.htm|''Absolute-ExpressionType'']] <br />[[00600.htm|''Constant-ExpressionType'']] <br />[[00601.htm|''Immediate-ExpressionType'']] <br />[[00602.htm|''Direct-ExpressionType'']] <br />[[00603.htm|''Indirect-ExpressionType'']] <br />[[00604.htm|''Indexed-ExpressionType'']] <br />[[00605.htm|''Register-ExpressionType'']] <br />[[00606.htm|''String-ExpressionType'']] <br />[[00607.htm|''Floating-Point-ExpressionType'']] <br />[[00608.htm|''Type-ExpressionType'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00613.htm|prev]]][[[00615.htm|next]]][[[00584.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Initializer Expression Type ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | An ''Initializer-ExpressionType''consists of those [[00596.htm|''ExpressionType'']]''s''that are valid for use in initializing variables. The following [[00596.htm|''ExpressionType'']]''s''are not valid ''Initializer-ExpressionType''''s'''':''
 |  | 
|  |   |  | 
|  | �[[00604.htm|''Indexed-ExpressionType'']] <br />�[[00605.htm|''Register-ExpressionType'']] <br />
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Initializer-ExpressionType'''':'' <br />''Scalar-Initializer-ExpressionType'' <br />[[00609.htm|''Compound-ExpressionType'']] <br />[[00610.htm|''Duplicated-ExpressionType'']] <br /> <br />
 |  | 
|  |   |  | 
|  | ''Scalar-Initializer-ExpressionType'''':'' <br />[[00599.htm|''Absolute-ExpressionType'']] <br />[[00600.htm|''Constant-ExpressionType'']] <br />[[00601.htm|''Immediate-ExpressionType'']] <br />[[00602.htm|''Direct-ExpressionType'']] <br />[[00603.htm|''Indirect-ExpressionType'']] <br />[[00606.htm|''String-ExpressionType'']] <br />[[00607.htm|''Floating-Point-ExpressionType'']] <br />[[00608.htm|''Type-ExpressionType'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00614.htm|prev]]][[[00616.htm|next]]][[[00614.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | An ''Initializer-ExpressionType''consists of those [[00596.htm|''ExpressionType'']]''s''that are valid for use in initializing variables. The following [[00596.htm|''ExpressionType'']]''s''are not valid ''Initializer-ExpressionType''''s'''':''
 |  | 
|  |   |  | 
|  | �[[00604.htm|''Indexed-ExpressionType'']] <br />�[[00605.htm|''Register-ExpressionType'']] <br />
 |  | 
|  |   |  | 
|  | [[[00615.htm|prev]]][[[00617.htm|next]]][[[00614.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Definition ===
 |  | 
|  |   |  | 
|  | ''Initializer-ExpressionType'''':'' <br />''Scalar-Initializer-ExpressionType'' <br />[[00609.htm|''Compound-ExpressionType'']] <br />[[00610.htm|''Duplicated-ExpressionType'']] <br /> <br />
 |  | 
|  |   |  | 
|  | ''Scalar-Initializer-ExpressionType'''':'' <br />[[00599.htm|''Absolute-ExpressionType'']] <br />[[00600.htm|''Constant-ExpressionType'']] <br />[[00601.htm|''Immediate-ExpressionType'']] <br />[[00602.htm|''Direct-ExpressionType'']] <br />[[00603.htm|''Indirect-ExpressionType'']] <br />[[00606.htm|''String-ExpressionType'']] <br />[[00607.htm|''Floating-Point-ExpressionType'']] <br />[[00608.htm|''Type-ExpressionType'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00616.htm|prev]]][[[00618.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Text Preprocessor ===
 |  | 
|  |   |  | 
|  | The text preprocessor is a functional unit within the assembler that performs the '''''text preprocessing''translation phase. During text preprocessing, the following actions are performed:'''
 |  | 
|  |   |  | 
|  | 1.[[00107.htm|Language Elements]]are recognized.
 |  | 
|  |   |  | 
|  | 2.Text equates and macros are expanded.
 |  | 
|  |   |  | 
|  | 3.[[00687.htm|Macro directives]]and [[00665.htm|conditional assembly directives]]are recognized and processed.
 |  | 
|  |   |  | 
|  | 4.The preprocessed output is passed on to the assembler for final processing. <br />
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | This section also describes the various types of preprocessor directives: <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------------------------------------------------------------\
 |  | 
|  | |Type                     |Function                 |Directives               |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Conditional Assembly     |Tests for a specified    |IF                       |
 |  | 
|  | |                         |condition and assembles a|IFB                      |
 |  | 
|  | |                         |block of statements if   |IFDEF                    |
 |  | 
|  | |                         |the condition is true.   |IFDIFI                   |
 |  | 
|  | |                         |                         |IFE                      |
 |  | 
|  | |                         |                         |IFIDN                    |
 |  | 
|  | |                         |                         |IFNB                     |
 |  | 
|  | |                         |                         |IFNDEF                   |
 |  | 
|  | |                         |                         |IF1                      |
 |  | 
|  | |                         |                         |IF2                      |
 |  | 
|  | |                         |                         |ELSE                     |
 |  | 
|  | |                         |                         |ENDIF                    |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Text Equate              |Allows assignment of     |CATSTR                   |
 |  | 
|  | |                         |simple text strings to a |EQU                      |
 |  | 
|  | |                         |symbolic name. Provides  |INSTR                    |
 |  | 
|  | |                         |functions for expanding  |SIZESTR                  |
 |  | 
|  | |                         |and operating on the     |SUBSTR                   |
 |  | 
|  | |                         |values.                  |                         |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Macro                    |Provides text processing |ENDM                     |
 |  | 
|  | |                         |that is done sequentially|EXITM                    |
 |  | 
|  | |                         |at assembly time. By the |FOR                      |
 |  | 
|  | |                         |end of assembly, ALP     |FORC                     |
 |  | 
|  | |                         |expands all macros and   |IRP                      |
 |  | 
|  | |                         |assembles the resulting  |IRPC                     |
 |  | 
|  | |                         |text into object code.   |LOCAL                    |
 |  | 
|  | |                         |                         |MACRO                    |
 |  | 
|  | |                         |                         |PURGE                    |
 |  | 
|  | |                         |                         |REPEAT                   |
 |  | 
|  | |                         |                         |REPT                     |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Miscellaneous            |Miscellaneous text       |COMMENT                  |
 |  | 
|  | |                         |processing functions.    |ECHO                     |
 |  | 
|  | |                         |                         |%OUT                     |
 |  | 
|  | |                         |                         |INCLUDE                  |
 |  | 
|  | \-----------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00617.htm|prev]]][[[00619.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Text Operators ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The [[00617.htm|Text Preprocessor]]recognizes certain punctuator characters as text operators. The programmer may use these operators to force the [[00617.htm|Text Preprocessor]]to perform various operations such as delineating text, expanding arguments, and converting expressions into their text representations.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Text-Operator'''':'' <br />[[00621.htm|''Literal-Character-Operator'']] <br />[[00627.htm|''Literal-Text-Operator'']] <br />[[00632.htm|''Text-Expansion-Operator'']] <br />[[00638.htm|''Text-Substitution-Operator'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00618.htm|prev]]][[[00620.htm|next]]][[[00618.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The [[00617.htm|Text Preprocessor]]recognizes certain punctuator characters as text operators. The programmer may use these operators to force the [[00617.htm|Text Preprocessor]]to perform various operations such as delineating text, expanding arguments, and converting expressions into their text representations.
 |  | 
|  |   |  | 
|  | [[[00619.htm|prev]]][[[00621.htm|next]]][[[00618.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Text-Operator'''':'' <br />[[00621.htm|''Literal-Character-Operator'']] <br />[[00627.htm|''Literal-Text-Operator'']] <br />[[00632.htm|''Text-Expansion-Operator'']] <br />[[00638.htm|''Text-Substitution-Operator'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00620.htm|prev]]][[[00622.htm|next]]][[[00618.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Literal Character Operator (!) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00624.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00625.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00626.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | When you use an exclamation point (!) in an operand, ALP treats the next character literally. (!) is typically used to prevent the assembler from recognizing and acting upon special characters such as the semicolon (;) or the ampersand (&), forcing them to appear as normal data characters.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Literal-Character-Operator'''':'' <br />'''!'''any printable character <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00621.htm|prev]]][[[00623.htm|next]]][[[00621.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00624.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00625.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00626.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00622.htm|prev]]][[[00624.htm|next]]][[[00621.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Literal-Character-Operator'''':'' <br />'''!'''any printable character <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00623.htm|prev]]][[[00625.htm|next]]][[[00621.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | When you use an exclamation point (!) in an operand, ALP treats the next character literally. (!) is typically used to prevent the assembler from recognizing and acting upon special characters such as the semicolon (;) or the ampersand (&), forcing them to appear as normal data characters.
 |  | 
|  |   |  | 
|  | [[[00624.htm|prev]]][[[00626.htm|next]]][[[00621.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The ''Literal-Character-Operator''has no effect when used inside of a [[00241.htm|''String- Literal'']].
 |  | 
|  |   |  | 
|  | [[[00625.htm|prev]]][[[00627.htm|next]]][[[00621.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | In this example, use of the ! in the second macro argument prevents the assembler from interpreting the rest of the line as a comment: <br />
 |  | 
|  |   |  | 
|  | <pre>   MACRONAME   First ,   ! ; NonComment ,   Third              ; Comment </pre>
 |  | 
|  | [[[00626.htm|prev]]][[[00628.htm|next]]][[[00618.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Literal Text Operator (<>) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00630.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00631.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The literal-text operator directs the assembler to treat ''Char-Sequence''as a single literal element regardless of whether it contains commas, spaces, or other separators. The operator is most often used with macro calls and the FOR directive to ensure that values in a parameter list are treated as a single parameter.
 |  | 
|  |   |  | 
|  | The literal-text operator can also be used to force ALP to treat other special characters such as the semicolon (;) or the ampersand (&) literally . For example, the semicolon inside angle brackets (<;>) becomes a semicolon, not a comment indicator.
 |  | 
|  |   |  | 
|  | ALP removes one set of angle brackets each time the parameter is used in a macro. When using nested macros, you will need to supply as many sets of angle brackets as there are levels of nesting. The assembler recognizes nested occurrences of text literals.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Literal-Text-Operator'''':'' <br />'''<'''''Char-Sequence'''''>''' <br /> <br />''Char-Sequence'' <br />any printable character <br />''Char-Sequence''any printable character <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00627.htm|prev]]][[[00629.htm|next]]][[[00627.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00630.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00631.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00628.htm|prev]]][[[00630.htm|next]]][[[00627.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Literal-Text-Operator'''':'' <br />'''<'''''Char-Sequence'''''>''' <br /> <br />''Char-Sequence'' <br />any printable character <br />''Char-Sequence''any printable character <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00629.htm|prev]]][[[00631.htm|next]]][[[00627.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The literal-text operator directs the assembler to treat ''Char-Sequence''as a single literal element regardless of whether it contains commas, spaces, or other separators. The operator is most often used with macro calls and the FOR directive to ensure that values in a parameter list are treated as a single parameter.
 |  | 
|  |   |  | 
|  | The literal-text operator can also be used to force ALP to treat other special characters such as the semicolon (;) or the ampersand (&) literally . For example, the semicolon inside angle brackets (<;>) becomes a semicolon, not a comment indicator.
 |  | 
|  |   |  | 
|  | ALP removes one set of angle brackets each time the parameter is used in a macro. When using nested macros, you will need to supply as many sets of angle brackets as there are levels of nesting. The assembler recognizes nested occurrences of text literals.
 |  | 
|  |   |  | 
|  | [[[00630.htm|prev]]][[[00632.htm|next]]][[[00627.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | The following example illustrates how to pass arbitrary text to a macro as a single parameter: <br />
 |  | 
|  |   |  | 
|  | <pre>   MACRONAME   First ,   < Second   Argument > ,   < Third ,   < Nested > ,   Argument > </pre>
 |  | 
|  | The macro will receive three separate arguments:
 |  | 
|  |   |  | 
|  | 1.First <br /> 2.Second Argument <br /> 3.Third, <Nested>, Argument <br />
 |  | 
|  |   |  | 
|  | Notice that the outermost set of angle brackets were removed from the second and third arguments.
 |  | 
|  |   |  | 
|  | [[[00631.htm|prev]]][[[00633.htm|next]]][[[00618.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Text Expansion Operator (%) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00635.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00636.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00637.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The '''%'''''Text-Expansion-Operator''has different effects depending upon the context in which it is used. Its primary purpose is convert various sources of information into text literals that may in turn be passed to macros as arguments.
 |  | 
|  |   |  | 
|  | The '''%'''''Text-Expansion-Operator''causes the following types of conversions:
 |  | 
|  |   |  | 
|  | '''Line Expansion'''
 |  | 
|  |   |  | 
|  | When used as the first token on the line, the '''%'''operator forces expansion of [[00157.htm|''Text-EquateName'']]''s''in contexts where they would otherwise be left unexpanded. [[00157.htm|''Text-EquateName'']]''s''passed as arguments to macros are not automatically expanded; this is one context where the '''%'''operator is useful.
 |  | 
|  |   |  | 
|  | '''Expansion of a Text Equate Operand'''
 |  | 
|  |   |  | 
|  | As with '''''Line Expansion'', the '''%'''operator may be used within the body of a line to expand individual [[00157.htm|''Text-EquateName'']]''s''. This can be useful when expansion of all [[00157.htm|''Text-EquateName'']]''s''on the line is not desired.'''
 |  | 
|  |   |  | 
|  | '''Conversion of Numeric Expression to Text'''
 |  | 
|  |   |  | 
|  | If the ''Text-Expansion-Operator''is not the first token on the line or immediately followed by a [[00157.htm|''Text-EquateName'']], then the argument of the '''%''' operator is assumed to be an [[00255.htm|''Expression'']], which is evaluated and converted to the text representation of its value. This is useful when the need arises to pass the text representation of a number to a macro. <br />
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Text-Expansion-Operator'''':'' <br />'''%'''2nd through Nth token on line <br />'''%'''[[00157.htm|''Text-EquateName'']] <br />'''%'''[[00255.htm|''Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00632.htm|prev]]][[[00634.htm|next]]][[[00632.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00635.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00636.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00637.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00633.htm|prev]]][[[00635.htm|next]]][[[00632.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Text-Expansion-Operator'''':'' <br />'''%'''2nd through Nth token on line <br />'''%'''[[00157.htm|''Text-EquateName'']] <br />'''%'''[[00255.htm|''Expression'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00634.htm|prev]]][[[00636.htm|next]]][[[00632.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The '''%'''''Text-Expansion-Operator''has different effects depending upon the context in which it is used. Its primary purpose is convert various sources of information into text literals that may in turn be passed to macros as arguments.
 |  | 
|  |   |  | 
|  | The '''%'''''Text-Expansion-Operator''causes the following types of conversions:
 |  | 
|  |   |  | 
|  | '''Line Expansion'''
 |  | 
|  |   |  | 
|  | When used as the first token on the line, the '''%'''operator forces expansion of [[00157.htm|''Text-EquateName'']]''s''in contexts where they would otherwise be left unexpanded. [[00157.htm|''Text-EquateName'']]''s''passed as arguments to macros are not automatically expanded; this is one context where the '''%'''operator is useful.
 |  | 
|  |   |  | 
|  | '''Expansion of a Text Equate Operand'''
 |  | 
|  |   |  | 
|  | As with '''''Line Expansion'', the '''%'''operator may be used within the body of a line to expand individual [[00157.htm|''Text-EquateName'']]''s''. This can be useful when expansion of all [[00157.htm|''Text-EquateName'']]''s''on the line is not desired.'''
 |  | 
|  |   |  | 
|  | '''Conversion of Numeric Expression to Text'''
 |  | 
|  |   |  | 
|  | If the ''Text-Expansion-Operator''is not the first token on the line or immediately followed by a [[00157.htm|''Text-EquateName'']], then the argument of the '''%''' operator is assumed to be an [[00255.htm|''Expression'']], which is evaluated and converted to the text representation of its value. This is useful when the need arises to pass the text representation of a number to a macro. <br />
 |  | 
|  |   |  | 
|  | [[[00635.htm|prev]]][[[00637.htm|next]]][[[00632.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | When the '''%'''[[00255.htm|''Expression'']]form of the expansion operator is used, the [[00255.htm|''Expression'']]must evaluate to an [[00601.htm|''Immediate-ExpressionType'']].
 |  | 
|  |   |  | 
|  | [[[00636.htm|prev]]][[[00638.htm|next]]][[[00632.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>MakErr       MACRO       X 
 |  | 
|  | LB           =           0 
 |  | 
|  |              REPEAT      X 
 |  | 
|  | LB           =           LB + 1 
 |  | 
|  |              MakLib      % LB 
 |  | 
|  |              ENDM        ; ; End   of   REPEAT 
 |  | 
|  |              ENDM        ; ; End   of   MACRO 
 |  | 
|  | MakLib       MACRO       Y 
 |  | 
|  | Err & Y :    DB     ' Error    & Y ' , 0 
 |  | 
|  |              ENDM 
 |  | 
|  |   |  | 
|  |              MakErr   3 
 |  | 
|  | Err1 :    DB    ' Error   1 ' , 0 
 |  | 
|  | Err2 :    DB    ' Error   2 ' , 0 
 |  | 
|  | Err3 :    DB    ' Error   3 ' , 0 </pre>
 |  | 
|  | [[[00637.htm|prev]]][[[00639.htm|next]]][[[00618.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Text Substitution Operator (&) ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00641.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00642.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00643.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | An ampersand (&) is used in the body of a macro to force the substitution of a [[00169.htm|''Macro-ParameterName'']]with the value of its argument during expansion of the macro.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Text-Substitution-Operator'''':'' <br />[[00169.htm|''Macro-ParameterName'']]'''&''' <br />'''&'''[[00169.htm|''Macro-ParameterName'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00638.htm|prev]]][[[00640.htm|next]]][[[00638.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00641.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00642.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[00643.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00639.htm|prev]]][[[00641.htm|next]]][[[00638.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Text-Substitution-Operator'''':'' <br />[[00169.htm|''Macro-ParameterName'']]'''&''' <br />'''&'''[[00169.htm|''Macro-ParameterName'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00640.htm|prev]]][[[00642.htm|next]]][[[00638.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | An ampersand (&) is used in the body of a macro to force the substitution of a [[00169.htm|''Macro-ParameterName'']]with the value of its argument during expansion of the macro.
 |  | 
|  |   |  | 
|  | [[[00641.htm|prev]]][[[00643.htm|next]]][[[00638.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | The assembler does not substitute a [[00169.htm|''Macro-ParameterName'']]that is in a quoted string or not preceded by a delimiter in the expansion unless it is immediately preceded by an ampersand (&).
 |  | 
|  |   |  | 
|  | It is necessary to separate a [[00169.htm|''Macro-ParameterName'']]from other [[00149.htm|''Identifer- Character'']]''s''with an ampersand (&) before any substitution or paste operations are performed.
 |  | 
|  |   |  | 
|  | [[[00642.htm|prev]]][[[00644.htm|next]]][[[00638.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>ErrGen      MACRO      X 
 |  | 
|  | Error & X :    push      bx 
 |  | 
|  | ABX         mov        BX ,   " A " 
 |  | 
|  | AB & X        jmp        ERROR 
 |  | 
|  |            ENDM </pre>
 |  | 
|  | The statement '''ErrGen A'''produces this code: <br />
 |  | 
|  |   |  | 
|  | <pre>ErrorA :    push       bx 
 |  | 
|  | ABX         mov        BX ,   " A " 
 |  | 
|  | ABA        jmp        ERROR </pre>
 |  | 
|  | [[[00643.htm|prev]]][[[00645.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Preprocessor Tokens ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | During the text preprocessing translation phase, certain conditions will cause the preprocessor to convert raw [[00107.htm|Language Elements]]([[00107.htm|''Token'']]''s'') into ''Preprocessing-Token''''s''. The act of text preprocessing typically causes ''Preprocessing-Token''''s''to either be removed from the input stream or converted back into [[00107.htm|''Token'']]''s''before being passed on to the assembler for final processing.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Preprocessing-Token'''':'' <br />[[00149.htm|''Identifier'']] <br />[[00647.htm|''Text-Literal'']] <br />[[00652.htm|''FileName'']] <br />[[00657.htm|''Comment'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00644.htm|prev]]][[[00646.htm|next]]][[[00644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | During the text preprocessing translation phase, certain conditions will cause the preprocessor to convert raw [[00107.htm|Language Elements]]([[00107.htm|''Token'']]''s'') into ''Preprocessing-Token''''s''. The act of text preprocessing typically causes ''Preprocessing-Token''''s''to either be removed from the input stream or converted back into [[00107.htm|''Token'']]''s''before being passed on to the assembler for final processing.
 |  | 
|  |   |  | 
|  | [[[00645.htm|prev]]][[[00647.htm|next]]][[[00644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Preprocessing-Token'''':'' <br />[[00149.htm|''Identifier'']] <br />[[00647.htm|''Text-Literal'']] <br />[[00652.htm|''FileName'']] <br />[[00657.htm|''Comment'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00646.htm|prev]]][[[00648.htm|next]]][[[00644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Text Literals ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00650.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00651.htm|Constraints]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | A ''Text-Literal''is a single unit of text that is used by the [[00617.htm|Text Preprocessor]]in many different text handling contexts. In some contexts ( such as the processing of arguments to be passed to a macro), normal language [[00107.htm|''Token'']]''s''are implicitly treated as ''Text-Literal''''s'', provided they are not a delimiter character such as a comma or a blank. In other contexts, it may be necessary to explicitly convert a unit of text to a ''Text-Literal'' using the [[00627.htm|''Literal-Text-Operator'']].
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Text-Literal'''':'' <br />operand of [[00621.htm|''Literal-Character-Operator'']] <br />operand of [[00627.htm|''Literal-Text-Operator'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00647.htm|prev]]][[[00649.htm|next]]][[[00647.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00650.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00651.htm|Constraints]]
 |  | 
|  |   |  | 
|  | [[[00648.htm|prev]]][[[00650.htm|next]]][[[00647.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Text-Literal'''':'' <br />operand of [[00621.htm|''Literal-Character-Operator'']] <br />operand of [[00627.htm|''Literal-Text-Operator'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00649.htm|prev]]][[[00651.htm|next]]][[[00647.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | A ''Text-Literal''is a single unit of text that is used by the [[00617.htm|Text Preprocessor]]in many different text handling contexts. In some contexts ( such as the processing of arguments to be passed to a macro), normal language [[00107.htm|''Token'']]''s''are implicitly treated as ''Text-Literal''''s'', provided they are not a delimiter character such as a comma or a blank. In other contexts, it may be necessary to explicitly convert a unit of text to a ''Text-Literal'' using the [[00627.htm|''Literal-Text-Operator'']].
 |  | 
|  |   |  | 
|  | [[[00650.htm|prev]]][[[00652.htm|next]]][[[00647.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Constraints ===
 |  | 
|  |   |  | 
|  | A normal language [[00107.htm|''Token'']]is never implicitly considered to be a ''Text-Literal'' if a ''Text-Literal''is explicitly required in the syntax of the construct being parsed.
 |  | 
|  |   |  | 
|  | [[[00651.htm|prev]]][[[00653.htm|next]]][[[00644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === File Names ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00655.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00656.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''FileName''arguments may be coded as an arbitrary sequence of printable characters, or as a [[00647.htm|''Text-Literal'']]; use the [[00647.htm|''Text-Literal'']]form if the ''FileName'' is to contain embedded spaces or other special characters.
 |  | 
|  |   |  | 
|  | If path information is included in the ''FileName'', you can separate the individual directory names with either the back slash (\) or the forward slash (/) and they will be treated identically by the assembler.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''FileName'''':'' <br />''FileName-Text'' <br />[[00647.htm|''Text-Literal'']] <br /> <br />''FileName-Text'''':'' <br />''FileName-Character'' <br />''FileName-Text''''FileName-Character'' <br /> <br />''FileName-Character''.'':'' <br />any printable character except blank (ASCII 32) <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00652.htm|prev]]][[[00654.htm|next]]][[[00652.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00655.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00656.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00653.htm|prev]]][[[00655.htm|next]]][[[00652.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''FileName'''':'' <br />''FileName-Text'' <br />[[00647.htm|''Text-Literal'']] <br /> <br />''FileName-Text'''':'' <br />''FileName-Character'' <br />''FileName-Text''''FileName-Character'' <br /> <br />''FileName-Character''.'':'' <br />any printable character except blank (ASCII 32) <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00654.htm|prev]]][[[00656.htm|next]]][[[00652.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | ''FileName''arguments may be coded as an arbitrary sequence of printable characters, or as a [[00647.htm|''Text-Literal'']]; use the [[00647.htm|''Text-Literal'']]form if the ''FileName'' is to contain embedded spaces or other special characters.
 |  | 
|  |   |  | 
|  | If path information is included in the ''FileName'', you can separate the individual directory names with either the back slash (\) or the forward slash (/) and they will be treated identically by the assembler.
 |  | 
|  |   |  | 
|  | [[[00655.htm|prev]]][[[00657.htm|next]]][[[00652.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>   INCLUDE      < inc \ macros . inc > 
 |  | 
|  |    INCLUDELIB   os2386 . lib </pre>
 |  | 
|  | [[[00656.htm|prev]]][[[00658.htm|next]]][[[00644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Comments ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[00660.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00661.htm|Examples]]
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | '''''Comments''are language elements that have significance only to the programmer and not to the assembler. Comments are effectively removed from the input stream during the text preprocessing phase.'''
 |  | 
|  |   |  | 
|  | There are two classes of comments recognized by ALP:
 |  | 
|  |   |  | 
|  | �Comments that start with a character sequence and continue to the end of the line (''EndOfLine-Comment'')
 |  | 
|  |   |  | 
|  | �Comments that start with a character sequence and continue until the occurrence of another character sequence (''Block-Comment''). See the [[00700.htm|COMMENT]] directive for a description of [[00700.htm|''Block-Comment'']]''s''. <br />
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | There are two types of ''EndOfLine-Comment''''s'''':''
 |  | 
|  |   |  | 
|  | '''''Macro-Comment'''''
 |  | 
|  |   |  | 
|  | '''''Macro-Comments''(beginning with two semicolons) do not appear in the listing output even when the .LALL directive is used. Use of ''Macro-Comments''can significantly reduce the amount of memory workspace used by the definition of a macro. As a macro definition is read, ''Macro-Comments''are discarded and not entered into the macro definition, whereas ''NonMacro-Comments''are treated as normal text and are retained.'''
 |  | 
|  |   |  | 
|  | '''''NonMacro-Comment'''''
 |  | 
|  |   |  | 
|  | '''''NonMacro-Comment''(beginning with a single semicolon) are preserved in macro definitions and appear in the listing output during macro expansions. <br />'''
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Comment'''':'' <br />''EndOfLine-Comment'' <br />[[00700.htm|''Block-Comment'']] <br /> <br />''EndOfLine-Comment'''':'' <br />''NonMacro-Comment'' <br />''Macro-Comment'' <br /> <br />''NonMacro-Comment'''':'' <br />''';'''''Char-Sequence'' <br /> <br />''Macro-Comment'''':'' <br />''';;'''''Char-Sequence'' <br /> <br />''Char-Sequence'''':'' <br />any printable character <br />''Char-Sequence''any printable character <br /> <br />[[00700.htm|''Block-Comment'']]'':'' <br />See the [[00700.htm|COMMENT]]directive <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00657.htm|prev]]][[[00659.htm|next]]][[[00657.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[00660.htm|Description]]
 |  | 
|  |   |  | 
|  | [[00661.htm|Examples]]
 |  | 
|  |   |  | 
|  | [[[00658.htm|prev]]][[[00660.htm|next]]][[[00657.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Comment'''':'' <br />''EndOfLine-Comment'' <br />[[00700.htm|''Block-Comment'']] <br /> <br />''EndOfLine-Comment'''':'' <br />''NonMacro-Comment'' <br />''Macro-Comment'' <br /> <br />''NonMacro-Comment'''':'' <br />''';'''''Char-Sequence'' <br /> <br />''Macro-Comment'''':'' <br />''';;'''''Char-Sequence'' <br /> <br />''Char-Sequence'''':'' <br />any printable character <br />''Char-Sequence''any printable character <br /> <br />[[00700.htm|''Block-Comment'']]'':'' <br />See the [[00700.htm|COMMENT]]directive <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00659.htm|prev]]][[[00661.htm|next]]][[[00657.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | '''''Comments''are language elements that have significance only to the programmer and not to the assembler. Comments are effectively removed from the input stream during the text preprocessing phase.'''
 |  | 
|  |   |  | 
|  | There are two classes of comments recognized by ALP:
 |  | 
|  |   |  | 
|  | �Comments that start with a character sequence and continue to the end of the line (''EndOfLine-Comment'')
 |  | 
|  |   |  | 
|  | �Comments that start with a character sequence and continue until the occurrence of another character sequence (''Block-Comment''). See the [[00700.htm|COMMENT]] directive for a description of [[00700.htm|''Block-Comment'']]''s''. <br />
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | There are two types of ''EndOfLine-Comment''''s'''':''
 |  | 
|  |   |  | 
|  | '''''Macro-Comment'''''
 |  | 
|  |   |  | 
|  | '''''Macro-Comments''(beginning with two semicolons) do not appear in the listing output even when the .LALL directive is used. Use of ''Macro-Comments''can significantly reduce the amount of memory workspace used by the definition of a macro. As a macro definition is read, ''Macro-Comments''are discarded and not entered into the macro definition, whereas ''NonMacro-Comments''are treated as normal text and are retained.'''
 |  | 
|  |   |  | 
|  | '''''NonMacro-Comment'''''
 |  | 
|  |   |  | 
|  | ''NonMacro-Comment''(beginning with a single semicolon) are preserved in macro definitions and appear in the listing output during macro expansions. <br />
 |  | 
|  |   |  | 
|  | [[[00660.htm|prev]]][[[00662.htm|next]]][[[00657.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Examples ===
 |  | 
|  |   |  | 
|  | The following are examples of ''EndOfLine-Comment''''s'''':''<br />
 |  | 
|  |   |  | 
|  | <pre>;   Comments   may   be   on   a   line   all   by   themselves .    They   can   be   empty . . . 
 |  | 
|  | ; 
 |  | 
|  |                                 ;   They   don ' t   have   to   start   in   the   first   column 
 |  | 
|  | BumpCount   MACRO   Amount         ;   They   can   appear   to   the   right   of   statements 
 |  | 
|  |    Count   =   Count   +   Amount       ;   This   appears   in   macro   expansions 
 |  | 
|  |    $ Total   =   $ Total   +   Amount     ; ; This   does   not ,   discarded   during   definition 
 |  | 
|  | ENDM </pre>
 |  | 
|  | [[[00661.htm|prev]]][[[00663.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Text Arguments ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | Many preprocessing directives operate on sequences of raw text characters called ''Text-Argument''''s''. A ''Text-Argument''may be specified using any one of several methods:
 |  | 
|  |   |  | 
|  | �Specifying the text directly using a raw [[00647.htm|''Text-Literal'']].
 |  | 
|  |   |  | 
|  | �Using the [[00632.htm|''Text-Expansion-Operator'']]to convert a numeric expression to its text representation.
 |  | 
|  |   |  | 
|  | �Using a [[00157.htm|''Text-EquateName'']]in those contexts where a ''Text-Argument''is expected. In this case the preprocessor will automatically resolve the [[00157.htm|''Text-EquateName'']]and use its value as the ''Text-Argument''. <br />
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | ''Text-Argument'''':'' <br />[[00647.htm|''Text-Literal'']] <br />'''%'''[[00255.htm|''Expression'']] <br />[[00157.htm|''Text-EquateName'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00662.htm|prev]]][[[00664.htm|next]]][[[00662.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | Many preprocessing directives operate on sequences of raw text characters called ''Text-Argument''''s''. A ''Text-Argument''may be specified using any one of several methods:
 |  | 
|  |   |  | 
|  | �Specifying the text directly using a raw [[00647.htm|''Text-Literal'']].
 |  | 
|  |   |  | 
|  | �Using the [[00632.htm|''Text-Expansion-Operator'']]to convert a numeric expression to its text representation.
 |  | 
|  |   |  | 
|  | �Using a [[00157.htm|''Text-EquateName'']]in those contexts where a ''Text-Argument''is expected. In this case the preprocessor will automatically resolve the [[00157.htm|''Text-EquateName'']]and use its value as the ''Text-Argument''. <br />
 |  | 
|  |   |  | 
|  | [[[00663.htm|prev]]][[[00665.htm|next]]][[[00662.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Syntax ===
 |  | 
|  |   |  | 
|  | ''Text-Argument'''':'' <br />[[00647.htm|''Text-Literal'']] <br />'''%'''[[00255.htm|''Expression'']] <br />[[00157.htm|''Text-EquateName'']] <br /> <br />
 |  | 
|  |   |  | 
|  | [[[00664.htm|prev]]][[[00666.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Conditional Assembly Directives ===
 |  | 
|  |   |  | 
|  | At assembly time, ALP evaluates conditional assembly directives, assembling if the conditions are true. You can use conditional assembly directives when you want to test for a specified condition and assemble a block of statements if the condition is true. The [[00666.htm|IFxx]]and [[00680.htm|ENDIF]]directives enclose the statements to be considered for conditional assembly. The optional [[00679.htm|ELSEIFxx]]and [[00679.htm|ELSE]]blocks follow the [[00666.htm|IFxx]]directive. There are many forms of the [[00666.htm|IFxx]]and [[00679.htm|ELSEIFxx]]directives.
 |  | 
|  |   |  | 
|  | This section describes the following conditional assembly directives:
 |  | 
|  |   |  | 
|  | [[00667.htm|IF]] <br />[[00668.htm|IFB]] <br />[[00669.htm|IFDEF]] <br />[[00670.htm|IFDIF]] <br />[[00671.htm|IFDIFI]] <br />[[00672.htm|IFE]] <br />[[00673.htm|IFIDN]] <br />[[00674.htm|IFIDNI]] <br />[[00675.htm|IFNB]] <br />[[00676.htm|IFNDEF]] <br />[[00677.htm|IF1]] <br />[[00678.htm|IF2]] <br />[[00679.htm|ELSE]] <br />[[00680.htm|ENDIF]] <br />
 |  | 
|  |   |  | 
|  | [[[00665.htm|prev]]][[[00667.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IFxx (Begin Primary Conditional Block) ===
 |  | 
|  |   |  | 
|  | You can use each '''IFxx'''conditional directive with the [[00679.htm|ELSExx]], [[00679.htm|ELSE]]and [[00680.htm|ENDIF]] directives to provide the statements to be considered for conditional assembly. ALP assembles the statements following the [[00666.htm|IFxx]]directive only if this condition is true.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFxx   operand 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | [ ELSEIFxx ]   ( optional ) 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | [ ELSE ]   ( optional ) 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The following directives are members of the '''IFxx'''family:
 |  | 
|  |   |  | 
|  | �[[00667.htm|IF]] <br />�[[00668.htm|IFB]] <br />�[[00669.htm|IFDEF]] <br />�[[00670.htm|IFDIF]] <br />�[[00671.htm|IFDIFI]] <br />�[[00672.htm|IFE]] <br />�[[00673.htm|IFIDN]] <br />�[[00674.htm|IFIDNI]] <br />�[[00675.htm|IFNB]] <br />�[[00676.htm|IFNDEF]] <br />�[[00677.htm|IF1]] <br />�[[00678.htm|IF2]]
 |  | 
|  |   |  | 
|  | You can nest the conditional directives to any level. They are not limited to use within a macro. The assembler must know any operand to a conditional on pass one to avoid errors and incorrect evaluation. <br />
 |  | 
|  |   |  | 
|  | [[[00666.htm|prev]]][[[00668.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IF (If Expression is True) ===
 |  | 
|  |   |  | 
|  | '''IF'''starts a conditional assembly statement, which is ended by the corresponding [[00680.htm|ENDIF]]conditional assembly directive. Each '''IF'''directive must be ended by a matching [[00680.htm|ENDIF]]directive.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF   Expression 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | [ ELSEIFxx ]   ( optional ) 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | [ ELSE ]   ( optional ) 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If the [[00666.htm|IFxx]]conditional assembly statement is not ended by an [[00680.htm|ENDIF]] directive, an ''unterminated conditional''message is produced by the assembler . An [[00680.htm|ENDIF]]without a matching '''IF'''causes an error. [[00680.htm|ENDIF]]does not have an operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Note:'''The conditional directives can be nested to any level. They are not limited to use within a macro. Any operand to a conditional must be known on pass 1 to avoid errors and incorrect evaluation.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF   debug 
 |  | 
|  |       EXTERN   dump : FAR 
 |  | 
|  |       EXTERN   trace : FAR 
 |  | 
|  |       EXTERN   breakpoint : FAR 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00667.htm|prev]]][[[00669.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IFB (If Argument is Blank) ===
 |  | 
|  |   |  | 
|  | This is true if [[00662.htm|''Text-Argument'']]is blank (contains no characters).
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFB   Text - Argument </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | A [[00662.htm|''Text-Argument'']]must be specified, the contents of which are checked for the presence of characters. An error is generated if a [[00662.htm|''Text-Argument'']]is not supplied. <br />
 |  | 
|  |   |  | 
|  | [[[00668.htm|prev]]][[[00670.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IFDEF (If Identifier is Defined) ===
 |  | 
|  |   |  | 
|  | This is true if [[00149.htm|''Identifier'']]has been defined as a label, variable, or symbol .
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFDEF   Identifier </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00669.htm|prev]]][[[00671.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IFDIF (If Arguments Are Different) ===
 |  | 
|  |   |  | 
|  | This is true if [[00662.htm|''Text-Argument'']]''-1''and [[00662.htm|''Text-Argument'']]''-2''are different in a case -sensitive comparison.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFDIF   Text - Argument - 1 ,   Text - Argument - 2 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Both [[00662.htm|''Text-Argument'']]arguments must be specified. An error is generated if a either argument is not supplied.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In the following example: <br />
 |  | 
|  |   |  | 
|  | <pre>IFDIF   < EAGLES > , < Eagles > 
 |  | 
|  |    value   =   1 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | the condition would be true; the arguments are different because they are compared with a case-sensitive algorithm. <br />
 |  | 
|  |   |  | 
|  | [[[00670.htm|prev]]][[[00672.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IFDIFI (If Arguments Are Spelled Differently) ===
 |  | 
|  |   |  | 
|  | This is true if [[00662.htm|''Text-Argument'']]''-1''and [[00662.htm|''Text-Argument'']]''-2''are different in a case -insensitive comparison.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFDIFI   Text - Argument - 1 ,   Text - Argument - 2 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Both [[00662.htm|''Text-Argument'']]arguments must be specified. An error is generated if a either argument is not supplied.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In the following example: <br />
 |  | 
|  |   |  | 
|  | <pre>IFDIFI   < EAGLES > , < Eagles > 
 |  | 
|  |    value   =   1 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | the condition would be false; the arguments are not different because they are compared using a case-insensitive algorithm. <br />
 |  | 
|  |   |  | 
|  | [[[00671.htm|prev]]][[[00673.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IFE (If Expression is Not True) ===
 |  | 
|  |   |  | 
|  | This is true if ''expression''is 0.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFE   Expression </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00672.htm|prev]]][[[00674.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IFIDN (If Arguments Are Identical) ===
 |  | 
|  |   |  | 
|  | This is true if [[00662.htm|''Text-Argument'']]''-1''and [[00662.htm|''Text-Argument'']]''-2''are identical in a case -sensitive comparison.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFIDN   Text - Argument - 1 ,   Text - Argument - 2 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Both [[00662.htm|''Text-Argument'']]arguments must be specified. An error is generated if a either argument is not supplied.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In the following example: <br />
 |  | 
|  |   |  | 
|  | <pre>IFIDN   < EAGLES > , < Eagles > 
 |  | 
|  |    value   =   1 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | the condition would be false; the arguments are not identical because they are compared using a case-insensitive algorithm. <br />
 |  | 
|  |   |  | 
|  | [[[00673.htm|prev]]][[[00675.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IFIDNI (If Arguments Are Spelled Identically) ===
 |  | 
|  |   |  | 
|  | This is true if [[00662.htm|''Text-Argument'']]''-1''and [[00662.htm|''Text-Argument'']]''-2''are identical in a case -insensitive comparison.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFIDNI   Text - Argument - 1 ,   Text - Argument - 2 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Both [[00662.htm|''Text-Argument'']]arguments must be specified. An error is generated if a either argument is not supplied.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In the following example: <br />
 |  | 
|  |   |  | 
|  | <pre>IFIDNI   < EAGLES > , < Eagles > 
 |  | 
|  |    value   =   1 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | the condition would be true; the arguments are identical because they are compared using a case-insensitive algorithm. <br />
 |  | 
|  |   |  | 
|  | [[[00674.htm|prev]]][[[00676.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IFNB (If Argument is Not Blank) ===
 |  | 
|  |   |  | 
|  | This is true if [[00662.htm|''Text-Argument'']]is not blank (characters are present).
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFNB   Text - Argument </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | A [[00662.htm|''Text-Argument'']]must be specified, the contents of which are checked for the presence of characters. An error is generated if a [[00662.htm|''Text-Argument'']]is not supplied. <br />
 |  | 
|  |   |  | 
|  | [[[00675.htm|prev]]][[[00677.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IFNDEF (If Identifier is Not Defined) ===
 |  | 
|  |   |  | 
|  | This is true if ''symbol''has not yet been defined as a label, variable, or symbol.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFNDEF   symbol </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00676.htm|prev]]][[[00678.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IF1 (If Assembling On Pass 1) ===
 |  | 
|  |   |  | 
|  | This is true on pass one.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF1 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | '''IF1'''does not have an operand. <br />
 |  | 
|  |   |  | 
|  | [[[00677.htm|prev]]][[[00679.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === IF2 (If Assembling On Pass 2) ===
 |  | 
|  |   |  | 
|  | This is true on pass two.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF2 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | '''IF2'''does not have an operand. <br />
 |  | 
|  |   |  | 
|  | [[[00678.htm|prev]]][[[00680.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ELSEIFxx/ELSE (Begin Alternate Conditional Block) ===
 |  | 
|  |   |  | 
|  | Each conditional directive can be used with the '''ELSE'''directive to provide the statements to be considered for conditional assembly. The '''ELSE''' directive allows the assembly of the statements following it when the [[00666.htm|IFxx]] condition or intervening '''ELSEIFxx'''conditions are false.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFxx 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | [ ELSEIFxx ]   ( optional ) 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | [ ELSE ]   ( optional ) 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | There is a corresponding '''ELSEIFxx'''directive to match all forms of the [[00666.htm|IFxx]] family of directives:
 |  | 
|  |   |  | 
|  | �[[00667.htm|ELSEIF]] <br />�[[00668.htm|ELSEIFB]] <br />�[[00669.htm|ELSEIFDEF]] <br />�[[00670.htm|ELSEIFDIF]] <br />�[[00671.htm|ELSEIFDIFI]] <br />�[[00672.htm|ELSEIFE]] <br />�[[00673.htm|ELSEIFIDN]] <br />�[[00674.htm|ELSEIFIDNI]] <br />�[[00675.htm|ELSEIFNB]] <br />�[[00676.htm|ELSEIFNDEF]] <br />�[[00677.htm|ELSEIF1]] <br />�[[00678.htm|ELSEIF2]]
 |  | 
|  |   |  | 
|  | For information about the meaning of the conditional tests performed by the '''ELSEIFxx'''directives, refer to the definitions for the corresponding [[00666.htm|IFxx]] directives.
 |  | 
|  |   |  | 
|  | Any number of '''ELSEIFxx'''blocks may be used within a given [[00666.htm|IFxx]]statement. Only one '''ELSE'''block is permitted for a given [[00666.htm|IFxx]]. A conditional directive with more than one '''ELSE'''or an '''ELSE'''without a conditional directive causes an error. '''ELSE'''does not have an operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Note:'''The conditional directives can be nested to any level. They are not limited to use within a macro. Any operand to a conditional must be known on pass 1 to avoid errors and incorrect evaluation.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF   DEFBUF 
 |  | 
|  |   |  | 
|  |     BUF   DB   100   DUP ( 0 ) 
 |  | 
|  |   |  | 
|  | ELSE 
 |  | 
|  |   |  | 
|  |     EXTERN   BUF : BYTE 
 |  | 
|  |   |  | 
|  | ENDIF </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00679.htm|prev]]][[[00681.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ENDIF (End a Conditional Assembly Statement) ===
 |  | 
|  |   |  | 
|  | '''ENDIF'''ends the conditional assembly statement begun by the corresponding [[00666.htm|IFxx]]conditional assembly directive. Each [[00666.htm|IFxx]]directive must be ended by a matching '''ENDIF'''directive.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IFxx 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | [ ELSEIFxx ]   ( optional ) 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | [ ELSE ]   ( optional ) 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If the [[00666.htm|IFxx]]conditional assembly statement is not ended by an '''ENDIF''' directive, an '''unterminated conditional'''message is produced by the assembler . An '''ENDIF'''without a matching [[00666.htm|IFxx]]causes an error. '''ENDIF'''does not have an operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Note:'''The conditional directives can be nested to any level. They are not limited to use within a macro. Any operand to a conditional must be known on pass 1 to avoid errors and incorrect evaluation.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF   debug 
 |  | 
|  |     EXTERN   dump : FAR 
 |  | 
|  |     EXTERN   trace : FAR 
 |  | 
|  |     EXTERN   breakpoint : FAR 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00680.htm|prev]]][[[00682.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Text Equate Directives ===
 |  | 
|  |   |  | 
|  | A '''''Text Equate''is a symbolic name you give to a series of characters. Text equates are used to expand text within a source statement. The directives described in this section create and manipulate text equates.'''
 |  | 
|  |   |  | 
|  | EQU <br />CATSTR <br />INSTR <br />SIZESTR <br />SUBSTR <br />
 |  | 
|  |   |  | 
|  | [[[00681.htm|prev]]][[[00683.htm|next]]][[[00681.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === CATSTR (Concatenate Strings) ===
 |  | 
|  |   |  | 
|  | '''CATSTR'''concatenates a list of text values specified by ''string''into a single text value and assigns it to ''Name''.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   CATSTR   string [ ,   string ]   . . . </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00682.htm|prev]]][[[00684.htm|next]]][[[00681.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === EQU Directive (Assign Text to a Symbolic Constant) ===
 |  | 
|  |   |  | 
|  | The '''EQU'''directive assigns the contents of a text literal to ''Name''.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   EQU   Text - Literal </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The value of the [[00647.htm|''Text-Literal'']]is assigned to the ''Name''entry. In normal contexts, subsequent references to ''Name''will cause the preprocessor to replace ''Name''with the value specified by the [[00647.htm|''Text-Literal'']]entry. This is a simple text substitution operation.
 |  | 
|  |   |  | 
|  | The ''Name''entry is a globally-scoped [[00149.htm|''Identifier'']]that is converted to a [[00157.htm|''Text- EquateName'']]. The ''Name''cannot have been previously defined as a different [[00152.htm|''Identifier-Type'']]. However, the ''Name''entry can be redefined as many times as desired with different values for the [[00647.htm|''Text-Literal'']]entry.
 |  | 
|  |   |  | 
|  | See also [[00791.htm|EQU]]and [[00786.htm|=]].
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>A      EQU     < BP   + >    ; explicit   text   literal ,   A   is   a   text   equate 
 |  | 
|  | A      EQU     < 3 >       ; redefinition   of   A   with   different   value </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00683.htm|prev]]][[[00685.htm|next]]][[[00681.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === INSTR (Search In String For Value) ===
 |  | 
|  |   |  | 
|  | '''INSTR'''searches a specified ''String''for an occurrence of a given ''Sub-String'' and assigns its position (1-based) to ''Name''. The search is case sensitive. ''Start''is the position in ''String''to start the search for ''Sub-String''. If ''Start''is not given, it is assumed to be 1 (the start of the string). If ''Sub-String''is not found, the position assigned to ''Name''is 0.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   INSTR   [ Start , ] String , Sub - String </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | '''INSTR'''assigns the position value to a name as if it were a numeric equate.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>pos   INSTR   < person > ,   < son > </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00684.htm|prev]]][[[00686.htm|next]]][[[00681.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === SIZESTR (Return Size Of String) ===
 |  | 
|  |   |  | 
|  | Assigns the number of characters given by the [[00662.htm|''Text-Argument'']]to ''Name''.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   SIZESTR   Text - Argument </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00685.htm|prev]]][[[00687.htm|next]]][[[00681.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === SUBSTR (Extract a Sub-string From a String) ===
 |  | 
|  |   |  | 
|  | Assigns a substring of [[00662.htm|''Text-Argument'']]starting at ''Position''to the symbol given by ''Name.''.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   SUBSTR   Text - Argument , Position [ , Length ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The ''Position''parameter indicates the starting character of the substring to extract from the [[00662.htm|''Text-Argument'']], and must be 1 or greater. If specified, the ''Length''parameter indicates how many characters are desired, otherwise the remainder of the string is extracted. <br />
 |  | 
|  |   |  | 
|  | [[[00686.htm|prev]]][[[00688.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Macro Directives ===
 |  | 
|  |   |  | 
|  | '''A macro procedure or function''', which is comprised of one or more statements .
 |  | 
|  |   |  | 
|  | Macro processing is text processing that is done sequentially at assembly time. By the end of assembly, ALP expands all macros and assembles the resulting text into object code.
 |  | 
|  |   |  | 
|  | This section describes the following types of macros:
 |  | 
|  |   |  | 
|  | �Macro procedures, which expand to one or more complete statements and can optionally take parameters <br />�Repeat blocks, which generate a group of statements a specified number of times or until a condition becomes true <br />
 |  | 
|  |   |  | 
|  | This section describes the following macro directives:
 |  | 
|  |   |  | 
|  | ENDM <br />EXITM <br />FOR/IRP <br />FORC/IRPC <br />LOCAL <br />MACRO <br />PURGE <br />REPEAT/REPT <br />
 |  | 
|  |   |  | 
|  | [[[00687.htm|prev]]][[[00689.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ENDM (End Current Macro Definition) ===
 |  | 
|  |   |  | 
|  | End each [[00693.htm|MACRO]], [[00697.htm|REPEAT/REPT]], [[00690.htm|FOR/IRP]], and [[00691.htm|FORC/IRPC]]directive with the '''ENDM''' directive.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>ENDM </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If the '''ENDM'''directive is not used with the [[00693.htm|MACRO]], [[00697.htm|REPEAT/REPT]], [[00690.htm|FOR/IRP]], and [[00691.htm|FORC/IRPC]]directives, an error occurs. An unmatched '''ENDM'''also causes an error.
 |  | 
|  |   |  | 
|  | If the assembler produces an error message stating that it found the end-of -file on the source and cannot find an [[00715.htm|END]]statement when there was an [[00715.htm|END]], the likely cause is a missing '''ENDM'''or ENDIF statement. Without '''ENDM''', the assembler treats the rest of the source as part of the [[00693.htm|MACRO]]definition.
 |  | 
|  |   |  | 
|  | '''Note:'''The ''name field''is not allowed. Do not confuse the '''ENDM'''directive with other ending directives that do require the name of the block being ended, such as ENDP or ENDS.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>addup     MACRO     ad1 , ad2 , ad3 
 |  | 
|  |          MOV       AX , ad1         ; ; first   parameter   in   AX 
 |  | 
|  |          ADD       AX , ad2         ; ; add   next   two   parameters 
 |  | 
|  |          ADD       AX , ad3         ; ; leave   sum   in   AX 
 |  | 
|  |          ENDM </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00688.htm|prev]]][[[00690.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === EXITM (End Current Macro Expansion) ===
 |  | 
|  |   |  | 
|  | Use the '''EXITM'''directive when a block contains a directive that tests for some condition and you want to end the current macro expansion when the test proves that the remainder of the expansion is not required. When an '''EXITM'''directive is run, the expansion is stopped immediately, and any remaining expansion or repetition is not produced.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>EXITM </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Only the block containing the '''EXITM'''directive is ended; outer levels of a nested macro expansion continue unaffected.
 |  | 
|  |   |  | 
|  | '''EXITM'''is executed at macro expansion time and is not a substitute for the [[00688.htm|ENDM]]directive, which marks the end of the macro body and is recognized at macro definition time.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>DSEG   SEGMENT 
 |  | 
|  |       . 
 |  | 
|  |       . 
 |  | 
|  |       . 
 |  | 
|  | SYM   =   0 
 |  | 
|  |       REPEAT   16 
 |  | 
|  | ; ; Check   for   paragraph   boundary 
 |  | 
|  |       IF   ( $ - DSEG )   MOD   16   EQ   0 
 |  | 
|  |       EXITM   ; ; quit   if   padded   to   boundary 
 |  | 
|  |       ENDIF 
 |  | 
|  | SYM   =   SYM   +   1 
 |  | 
|  |       DB   SYM   ; ; produce   numbered   padding 
 |  | 
|  |       ENDM </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00689.htm|prev]]][[[00691.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === FOR/IRP (Iterative Macro Expansion Using List of Arguments) ===
 |  | 
|  |   |  | 
|  | The '''FOR'''directive, used in combination with the [[00688.htm|ENDM]]directive, designates a block of statements to be repeated, once for each argument in the list enclosed by angle brackets. Each repetition substitutes the next item in the <''Argument-List''> entry for every occurrence of ''Parameter''in the block.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>FOR   Parameter ,   < Argument - List > 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | ENDM </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The obsolete spelling for the '''FOR'''directive is '''IRP'''.
 |  | 
|  |   |  | 
|  | You must enclose the <''Argument-List''> entry in angle brackets. It has the following format: <br />
 |  | 
|  |   |  | 
|  | <pre>< [ Argument   [ ,   Argument   . . . ] ] > </pre>
 |  | 
|  | If an empty (<>) ''Argument''is found in <''Argument-List''>, the ''Parameter''name is replaced by a null value. If the argument list is empty, the '''FOR''' directive is ignored and no statements are copied. The assembler processes the block once for each ''Argument''in the <''Argument-List''>, replacing each occurrence of ''Parameter''in the macro body with the current ''Argument''value.
 |  | 
|  |   |  | 
|  | The [[00690.htm|FOR/IRP]]-[[00688.htm|ENDM]]block does not have to be within a macro definition.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In this example, the assembler produces the code '''DB'''1 through '''DB'''10. <br />
 |  | 
|  |   |  | 
|  | <pre>FOR     X ,   < 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 > 
 |  | 
|  | DB      X 
 |  | 
|  | ENDM </pre>
 |  | 
|  | In the next example: <br />
 |  | 
|  |   |  | 
|  | <pre>FOR      ARGUMENT , < " first   line " , 13 , 10 , 
 |  | 
|  | " second   line " , 13 , 10 > 
 |  | 
|  | DB      ARGUMENT 
 |  | 
|  | ENDM </pre>
 |  | 
|  | The assembler produces the code: <br />
 |  | 
|  |   |  | 
|  | <pre>DB     " first   line " 
 |  | 
|  | DB     13 
 |  | 
|  | DB     10 
 |  | 
|  | DB     " second   line " 
 |  | 
|  | DB     13 
 |  | 
|  | DB     10 </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00690.htm|prev]]][[[00692.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === FORC/IRPC (Iterative Macro Expansion Using List of Characters) ===
 |  | 
|  |   |  | 
|  | The assembler repeats the statements in the block once for each character in the string. Each repetition substitutes the next character in the string for every occurrence of ''Parameter''in the block.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>FORC   Parameter ,   String   ( or   < String > ) 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | ENDM </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The obsolete spelling for the '''FORC'''directive is '''IRPC'''.
 |  | 
|  |   |  | 
|  | The '''FORC'''directive is similar to the [[00690.htm|FOR/IRP]]directive except that a ''String'' is used instead of <''Argument-List''>, and the angle brackets around the string are optional. The string should be enclosed with angle brackets (<> ) if it contains spaces, commas, or other separating characters.
 |  | 
|  |   |  | 
|  | The [[00691.htm|FORC/IRPC]]-[[00688.htm|ENDM]]block does not have to be within a macro definition.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In this example, the assembler produces the code '''DB'''1 through '''DB'''8: <br />
 |  | 
|  |   |  | 
|  | <pre>FORC      X , 12345678 
 |  | 
|  | DB        X 
 |  | 
|  | ENDM </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00691.htm|prev]]][[[00693.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === LOCAL (Identify Names Local to a Macro Definition) ===
 |  | 
|  |   |  | 
|  | The '''LOCAL'''directive is used inside the body of a macro definition, and provides a method of automatically generating unique assembler labels each time the macro is expanded. The names appearing in the argument list of the '''LOCAL'''directive are known only to the enclosing macro, and each time they are referenced during a macro expansion a unique symbol is created. This prevents the assembler from issuing duplicate definition errors when the macro is expanded more than once and symbols contained therein are being used to create assembler labels.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>LOCAL   Name   [ ,   Name . . . . ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''LOCAL'''directive is recognized only within the body of a macro given by a [[00693.htm|MACRO]], [[00690.htm|FOR/IRP]], [[00691.htm|FORC/IRPC]], or [[00697.htm|REPEAT/REPT]]definition. The symbols created by the preprocessor are of the form '''??nnnn''', where '''nnnn'''is a hexadecimal number in the range 0000 through FFFF. You must avoid using identifiers of this form for your own purposes, because doing so can cause duplicate definition errors.
 |  | 
|  |   |  | 
|  | To insure that they have the proper effect, '''LOCAL'''statements should appear in the body of the macro before any other directives are used. It is acceptable for blank lines or comments to precede any '''LOCAL'''statements.
 |  | 
|  |   |  | 
|  | You can use multiple '''LOCAL'''statements if the argument list is too long to fit on one line, or if you want a vertical list of '''LOCAL'''symbols.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>DISPLAY   MACRO   TT 
 |  | 
|  |   |  | 
|  | ;   Blank   lines   and   comments   are   ok   here 
 |  | 
|  |          LOCAL   AGAIN 
 |  | 
|  |   |  | 
|  | ; ;   DOS   macro   to   display   message   addressed   by   BX   TT   times 
 |  | 
|  |          MOV     CX , TT 
 |  | 
|  |          MOV     AH , 9 
 |  | 
|  |          MOV     DX , BX 
 |  | 
|  | ; Generate   a   unique   label   for   AGAIN 
 |  | 
|  | AGAIN : 
 |  | 
|  |          INT     21H 
 |  | 
|  |          LOOP    AGAIN 
 |  | 
|  |          ENDM </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00692.htm|prev]]][[[00694.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === MACRO (Assign a Body of Text to a Name) ===
 |  | 
|  |   |  | 
|  | This directive produces a given sequence of statements from various places in your program, even though different parameters may be required each time you call the sequence.
 |  | 
|  |   |  | 
|  | Macro processing consists of two separate and distinct phases: [[00694.htm|Macro Definition]]and [[00695.htm|Macro Expansion]].
 |  | 
|  |   |  | 
|  | [[[00693.htm|prev]]][[[00695.htm|next]]][[[00693.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Macro Definition ===
 |  | 
|  |   |  | 
|  | A macro definition consists of three essential parts:
 |  | 
|  |   |  | 
|  | �The '''MACRO'''directive, defining the ''Name''and the ''Parameter-List'' <br />�The body of the macro, containing the prototypes of statements to produce when you invoke the macro for expansion. <br />�The [[00688.htm|ENDM]]directive, ending the definition of the macro. <br />
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   MACRO   [ Parameter   [ ,   Parameter   . . . ] ] 
 |  | 
|  |    . 
 |  | 
|  |    . 
 |  | 
|  |    . 
 |  | 
|  | ENDM </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The ''Name''field must be a valid preprocessor identifier and specifies the symbolic name that the user will refer to when invoking the macro for expansion. If ''Name''is already defined, it must be that of a previous macro definition, otherwise an error message is issued. Macros may be redefined to have a different ''Parameter-List''s or macro body text; doing so causes the previous definition to be lost.
 |  | 
|  |   |  | 
|  | The optional ''Parameter-List''is the complete comma-separated list of all ''Parameter''valuess given in the macro definition statement. A parameter must be a valid symbol name according to the rules for naming preprocessor and assembler identifiers. Each parameter becomes a symbol that is local to the macro being defined and is recognized during macro expansion prior to searching the global name space. Thus, macro parameters need not have names unique from identifiers defined elsewhere in the program. <br />
 |  | 
|  |   |  | 
|  | [[[00694.htm|prev]]][[[00696.htm|next]]][[[00693.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Macro Expansion ===
 |  | 
|  |   |  | 
|  | To expand the macro, the macro ''Name''(defined in the ''Name''field of the '''MACRO''' definition statement) is coded as you would any other assembler directive, followed by the list of arguments (if any) that you want to pass to the macro.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   [ Argument   [ ,   Argument   . . . ] ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The ''Name''field must be the name of a macro defined previously with a '''MACRO''' directive.
 |  | 
|  |   |  | 
|  | Each ''Argument''field denotes a text value that you want to pass to the macro . The relative positions of the elements are important, because each ''Argument''is associated in left-to-right fashion with the corresponding ''Parameter''as defined in the ''Parameter-List''during the macro definition.
 |  | 
|  |   |  | 
|  | The number of ''Argument''entries given when the macro is invoked need not be the same as the number of ''Parameter''entries. If you pass extra ''Argument''s to the macro, they are ignored; if too few are supplied, empty text values are associated with the remaining ''Parameter''s. You may also associate an empty text value with a ''Parameter''by passing an explicitly empty text literal <> as an ''Argument''.
 |  | 
|  |   |  | 
|  | Commas are normally used to separate arguments, although blanks or tabs are also considered to be argument separators. For this reason, any argument that must contain an argument separator character (commas, blanks, or tabs) should be enclosed in angle brackets <>. For example: <br />
 |  | 
|  |   |  | 
|  | <pre>PUSHVEC     MACRO   PARM1 , PARM2 
 |  | 
|  |            MOV     AX , PARM1 
 |  | 
|  |            PUSH    AX 
 |  | 
|  |            MOV     AX , PARM2 
 |  | 
|  |            PUSH    AX 
 |  | 
|  |            ENDM 
 |  | 
|  |            . 
 |  | 
|  |            . 
 |  | 
|  |            . 
 |  | 
|  |            PUSHVEC   DS , < OFFSET   VARNAME > 
 |  | 
|  | ; PUSH   DWORD   VECTOR   OF   VARNAME   ONTO   STACK </pre>
 |  | 
|  | You can also use angle brackets to produce variable lengths of results. For example: <br />
 |  | 
|  |   |  | 
|  | <pre>STRING     MACRO     NUMBERS 
 |  | 
|  |           DB        NUMBERS 
 |  | 
|  |           ENDM 
 |  | 
|  |               . 
 |  | 
|  |               . 
 |  | 
|  |               . 
 |  | 
|  |           STRING   < 1 , 2 , 3 , 4 > 
 |  | 
|  |           ; PRODUCE   4   BYTES   OF   INTEGER   NUMBERS </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Each time a macro is invoked (expanded) by specifying its name, the preprocessor emits the statements contained in the body of the macro and passes them to the assembler for processing. During the expansion process, any replacement parameters encountered in the macro body (as named in the ''Parameter-List''of the macro definition) are replaced with the corresponding ''Argument''(if any) passed through the ''argument-list''at the time the macro was invoked.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>GEN     MACRO     XX , YY , ZZ 
 |  | 
|  |        MOV     AX , XX 
 |  | 
|  |        ADD     AX , YY 
 |  | 
|  |        MOV     ZZ , AX 
 |  | 
|  |        ENDM </pre>
 |  | 
|  | When the call is made, for example: <br />
 |  | 
|  |   |  | 
|  | <pre>GEN     ED , KISER , SUM </pre>
 |  | 
|  | The assembler produces the following code: <br />
 |  | 
|  |   |  | 
|  | <pre>MOV     AX , ED 
 |  | 
|  | ADD     AX , KISER 
 |  | 
|  | MOV     SUM , AX </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00695.htm|prev]]][[[00697.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === PURGE (Remove Macro Definition) ===
 |  | 
|  |   |  | 
|  | The '''PURGE'''directive deletes the definition of a specified macro entry, letting you reuse space.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>PURGE   Macro - Name [ , . . . ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | It is not necessary to purge a macro before redefining it. You may use '''PURGE'''to recover memory during assembly by deleting the contents of unreferenced macros. An '''Out of Memory'''condition can occur if a large, general-purpose macro library is included.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | The directive: <br />
 |  | 
|  |   |  | 
|  | <pre>PURGE     MACRONAME </pre>
 |  | 
|  | performs the same function as redefining the macro with no contents, as in: <br />
 |  | 
|  |   |  | 
|  | <pre>MACRONAME   MACRO 
 |  | 
|  |            ENDM </pre>
 |  | 
|  | In the following example, assume that MAC1 is a macro included in MACRO.LIB : <br />
 |  | 
|  |   |  | 
|  | <pre>INCLUDE     MACRO . LIB 
 |  | 
|  | PURGE       MAC1 
 |  | 
|  | MAC1        ;   Calls   the   purged   macro 
 |  | 
|  |            ;   but   produces   nothing </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00696.htm|prev]]][[[00698.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === REPEAT/REPT (Iterative Macro Expansion Using a Count Expression) ===
 |  | 
|  |   |  | 
|  | '''REPEAT'''specifies the number of times to generate the statements inside the macro.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>REPEAT   Expression 
 |  | 
|  |    Statements 
 |  | 
|  | ENDM </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The [[00255.htm|''Expression'']]field must evaluate to an [[00599.htm|''Absolute-ExpressionType'']](it cannot contain forward references). Because the repeat block will be expanded at assembler time, the number of iterations must be known then. <br />
 |  | 
|  |   |  | 
|  | [[[00697.htm|prev]]][[[00699.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ECHO Directive (Display Message on Standard Output Device) ===
 |  | 
|  |   |  | 
|  | The '''ECHO'''directive displays progress through a long assembly or displays the value of conditional assembly parameters.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>ECHO   Text </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The assembler lists the ''Text''entry on the standard output device during assembly when the assembler encounters the '''ECHO'''directive.
 |  | 
|  |   |  | 
|  | '''ECHO'''is not available under MASM 5.10 emulation; you must use '''%OUT,'''which is the obsolete spelling for the '''ECHO'''directive.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | '''Example 1:'''<br />
 |  | 
|  |   |  | 
|  | <pre>IF   IBM 
 |  | 
|  |     ECHO   IBM   VERSION 
 |  | 
|  |     ENDIF 
 |  | 
|  |   |  | 
|  | IF2 
 |  | 
|  |     ECHO   STARTING   SECOND   PASS 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     ENDIF </pre>
 |  | 
|  | '''Example 2:'''<br />
 |  | 
|  |   |  | 
|  | <pre>INNER     MACRO      TEXT , VAL 
 |  | 
|  |          ECHO       TEXT   VAL 
 |  | 
|  |          ENDM 
 |  | 
|  |          . 
 |  | 
|  |          . 
 |  | 
|  |          . 
 |  | 
|  | HERE      =          $   -   CSEG 
 |  | 
|  |          INNER      < CURRENT   LOCATION > , % HERE </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00698.htm|prev]]][[[00700.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === INCLUDE Directive (Insert File Contents into Input Stream) ===
 |  | 
|  |   |  | 
|  | The '''INCLUDE'''directive "stacks" the current source file and begins reading tokens from the source file given by the [[00652.htm|''FileName'']]argument. If you use the '''INCLUDE'''directive, you need not repeat a sequence of statements that are common to several source files.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>INCLUDE   FileName </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The assembler uses the following search order when attempting to open the '''INCLUDE'''file:
 |  | 
|  |   |  | 
|  | 1.If the [[00652.htm|''FileName'']]argument contains a fully qualified path name (one that begins with a back slash or forward slash), then the assembler attempts to open the file exactly as specified, and no other search is performed if the file is not found.
 |  | 
|  |   |  | 
|  | 2.If the [[00652.htm|''FileName'']]begins with a relative path name or contains no path information, the assembler begins searching for the '''INCLUDE'''file by looking in the directory of the source file that issued the '''INCLUDE'''directive.
 |  | 
|  |   |  | 
|  | 3.The assembler searches for [[00652.htm|''FileName'']]in the list of directories given by any [[00053.htm|-Fdi]]or [[00053.htm|-I]]options found on the command line.
 |  | 
|  |   |  | 
|  | 4.The assembler searches for [[00652.htm|''FileName'']]in the list of directories given by the [[00028.htm|<BaseEXE>_INCLUDE]]environment variable.
 |  | 
|  |   |  | 
|  | 5.The assembler searches for [[00652.htm|''FileName'']]in the list of directories given by the [[00032.htm|INCLUDE]]environment variable.
 |  | 
|  |   |  | 
|  | 6.Lastly, the assembler searches for [[00652.htm|''FileName'']]in the current directory. If the named file is not found, the assembler issues a fatal error message and the assembler is ended.
 |  | 
|  |   |  | 
|  | In no case does the assembler strip relative path information from the [[00652.htm|''FileName'']]when performing search steps 2 through 6.
 |  | 
|  |   |  | 
|  | When the file named in the '''INCLUDE'''directive is located, the assembler opens it and assembles all of the statements contained therein until the end of the file is reached. The file is then closed and assembler resumes in the original module at the line following the '''INCLUDE'''directive.
 |  | 
|  |   |  | 
|  | An '''INCLUDE'''file should not contain an [[00715.htm|END]]assembler directive to denote the end of the included module; the assembler closes the included module when its physical end of file is reached.
 |  | 
|  |   |  | 
|  | '''INCLUDE'''files may be nested to any reasonable level, and is limited only by the operating system's ability to provide the necessary resources.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>INCLUDE   OS2 . INC </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00699.htm|prev]]][[[00701.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === COMMENT Directive (Program Information Block) ===
 |  | 
|  |   |  | 
|  | '''COMMENT'''lets you enter comments about your program without having to enter semicolons (;) for each line.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>COMMENT   Delimiter   Text   Delimiter </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The first non-blank character after '''COMMENT'''is the first delimiter. The '''COMMENT'''directive causes the assembler to treat all ''Text''between ''Delimiter'' and ''Delimiter''as a comment. The text must not contain the delimiter character. This directive is used for multiple-line comments. A '''COMMENT''' defined in the body of a macro does not appear unless '''.LALL'''is requested.
 |  | 
|  |   |  | 
|  | '''Example'''<br />
 |  | 
|  |   |  | 
|  | <pre>COMMENT   * You   can   enter   as   many   lines 
 |  | 
|  | of   text   between   the   delimiters 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | as   you   need   to   describe   your   program . * </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00700.htm|prev]]][[[00702.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Assembler Directives ===
 |  | 
|  |   |  | 
|  | This section describes the various types of ALP directives: <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------------------------------------------------------------\
 |  | 
|  | |Type                     |Function                 |Directives               |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Conditional error        |Debugs programs and      |.ERR                     |
 |  | 
|  | |                         |checks for assembly-time |.ERR1                    |
 |  | 
|  | |                         |errors.                  |.ERR2                    |
 |  | 
|  | |                         |                         |.ERRDEF                  |
 |  | 
|  | |                         |                         |.ERRNDEF                 |
 |  | 
|  | |                         |                         |.ERRE                    |
 |  | 
|  | |                         |                         |.ERRNZ                   |
 |  | 
|  | |                         |                         |.ERRB                    |
 |  | 
|  | |                         |                         |.ERRDIF                  |
 |  | 
|  | |                         |                         |.ERRDIFI                 |
 |  | 
|  | |                         |                         |.ERRIDN                  |
 |  | 
|  | |                         |                         |.ERRIDNI                 |
 |  | 
|  | |                         |                         |.ERRNB                   |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Data allocation          |Allows you to create and |BYTE                     |
 |  | 
|  | |                         |initialize variables for |DB                       |
 |  | 
|  | |                         |use within your program. |DD                       |
 |  | 
|  | |                         |                         |DF                       |
 |  | 
|  | |                         |                         |DQ                       |
 |  | 
|  | |                         |                         |DT                       |
 |  | 
|  | |                         |                         |DW                       |
 |  | 
|  | |                         |                         |DWORD                    |
 |  | 
|  | |                         |                         |FWORD                    |
 |  | 
|  | |                         |                         |QWORD                    |
 |  | 
|  | |                         |                         |REAL4                    |
 |  | 
|  | |                         |                         |REAL8                    |
 |  | 
|  | |                         |                         |REAL10                   |
 |  | 
|  | |                         |                         |SBYTE                    |
 |  | 
|  | |                         |                         |SDWORD                   |
 |  | 
|  | |                         |                         |SWORD                    |
 |  | 
|  | |                         |                         |TBYTE                    |
 |  | 
|  | |                         |                         |WORD                     |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Intermodule linkage      |Simplifies data sharing  |COMM                     |
 |  | 
|  | |                         |and a provides a         |END                      |
 |  | 
|  | |                         |high-level interface to  |EXTERN/EXTRN             |
 |  | 
|  | |                         |multiple-module          |EXTERNDEF                |
 |  | 
|  | |                         |programming.             |INCLUDELIB               |
 |  | 
|  | |                         |                         |NAME                     |
 |  | 
|  | |                         |                         |PUBLIC                   |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Listing control          |Controls the assembler   |%BIN                     |
 |  | 
|  | |                         |listing of your source   |.CREF                    |
 |  | 
|  | |                         |file.                    |.LALL                    |
 |  | 
|  | |                         |                         |.LIST                    |
 |  | 
|  | |                         |                         |.LISTALL                 |
 |  | 
|  | |                         |                         |.LISTIF                  |
 |  | 
|  | |                         |                         |.LISTMACRO               |
 |  | 
|  | |                         |                         |.LISTMACROALL            |
 |  | 
|  | |                         |                         |.NOCREF                  |
 |  | 
|  | |                         |                         |.NOLIST                  |
 |  | 
|  | |                         |                         |.NOLISTIF                |
 |  | 
|  | |                         |                         |.NOLISTMACRO             |
 |  | 
|  | |                         |                         |PAGE                     |
 |  | 
|  | |                         |                         |.SALL                    |
 |  | 
|  | |                         |                         |.SFCOND                  |
 |  | 
|  | |                         |                         |SUBTITLE                 |
 |  | 
|  | |                         |                         |SUBTTL                   |
 |  | 
|  | |                         |                         |.TFCOND                  |
 |  | 
|  | |                         |                         |TITLE                    |
 |  | 
|  | |                         |                         |.XALL                    |
 |  | 
|  | |                         |                         |.XCREF                   |
 |  | 
|  | |                         |                         |.XLIST                   |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Procedure control        |Allows you to organize   |PROC                     |
 |  | 
|  | |                         |your code into           |LOCAL                    |
 |  | 
|  | |                         |procedures.              |ENDP                     |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Processor control        |Selects processors and   |.186                     |
 |  | 
|  | |                         |coprocessors.            |.286                     |
 |  | 
|  | |                         |                         |.286P                    |
 |  | 
|  | |                         |                         |.287                     |
 |  | 
|  | |                         |                         |.386                     |
 |  | 
|  | |                         |                         |.386P                    |
 |  | 
|  | |                         |                         |.387                     |
 |  | 
|  | |                         |                         |.486                     |
 |  | 
|  | |                         |                         |.486P                    |
 |  | 
|  | |                         |                         |.586                     |
 |  | 
|  | |                         |                         |.586P                    |
 |  | 
|  | |                         |                         |.686                     |
 |  | 
|  | |                         |                         |.686P                    |
 |  | 
|  | |                         |                         |.8086                    |
 |  | 
|  | |                         |                         |.8087                    |
 |  | 
|  | |                         |                         |.MMX                     |
 |  | 
|  | |                         |                         |.NOMMX                   |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Segments                 |Creates and manages      |ALIGN                    |
 |  | 
|  | |                         |segments.                |.ALPHA                   |
 |  | 
|  | |                         |                         |.CODE                    |
 |  | 
|  | |                         |                         |.CONST                   |
 |  | 
|  | |                         |                         |.DATA                    |
 |  | 
|  | |                         |                         |.DATA?                   |
 |  | 
|  | |                         |                         |DOSSEG                   |
 |  | 
|  | |                         |                         |.DOSSEG                  |
 |  | 
|  | |                         |                         |ENDS                     |
 |  | 
|  | |                         |                         |EVEN                     |
 |  | 
|  | |                         |                         |.FARDATA                 |
 |  | 
|  | |                         |                         |.FARDATA?                |
 |  | 
|  | |                         |                         |GROUP                    |
 |  | 
|  | |                         |                         |.MODEL                   |
 |  | 
|  | |                         |                         |ORG                      |
 |  | 
|  | |                         |                         |SEGMENT                  |
 |  | 
|  | |                         |                         |.SEQ                     |
 |  | 
|  | |                         |                         |.STACK                   |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Type definition          |Allows the creation of   |RECORD                   |
 |  | 
|  | |                         |complex user-defined data|STRUC                    |
 |  | 
|  | |                         |types.                   |STRUCT                   |
 |  | 
|  | |                         |                         |TYPEDEF                  |
 |  | 
|  | |                         |                         |UNION                    |
 |  | 
|  | |-------------------------+-------------------------+-------------------------|
 |  | 
|  | |Miscellaneous            |Provides miscellaneous   |=                        |
 |  | 
|  | |                         |functions.               |.ABORT                   |
 |  | 
|  | |                         |                         |ASSUME                   |
 |  | 
|  | |                         |                         |EQU                      |
 |  | 
|  | |                         |                         |LABEL                    |
 |  | 
|  | |                         |                         |OPTION                   |
 |  | 
|  | |                         |                         |.RADIX                   |
 |  | 
|  | \-----------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00701.htm|prev]]][[[00703.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Conditional Error Control ===
 |  | 
|  |   |  | 
|  | Use conditional error control directives to debug programs and check for assembly-time errors. If you insert a conditional assembly directive in your code, you can test assembly-time conditions at that point. You can also test for boundary conditions in macros by using conditional error control directives.
 |  | 
|  |   |  | 
|  | Errors generated by conditional error control directives cause ALP to return a nonzero return code. If a severe error is detected during assembly , ALP does not generate the object module.
 |  | 
|  |   |  | 
|  | This section describes the following conditional error control directives:
 |  | 
|  |   |  | 
|  | .ERR <br />.ERR1 <br />.ERR2 <br />.ERRB <br />.ERRDEF <br />.ERRDIF <br />.ERRDIFI <br />.ERRE <br />.ERRIDN <br />.ERRIDNI <br />.ERRNB <br />.ERRNDEF <br />.ERRNZ <br />
 |  | 
|  |   |  | 
|  | [[[00702.htm|prev]]][[[00704.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .ERR/.ERR1/.ERR2 (Force Assembly Error Condition) ===
 |  | 
|  |   |  | 
|  | The '''.ERR''', '''.ERR1''', and '''.ERR2'''directives cause errors at the points at which they occur in the source file.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. ERR 
 |  | 
|  |     or 
 |  | 
|  | . ERR1 
 |  | 
|  |     or 
 |  | 
|  | . ERR2 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.ERR'''directive causes an error regardless of the pass. '''.ERR1'''causes an error on the first pass only. '''.ERR2'''causes an error on the second pass only. If you use the '''-Lp:1'''option to request a first pass listing, the '''. ERR1'''error message appears on the screen and in the listing file. Like other error conditions occurring during pass one, the error generated by '''. ERR1'''does not cause the assembly to fail.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | This example ensures that you define either the DOS or the OS2 symbol. If you define neither, the assembler assembles the nested '''ELSE'''condition and produces an error message. The '''.ERR'''directive causes an error on each pass. <br />
 |  | 
|  |   |  | 
|  | <pre>IFDEF   DOS 
 |  | 
|  |        . 
 |  | 
|  |        . 
 |  | 
|  |        . 
 |  | 
|  | ELSE 
 |  | 
|  |        IFDEF   OS2 
 |  | 
|  |           . 
 |  | 
|  |           . 
 |  | 
|  |           . 
 |  | 
|  |        ELSE 
 |  | 
|  |           . ERR 
 |  | 
|  |        ENDIF 
 |  | 
|  | ENDIF </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00703.htm|prev]]][[[00705.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .ERRB/.ERRNB (Error if Argument Blank/Non-Blank) ===
 |  | 
|  |   |  | 
|  | The '''.ERRB'''and '''.ERRNB'''directives test the given [[00662.htm|''Text-Argument'']].
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. ERRB   Text - Argument 
 |  | 
|  |     or 
 |  | 
|  | . ERRNB   Text - Argument </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If [[00662.htm|''Text-Argument'']]is blank, the '''.ERRB'''directive produces an error. If [[00662.htm|''Text- Argument'']]is not blank, '''.ERRNB'''produces an error.
 |  | 
|  |   |  | 
|  | You can test for the existence of parameters by using these directives within macros.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In this example, the directives ensure that only one argument is passed to the macro. If no argument is passed to the macro, the '''.ERRB'''directive produces an error. If more than one argument is passed, the '''.ERRNB''' directive produces an error. <br />
 |  | 
|  |   |  | 
|  | <pre>WORK      MACRO      REALARG , TESTARG 
 |  | 
|  |          . ERRB      < REALARG >    ; ;   Error   if   no   parameters 
 |  | 
|  |          . ERRNB     < TESTARG >    ; ;   Error   if   more   than   one   parameter 
 |  | 
|  |                   . 
 |  | 
|  |                   . 
 |  | 
|  |                   . 
 |  | 
|  |          ENDM </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00704.htm|prev]]][[[00706.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .ERRDEF/.ERRNDEF (Error if Symbol Defined/Not Defined) ===
 |  | 
|  |   |  | 
|  | The '''.ERRDEF'''and '''.ERRNDEF'''directives test whether a symbol has been defined.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. ERRDEF   Identifier 
 |  | 
|  |     or 
 |  | 
|  | . ERRNDEF   Identifier </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If [[00149.htm|''Identifier'']]is defined as a label, a variable, or a symbol, the '''.ERRDEF''' directive produces an error. If you have not defined [[00149.htm|''Identifier'']], '''.ERRNDEF''' produces an error. When [[00149.htm|''Identifier'']]is a forward reference, the assembler considers it undefined on the first pass and defined on the second pass.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In this example, '''.ERRDEF'''ensures that '''SYMBOL'''is not defined before entering the blocks, and '''.ERRNDEF'''ensures that you defined '''SYMBOL'''somewhere within the blocks. <br />
 |  | 
|  |   |  | 
|  | <pre>. ERRDEF      SYMBOL 
 |  | 
|  | IFDEF        CONFIG1 
 |  | 
|  |              . 
 |  | 
|  |              .     SYMBOL   EQU   0 
 |  | 
|  |              . 
 |  | 
|  | ENDIF 
 |  | 
|  | IFDEF        CONFIG2 
 |  | 
|  |              . 
 |  | 
|  |              .    SYMBOL    EQU   1 
 |  | 
|  |              . 
 |  | 
|  | ENDIF 
 |  | 
|  | . ERRNDEF      SYMBOL </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00705.htm|prev]]][[[00707.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .ERRDIF/.ERRDIFI (Error if Arguments are Different) ===
 |  | 
|  |   |  | 
|  | The '''.ERRDIF'''and '''.ERRDIFI'''directives generate an assembler error if the two [[00662.htm|''Text-Argument'']]''s''are different.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. ERRDIF   Text - Argument - 1 ,   Text - Argument - 2 
 |  | 
|  |     or 
 |  | 
|  | . ERRDIFI   Text - Argument - 1 ,   Text - Argument - 2 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.ERRDIF'''directive performs a case-sensitive comparision, and the '''. ERRDIFI'''directive performs a case-insensitive comparision.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In this example, a check is made to verify that the currently opened segment is '''_TEXT'''. This helps to insure that the macro is used only from within the default near code segment, and not from a program with a memory model that uses far code pointers (MEDIUM, LARGE, or HUGE). <br />
 |  | 
|  |   |  | 
|  | <pre>RETURN   MACRO 
 |  | 
|  |      ; ;   Use   the   expansion   operator   ( % )   to   resolve   @ CurSeg   equate 
 |  | 
|  |      %   . errdif   < _ TEXT > , < @ CurSeg >    ; ;   Must   be   in   near   . CODE   segment 
 |  | 
|  |      RETN                             ; ;   Force   a   near   return 
 |  | 
|  | ENDM </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00706.htm|prev]]][[[00708.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .ERRE/.ERRNZ (Error if Expression False/True) ===
 |  | 
|  |   |  | 
|  | The '''.ERRE'''and '''.ERRNZ'''directives test the value of an [[00255.htm|''Expression'']].
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. ERRE   Expression 
 |  | 
|  |     or 
 |  | 
|  | . ERRNZ   Expression </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If the [[00255.htm|''Expression'']]evaluates to be false (zero), the '''.ERRE'''directive produces an error. If the [[00255.htm|''Expression'']]evaluates to be true (not zero), the '''.ERRNZ'''directive produces an error. The [[00255.htm|''Expression'']]must evaluate to an absolute value and cannot contain forward references.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In this example, '''.ERRE'''checks the boundaries of a parameter that the program passes to the macro '''BUFFER'''. If count is less than or equal to 128, the expression that the directive tests is true (not zero) and the directive produces no error. If '''COUNT'''is greater than 128, the expression is false (zero) and the directive produces an error. <br />
 |  | 
|  |   |  | 
|  | <pre>BUFFER   MACRO    COUNT , BNAME 
 |  | 
|  |         . ERRE     COUNT   LE   128 
 |  | 
|  |         BNAME   DB   COUNT   DUP   ( 0 )   ; ;   Reserve   memory ,   but   no   more   than   128   bytes 
 |  | 
|  |         ENDM 
 |  | 
|  |   |  | 
|  | BUFFER   128 , BUF1    ;   Data   reserved   -   no   error 
 |  | 
|  | BUFFER   129 , BUF2    ;   Error   produced </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00707.htm|prev]]][[[00709.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .ERRIDN/.ERRIDNI (Error if Arguments are Identical) ===
 |  | 
|  |   |  | 
|  | The '''.ERRIDN'''and '''.ERRIDNI'''directives generate an assembly error if the two [[00662.htm|''Text-Argument'']]''s''are identical.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. ERRIDN   Text - Argument - 1 ,   Text - Argument - 2 
 |  | 
|  |     or 
 |  | 
|  | . ERRIDNI   Text - Argument - 1 ,   Text - Argument - 2 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.ERRIDN'''directive performs a case-sensitive comparision, and the '''. ERRIDNI'''directive performs a case-insensitive comparision.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In this example, '''.ERRIDN'''protects against the passing the AX register as the second parameter, because the macro does not work if this happens. This example uses the '''.ERRIDNI'''directive since the macro needs to check for all possible spellings of the AX register. <br />
 |  | 
|  |   |  | 
|  | <pre>ADDEM    MACRO   AD1 , AD2 , SUM 
 |  | 
|  |         . ERRIDNI   < ax > , < AD2 >   ; ;   ERROR   IF   AD2   is   ax 
 |  | 
|  |         MOV        AX , AD1       ; ;   Would   overwrite   if   AD2   were   AX 
 |  | 
|  |         ADD        AX , AD2 
 |  | 
|  |         MOV        SUM , AX       ; ;   SUM   must   be   register   or   memory 
 |  | 
|  | ENDM </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00708.htm|prev]]][[[00710.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Data Allocation ===
 |  | 
|  |   |  | 
|  | Data allocation statements allow you to reserve storage for your program data. To initiate a data allocation statement, an '''''Old-Style-Allocation- Directive''may be used, but in modes other than [[00105.htm|M510]]it is preferable to use a [[00125.htm|''Scalar-TypeName'']]or [[00171.htm|''UserDefined-TypeName'']], which the assembler treats as a pseudo-directive. To introduce consistency into the descriptions, all such variations will be referred to as the '''''Allocation-TypeName''.''''''
 |  | 
|  |   |  | 
|  | The ''Allocation-TypeName''that you select determines the data-type of the allocated storage. An optional symbolic name may be associated with the storage, and the storage may also be initialized with specific values if so desired.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>[ Name ]   Allocation - TypeName   Initializer   [ ,   Initializer   . . . ] </pre>
 |  | 
|  | Allocation-TypeName'':'' <br />''Old-Style-Allocation-Directive'' <br />[[00125.htm|''Scalar-TypeName'']] <br />[[00172.htm|''Record-TypeName'']] <br />[[00173.htm|''Structure-TypeName'']] <br />[[00175.htm|''Union-TypeName'']] <br />[[00174.htm|''Typedef-TypeName'']] <br />
 |  | 
|  |   |  | 
|  | '''''Old-Style-Allocation-Directive:''one of <br />'''<br />''''''
 |  | 
|  |   |  | 
|  | <pre>DB DW DD DF DQ DT</pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The various fields of the data allocation statement are described as follows:
 |  | 
|  |   |  | 
|  | '''''Name''If the ''Name''entry is present, it must be specified as a valid [[00149.htm|''Identifier'']]unique to the scope in which it appears. If the allocation statement is assembled into an open segment, the assembler converts the identifier to a [[00167.htm|''Data-LabelName'']]to allow referencing the storage by a symbolic variable name. If the allocation statement is assembled into the body of a [[00782.htm|STRUCT]]or [[00784.htm|UNION]]type definition, then the assembler converts the identifier to a [[00160.htm|''Structure-FieldName'']]or [[00161.htm|''Union-FieldName'']].'''
 |  | 
|  |   |  | 
|  | '''''Allocation-TypeName''If the ''Allocation-TypeName''is specified as a [[00174.htm|''Typedef- TypeName'']], the assembler ''resolves''it to its underlying data type to determine what type of initialization is to be performed.'''
 |  | 
|  |   |  | 
|  | If the ''Allocation-TypeName''entry resolves to a [[00125.htm|''Scalar-TypeName'']]or a pointer to some other type, then the ''Initializer''field must be specified using an expression syntax that can be resolved to a [[00614.htm|''Scalar-Initializer- ExpressionType'']]. See the following section on [[00710.htm|Initialization of Scalar Types]]for a full description of this topic.
 |  | 
|  |   |  | 
|  | If the ''Allocation-TypeName''entry resolves to a [[00172.htm|''Record-TypeName'']], [[00173.htm|''Structure- TypeName'']], or [[00175.htm|''Union-TypeName'']], then the ''Initializer''field must be specified using the [[00579.htm|''Compound-Initializer'']]syntax. See the following section on [[00711.htm|Initialization of Aggregate Types]]for a full description of this topic.
 |  | 
|  |   |  | 
|  | If the ''Allocation-TypeName''entry resolves to an array of any other type, then the ''Initializer''field must be specified using the [[00579.htm|''Compound-Initializer'']] syntax. See the following section on [[00712.htm|Initialization of Vector Types]]for a full description of this topic.
 |  | 
|  |   |  | 
|  | '''''Initializer''Each ''Initializer''entry is an [[00255.htm|''Expression'']]that must resolve to an [[00614.htm|''Initializer-ExpressionType'']]appropriate for the type of data described by the ''Allocation-TypeName''field.'''
 |  | 
|  |   |  | 
|  | Each ''Initializer''entry may also be duplicated by making it the operand of a [[00258.htm|''Duplicative-Expression'']]. When assembling in [[00105.htm|ALP]]mode however, the '''DUP''' operator is considered obsolete and its use is discouraged. Instead, a [[00174.htm|''Typedef-TypeName'']]associated with the declaration of a true array should be used in the ''Allocation-TypeName''field along with the appropriate compound initializer. <br />
 |  | 
|  |   |  | 
|  | [[[00709.htm|prev]]][[[00711.htm|next]]][[[00709.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Initialization of Scalar Types ===
 |  | 
|  |   |  | 
|  | A scalar data item represents a numeric quantity that may be increased or decreased in magnitude as a single unit. Thus, an ''Initializer''expression for a scalar data item must be coded such that it resolves to a single scalar value. See the section on [[00614.htm|''Scalar-Initializer-ExpressionType'']]for the syntax and semantics of such expressions.
 |  | 
|  |   |  | 
|  | The old-style allocation directives (DB, DW, DD, DF, DQ, and DT) are supported in all assembler emulation modes, but for modes other than [[00105.htm|M510]], the [[00125.htm|''Scalar-TypeName'']]keywords should be used instead.
 |  | 
|  |   |  | 
|  | When the [[00125.htm|''Scalar-TypeName'']]keywords are used instead of the old-style allocation directives, the assembler has full knowledge of the data types of the variables being created. This allows the assembler to make more intelligent code generation decisions, and it enables the assembler to correctly describe the variable in the symbolic debugging information that it generates for the source level debugger. [[00125.htm|''Scalar-TypeName'']]''s''may only be used as allocation directives in the [[00105.htm|ALP]]or [[00105.htm|M600]]modes.
 |  | 
|  |   |  | 
|  | To allocate an uninitialized scalar data item, use the [[00140.htm|''Indeterminate-Value- Alias'']]($) in the ''Initializer''field. <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------------------------------------------------------\
 |  | 
|  | |Type Name|Data Type           |Initializer Description                 |
 |  | 
|  | |---------+--------------------+----------------------------------------|
 |  | 
|  | |DB, BYTE,|Allocates 8-bit     |Each Initializer must be in the range   |
 |  | 
|  | |or SBYTE |(byte) values.      |from 0 to 255 (unsigned) for a DB or    |
 |  | 
|  | |         |                    |BYTE directive, and from -128 to 127    |
 |  | 
|  | |         |                    |(signed) for a SBYTE directive.         |
 |  | 
|  | |---------+--------------------+----------------------------------------|
 |  | 
|  | |DW, WORD,|Allocates 16-bit    |Each Initializer must be in the range   |
 |  | 
|  | |or SWORD |(word) values.      |from 0 to 65535 (unsigned) for a DW or  |
 |  | 
|  | |         |                    |WORD directive, and from -32768 to 32767|
 |  | 
|  | |         |                    |(signed) for a SWORD directive.         |
 |  | 
|  | |---------+--------------------+----------------------------------------|
 |  | 
|  | |DD,      |Allocates 32-bit    |If the Initializer is an integer, each  |
 |  | 
|  | |DWORD, or|(double-word)       |must be in the range from 0 to          |
 |  | 
|  | |SDWORD   |values.             |4,294,967,295 (unsigned) for a DD or    |
 |  | 
|  | |         |                    |DWORD directive, and from -2,147,483,648|
 |  | 
|  | |         |                    |to 2,147,483,647 (signed) for a SDWORD  |
 |  | 
|  | |         |                    |directive.  If the DD directive is being|
 |  | 
|  | |         |                    |used, an Initializer may also resolve to|
 |  | 
|  | |         |                    |a 32-bit Floating-Point-ExpressionType. |
 |  | 
|  | |---------+--------------------+----------------------------------------|
 |  | 
|  | |DF or    |Allocates 48-bit    |Each Initializer typically specifies the|
 |  | 
|  | |FWORD    |(6-byte far-word)   |full address of a 32-bit far code or    |
 |  | 
|  | |         |values.             |data label, but normal 32-bit integer   |
 |  | 
|  | |         |                    |values may also be used.  The processor |
 |  | 
|  | |         |                    |does not support 48-bit integer         |
 |  | 
|  | |         |                    |operations, thus the assembler does     |
 |  | 
|  | |         |                    |support 48-bit integer precision when   |
 |  | 
|  | |         |                    |initializing such variables.  These     |
 |  | 
|  | |         |                    |directives are typically only useful for|
 |  | 
|  | |         |                    |defining pointer variables for use on   |
 |  | 
|  | |         |                    |32-bit processors.                      |
 |  | 
|  | |---------+--------------------+----------------------------------------|
 |  | 
|  | |DQ or    |Allocates 64-bit    |Both DQ and QWORD allow an integer      |
 |  | 
|  | |QWORD    |(quad-word) values. |Initializer with 64-bit (8-byte)        |
 |  | 
|  | |         |                    |precision.  If the DQ directive is being|
 |  | 
|  | |         |                    |used, the Initializer field may resolve |
 |  | 
|  | |         |                    |to a 64-bit                             |
 |  | 
|  | |         |                    |Floating-Point-ExpressionType.          |
 |  | 
|  | |---------+--------------------+----------------------------------------|
 |  | 
|  | |DT or    |Allocates 80-bit    |Both DT and TBYTE allow an integer      |
 |  | 
|  | |TBYTE    |(10-byte) values    |Initializer with 80-bit (10-byte)       |
 |  | 
|  | |         |                    |precision.  If the DT directive is being|
 |  | 
|  | |         |                    |used, the Initializer field may resolve |
 |  | 
|  | |         |                    |to a 80-bit                             |
 |  | 
|  | |         |                    |Floating-Point-ExpressionType.          |
 |  | 
|  | |---------+--------------------+----------------------------------------|
 |  | 
|  | |REAL4,   |Allocates real      |Each Initializer must resolve to a      |
 |  | 
|  | |REAL8, or|(floating-point)    |Floating-Point-ExpressionType.  The     |
 |  | 
|  | |REAL10   |values of a specific|assembler converts the floating-point   |
 |  | 
|  | |         |size (4 bytes, 8    |literal to the IEEE format appropriate  |
 |  | 
|  | |         |bytes, or 10 bytes).|for the type of variable being          |
 |  | 
|  | |         |                    |allocated.                              |
 |  | 
|  | \-----------------------------------------------------------------------/</pre>
 |  | 
|  | '''Examples'''
 |  | 
|  |   |  | 
|  | Here are some examples of scalar initialization: <br />
 |  | 
|  |   |  | 
|  | <pre>;   Allocate   some   integer   variables 
 |  | 
|  | uint8        BYTE        0 ,   255                ;   min ,   max   values   for   unsigned   byte 
 |  | 
|  | sint8        SBYTE       - 128 ,   127            ;   min ,   max   values   for   signed   byte 
 |  | 
|  | USHORT _ T     TYPEDEF     WORD                  ;   Define   a   typedef   alias   for   WORD 
 |  | 
|  | ushort       USHORT _ T    0 ,   0FFFFh            ;   and   use   it   as   allocation   type   name 
 |  | 
|  |   |  | 
|  | ;   Some   things   to   know   about   string - literal   initializers 
 |  | 
|  | char         BYTE        " a "                   ;   a   single   BYTE   value   ( 061h ) 
 |  | 
|  | is _ int       WORD        " ab "                  ;   a   single   WORD   value   ( 06162h ) 
 |  | 
|  | this _ too     DWORD       " abcd "                ;   a   single   DWORD   value   ( 061626364h ) 
 |  | 
|  | too _ long     WORD        " abcd "                ;   error ,   expression   too   big   for   a   word 
 |  | 
|  | string       BYTE        " string " ,   0          ;   but   strings   can   allocate   many   bytes 
 |  | 
|  |   |  | 
|  | ;   Integers ,   pointers ,   and   old - style   initializations 
 |  | 
|  | PDWORD _ T     TYPEDEF     PTR   DWORD            ;   First ,   define   a   pointer   type 
 |  | 
|  | ulong        DWORD       0 ,   0FFFFFFFFh        ;   min ,   max   values   for   unsigned   dword 
 |  | 
|  | pulong       PDWORD _ T    OFFSET   ulong         ;   pointer   to   the   ulong   variable 
 |  | 
|  | old _ style    DD          1 . 314                 ;   old   style ,   floats   are   accepted 
 |  | 
|  | new _ int      SDWORD      1 . 314                 ;   new   style ,   error - must   use   integers 
 |  | 
|  | new _ real     REAL4       1314                  ;   new   style ,   error - must   use   floats 
 |  | 
|  |   |  | 
|  | ;   Allocate   some   real   numbers   using   decimal   floating - point   literals 
 |  | 
|  | float _ f      REAL4       123 . 45                ;   4 - byte   IEEE   real 
 |  | 
|  | double _ f     REAL8       98 . 7654E1            ;   8 - byte   IEEE   real 
 |  | 
|  | longdbl _ f    REAL10      1000 . 0E - 2            ; 10 - byte   IEEE   real 
 |  | 
|  |   |  | 
|  | ;   The   same   values   using   hexdecimal   floating - point   literals 
 |  | 
|  | float _ h      REAL4    42F6E666r                ;   4 - byte   IEEE   real 
 |  | 
|  | double _ h     REAL8    408EDD3B645A1CACr       ;   8 - byte   IEEE   real 
 |  | 
|  | longdbl _ h    REAL10   4002A000000000000000r   ; 10 - byte   IEEE   real </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00710.htm|prev]]][[[00712.htm|next]]][[[00709.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Initialization of Aggregate Types ===
 |  | 
|  |   |  | 
|  | An aggregate data item is a collection of one or more sub-items of possibly dissimilar types that are allocated, initialized, and treated as a single unit. The sub-items usually have unique names, and their positions relative to other sub-items is significant. The assembler provides the ability to define aggregate types through use of the [[00781.htm|RECORD]], [[00782.htm|STRUCT]], and [[00784.htm|UNION]]directives.
 |  | 
|  |   |  | 
|  | Initialization of an aggregate data item requires a programming notation that isolates the entire aggregate from surroundings constructs, and denotes the position of each sub-item within the aggregate. The syntax for this construct is as follows:
 |  | 
|  |   |  | 
|  | ''Aggregate-Initializer'''':'' <br />'''{'''[''Initializer-List''] '''}''' <br />'''<'''[''Initializer-List''] '''>''' <br /> <br />''Initializer-List'''':'' <br />''Initializer-Item'' <br />''Initializer-List'', [''LineBreak''] ''Initializer-Item'' <br /> <br />''Initializer-Item'''':'' <br />[''Scalar-Initializer''] <br />[''Aggregate-Initializer''] <br />[''Array-Initializer''] <br /> <br />
 |  | 
|  |   |  | 
|  | The syntax requires that an ''Aggregate-Initializer''be enclosed in an outer set of braces or angle brackets, but the ''Initializer-List''or individual comma-separated ''Initializer-Item''s may be left unspecified, in which case a default initializer value is used. Commas are used to denote the position of each sub-item within the entire aggregate, and nested initializers are allowed to accomodate imbedded occurrences of other aggregates (or vector types, which share the same initializer syntax).
 |  | 
|  |   |  | 
|  | When initializing an instance of a union, the assembler only allows an initializer to be specified for the first field defined in the union type.
 |  | 
|  |   |  | 
|  | '''Examples'''
 |  | 
|  |   |  | 
|  | Here are some examples of aggregate initialization: <br />
 |  | 
|  |   |  | 
|  | <pre>YES     equ    1 
 |  | 
|  | NO      equ    0 
 |  | 
|  | MAYBE   equ   - 1 
 |  | 
|  |   |  | 
|  | BOOL _ T   typedef   sbyte 
 |  | 
|  |   |  | 
|  | IDEAS _ T   struct 
 |  | 
|  |    sanctum    BOOL _ T   ?            ;   For   scalar   data ,   use   the   ?   operator 
 |  | 
|  |    peace      BOOL _ T   ?            ;     to   request   an   uninitialized   value . 
 |  | 
|  |    pilzner    BOOL _ T   ? 
 |  | 
|  | IDEAS _ T   ends 
 |  | 
|  |   |  | 
|  | PROBLEM _ T   struct 
 |  | 
|  |     work     BOOL _ T    YES          ;   Establish   default   initial   values   that 
 |  | 
|  |     car      BOOL _ T    NO           ;     can   be   inherited   when   an   instance   of 
 |  | 
|  |     house    BOOL _ T    MAYBE        ;     the   structure   is   allocated 
 |  | 
|  | PROBLEM _ T   ends 
 |  | 
|  |   |  | 
|  | SOLUTION _ T   struct 
 |  | 
|  |      fixing   PROBLEM _ T   { }        ;   Outermost   set   of   braces   required   even 
 |  | 
|  |              IDEAS _ T     { }        ;    with   unspecified   ( default )   initializers 
 |  | 
|  | SOLUTION _ T   ends 
 |  | 
|  |   |  | 
|  | DATA   segment 
 |  | 
|  |    ProblemWith   PROBLEM _ T    {   NO ,   ,   MAYBE   }           ;   First - level   structure 
 |  | 
|  |    ThinkOf       SOLUTION _ T   {   {   YES ,   YES ,   YES   } ,      ;   Intializer   syntax   for 
 |  | 
|  |                               {    NO ,    NO ,    NO   }   }     ;     imbedded   structures 
 |  | 
|  | DATA   ends 
 |  | 
|  |   |  | 
|  | CODE     segment 
 |  | 
|  |         assume   ds : DATA 
 |  | 
|  |         mov   al ,   NO 
 |  | 
|  |         or    al ,   ProblemWith . work 
 |  | 
|  |         or    al ,   ProblemWith . car 
 |  | 
|  |         or    al ,   ProblemWith . house 
 |  | 
|  |         jz    exit 
 |  | 
|  |         mov   ThinkOf . fixing . work ,   NO       ;   References   to   named   fields   in 
 |  | 
|  |         mov   ThinkOf . fixing . car ,   NO        ;     imbedded   structures   must   be 
 |  | 
|  |         mov   ThinkOf . fixing . house ,   NO      ;     fully   qualified . 
 |  | 
|  | exit :    mov   ThinkOf . pilzner ,   YES          ;   Reference   to   " promoted "   field 
 |  | 
|  |         ret 
 |  | 
|  | CODE     ends 
 |  | 
|  | end </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00711.htm|prev]]][[[00713.htm|next]]][[[00709.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Initialization of Vector Types ===
 |  | 
|  |   |  | 
|  | A vector data item is a linear collection of one or more sub-items of identical type that are allocated, initialized, and treated as a single unit. A vector (more commonly referred to as an '''''array'') is defined to have a specific number of items '''''n'', which are numbered from '''''0''to '''''n - 1''and occupy a contiguous area of allocated storage. The items in the vector may be of any type, possibly even other vectors (commonly known as a '''''multi- dimensional array''). The assembler provides the ability to define vector types through the use of the standard [[00250.htm|''Type-Declaration'']]syntax.'''''''''''''''
 |  | 
|  |   |  | 
|  | The syntax required to initialize a vector is similar to that used for an aggegrate data type, and is as follows:
 |  | 
|  |   |  | 
|  | ''Array-Initializer'''':'' <br />'''{'''[''Initializer-List''] '''}''' <br />'''<'''[''Initializer-List''] '''>''' <br /> <br />''Initializer-List'''':'' <br />''Initializer-Item'' <br />''Initializer-List'', [''LineBreak''] ''Initializer-Item'' <br /> <br />''Initializer-Item'''':'' <br />[''Scalar-Initializer''] <br />[''Aggregate-Initializer''] <br />[''Array-Initializer''] <br /> <br />
 |  | 
|  |   |  | 
|  | The syntax requires that an ''Array-Initializer''be enclosed in an outer set of braces or angle brackets, but the ''Initializer-List''or individual comma- separated ''Initializer-Item''s may be left unspecified, in which case a default initializer value is used. Commas are used to denote the position of each sub-item within the entire array, and nested initializers are allowed to accomodate imbedded occurrences of other arrays (or aggregate types, which share the same initializer syntax).
 |  | 
|  |   |  | 
|  | '''Examples'''
 |  | 
|  |   |  | 
|  | Here are some examples of vector initialization: <br />
 |  | 
|  |   |  | 
|  | <pre>;   Data   structures   to   define   a   " computer "   data   type 
 |  | 
|  |   |  | 
|  | TRUE         equ          1 
 |  | 
|  | FALSE        equ          0 
 |  | 
|  | MB           equ       1024                   ;   Megabytes 
 |  | 
|  |   |  | 
|  | BOOL _ T       typedef   BYTE                   ;   true   or   false   value 
 |  | 
|  | INCHES _ T     typedef   BYTE                   ;   number   of   inches 
 |  | 
|  | MONITOR _ T    typedef   INCHES _ T               ;   size   of   monitor   in   inches 
 |  | 
|  | KEYBOARD _ T   typedef   BOOL _ T                 ;   is   a   keyboard   installed ? 
 |  | 
|  | MOUSE _ T      typedef   BOOL _ T                 ;   is   a   mouse   installed ? 
 |  | 
|  | KBYTES _ T     typedef   WORD                   ;   number   of   kilobytes 
 |  | 
|  | MBYTES _ T     typedef   WORD                   ;   number   of   megabytes 
 |  | 
|  | FPRESENT _ T   typedef   BOOL _ T [ 2 ]              ;   up   to   two   floppies   installed 
 |  | 
|  | FSIZE _ T      typedef   KBYTES _ T [ 2 ]           ;   how   big   they   are 
 |  | 
|  | DPRESENT _ T   typedef   BOOL _ T [ 4 ]              ;   up   to   four   hardfiles   installed 
 |  | 
|  | DSIZE _ T      typedef   MBYTES _ T [ 4 ]           ;   how   big   they   are 
 |  | 
|  | RAM _ T        typedef   DWORD                  ;   how   much   memory   we   have 
 |  | 
|  | NAME _ T       typedef   BYTE [ 64 ]               ;   what   we   call   the   system 
 |  | 
|  |   |  | 
|  | FLOPPIES _ T   struct 
 |  | 
|  | DriveCount   FPRESENT _ T   {   TRUE ,   FALSE   }    ;   assume   one   floppy   installed 
 |  | 
|  | DriveSize    FSIZE _ T      {   360 ,   0   }         ;   assume   360KB   in   size   : - ) 
 |  | 
|  | FLOPPIES _ T   ends 
 |  | 
|  |   |  | 
|  | DRIVES _ T     struct 
 |  | 
|  | DriveCount   DPRESENT _ T   {   TRUE ,   FALSE ,   FALSE ,   FALSE   }     ;   one   drive   installed 
 |  | 
|  | DriveSize    DSIZE _ T      {   20 ,   0 ,   0 ,   0   }                    ;   20MB   in   size   ( ! ) 
 |  | 
|  | DRIVES _ T     ends 
 |  | 
|  |   |  | 
|  | COMPUTER _ T   struct 
 |  | 
|  | Monitor      MONITOR _ T     14                 ;   Assume   a   14   inch   monitor 
 |  | 
|  | Keyboard     BOOL _ T        TRUE               ;   We   have   a   keyboard 
 |  | 
|  | Mouse        BOOL _ T        FALSE              ;   but   no   mouse 
 |  | 
|  | Memory       RAM _ T         640                ;   Assume   640KB 
 |  | 
|  | Floppies     FLOPPIES _ T    { }                 ;   Go   with   the   defaults 
 |  | 
|  | HardFiles    DRIVES _ T      { }                 ;   Go   with   the   defaults 
 |  | 
|  | ModelName    NAME _ T        { }                 ;   No   default   name 
 |  | 
|  | COMPUTER _ T   ends 
 |  | 
|  |   |  | 
|  | DATA   segment 
 |  | 
|  | Circa1997    COMPUTER _ T    \                  ;   initializer   begins   on   next   line 
 |  | 
|  |    {   17 ,                                     ;   of   course ,   we   have   a   17 "   monitor 
 |  | 
|  |      TRUE ,   TRUE ,                            ;   a   keyboard   and   a   mouse 
 |  | 
|  |      32   *   MB ,                               ;   32   Megabytes   of   ram 
 |  | 
|  |      {   {   } ,                                 ;   still   one   floppy 
 |  | 
|  |        {   1440   }   } ,                          ;   but   it   has   a   1 . 2   MB   capacity 
 |  | 
|  |      {   {   ,   TRUE ,   TRUE   } ,                   ;   also   have   second   and   third   hardfiles 
 |  | 
|  |        {   512 ,   1024 ,   4096   }   } ,              ;   512MB ,   1   GIG ,   and   4   GIG 
 |  | 
|  |      {   " Spiffatron   9000 " ,   10 ,   13 ,         ;   with   a   fancy   system   name 
 |  | 
|  |        " Acme   Computers " ,   10 ,   13 ,   0   }   } 
 |  | 
|  | DATA   ends 
 |  | 
|  | end </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00712.htm|prev]]][[[00714.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Intermodule Linkage ===
 |  | 
|  |   |  | 
|  | To use symbols and procedures in more than one module, ALP must recognize shared data as global to all modules. ALP provides directives to simplify data sharing and a high-level interface to multiple-module programming. With these directives, you can define shared symbols and refer to them from other modules.
 |  | 
|  |   |  | 
|  | This section describes the following intermodule linkage directives:
 |  | 
|  |   |  | 
|  | COMM <br />END <br />EXTERN/EXTRN <br />EXTERNDEF <br />INCLUDELIB <br />NAME <br />PUBLIC <br />
 |  | 
|  |   |  | 
|  | [[[00713.htm|prev]]][[[00715.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === COMM (Declare Communal Variable) ===
 |  | 
|  |   |  | 
|  | Declares an uninitialized '''''common''or '''''communal''variable that is allocated by the linker.''''''
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>COMM   [ Language - Name ]   [ Distance ]   Name [ [ Count ] ] : TypeName [ : Size ]   [ ,   . . . ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The arguments to the '''COMM'''directive are as follows:
 |  | 
|  |   |  | 
|  | [[00131.htm|''Language-Name'']]Optional parameter that determines how ''Name''is spelled when written to the object file. Used when interfacing with routines written in high-level languages. If not specified, the language defaults to the value set by [[00775.htm|.MODEL]]or [[00793.htm|OPTION LANGUAGE]].
 |  | 
|  |   |  | 
|  | '''''Distance''One of '''NEAR'''or '''FAR'''; determines the distance of allocated variable. If not specified, the current memory model determines the distance. The default is '''NEAR'''if no memory model is active.'''
 |  | 
|  |   |  | 
|  | '''''Name''The name of the variable to be allocated by the linker. This field is required.'''
 |  | 
|  |   |  | 
|  | '''''[Count]''Optional; if specified, this parameter must be surrounded by square brackets. The ''Count''parameter can be thought of as a major (row) array dimension. It defaults to 1 if not specified.'''
 |  | 
|  |   |  | 
|  | '''''TypeName''Required parameter that specifies the type of the variable being allocated. It must be a single keyword or identifier that specifies a [[00128.htm|''Distance-TypeName'']], [[00125.htm|''Scalar-TypeName'']], or [[00171.htm|''UserDefined-TypeName'']].'''
 |  | 
|  |   |  | 
|  | '''''Size''''Size''is an optional parameter that can be thought of as a minor ( column) array dimension. It defaults to 1 if not specified.'''
 |  | 
|  |   |  | 
|  | Communal variables are allocated by the linker. When the linker combines object modules together, all instances of an identically-named communal variable are merged into a single instance (union), and are uninitialized.
 |  | 
|  |   |  | 
|  | The allocated size of a communal variable is the largest size requested by all encountered references.
 |  | 
|  |   |  | 
|  | The allocation order with respect to the addresses of other global symbols is undefined; an application must not depend on the address of a communal variable being less than or greater than that of another global symbol.
 |  | 
|  |   |  | 
|  | A variable allocated with the '''COMM'''directive need not be declared in all referencing modules as communal; the linker matches all [[00716.htm|EXTERN/EXTRN]] references with that of the communal variable. Similarly, a variable allocated in one module with the [[00720.htm|PUBLIC]]directive may be declared in other modules as communal.
 |  | 
|  |   |  | 
|  | Since communal variables cannot be initialized and their address positions cannot be compared, use of the '''COMM'''directive is discouraged. The [[00717.htm|EXTERNDEF]]directive should be used instead. <br />
 |  | 
|  |   |  | 
|  | [[[00714.htm|prev]]][[[00716.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === END (Define End of Module and Entry Point) ===
 |  | 
|  |   |  | 
|  | The '''END'''directive has two functions:
 |  | 
|  |   |  | 
|  | �Identifies the end of the source program. <br />�Identifies the symbol that is the name of the entry point (through the [[00255.htm|''Expression'']]on the '''END'''directive) <br />
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>END   [ Expression ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | All source files must have the '''END'''directive as the last statement. Any lines following the '''END'''statement are ignored by the assembler.
 |  | 
|  |   |  | 
|  | When the linker builds an application program from one or more object modules, it needs to know where the entry point is for the operating system to pass initial control. If you do not specify an entry point, none is assumed. Only one module can identify a label as the entry point by specifying that label on its '''END'''statement. Any module not defining an operating system entry point must not have an entry point identified on its '''END'''statement. If you fail to define an entry point for the main module, your program may not be able to initialize correctly. It will assemble and link without error, but it cannot run.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | The following example is the '''END'''statement for the section of code that starts with the name '''BEGIN'''. <br />
 |  | 
|  |   |  | 
|  | <pre>END   BEGIN </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00715.htm|prev]]][[[00717.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === EXTERN/EXTRN (Declare External Identifier) ===
 |  | 
|  |   |  | 
|  | The '''EXTERN'''directive specifies a declaration for the external symbol ''Name'' so that it may be referred to within this module. The actual definition for the symbol occurs in some other module, and the linker resolves all such external declarations to a single definition for ''Name''.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>EXTERN   [ Language - Name ]   Name   [ ( Default - Resolution ) ]   : Type   [ ,   . . . ] </pre>
 |  | 
|  | Where ''Type''is one of:
 |  | 
|  |   |  | 
|  | �'''ABS''' <br />�[[00250.htm|''Type-Declaration'']]
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The obsolete spelling for the '''EXTERN'''directive is '''EXTRN'''.
 |  | 
|  |   |  | 
|  | The external source module that defines the symbol must give it public visibility in the corresponding object module, which is accomplished in assembler language by declaring it with the [[00714.htm|COMM]]directive, defining the symbol in association with an [[00717.htm|EXTERNDEF]]or [[00720.htm|PUBLIC]]directive, or by specifying the '''PUBLIC'''or '''EXPORT'''attributes in a [[00739.htm|PROC]]directive.
 |  | 
|  |   |  | 
|  | If the '''EXTERN'''directive is given within a segment, the assembler assumes that the symbol is located within that segment. If the segment is not known, place the '''EXTERN'''directive outside all segments and either use an explicit segment prefix or an '''ASSUME'''directive.
 |  | 
|  |   |  | 
|  | A ''Type''value of '''ABS'''indicates that ''Name''is an externally-defined constant value. Local references to ''Name''are treated as immediate values having an [[00587.htm|''Operand Size'']]equal to the [[00586.htm|''Address Size'']]of the segment containing the reference.
 |  | 
|  |   |  | 
|  | '''Note:'''If the ''Type''of '''EXTERN'''is '''ABS''', it may not be used anywhere in this module where conversion to an immediate value of type '''BYTE'''is required. Additionally, the defining module must define the value as a constant symbol.
 |  | 
|  |   |  | 
|  | '''For example:'''<br />
 |  | 
|  |   |  | 
|  | <pre>FOO      EQU      5 
 |  | 
|  | PUBLIC   FOO </pre>
 |  | 
|  | Use of the ''(default_resolution)''syntax declares the external symbol ''Name''to be a "weak" symbol, in which case the linker will pair all such declarations with the symbol ''default_resolution''unless a standard "strong" public definition for ''Name''is encountered during the link.
 |  | 
|  |   |  | 
|  | '''Example'''<br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------------------------------------------------------\
 |  | 
|  | |IN THE SAME SEGMENT                |IN ANOTHER SEGMENT                 |
 |  | 
|  | |-----------------------------------+-----------------------------------|
 |  | 
|  | |IN MODULE 1:                       |IN MODULE 1:                       |
 |  | 
|  | |                                   |                                   |
 |  | 
|  | |cseg segment                       |csega segment                      |
 |  | 
|  | |public tagn                        |public tagf                        |
 |  | 
|  | |.                                  |.                                  |
 |  | 
|  | |.                                  |.                                  |
 |  | 
|  | |.                                  |.                                  |
 |  | 
|  | |tagn:                              |tagf:                              |
 |  | 
|  | |.                                  |.                                  |
 |  | 
|  | |.                                  |.                                  |
 |  | 
|  | |.                                  |.                                  |
 |  | 
|  | |cseg ends                          |csega ends                         |
 |  | 
|  | |                                   |                                   |
 |  | 
|  | |IN MODULE 2:                       |IN MODULE 2:                       |
 |  | 
|  | |                                   |                                   |
 |  | 
|  | |cseg segment                       |extern tagf:far                    |
 |  | 
|  | |extern tagn:near                   |csegb segment                      |
 |  | 
|  | |.                                  |.                                  |
 |  | 
|  | |.                                  |.                                  |
 |  | 
|  | |.                                  |.                                  |
 |  | 
|  | |jmp tagn                           |jmp tagf                           |
 |  | 
|  | |cseg ends                          |csegb ends                         |
 |  | 
|  | \-----------------------------------------------------------------------/</pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00716.htm|prev]]][[[00718.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === EXTERNDEF (Declare Global Identifier) ===
 |  | 
|  |   |  | 
|  | The '''EXTERNDEF'''directive combines the functionality of the [[00716.htm|EXTERN/EXTRN]]and [[00720.htm|PUBLIC]]directives. It provides a uniform way to declare global symbols that are to be shared across multiple modules.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>EXTERNDEF   [ Language - Name ]   Name : Type   [ ,   . . . ] </pre>
 |  | 
|  | Where ''Type''is one of:
 |  | 
|  |   |  | 
|  | �'''ABS''' <br />�[[00250.htm|''Type-Declaration'']]
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | A symbol declared with '''EXTERNDEF'''is treated as [[00720.htm|PUBLIC]]if a definition for the symbol is encountered during the assembly, otherwise the symbol is assumed to be defined in another module and is treated as if it were declared with the [[00716.htm|EXTERN/EXTRN]]directive.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | The following example shows how a declaration for the '''ReturnCode'''symbol can be shared between two modules (Main.asm and FileErr.asm) by way of a common header file (ErrNum.inc): <br />
 |  | 
|  |   |  | 
|  | <pre>;   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 |  | 
|  | ;   ErrNum . inc 
 |  | 
|  |   |  | 
|  | RETCODE _ T   typedef   DWORD 
 |  | 
|  |   |  | 
|  | RC _ NoError        equ   0 
 |  | 
|  | RC _ FileNotFound   equ   1 
 |  | 
|  | RC _ SystemError    equ   3 
 |  | 
|  |   |  | 
|  | EXTERNDEF   ReturnCode : RETCODE _ T      ;   declaration 
 |  | 
|  |   |  | 
|  |   |  | 
|  | ;   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 |  | 
|  | ;   FileErr . asm 
 |  | 
|  | . 386 
 |  | 
|  | . MODEL   FLAT 
 |  | 
|  | INCLUDE   ErrNum . inc                   ;   bring   in   error   number   definitions 
 |  | 
|  |                                       ;   and   declaration   for   ReturnCode 
 |  | 
|  |   |  | 
|  | . CODE 
 |  | 
|  | ;   Tell   the   user   about   the   file   error , 
 |  | 
|  | ;   then   make   sure   the   program   has   a   non - zero   exit   status 
 |  | 
|  | FileError   proc 
 |  | 
|  |            . . . 
 |  | 
|  |            mov   ReturnCode ,   RC _ FileNotFound 
 |  | 
|  |            ret 
 |  | 
|  | FileError   endp 
 |  | 
|  |            end 
 |  | 
|  |   |  | 
|  |   |  | 
|  | ;   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 |  | 
|  | ;   Main . asm 
 |  | 
|  | . 386 
 |  | 
|  | . MODEL   FLAT 
 |  | 
|  | INCLUDE   ErrNum . inc                   ;   bring   in   error   number   definitions 
 |  | 
|  |                                       ;   and   declaration   for   ReturnCode 
 |  | 
|  | EXTERNDEF   FileError : PROC            ;   This   could   be   in   a   common   header   too 
 |  | 
|  |   |  | 
|  | . DATA 
 |  | 
|  | ReturnCode   RETCODE _ T   RC _ NoError     ;   actual   definition   of   ReturnCode 
 |  | 
|  |   |  | 
|  | . CODE 
 |  | 
|  | Main   proc 
 |  | 
|  |       . . . 
 |  | 
|  |       . . . 
 |  | 
|  |       call   FileError            ;   hypothetical   error   condition 
 |  | 
|  |       . . . 
 |  | 
|  |       . . . 
 |  | 
|  |       mov   eax ,   ReturnCode       ;   load   the   exit   status 
 |  | 
|  |       call   Exit                  ;   and   shutdown   the   program 
 |  | 
|  | Main   endp 
 |  | 
|  |       end   Main 
 |  | 
|  | </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00717.htm|prev]]][[[00719.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === INCLUDELIB (Pass Library Name to Linker through Object File) ===
 |  | 
|  |   |  | 
|  | The '''INCLUDELIB'''directive is used to inform the linker that a library file of a given name is to be used when attempting to resolve external references declared by this module.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>INCLUDELIB   FileName </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The [[00652.htm|''FileName'']]argument is parsed as a contiguous string of arbitrary characters, and should constitute a file name that is valid in the context where it will be used. The [[00652.htm|''FileName'']]should be coded as a <''text-literal''> if it is to contain embedded spaces or other special characters.
 |  | 
|  |   |  | 
|  | The assembler emits a special record into the object file which contains the string of characters given by the [[00652.htm|''FileName'']]entry. This record instructs the linker to include the named library file in its list of libraries to be searched during the process of resolving external references. The assembler attaches no other meaning to the object file record, and it is up to the linker to interpret the file name for any special meaning (such as search path information, file name extension, and so on).
 |  | 
|  |   |  | 
|  | Use of this directive avoids the need to explicitly reference the library name in a linker invocation parameter, and helps to avoid the problems that can arise when such parameters are specified incorrectly.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>INCLUDELIB   OS2386 . LIB </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00718.htm|prev]]][[[00720.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === NAME (Specify Module Name) ===
 |  | 
|  |   |  | 
|  | The '''NAME'''directive assigns a module a name.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>NAME   module - name </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''NAME'''directive is ignored; it is provided for backward compatibility with other assemblers. <br />
 |  | 
|  |   |  | 
|  | [[[00719.htm|prev]]][[[00721.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === PUBLIC (Make Symbol Visible to Other Modules) ===
 |  | 
|  |   |  | 
|  | The '''PUBLIC'''directive makes defined symbols available to other programs that are to be linked. The information referred to by the '''PUBLIC'''directive is passed to the linker.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>PUBLIC   [ Language - Name ]   Identifier [ , . . . ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | [[00149.htm|''Identifier'']]can be a variable or a label (including '''PROC'''labels). Register names and any symbols defined by '''EQU'''or = to floating-point numbers or integers larger than 4 bytes are incorrect entries.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>         PUBLIC     GETINFO     ; Make   GETINFO   visible   to   linker 
 |  | 
|  | GETINFO   PROC       FAR 
 |  | 
|  |          PUSH       BP          ; Save   caller ' s   register 
 |  | 
|  |          MOV        BP , SP       ; Get   address   of   parameters 
 |  | 
|  |                               ; BODY   OF   SUBROUTINE 
 |  | 
|  |          POP        BP          ; restore   caller ' s   register 
 |  | 
|  |          RET                   ; return   to   caller 
 |  | 
|  | GETINFO   ENDP </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00720.htm|prev]]][[[00722.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Listing Control ===
 |  | 
|  |   |  | 
|  | ALP creates an assembler listing of your source file whenever you use a related source code directive or specify the [[00050.htm|+Fl]]option on the ALP command line.
 |  | 
|  |   |  | 
|  | The assembler listing contains:
 |  | 
|  |   |  | 
|  | �Cumulative Listing Line Number <br />�Individual Source File Line Number <br />�Macro Expansion Line Number <br />�Macro Definition Line Number <br />�Macro Expansion Indentation Level <br />�Macro Expansion Nesting Level <br />�Include File Nesting Level <br />�Conditional Assembly Nesting Level <br />�True or False Conditional Flag <br />�Location Counter Offset Value <br />�Generated Machine Code Data <br />�Source Line Data <br />
 |  | 
|  |   |  | 
|  | If requested (via the [[00082.htm|+Ls]]command line option) a symbol table listing is produced that shows the names and values of all of the user-defined identifiers created during the assembly. The values of certain predefined identifiers are also show in the symbol table listing.
 |  | 
|  |   |  | 
|  | The symbol table listing is divided into the following categories:
 |  | 
|  |   |  | 
|  | �Macro Names <br />�Text Equate Names <br />�Structures/Union Type Names <br />�Orphaned Structure Fields <br />�Record Type Names <br />�Typedef Type Names <br />�Group Names <br />�Segment Names <br />�Numeric Equate Names <br />�Code Label Names <br />�Procedure Names <br />�Variable Names <br />
 |  | 
|  |   |  | 
|  | ALP places the symbol table listing at the end of the listing output. ALP lists only the types of symbols encountered in the program. For example, if your program does not define any macros, the '''Macro Names'''section is omitted from the listing output.
 |  | 
|  |   |  | 
|  | This section describes the following listing control directives:
 |  | 
|  |   |  | 
|  | %BIN <br />.CREF <br />.LALL <br />.LFCOND <br />.LIST <br />.LISTALL <br />.LISTIF <br />.LISTMACRO <br />.LISTMACROALL <br />.NOCREF <br />.NOLIST <br />.NOLISTIF <br />.NOLISTMACRO <br />PAGE <br />.SALL <br />.SFCOND <br />SUBTITLE <br />SUBTTL <br />.TFCOND <br />TITLE <br />.XALL <br />.XCREF <br />.XLIST <br />
 |  | 
|  |   |  | 
|  | [[[00721.htm|prev]]][[[00723.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === %BIN (Set Listing Width for Object Code Field) ===
 |  | 
|  |   |  | 
|  | Sets the width of the object code field in the listing file to ''size''columns .
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>% BIN   size </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00722.htm|prev]]][[[00724.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .CREF/.XCREF (Control Symbol Cross Referencing) ===
 |  | 
|  |   |  | 
|  | The output of the cross-reference information is controlled by these directives. The default condition is the '''.CREF'''directive. When the assembler finds a '''.XCREF'''directive, cross-reference information results in no output until the assembler finds
 |  | 
|  |   |  | 
|  | '''Note:'''The assembler does not produce cross-referencing information. These directives are provided for source file compatibility with other assemblers .
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. CREF 
 |  | 
|  |     or 
 |  | 
|  | . XCREF   [ [ operand   [ , . . . ] ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.XCREF'''directive can have an optional operand consisting of a list of one or more variable names suppressed in the cross-reference listing. <br />
 |  | 
|  |   |  | 
|  | [[[00723.htm|prev]]][[[00725.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .LFCOND (List False Conditionals) ===
 |  | 
|  |   |  | 
|  | You use the '''.LFCOND'''(List False Conditionals) directive to list conditional blocks that are evaluated as false.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. LFCOND </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Equivalent to the '''.LISTIF'''directive.
 |  | 
|  |   |  | 
|  | '''.LFCOND'''does not have an operand. You can end this state either by issuing '''.TFCOND''', which reverts to the default state concerning listing of false conditionals (but with the default state redefined as being in the opposite state,) or by issuing the '''.SFCOND''', which suppresses the listing of false conditionals.
 |  | 
|  |   |  | 
|  | The assembler does not print false conditionals within macros when '''.LALL'''is set. <br />
 |  | 
|  |   |  | 
|  | [[[00724.htm|prev]]][[[00726.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .LIST/.XLIST (Control Listing File Output) ===
 |  | 
|  |   |  | 
|  | These two directives control output to the listing file.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. LIST 
 |  | 
|  |     or 
 |  | 
|  | . XLIST </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If a listing is not being created, these directives have no effect. The '''. LIST'''is the default condition. When the assembler finds an '''.XLIST''', the assembler does not list the source and the object code until it finds a '''. LIST'''directive. <br />
 |  | 
|  |   |  | 
|  | [[[00725.htm|prev]]][[[00727.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .LISTALL (List All Statements) ===
 |  | 
|  |   |  | 
|  | Starts the listing of all statements.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. LISTALL </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Equivalent to the combination of '''.LIST''', '''.LISTIF''', and '''.LISTMACROALL'''. <br />
 |  | 
|  |   |  | 
|  | [[[00726.htm|prev]]][[[00728.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .LISTIF (List False Conditionals) ===
 |  | 
|  |   |  | 
|  | Starts the listing of all statements, including those in false conditional blocks.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. LISTIF </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Equivalent to the combination of '''.LIST''', '''.LISTIF''', and '''.LISTMACROALL'''. <br />
 |  | 
|  |   |  | 
|  | [[[00727.htm|prev]]][[[00729.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .LISTMACRO/.XALL (List Code and Data Statements in Macros) ===
 |  | 
|  |   |  | 
|  | Starts listing of only those statements that generate code or data when processing macro expansions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. LISTMACRO 
 |  | 
|  |     or 
 |  | 
|  | . XALL </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | ALP does not support this mode; it is provided for compatibility with other assemblers. <br />
 |  | 
|  |   |  | 
|  | [[[00728.htm|prev]]][[[00730.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .LISTMACROALL/.LALL (List All Statements in Macros) ===
 |  | 
|  |   |  | 
|  | Starts listing of all statements when processing macros expansions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. LISTMACROALL 
 |  | 
|  |     or 
 |  | 
|  | . LALL </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00729.htm|prev]]][[[00731.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .NOCREF (Suppress Symbol Cross Referencing) ===
 |  | 
|  |   |  | 
|  | Suppresses the listing of symbols in the symbol table and cross-referencing output.
 |  | 
|  |   |  | 
|  | '''Note:'''The assembler does not produce cross-referencing information. This directive is provided for source file compatibility with other assemblers.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. NOCREF   [ name [ , name ] . . . ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If names are specified, only the given names are suppressed. Same as '''.XCREF''' . <br />
 |  | 
|  |   |  | 
|  | [[[00730.htm|prev]]][[[00732.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .NOLIST (Suppress List Output) ===
 |  | 
|  |   |  | 
|  | Suppresses program listing.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. NOLIST </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Same as '''.XLIST'''. <br />
 |  | 
|  |   |  | 
|  | [[[00731.htm|prev]]][[[00733.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .NOLISTIF (Do Not List False Conditionals) ===
 |  | 
|  |   |  | 
|  | Suppresses listing of conditional blocks whose condition evaluates to false (0).
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. NOLISTIF </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | This is the default. Same as '''.SFCOND'''. <br />
 |  | 
|  |   |  | 
|  | [[[00732.htm|prev]]][[[00734.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .NOLISTMACRO (Do Not List Macro Expansions) ===
 |  | 
|  |   |  | 
|  | Suppresses listing of macro expansion.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. NOLISTMACRO </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Same as '''.SALL'''.
 |  | 
|  |   |  | 
|  | This is the default setting for ALP. <br />
 |  | 
|  |   |  | 
|  | [[[00733.htm|prev]]][[[00735.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === PAGE (Control Listing Page Length and Width) ===
 |  | 
|  |   |  | 
|  | The '''PAGE''' directive controls the length and width of each listing page. Place the '''PAGE'''directive in the source file to control the format of the listing file produced during assembly.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>PAGE   [ operand - 1 ] [ , operand - 2 ] 
 |  | 
|  |     or 
 |  | 
|  | PAGE   + </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Using '''PAGE'''+ or the '''PAGE'''directive without an operand entries causes the printer to go to the top of the page and increases the page number by 1. The assembler normally takes this action only when a page is full.
 |  | 
|  |   |  | 
|  | The ''operand-1''entry specifies the actual number of lines that can be physically printed on the page; the default value is 66.
 |  | 
|  |   |  | 
|  | Use the ''operand-2''entry to control the width of the page. The page width without a specified number is 132.
 |  | 
|  |   |  | 
|  | '''Note:'''The '''PAGE'''directive does not set the printer to the desired line width. For proper formatting of the listing, initialize the printer to operate at a corresponding line width before printing the listing file. <br />
 |  | 
|  |   |  | 
|  | [[[00734.htm|prev]]][[[00736.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === SUBTITLE/SUBTTL (Specify Listing Page Subtitle) ===
 |  | 
|  |   |  | 
|  | Defines the subtitle displayed in the user area of each page in the listing output.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>SUBTITLE   text 
 |  | 
|  |     or 
 |  | 
|  | SUBTTL   text </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00735.htm|prev]]][[[00737.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .TFCOND (Toggle Listing of False Conditionals) ===
 |  | 
|  |   |  | 
|  | Toggles listing of false conditional blocks.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. TFCOND </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00736.htm|prev]]][[[00738.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === TITLE (Specify Listing Page Title) ===
 |  | 
|  |   |  | 
|  | Defines the title displayed in the user area of each page in the listing output.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>TITLE   text </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00737.htm|prev]]][[[00739.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Procedure Control ===
 |  | 
|  |   |  | 
|  | Procedure control directives allow you to organize your code into procedures. The '''PROC'''and '''ENDP'''directives mark the beginning and end of a procedure. Also, '''PROC'''can automatically:
 |  | 
|  |   |  | 
|  | �Preserve higher register values that should not change but that the procedure might otherwise alter <br />�Set up a local stack pointer, so that you can access parameters and local variables placed on the stack <br />�Adjust the stack when the procedure ends <br />
 |  | 
|  |   |  | 
|  | This section describes the following procedure control directives:
 |  | 
|  |   |  | 
|  | '''PROC''' <br />'''LOCAL''' <br />'''ENDP''' <br />
 |  | 
|  |   |  | 
|  | [[[00738.htm|prev]]][[[00740.htm|next]]][[[00738.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === PROC (Identify Code Procedure) ===
 |  | 
|  |   |  | 
|  | The '''PROC'''directive identifies a block of code. By dividing the code into blocks, each of which performs a distinct function, you can clarify the overall function of the complete module.
 |  | 
|  |   |  | 
|  | The '''PROC'''directive also identifies the procedure ''distance''to help insure that the assembler generates the appropriate instructions for calling and returning from the procedure while maintaining the integrity of the run- time stack.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Procedure - Name   PROC   [ Attributes ]   [ Register - List ]   [ Parameter - List ] 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | RET   [ Constant ] 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | Procedure - Name   ENDP </pre>
 |  | 
|  |   |  | 
|  |   |  | 
|  | Refer to the following sections for descriptions of the optional arguments to the '''PROC'''directive:
 |  | 
|  |   |  | 
|  | �[[00740.htm|''Attributes'']] <br />�[[00741.htm|''Register-List'']] <br />�[[00742.htm|''Parameter-List'']]
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | You can execute the block of code identified by the '''PROC'''directive in-line, jump to it, or start it with a '''CALL'''instruction. If the '''PROC'''is called from code that has another '''ASSUME CS'''value, you must use the appropriate '''FAR''', '''FAR16''', or '''FAR32'''''distance attribute''.
 |  | 
|  |   |  | 
|  | The '''NEAR'''attribute causes any '''RET'''instruction coded within the procedure to be an intra-segment return that pops a return '''''offset''from the stack. You can call a '''NEAR'''subroutine only from the same segment. However, the '''FAR''' attribute causes '''RET'''to be an inter-segment return that pops both a return '''''offset''and a '''''segment base''from the stack. You can call a '''FAR'''subroutine from any segment; a '''FAR'''subroutine is usually called from a segment other than the one containing the subroutine.'''''''''
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | In this example, the '''Near_Name'''subroutine is called by the '''Far_Name''' subroutine. <br />
 |  | 
|  |   |  | 
|  | <pre>           PUBLIC     Far _ Name 
 |  | 
|  | Far _ Name    PROC       FAR 
 |  | 
|  |            CALL   Near _ Name 
 |  | 
|  |            RET                  ; Pops   return   offset   and   seg   base   value 
 |  | 
|  | Far _ Name    ENDP 
 |  | 
|  |   |  | 
|  |            PUBLIC     Near _ Name 
 |  | 
|  | Near _ Name   PROC       NEAR 
 |  | 
|  |            . 
 |  | 
|  |            . 
 |  | 
|  |            . 
 |  | 
|  |            RET                  ; pops   only   return   offset 
 |  | 
|  | Near _ Name   ENDP </pre>
 |  | 
|  | You can call the '''Near_Name'''subroutine directly from a '''NEAR'''segment by using : <br />
 |  | 
|  |   |  | 
|  | <pre>CALL   Near _ Name </pre>
 |  | 
|  | A '''FAR'''segment can indirectly call the second subroutine by first calling the '''Far_Name'''subroutine with: <br />
 |  | 
|  |   |  | 
|  | <pre>CALL   Far _ Name </pre>
 |  | 
|  | A '''CALL'''to a forward-referenced symbol assumes the symbol is '''NEAR'''. If that symbol is '''FAR''', the '''CALL'''must have an override, for example: <br />
 |  | 
|  |   |  | 
|  | <pre>CALL   FAR   PTR   Forward _ Reference </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00739.htm|prev]]][[[00741.htm|next]]][[[00739.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Attributes ===
 |  | 
|  |   |  | 
|  | The optional fields in the ''Attributes''argument control how the procedure is defined.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>[ Distance ]   [ Language ]   [ Visibility ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The various ''Attribute''fields are defined as follows:
 |  | 
|  |   |  | 
|  | '''''Distance''Determines the type of '''CALL'''instruction that should be used to invoke the procedure, and the type of '''RET'''instruction generated by the assembler. The default is '''NEAR'''if no [[00775.htm|.MODEL]]directive has been specified, or if the model has been set to '''TINY''', '''SMALL''', '''COMPACT''', or '''FLAT'''. The default is '''FAR'''if the model has been set to '''LARGE''', '''MEDIUM''', or '''HUGE'''. If the programmer is using segments with mixed address sizes ('''USE16'''and '''USE32''') on a 32-bit processor, then the '''NEAR16''', '''FAR16''', '''NEAR32''', and '''FAR32'''keywords may also be used.'''
 |  | 
|  |   |  | 
|  | '''''Language''Determines the calling convention used by the procedure, and the naming convention used when writing the procedure name to the object file. The calling convention defines the layout of the stack frame upon entry to the procedure and how the stack frame is destroyed upon procedure exit. See the section on [[00163.htm|''LabelName'']]''s''for more information on language naming conventions.'''
 |  | 
|  |   |  | 
|  | With the '''BASIC''', '''FORTRAN''', and '''PASCAL'''calling conventions, the called procedure expects arguments to be pushed on the stack from left to right, causing the rightmost parameter to be at the lowest stack address and closest in proximity to the ''frame pointer''(the BP or EBP register). With this arrangement, the called procedure always knows the exact amount of stack space used by the parameters, and is responsible for removing them from the stack with a '''RET''''''''Constant''instruction when the procedure exits. Such procedures are unable to accept a variable number of arguments.'''
 |  | 
|  |   |  | 
|  | With the '''C''', '''STDCALL''', '''SYSCALL''', and '''OPTLINK'''calling conventions, the called procedure expects arguments to be pushed on the stack from right to left, causing the leftmost parameter to be at the lowest stack address and closest in proximity to the ''frame pointer''(the BP or EBP register). With this arrangement, the calling procedure is free to push additional arguments on the stack, and is responsible for restoring the stack after the called procedure returns ('''STDCALL'''requires the called procedure to restore the stack if a fixed number of arguments is being passed).
 |  | 
|  |   |  | 
|  | With the '''OPTLINK'''32-bit calling convention (as defined by the IBM VisualAge C/C++ Compiler environment), up to three parameters will be passed in machine registers to the called procedure, provided they not larger than a DWORD in size. The EAX, EDX, and ECX registers (respectively) are used for this purpose. Stack space for the parameters is still allocated, but the parameter values are not actually copied onto the stack. Refer to the documentation for the IBM VisualAge C++ compiler for more information on the '''OPTLINK'''calling convention.
 |  | 
|  |   |  | 
|  | '''''Visibility''Determines if the procedure name is written to the object file as a global identifier, allowing it to be referenced by other modules. The allowable values are '''PRIVATE''', '''PUBLIC''', and '''EXPORT'''. If operating in [[00105.htm|M510]] mode and no [[00775.htm|.MODEL]]directive with a [[00131.htm|''Language-Name'']]has been specified, then the default visibility is '''PRIVATE'''. In all other situations, the default visibility is '''PUBLIC'''unless the default has been overridden by an [[00793.htm|OPTION LANGUAGE]]directive.'''
 |  | 
|  |   |  | 
|  | When the '''PRIVATE'''keyword is used, the procedure name is visible only within the defining module at assembly-time. When the visibility is '''PUBLIC''', the procedure name is made visible to other modules at link-time. The same is true of '''EXPORT'''visibility, but in this case the assembler emits a special record into the object file that causes the linker to also make the symbol visible as an exported entry point in the executable module , allowing it be called by other modules at program run-time. <br />
 |  | 
|  |   |  | 
|  | [[[00740.htm|prev]]][[[00742.htm|next]]][[[00739.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Register List ===
 |  | 
|  |   |  | 
|  | The optional ''Register-List''defines those registers used in the body of the procedure that must be preserved on behalf of the caller. The assembler generates code to save these registers on the stack when the procedure is entered, and to restore them when the procedure exits.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>USES   Register   [   Register . . . ] </pre>
 |  | 
|  | '''''Register:'' <br />[[00122.htm|''16-Bit-Register'']] <br />[[00122.htm|''32-Bit-Register'']] <br />[[00122.htm|''Segment-Register'']] <br />'''
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | When more than one register is specified, do not use commas to separate the register keywords; use blanks or tabs instead. <br />
 |  | 
|  |   |  | 
|  | [[[00741.htm|prev]]][[[00743.htm|next]]][[[00739.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Parameter List ===
 |  | 
|  |   |  | 
|  | The optional ''Parameter-List''defines the parameters that the caller passes to the procedure on the run-time stack.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>[ ,   [ LineBreak ] ]   Parm - List </pre>
 |  | 
|  | '''''Parm-List:'' <br />''Parm-Spec''[, [''LineBreak''] ''Parm-Spec''...] <br />'''
 |  | 
|  |   |  | 
|  | '''''Parm-Spec:'' <br />''Parameter-Name''[:''Type''] <br />'''
 |  | 
|  |   |  | 
|  | The introductory comma in front of the ''Parm-List''is only required if a ''LineBreak''is used to put the first ''Parm-Spec''on the line following the '''PROC''' directive.
 |  | 
|  |   |  | 
|  | The optional ''LineBreak''entry allows you to end a ''Parm-Spec''entry with a comma, enter an optional [[00657.htm|''EndOfLine-Comment'']]followed by a physical ''NewLine'' character, then continue the ''Parm-List''on the next line.
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Each ''Parameter-Name''is defined as a [[00156.htm|''Numeric-EquateName'']]that is visible only from within the body of the procedure. The value assigned to the parameter name is an expression that defines the parameter type and its location on the stack relative to the value of the ''frame pointer''(the BP or EBP register). The assembler automatically calculates the correct offset value based upon the size of the parameter type.
 |  | 
|  |   |  | 
|  | The ''Type''field is specified as a [[00250.htm|''Type-Declaration'']]and defines the data type associated with the ''Parameter-Name''. If this field is omitted, the data type defaults to '''WORD'''if the procedure is defined within a '''USE16'''segment, and '''DWORD'''if the procedure is defined within a '''USE32'''segment.
 |  | 
|  |   |  | 
|  | The programmer can read from and store into the locations defined by the ''Parm-Spec''entries as though they were regular named variables, but if the parameter names are to be combined in indexed expressions with other registers, the normal rules for specifying '''BP'''- and '''EBP'''-relative expressions must be followed.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | This example defines a '''ReadBuffer'''procedure to accept four arguments passed on the stack. <br />
 |  | 
|  |   |  | 
|  | <pre>         . 386                          ;   Assemble   for   32 - bit   processors 
 |  | 
|  |          . model   flat , syscall         ;   OS / 2   programming   model / calling   convention 
 |  | 
|  |   |  | 
|  |          EXTERN   DosRead : PROC         ;   OS / 2   DosRead ( )   API 
 |  | 
|  |          INCLUDELIB   os2386 . lib       ;   This   lets   us   link   to   the   API 
 |  | 
|  |   |  | 
|  |          . code                         ;   Open   the   code   segment 
 |  | 
|  |   |  | 
|  | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 |  | 
|  | ;   Call   operating   system   to   read   input   into   a   buffer 
 |  | 
|  | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 |  | 
|  | ReadBuffer   PROC ,                     ;   need   comma   to   continue   the   PROC   statement 
 |  | 
|  |                 hFile : dword ,          ;   parm   1 :   Read   handle 
 |  | 
|  |                 pBuffer : ptr   byte ,     ;   parm   2 :   Address   of   input   buffer 
 |  | 
|  |                 cbRead : dword ,         ;   parm   3 :   Size   of   input   buffer 
 |  | 
|  |                 pulActual : ptr   dword   ;   parm   4 :   Address   of   byte   count   from   read 
 |  | 
|  |   |  | 
|  |          ;   set   up   to   call   the   OS / 2   DosRead   entry   point 
 |  | 
|  |   |  | 
|  |          PUSH    pulActual              ;   arg   4 
 |  | 
|  |          PUSH    cbRead                 ;   arg   3 
 |  | 
|  |          PUSH    pBuffer                ;   arg   2 
 |  | 
|  |          PUSH    hFile                  ;   arg   1 
 |  | 
|  |          CALL    DosRead                ;   Invoke   syscall   ( SYSTEM )   function 
 |  | 
|  |          ADD     ESP , DWORD   *   4         ;   Remove   the   four   parameters   we   pushed 
 |  | 
|  |                                       ;     onto   the   stack   for   the   DosRead   call 
 |  | 
|  |          RET 
 |  | 
|  | ReadBuffer      ENDP </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00742.htm|prev]]][[[00744.htm|next]]][[[00738.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === LOCAL (Define Local Procedure Variables) ===
 |  | 
|  |   |  | 
|  | The '''LOCAL'''directive defines local stack variables from within a code procedure.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>LOCAL   Local - Spec   [ ,   [ LineBreak ]   Local - Spec   . . . ] </pre>
 |  | 
|  | '''''Local-Spec:'' <br />''Local-Name''[:[[00250.htm|''Type-Declaration'']]] <br />''Local-Name[Count]''[:[[00250.htm|''Type-Declaration'']]] <br />'''
 |  | 
|  |   |  | 
|  | The optional ''LineBreak''entry allows you to end a ''Local-Spec''entry with a comma, enter an optional [[00657.htm|''EndOfLine-Comment'']]followed by a physical ''NewLine'' character, then continue with a new ''Local-Spec''on the next line.
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''LOCAL'''assembler directive can only appear within the body of a procedure. If used, the '''LOCAL'''directive(s) must immediately follow the '''PROC'''statement that encloses them, and they must appear before any instructions, code labels, or directives that modify the location counter. Multiple '''LOCAL'''directives may appear in succession.
 |  | 
|  |   |  | 
|  | Each ''Local-Name''is defined as a [[00156.htm|''Numeric-EquateName'']]that is visible only from within the body of the procedure. The value assigned to the variable name is an expression that defines the type of the variable and its location on the stack relative to the value of the ''frame pointer''(the BP or EBP register). The assembler reserves space on the stack for each local variable and automatically calculates their locations. After all ''Local- Spec''entries have been processed, the assembler allocates the space by generating instructions to adjust the stack pointer. The assembler also generates instructions to restore the state of the stack and frame pointers when the procedure exits.
 |  | 
|  |   |  | 
|  | The optional ''[Count]''entry can be used to indicate that the variable is a simple "array" of values, where ''Count''is a constant expression. If used, the square brackets surrounding the ''Count''must be specified. Use of this notation is discouraged however, because it does not associate a "true array" data type with the variable, and cannot be viewed as such from within a symbolic debugger. ALP allows the variable to be associated with a "true array" data type through use of the native [[00250.htm|''Type-Declaration'']]syntax.
 |  | 
|  |   |  | 
|  | The [[00250.htm|''Type-Declaration'']]field specifies the data type to be associated with the ''Local-Name''. If this field is omitted, the data type defaults to '''WORD''' if the procedure is defined within a '''USE16'''segment, and '''DWORD'''if the procedure is defined within a '''USE32'''segment.
 |  | 
|  |   |  | 
|  | '''Example'''<br />
 |  | 
|  |   |  | 
|  | <pre>;   bootdrv . asm   :   Returns   value   of   OS / 2   boot   drive   as   exit   code 
 |  | 
|  | ;   assemble   as   :   alp   + Od   bootdrv . asm 
 |  | 
|  | ;   link   as       :   link386   / de   bootdrv ; 
 |  | 
|  |   |  | 
|  |          . 386                            ;   Assemble   for   32 - bit   processors 
 |  | 
|  |          . model   flat , syscall           ;   OS / 2   flat   model / calling   convention 
 |  | 
|  |          . stack   4096 
 |  | 
|  |   |  | 
|  |          EXTERN   DosExit : PROC           ;   OS / 2   DosExit ( )   API 
 |  | 
|  |          EXTERN   DosQuerySysInfo : PROC   ;   OS / 2   DosQuerySysInfo ( )   API 
 |  | 
|  |          INCLUDELIB   os2386 . lib         ;   link   with   these   routines 
 |  | 
|  |   |  | 
|  | ;   These   are   values   taken   from   OS / 2   API   headers .    See   the   OS / 2   Toolkit 
 |  | 
|  | ;   Control   Program   Programming   Guide   and   Reference   for   more   information . 
 |  | 
|  |   |  | 
|  | EXIT _ PROCESS      EQU    1                 ;   for   DosExit 
 |  | 
|  | QSV _ BOOT _ DRIVE    EQU    5                 ;   For   DosQuerySysInfo 
 |  | 
|  |   |  | 
|  | ULONG     TYPEDEF   DWORD                  ;   use   OS / 2   type   convention 
 |  | 
|  |   |  | 
|  |          . code                           ;   open   code   segment 
 |  | 
|  |   |  | 
|  | main      PROC 
 |  | 
|  |          LOCAL   BootDrive : ULONG         ;   place   to   put   value   of   boot   drive 
 |  | 
|  |   |  | 
|  |          ;   Push   parameters   to   DosQuerySysInfo   onto   the   stack 
 |  | 
|  |   |  | 
|  |          PUSH    sizeof   BootDrive        ;   arg   4 :   size   of   output   buffer 
 |  | 
|  |          LEA     EAX , BootDrive           ;   arg   3 :   Address   of   buffer 
 |  | 
|  |          PUSH    EAX 
 |  | 
|  |          PUSH    QSV _ BOOT _ DRIVE          ;   arg   2 :   last   ordinal   value   to   return 
 |  | 
|  |          PUSH    QSV _ BOOT _ DRIVE          ;   arg   1 :   first   ordinal ,   same   as   last 
 |  | 
|  |          CALL    DosQuerySysInfo         ;   invoke   API 
 |  | 
|  |          ADD     ESP , DWORD   *   4           ;   remove   the   parameters   from   the   stack 
 |  | 
|  |   |  | 
|  |          CMP     EAX , 0                    ;   Did   the   API   succeed ? 
 |  | 
|  |          MOV     EAX , 0                    ;     if   not ,   use   zero   as   a   return   code 
 |  | 
|  |          JNZ     SomeKindOfError         ;     and   skip   around   to   the   exit   logic 
 |  | 
|  |          MOV     EAX , BootDrive           ;   else ,   return   the   boot   drive   value 
 |  | 
|  | SomeKindOfError : 
 |  | 
|  |          push    EAX                      ;   exit   code 
 |  | 
|  |          push    EXIT _ PROCESS            ;   terminates   all   threads 
 |  | 
|  |          call    DosExit                  ;   exit   to   calling   process 
 |  | 
|  |          RET                             ;   never   executed 
 |  | 
|  | main      ENDP 
 |  | 
|  |   |  | 
|  |          END     main </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00743.htm|prev]]][[[00745.htm|next]]][[[00738.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ENDP (Close a Procedure Definition Block) ===
 |  | 
|  |   |  | 
|  | Every procedure block opened with the '''PROC'''directive must be ended with the '''ENDP'''directive.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>procedure - name   ENDP </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If the '''ENDP'''directive is not used with the '''PROC'''directive, an error occurs. An unmatched '''ENDP'''also causes an error.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Note:'''See the '''PROC'''directive in this chapter for more detail and examples of '''ENDP'''use.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>PUSH       AX                  ;   Push   third   parameter 
 |  | 
|  | PUSH       BX                  ;   Push   second   parameter 
 |  | 
|  | PUSH       CX                  ;   Push   first   parameter 
 |  | 
|  | CALL       ADDUP               ;   Call   the   procedure 
 |  | 
|  | ADD        SP , 6                ;   Bypass   the   pushed   parameters 
 |  | 
|  | . 
 |  | 
|  | . 
 |  | 
|  | . 
 |  | 
|  | ADDUP      PROC     NEAR        ;   Return   address   for   near   call 
 |  | 
|  |                              ;   takes   two   bytes 
 |  | 
|  |           PUSH     BP          ;   Save   base   pointer   -   takes   two   more 
 |  | 
|  |                              ;   so   parameters   start   at   4th   byte 
 |  | 
|  |           MOV      BP , SP       ;   Load   stack   into   base   pointer 
 |  | 
|  |           MOV      AX , [ BP + 4 ]   ;   Get   first   parameter 
 |  | 
|  |                              ;   4th   byte   above   pointer 
 |  | 
|  |           ADD      AX , [ BP + 6 ]   ;   Get   second   parameter 
 |  | 
|  |                              ;   6th   byte   above   pointer 
 |  | 
|  |           ADD      AX , [ BP + 8 ]   ;   Get   third   parameter 
 |  | 
|  |                              ;   8th   byte   above   pointer 
 |  | 
|  |           POP      BP          ;   Restore   base 
 |  | 
|  |           RET                 ;   Return 
 |  | 
|  | ADDUP      ENDP </pre>
 |  | 
|  | In this example, three numbers are passed as parameters for the procedure '''ADDUP'''. Parameters are often passed to procedures by pushing them before the call so that the procedure can read them off the stack. <br />
 |  | 
|  |   |  | 
|  | [[[00744.htm|prev]]][[[00746.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Processor Control ===
 |  | 
|  |   |  | 
|  | ALP provides a set of directives for selecting processors and coprocessors. Once you select a processor, you must only use the instruction set available for that processor. The default is the 8086 processor. If you always want your code to run on this processor, you need not add any processor directives.
 |  | 
|  |   |  | 
|  | This section describes the following processor control directives:
 |  | 
|  |   |  | 
|  | .8086 <br />.8087 <br />.186 <br />.286 <br />.286P <br />.287 <br />.386 <br />.386P <br />.387 <br />.486 <br />.486P <br />.586 <br />.586P <br />.686 <br />.686P <br />.MMX <br />.NOMMX <br />
 |  | 
|  |   |  | 
|  | [[[00745.htm|prev]]][[[00747.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .8086 (Select 8086 Processor Instruction Set) ===
 |  | 
|  |   |  | 
|  | The '''.8086'''directive tells the assembler to recognize and assemble 8086 instructions. This directive assembles only 8086 and 8088 instructions (the 8088 instructions are identical to the 8086 instructions). ALP assembles 8086 instructions by default.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 8086 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.8086'''directive does not have an operand.
 |  | 
|  |   |  | 
|  | '''Note:'''The '''.8086'''directive does not end ALP 8087/80287 mode. <br />
 |  | 
|  |   |  | 
|  | [[[00746.htm|prev]]][[[00748.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .8087 (Select 8087 Coprocessor Instruction Set) ===
 |  | 
|  |   |  | 
|  | The '''.8087'''directive tells the assembler to recognize and assemble 8087 instructions and data formats. ALP assembles 8087 instructions by default.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 8087 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.8087'''directive does not have an operand. <br />
 |  | 
|  |   |  | 
|  | [[[00747.htm|prev]]][[[00749.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .186 (Select 80186 Processor Instruction Set) ===
 |  | 
|  |   |  | 
|  | The '''.186'''directive tells the assembler to recognize and assemble 8086 or 8088 instructions and the additional instructions for the 80186 microprocessor.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 186 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.186'''directive does not have an operand. Use it only for programs that run on an 80186 microprocessor. <br />
 |  | 
|  |   |  | 
|  | [[[00748.htm|prev]]][[[00750.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .286 (Select 80286 Processor Instruction Set) ===
 |  | 
|  |   |  | 
|  | Enables assembly of nonprivileged instructions for the 80286 processor. Disables assembly of instructions introduced with later processors. Also enables 80287 instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''<br />
 |  | 
|  |   |  | 
|  | <pre>. 286 </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00749.htm|prev]]][[[00751.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .286P (Select 80286 Processor Protected Mode Instruction Set) ===
 |  | 
|  |   |  | 
|  | The '''.286P'''directive tells the assembler to recognize and assemble the protected instructions of the 80286 in addition to the 8086, 8088, and nonprotected 80286 instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 286P </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.286P'''directive does not have an operand. Use it only for programs run on an 80286 processor using both protected and nonprotected instructions. <br />
 |  | 
|  |   |  | 
|  | [[[00750.htm|prev]]][[[00752.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .287 (Select 80287 Coprocessor Instruction Set) ===
 |  | 
|  |   |  | 
|  | The '''.287'''directive tells the assembler to recognize and assemble instructions for the 80287 floating point math coprocessor. The 80287 instruction set consists of all 8087 instructions, plus three additional instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 287 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.287'''directive does not have an operand. Use it only for programs that have 80287 floating point instructions and run on an 80287 math coprocessor . <br />
 |  | 
|  |   |  | 
|  | [[[00751.htm|prev]]][[[00753.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .386 (Select 80386 Processor Instruction Set) ===
 |  | 
|  |   |  | 
|  | Enables assembly of nonprivileged instructions for the 80386 processor. Disables assembly of instructions introduced with later processors. Also enables 80387 instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 386 </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00752.htm|prev]]][[[00754.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .386P (Select 80386 Processor Protected Mode Instruction Set) ===
 |  | 
|  |   |  | 
|  | Enables assembly of all instructions (including privileged) for the 80386P processor. Disables assembly of instructions introduced with later processors. Also enables 80387 instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 386P </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00753.htm|prev]]][[[00755.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .387 (Select 80387 Coprocessor Instruction Set) ===
 |  | 
|  |   |  | 
|  | Enables assembly of instructions for the 80387 coprocessor.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 387 </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00754.htm|prev]]][[[00756.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .486 (Select 80486 Processor Instruction Set) ===
 |  | 
|  |   |  | 
|  | Enables assembly of instructions for the 80486 processor. Also enables 80387 (and later) floating point instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 486 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.486'''directive is not available in [[00105.htm|M510]]mode. <br />
 |  | 
|  |   |  | 
|  | [[[00755.htm|prev]]][[[00757.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .486P (Select 80486 Processor Protected Mode Instruction Set) ===
 |  | 
|  |   |  | 
|  | Enables assembly of all instructions (including privileged) for the 80486 processor. Also enables 80387 (and later) floating point instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 486P </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.486P'''directive is not available in [[00105.htm|M510]]mode. <br />
 |  | 
|  |   |  | 
|  | [[[00756.htm|prev]]][[[00758.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .586 (Select Pentium/586 Processor Instruction Set) ===
 |  | 
|  |   |  | 
|  | Enables assembly of instructions for the Pentium processor family. Also enables 80387 (and later) floating point instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 586 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.586'''directive is not available in [[00105.htm|M510]]mode or [[00105.htm|M600]]mode. <br />
 |  | 
|  |   |  | 
|  | [[[00757.htm|prev]]][[[00759.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .586P (Select Pentium/586 Processor Protected Mode Instruction Set) ===
 |  | 
|  |   |  | 
|  | Enables assembly of all instructions (including privileged) for the Pentium processor family. Also enables 80387 (and later) floating point instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 586P </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.586P'''directive is not available in [[00105.htm|M510]]mode or [[00105.htm|M600]]mode. <br />
 |  | 
|  |   |  | 
|  | [[[00758.htm|prev]]][[[00760.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .686 (Select Pentium Pro/686 Processor Instruction Set) ===
 |  | 
|  |   |  | 
|  | Enables assembly of instructions for the Pentium Pro processor family. Also enables 80387 (and later) floating point instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 686 </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.686'''directive is not available in [[00105.htm|M510]]mode or [[00105.htm|M600]]mode. <br />
 |  | 
|  |   |  | 
|  | [[[00759.htm|prev]]][[[00761.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .686P (Select Pentium Pro/686 Processor Protected Mode Instruction Set) ===
 |  | 
|  |   |  | 
|  | Enables assembly of all instructions (including privileged) for the Pentium Pro processor family. Also enables 80387 (and later) floating point instructions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. 686P </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.686P'''directive is not available in [[00105.htm|M510]]mode or [[00105.htm|M600]]mode. <br />
 |  | 
|  |   |  | 
|  | [[[00760.htm|prev]]][[[00762.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .MMX (Select MMX Processor Instruction Set Extensions) ===
 |  | 
|  |   |  | 
|  | Enables recognition of mnenomics for the MMX instruction set extensions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. MMX </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If 586 mnemonics (or later) are not already being recognized, the '''.MMX''' directive also causes an implicit '''.586'''directive to be executed.
 |  | 
|  |   |  | 
|  | Issuing any '''.486'''(or earlier) processor selection directive causes recognition of MMX mnemonics to be disabled.
 |  | 
|  |   |  | 
|  | If MMX mnemonics are being recognized, issuing a '''.586'''(or later) processor selection directive does not cause recognition of MMX mnemonics to be disabled. If this behavior is desired, use the '''.NOMMX'''directive.
 |  | 
|  |   |  | 
|  | The '''.MMX'''directive is not available in [[00105.htm|M510]]mode or [[00105.htm|M600]]mode. <br />
 |  | 
|  |   |  | 
|  | [[[00761.htm|prev]]][[[00763.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .NOMMX (Deselect MMX Processor Instruction Set Extensions) ===
 |  | 
|  |   |  | 
|  | Disables recognition of mnenomics for the MMX instruction set extensions.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. NOMMX </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Does not affect recognition of instruction mnemonics for the currently selected primary processor; it only disables recognition of the MMX mnemonics.
 |  | 
|  |   |  | 
|  | The '''.NOMMX'''directive is not available in [[00105.htm|M510]]mode or [[00105.htm|M600]]mode.
 |  | 
|  |   |  | 
|  | '''Example'''<br />
 |  | 
|  |   |  | 
|  | <pre>;   Top   of   file   -   no   processor   currently   selected 
 |  | 
|  | . MMX            ;   enables   both   MMX   and   586   mnemonics 
 |  | 
|  | . NOMMX          ;   586   mnemonics   still   enabled 
 |  | 
|  | . 686            ;   686   mnemonics   now   being   recognized 
 |  | 
|  | . MMX            ;   686   and   MMX   mnemonics   now   being   recognized 
 |  | 
|  | . NOMMX          ;   686   mnemonics   still   enabled </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00762.htm|prev]]][[[00764.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Segments ===
 |  | 
|  |   |  | 
|  | A segment is a collection of instructions or data whose addresses are all relative to the same segment register. The code in your assembler language program defines and organizes segments.
 |  | 
|  |   |  | 
|  | You can define segments by using segment directives or full segment definitions.
 |  | 
|  |   |  | 
|  | This section describes the following directives used to create and manage segments:
 |  | 
|  |   |  | 
|  | ALIGN <br />.CODE <br />.CONST <br />.DATA <br />.DATA? <br />DOSSEG <br />.DOSSEG <br />ENDS <br />EVEN <br />.FARDATA <br />.FARDATA? <br />GROUP <br />.MODEL <br />ORG <br />SEGMENT <br />.SEQ <br />.STACK <br />
 |  | 
|  |   |  | 
|  | [[[00763.htm|prev]]][[[00765.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ALIGN (Align Code or Data Item) ===
 |  | 
|  |   |  | 
|  | Advances the current location counter to the next byte boundary that is a multiple of [[00255.htm|''Expression'']].
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>ALIGN   Expression </pre>
 |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | To align to a 2-byte boundary: <br />
 |  | 
|  |   |  | 
|  | <pre>ALIGN   2 </pre>
 |  | 
|  | To align to a 4-byte boundary: <br />
 |  | 
|  |   |  | 
|  | <pre>ALIGN   4 </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00764.htm|prev]]][[[00766.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .CODE (Opens Default or Named Code Segment) ===
 |  | 
|  |   |  | 
|  | Closes the currently opened segment (if any) and opens the default code segment or a segment with the name given by an optional ''SegmentName'' parameter. The '''.CODE'''directive may only be used if previous [[00775.htm|.MODEL]] directive has been processed.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. CODE   [ SegmentName ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | When the ''SegmentName''parameter is omitted from the '''.CODE'''directive, the assembler generates a default code segment whose name is determined by the memory model as follows:
 |  | 
|  |   |  | 
|  | '''Memory Model''''''Value for @code''' <br />TINY _TEXT <br />SMALL _TEXT <br />MEDIUM ''module''_TEXT <br />COMPACT_TEXT <br />LARGE ''module''_TEXT <br />HUGE ''module''_TEXT <br />FLAT CODE32
 |  | 
|  |   |  | 
|  | The ''module''entry is replaced with base file name of the top-level module being assembled.
 |  | 
|  |   |  | 
|  | When operating in [[00105.htm|M510]]mode, the ''SegmentName''parameter may only be specified for those memory models that allow multiple code segments (MEDIUM , LARGE, and HUGE), and the value of the [[00177.htm|@code]]symbol is not altered from the default. For other modes of operation, the ''SegmentName''parameter is allowed for any model other than TINY, and the [[00177.htm|@code]]symbol is updated to reflect the ''SegmentName''value. <br />
 |  | 
|  |   |  | 
|  | [[[00765.htm|prev]]][[[00767.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .CONST (Opens Default Constant Data Segment) ===
 |  | 
|  |   |  | 
|  | When used with '''.MODEL''', starts a constant data segment for initialized read- only data.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. CONST </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The name of the segment is CONST32 in flat model, and CONST for all other models. <br />
 |  | 
|  |   |  | 
|  | [[[00766.htm|prev]]][[[00768.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .DATA (Opens Default Data Segment) ===
 |  | 
|  |   |  | 
|  | When used with '''.MODEL''', starts a near data segment for initialized data.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. DATA </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The name of the segment is DATA32 in flat model, and _DATA for all other models. <br />
 |  | 
|  |   |  | 
|  | [[[00767.htm|prev]]][[[00769.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .DATA? (Opens Default Uninitialized Data Segment) ===
 |  | 
|  |   |  | 
|  | When used with '''.MODEL''', starts a near data segment for uninitialized data.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. DATA ? </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The name of the segment is BSS32 in flat model, and _BSS for all other models. <br />
 |  | 
|  |   |  | 
|  | [[[00768.htm|prev]]][[[00770.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .DOSSEG/DOSSEG (Specify Standard DOS Segment Ordering) ===
 |  | 
|  |   |  | 
|  | Orders the segments according to the DOS segment convention: CODE first, then segments not in DGROUP, and then segments in DGROUP. The segments in DGROUP follow this order:
 |  | 
|  |   |  | 
|  | 1.Segments not in BSS or STACK <br /> 2.BSS segments <br /> 3.STACK segments <br />
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. DOSSEG   ( preferred   form ) 
 |  | 
|  |     or 
 |  | 
|  | DOSSEG </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | '''.DOSSEG'''is the preferred form.
 |  | 
|  |   |  | 
|  | Use of this directive allows the linker to control the segment ordering according to conventions used in many high-level languages. <br />
 |  | 
|  |   |  | 
|  | [[[00769.htm|prev]]][[[00771.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ENDS (Close a Segment, Structure, or Union Declaration) ===
 |  | 
|  |   |  | 
|  | Closes a program segment opened with '''SEGMENT'''directive, or ends a structure or union definition opened with the '''STRUCT'''or '''UNION'''directives. Every '''SEGMENT''', '''STRUCT''', and '''UNION'''directive must end with a corresponding '''ENDS''' directive.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Segment - Name   ENDS 
 |  | 
|  |     or 
 |  | 
|  | Structure - Name   ENDS 
 |  | 
|  |     or 
 |  | 
|  | Union - Name   ENDS </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If the '''ENDS'''directive is not used with the corresponding '''SEGMENT''', '''STRUCT''', or '''UNION'''directive, an error occurs. An unmatched '''ENDS'''also causes an error.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Note:'''See the [[00777.htm|SEGMENT]], [[00782.htm|STRUCT]], and [[00784.htm|UNION]]directives for more details and examples of the use of '''ENDS'''.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CONST      SEGMENT      word   public   ' CONST ' 
 |  | 
|  | SEG1       DW           ARRAY _ DATA 
 |  | 
|  | SEG2       DW           MESSAGE _ DATA 
 |  | 
|  | CONST      ENDS </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00770.htm|prev]]][[[00772.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === EVEN (Align Code or Data Item on an Even Boundary) ===
 |  | 
|  |   |  | 
|  | The '''EVEN'''directive causes the program counter to go to an even boundary (an address that begins a word). This ensures that the code or data that follows is aligned on an even boundary.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>EVEN </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If the program counter is not already at an even boundary, '''EVEN'''causes the assembler to add a '''NOP'''(no operation) instruction so that the counter reaches an even boundary. An error message occurs if '''EVEN'''is used with a byte-aligned segment. If the program counter is already at an even boundary, '''EVEN'''does nothing.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | Before: PC points to 0019 hex (25 decimal).
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>EVEN </pre>
 |  | 
|  | After: PC points to 001A hex (26 decimal). <br />
 |  | 
|  |   |  | 
|  | [[[00771.htm|prev]]][[[00773.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .FARDATA (Opens Default or Named Far Data Segment) ===
 |  | 
|  |   |  | 
|  | When used with '''.MODEL''', starts a far data segment for initialized data.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. FARDATA   [ SegmentName ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If the ''SegmentName''parameter is not specified, the assembler sets it to FAR _DATA. <br />
 |  | 
|  |   |  | 
|  | [[[00772.htm|prev]]][[[00774.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .FARDATA? (Opens Default or Named Uninitialized Far Data Segment) ===
 |  | 
|  |   |  | 
|  | When used with '''.MODEL''', starts a far data segment for uninitialized data.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. FARDATA ?   [ SegmentName ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If the ''SegmentName''parameter is not specified, the assembler sets it to FAR _BSS. <br />
 |  | 
|  |   |  | 
|  | [[[00773.htm|prev]]][[[00775.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === GROUP (Treat Multiple Segments as a Single Unit) ===
 |  | 
|  |   |  | 
|  | The '''GROUP'''directive associates a group ''Name''with one or more segments, and causes all labels and variables defined in the given segments to have addresses relative to the beginning of the group, rather than to the segments where they are defined.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   GROUP   Segment - Name   [ , . . . ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | Each ''Segment-Name''entry must be a unique segment name assigned by the [[00777.htm|SEGMENT]]directive. A ''Segment-Name''entry may be a forward reference to a subsequently declared segment name.
 |  | 
|  |   |  | 
|  | An additional occurrence of a given group ''Name''in a subsequent '''GROUP''' directive does not constitute a redefinition, but instead the effect is cumulative. The group ''Name''itself is declared the first time it appears in a '''GROUP'''directive, but the group definition is not complete until the end of the source module is reached. The final group definition is the cumulative list of all unique segments named in all occurrences of a '''GROUP''' directive for that group ''Name''.
 |  | 
|  |   |  | 
|  | Segments in a group need not be contiguous. Segments that do not belong to the group can be loaded between segments that do belong to the group. The only restriction is that for USE16 segments the distance (in bytes) between the first byte in the first segment of the group and the last byte in the last segment must not exceed 65535 bytes.
 |  | 
|  |   |  | 
|  | Group names can be used with the [[00788.htm|ASSUME]]directive and as an operand prefix with the segment override operation (:).
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | The following example shows how to use the '''GROUP'''directive to combine segments:
 |  | 
|  |   |  | 
|  | '''In Module A:'''<br />
 |  | 
|  |   |  | 
|  | <pre>CGROUP     GROUP      XXX , YYY 
 |  | 
|  | XXX        SEGMENT 
 |  | 
|  |           ASSUME     CS : CGROUP 
 |  | 
|  |           . 
 |  | 
|  |           . 
 |  | 
|  |           . 
 |  | 
|  | XXX        ENDS 
 |  | 
|  | YYY        SEGMENT 
 |  | 
|  |           ASSUME     CS : CGROUP 
 |  | 
|  |           . 
 |  | 
|  |           . 
 |  | 
|  |           . 
 |  | 
|  | YYY        ENDS </pre>
 |  | 
|  | '''In Module B:'''<br />
 |  | 
|  |   |  | 
|  | <pre>CGROUP     GROUP      ZZZ 
 |  | 
|  | ZZZ        SEGMENT 
 |  | 
|  |           ASSUME     CS : CGROUP 
 |  | 
|  |           . 
 |  | 
|  |           . 
 |  | 
|  |           . 
 |  | 
|  | ZZZ        ENDS </pre>
 |  | 
|  | The next example shows how to set '''DS'''with the paragraph number of the group called '''DGROUP'''.
 |  | 
|  |   |  | 
|  | '''As immediate:'''<br />
 |  | 
|  |   |  | 
|  | <pre>MOV        AX , DGROUP 
 |  | 
|  | MOV        DS , AX </pre>
 |  | 
|  | '''In assume:'''<br />
 |  | 
|  |   |  | 
|  | <pre>ASSUME      DS : DGROUP </pre>
 |  | 
|  | '''As an operand prefix:'''<br />
 |  | 
|  |   |  | 
|  | <pre>MOV      BX , OFFSET   DGROUP : FOO 
 |  | 
|  | DW       FOO 
 |  | 
|  | DW       DGROUP : FOO </pre>
 |  | 
|  | '''Note:'''
 |  | 
|  |   |  | 
|  | 1.'''DW FOO'''returns the offset of the symbol within its segment.
 |  | 
|  |   |  | 
|  | 2.'''DW DGROUP:FOO'''returns the offset of the symbol within the group.
 |  | 
|  |   |  | 
|  | The next example shows how you can use the '''GROUP'''directive to create a '''.COM''' file type. <br />
 |  | 
|  |   |  | 
|  | <pre>PAGE      , 132 
 |  | 
|  | TITLE     GRPCOM   -   Use   GROUP   to   create   a   DOS   . COM   file 
 |  | 
|  | ; Use   the   DOS   EXE2BIN   utility   to   convert   GRPCOM . EXE   to   GRPCOM . COM . 
 |  | 
|  |   |  | 
|  | CG        GROUP      CSEG , DSEG      ; ALL   SEGS   IN   ONE   GROUP 
 |  | 
|  | DISPLAY   MACRO      TEXT 
 |  | 
|  | LOCAL     MSG 
 |  | 
|  | DSEG      SEGMENT    BYTE   PUBLIC   ' DATA ' 
 |  | 
|  | MSG       DB         TEXT , 13 , 10 , " $ " 
 |  | 
|  | DSEG      ENDS 
 |  | 
|  | ; ; Macro   produces   partly   in   DSEG , 
 |  | 
|  | ; ; partly   in   CSEG 
 |  | 
|  |          MOV        AH , 9 
 |  | 
|  |          MOV        DX , OFFSET   CG :   MSG 
 |  | 
|  | ; ; Note   use   of   group   name 
 |  | 
|  | ; ; in   producing   offset 
 |  | 
|  |          INT   21H 
 |  | 
|  |          ENDM 
 |  | 
|  | DSEG      SEGMENT    BYTE   PUBLIC   ' DATA ' 
 |  | 
|  | ; Insert   local   constants   and   work   areas   here 
 |  | 
|  | DSEG      ENDS 
 |  | 
|  | CSEG      SEGMENT   BYTE   PUBLIC   ' CODE ' 
 |  | 
|  |    ASSUME    CS : CG , DS : CG , SS : CG , ES : CG   ; SET   BY   LOADER 
 |  | 
|  |          ORG   100H   ; Skip   to   end   of   the   PSP 
 |  | 
|  | ENTPT     PROC       NEAR   ; COM   file   entry   at   0100H 
 |  | 
|  |       DISPLAY   " USING   MORE   THAN   ONE   SEGMENT " 
 |  | 
|  |       DISPLAY   " YET   STILL   OBEYING   . COM   RULES " 
 |  | 
|  |          RET        ; Near   return   to   DOS 
 |  | 
|  | ENTPT     ENDP 
 |  | 
|  | CSEG      ENDS 
 |  | 
|  |          END        ENTPT </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00774.htm|prev]]][[[00776.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .MODEL (Define Program Memory Segmentation Model) ===
 |  | 
|  |   |  | 
|  | The '''''.MODEL''directive establishes a predefined set of definitions, conventions, and modifications to various default operating behaviors of the assembler. These adjustments are designed to simply certain programming tasks and to allow a more seamless integration with routines written in high level languages.'''
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. MODEL   Memory - Model [ , Language - Type ] [ , OS - Type ] [ , Stack - Distance ] </pre>
 |  | 
|  | '''''Memory-Model:'' <br />'''TINY''' <br />'''SMALL''' <br />'''COMPACT''' <br />'''MEDIUM''' <br />'''LARGE''' <br />'''HUGE''' <br />'''FLAT''' <br />'''
 |  | 
|  |   |  | 
|  | '''''Language-Type:'' <br />'''BASIC''' <br />'''C''' <br />'''FORTRAN''' <br />'''OPTLINK''' <br />'''PASCAL''' <br />'''STDCALL''' <br />'''SYSCALL''' <br />'''
 |  | 
|  |   |  | 
|  | '''''OS-Type:'' <br />'''OS_DOS''' <br />'''OS_OS2''' <br />'''
 |  | 
|  |   |  | 
|  | '''''Stack-Distance:'' <br />'''FARSTACK''' <br />'''NEARSTACK''' <br />'''
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''''.MODEL''directive should be placed at the top of the file, after any [[00745.htm|processor control]]directives, but before any of the following simplified segmentation directives are encountered:'''
 |  | 
|  |   |  | 
|  | �[[00765.htm|.CODE]] <br />�[[00766.htm|.CONST]] <br />�[[00767.htm|.DATA]] <br />�[[00768.htm|.DATA?]] <br />�[[00772.htm|.FARDATA]] <br />�[[00773.htm|.FARDATA?]] <br />�[[00779.htm|.STACK]]
 |  | 
|  |   |  | 
|  | Each of these directives close any segment that is currently opened, then open a different segment whose name and attributes are determined by the ''Memory-Model''argument.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Memory-Model'''
 |  | 
|  |   |  | 
|  | The fundamental purpose of establishing a programming memory model is to define how the program will be organized within the constraints of the segmented processor architecture. It defines whether there are single or multiple default code and data segments, or whether the default code and data segments are merged into a single segment. The operating system upon which the program will run is a determining factor of which memory models can be used. The following table describes these relationships. <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------\
 |  | 
|  | |Memory  |Default |Default |Merged? |Operating Systems       |
 |  | 
|  | |Model   |Code    |Data    |        |                        |
 |  | 
|  | |--------+--------+--------+--------+------------------------|
 |  | 
|  | |Tiny    |Near    |Near    |Yes     |DOS                     |
 |  | 
|  | |--------+--------+--------+--------+------------------------|
 |  | 
|  | |Small   |Near    |Near    |No      |DOS, 16-Bit OS/2, Win16 |
 |  | 
|  | |--------+--------+--------+--------+------------------------|
 |  | 
|  | |Medium  |Far     |Near    |No      |DOS, 16-Bit OS/2, Win16 |
 |  | 
|  | |--------+--------+--------+--------+------------------------|
 |  | 
|  | |Compact |Near    |Far     |No      |DOS, 16-Bit OS/2, Win16 |
 |  | 
|  | |--------+--------+--------+--------+------------------------|
 |  | 
|  | |Large   |Far     |Far     |No      |DOS, 16-Bit OS/2, Win16 |
 |  | 
|  | |--------+--------+--------+--------+------------------------|
 |  | 
|  | |Huge    |Far     |Far     |No      |DOS, 16-Bit OS/2, Win16 |
 |  | 
|  | |--------+--------+--------+--------+------------------------|
 |  | 
|  | |Flat    |Near    |Near    |Yes     |32-Bit OS/2, Win32      |
 |  | 
|  | \------------------------------------------------------------/</pre>
 |  | 
|  | The assembler creates the default code and data segments, then automatically generates an [[00788.htm|ASSUME]]CS:[[00178.htm|@code]]and an [[00788.htm|ASSUME]]DS:[[00181.htm|@data]]statement to refer to them.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Language-Type'''
 |  | 
|  |   |  | 
|  | Specifies the default naming convention for all public identifiers written that to the object file, and the method whereby parameters are passed to procedures (the '''''calling convention''). See the section on the [[00740.htm|PROC]]directive for a detailed explanation of the effects of the ''Language-Type''setting.'''
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''OS-Type'''
 |  | 
|  |   |  | 
|  | This parameter identifies the target operating system upon which the program will run, and is provided for compatibility with other assemblers. ALP ignores this parameter.
 |  | 
|  |   |  | 
|  |   |  | 
|  |   |  | 
|  | '''Stack-Distance'''
 |  | 
|  |   |  | 
|  | The '''NEARSTACK'''parameter causes the assembler to assume that the stack segment and the default data segment are the same, and that the DS register is equal to the SS register. This is the default setting. The assembler performs an automatic [[00788.htm|ASSUME]]SS:[[00181.htm|@data]]statement when a near stack is used.
 |  | 
|  |   |  | 
|  | The '''FARSTACK'''parameter causes the assembler to assume that the stack is in a different physical segment from that of the default data, and that SS register is not equal to DS. This is typically the case for code in a 16- bit dynamic link library that must use the caller's stack. The assembler performs an automatic [[00788.htm|ASSUME]]SS:STACK when this keyword is used. <br />
 |  | 
|  |   |  | 
|  | [[[00775.htm|prev]]][[[00777.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ORG (Adjust Segment Location Counter) ===
 |  | 
|  |   |  | 
|  | The '''ORG'''directive sets the location counter to the value of [[00255.htm|''Expression'']]. Subsequent instructions are generated beginning at this new location.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>ORG   Expression </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The assembler must know all names used in [[00255.htm|''Expression'']]on pass 1, and the value must be either absolute or in the same segment as the location counter.
 |  | 
|  |   |  | 
|  | The numeric value of [[00255.htm|''Expression'']]must not be a quantity larger than that which is representable by an unsigned integer having the same word size as the current segment.
 |  | 
|  |   |  | 
|  | You can use the current address operator ($) to refer to the current value of the location counter.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>ORG      120H 
 |  | 
|  | ORG      $ + 2       ; SKIP   NEXT   2   BYTES </pre>
 |  | 
|  | To conditionally skip to the next 256-byte boundary: <br />
 |  | 
|  |   |  | 
|  | <pre>CSEG      SEGMENT      PAGE 
 |  | 
|  | BEGIN     =            $ 
 |  | 
|  |          . 
 |  | 
|  |          . 
 |  | 
|  |          . 
 |  | 
|  |          IF   ( $ - BEGIN )   MOD   256 
 |  | 
|  | ; IF   NOT   ALREADY   ON   256   BYTE   BOUNDARY 
 |  | 
|  |          ORG   ( $ - BEGIN ) + 256 - ( ( $ - BEGIN )   MOD   256 ) 
 |  | 
|  |          ENDIF </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00776.htm|prev]]][[[00778.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === SEGMENT (Open a Program Information Segment) ===
 |  | 
|  |   |  | 
|  | Defines or reopens a segment called ''Segment-Name''which will contain all subsequently emitted code or data.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Segment - Name   SEGMENT   [ align ] [ combine ] [ use ] [ ' class ' ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | A segment definition may be followed by zero or more segment attributes, at most one from each of the following selections:
 |  | 
|  |   |  | 
|  | '''''align''Instructs the linker to align the segment at the next ''align''boundary. One of:'''
 |  | 
|  |   |  | 
|  | '''BYTE'''The next 8-bit boundary. <br />'''DWORD'''The next 32-bit boundary. <br />'''PAGE'''The next 256-byte boundary (4096 under 32-bit OS/2). <br />'''PARA'''The next 16-byte boundary (default). <br />'''WORD'''The next 16-bit boundary.
 |  | 
|  |   |  | 
|  | '''''combine''Controls how the linker will combine this segment with identically- named segments from other modules. One of:'''
 |  | 
|  |   |  | 
|  | '''AT'''''address''Locates the segment at the absolute paragraph given by ''address''. <br />'''COMMON'''Unioned with segments from other modules. <br />'''PRIVATE'''Will not be combined with other segments (default). <br />'''PUBLIC'''Concatenated to segments from other modules. <br />'''STACK'''Concatenated to segments from other modules. At load time: <br /> <br />SS=beginning of segment <br />SS:(E)SP=end of segment
 |  | 
|  |   |  | 
|  | '''''use''Word size of the segment.'''
 |  | 
|  |   |  | 
|  | '''USE16'''The segment will have a 16-bit word size. <br />'''USE32'''The segment will have a 32-bit word size.
 |  | 
|  |   |  | 
|  | '''class'''Instructs the linker to order segments according to the class name given by '''class'''. Segments will not be combined if their class names differ. <br />
 |  | 
|  |   |  | 
|  | [[[00777.htm|prev]]][[[00779.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .SEQ (Specifies Sequential Segment Ordering) ===
 |  | 
|  |   |  | 
|  | Orders segments sequentially (the default order).
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. SEQ </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00778.htm|prev]]][[[00780.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .STACK (Defines Default Stack Segment With Optional Size) ===
 |  | 
|  |   |  | 
|  | When used with '''.MODEL''', defines a stack segment with the segment name STACK. The optional ''Size''specifies the number of bytes for the stack (default 1024 ).
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. STACK   [ Size ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.STACK'''directive does not leave the stack segment open when the statement is completed, since it is not a common practice to emit initialized data into the stack segment.
 |  | 
|  |   |  | 
|  | The name of the segment is STACK32 in flat model, and STACK for all other models. <br />
 |  | 
|  |   |  | 
|  | [[[00779.htm|prev]]][[[00781.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Type Definition ===
 |  | 
|  |   |  | 
|  | Type definition directives allow the creation of user-defined data types.
 |  | 
|  |   |  | 
|  | This section describes the following type definition directives:
 |  | 
|  |   |  | 
|  | RECORD <br />STRUCT/STRUC <br />TYPEDEF <br />UNION <br />
 |  | 
|  |   |  | 
|  | [[[00780.htm|prev]]][[[00782.htm|next]]][[[00780.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === RECORD (Define a Record Type Name) ===
 |  | 
|  |   |  | 
|  | A record is a bit pattern you define to format bytes, words, or dwords for bit-packing. The ''RecordName''becomes a [[00172.htm|''Record-TypeName'']]that can be used create record variables.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>RecordName   RECORD   FieldDeclaration   [ ,   [ LineBreak ]   FieldDeclaration   . . . ] </pre>
 |  | 
|  | Where ''FieldDeclaration''has the following form: <br />
 |  | 
|  |   |  | 
|  | <pre>FieldName : Width [   =   InitialValue ] </pre>
 |  | 
|  | The optional ''LineBreak''entry allows you to end a ''FieldDeclaration''with a comma, enter an optional [[00657.htm|''EndOfLine-Comment'']]followed by a physical ''NewLine'' character, then continue the record definition on the next line.
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The ''RecordName''and ''FieldName''entries are unique globally-scoped [[00149.htm|''Identifier'']]''s'' that must be specified. Upon successful processing of the '''RECORD''' definition, the ''RecordName''entry is converted to a [[00172.htm|''Record-TypeName'']], and all ''FieldNames''are converted to [[00159.htm|''Record-FieldName'']]''s''.
 |  | 
|  |   |  | 
|  | Each ''Width''entry in a ''FieldDeclaration''is specified as an [[00255.htm|''Expression'']]which must evaluate to an [[00599.htm|''Absolute-ExpressionType'']]. The cumulative value of all ''Width''entries becomes the total '''''RecordWidth''and must not exceed 32, the size of a DWORD, the maximum size for a [[00172.htm|''Record-TypeName'']]. The [[00587.htm|''Operand Size'']] of the record becomes 1 (BYTE) if the ''RecordWidth''is from 1 through 8, 2 ( WORD) if the ''RecordWidth''is from 9 through 16, and 4 (DWORD) if the ''RecordWidth''is from 17 through 32. Any other value causes an error. If the total number of bits in the ''RecordWidth''is not evenly divisible by the [[00587.htm|''Operand Size'']], the assembler right-justifies the fields into the least- significant bit positions of the record.'''
 |  | 
|  |   |  | 
|  | When a [[00159.htm|''Record-FieldName'']]is referenced in an expression, the value returned is the shift value required to access the field. The [[00563.htm|WIDTH]]operator is used on the [[00159.htm|''Record-FieldName'']]to return the width of the field in bits, and the [[00548.htm|MASK]]operator is used to obtain the value necessary for isolating the field within the record.
 |  | 
|  |   |  | 
|  | The ''InitialValue''entry contains the default value to used for the field when a record variable is allocated. If the field is at least 7 bits wide, you can initialize it to an ASCII character (for example, FIELD:7='Z').
 |  | 
|  |   |  | 
|  | To initialize a record, use the form: <br />
 |  | 
|  |   |  | 
|  | <pre>[ Identifier ]   Record - TypeName   Expression   [ ,   Expression   . . . ] </pre>
 |  | 
|  | The [[00149.htm|''Identifier'']]entry is an optional name for the first byte, word, or dword of the reserved memory. The [[00172.htm|''Record-TypeName'']]defines the format and default field values, and is the ''RecordName''you assigned to the record in the '''RECORD'''directive.
 |  | 
|  |   |  | 
|  | At least one [[00255.htm|''Expression'']]entry must be specified; additional entries are optional. The [[00255.htm|''Expression'']]must resolve to a [[00609.htm|''Compound-ExpressionType'']], which may also be be duplicated by specifying it as a sub-expression of a [[00610.htm|''Duplicated-ExpressionType'']]. Each [[00609.htm|''Compound-ExpressionType'']]represents a single allocated record entry; each explicit sub-expression of the [[00609.htm|''Compound -ExpressionType'']]represents a field value which overrides the default ''InitialValue''for the field given in the record definition.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | Define the record fields; begin with the most significant fields first: <br />
 |  | 
|  |   |  | 
|  | <pre>MODULE   RECORD   R : 7 ,       ;   First   field .    " ,   LineBreak "   syntax 
 |  | 
|  |                 E : 4 ,       ;   may   be   used   to   split   RECORD 
 |  | 
|  |                 D : 5        ;   definition   across   multiple   lines </pre>
 |  | 
|  | Fields are 7 bits, 4 bits, and 5 bits; the assembler gives no default value . Most significant byte first, this looks like: <br />
 |  | 
|  |   |  | 
|  | <pre>RRRR   RRRE   EEED   DDDD </pre>
 |  | 
|  | To reserve its memory: <br />
 |  | 
|  |   |  | 
|  | <pre>STG _ FLD     MODULE      < 7 , , 2 >     ;   Initializer   is   a   Compound - ExpressionType </pre>
 |  | 
|  | This defines R=7 and D=2 and leaves E unknown; it produces 2 bytes, the least significant byte first: <br />
 |  | 
|  |   |  | 
|  | <pre>02   0E </pre>
 |  | 
|  | Define the record fields: <br />
 |  | 
|  |   |  | 
|  | <pre>AREA     RECORD     FLA : 8 = ' A ' , FLB : 8 = ' B ' </pre>
 |  | 
|  | To reserve its memory: <br />
 |  | 
|  |   |  | 
|  | <pre>CHAR _ FLD     AREA   < , ' P ' > </pre>
 |  | 
|  | This defines FLA='A' (the default) and changes FLB='P'.
 |  | 
|  |   |  | 
|  | To use a field in the record: <br />
 |  | 
|  |   |  | 
|  | <pre>DEFFIELD     RECORD     X : 3 , Y : 4 , Z : 9 
 |  | 
|  |              . 
 |  | 
|  |              . 
 |  | 
|  |              . 
 |  | 
|  | TABLE        DEFFIELD   10   DUP ( < 0 , 2 , 255 > ) 
 |  | 
|  |              . 
 |  | 
|  |              . 
 |  | 
|  |              . 
 |  | 
|  |              MOV   DX , TABLE [ 2 ] 
 |  | 
|  | ;   Move   data   from   record   to   register 
 |  | 
|  | ;   other   than   segment   register 
 |  | 
|  |              AND   DX , MASK   Y 
 |  | 
|  | ;   Mask   out   fields   X   and   Y 
 |  | 
|  | ;   to   remove   unwanted   fields 
 |  | 
|  | ;   The   MASK   of   Y   equals   1E00H 
 |  | 
|  | ;   00011111000000000B   ( 1E00H )   Is   the   value 
 |  | 
|  |               MOV   CL , Y         ;   Get   shift   count 
 |  | 
|  |                               ;     9   is   the   value 
 |  | 
|  |               SHR   DX , CL        ;   Field   to   low - order 
 |  | 
|  |                               ;     bits   of   register ,   DX   is   now 
 |  | 
|  |                               ;     equal   to   the   value   of   field   Y 
 |  | 
|  |               MOV   CL , WIDTH   Y   ;   Get   number   of   bits 
 |  | 
|  |                               ;     in   field   -   4   is   the   value , 
 |  | 
|  |                               ;     the   WIDTH   of   Y   is   4 </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00781.htm|prev]]][[[00783.htm|next]]][[[00780.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === STRUCT/STRUC (Define a Structure Type Name) ===
 |  | 
|  |   |  | 
|  | Defines a [[00173.htm|''Structure-TypeName'']]that represents an [[00711.htm|aggregate]]data type containing one or more fields.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Structure - Name   STRUCT 
 |  | 
|  |    FieldDeclaration 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | Structure - Name   ENDS </pre>
 |  | 
|  | Where ''FieldDeclaration''has the following form: <br />
 |  | 
|  |   |  | 
|  | <pre>[ FieldName ]   Allocation - TypeName   InitialValue   [ ,   InitialValue   . . . ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The obsolete spelling for the '''STRUCT'''directive is '''STRUC'''.
 |  | 
|  |   |  | 
|  | The syntax for the ''FieldDeclaration''is that of a normal data allocation statement. See the section on [[00709.htm|Data Allocation]]for a full description of this syntax.
 |  | 
|  |   |  | 
|  | The various parts of the ''FieldDeclaration''are described as follows:
 |  | 
|  |   |  | 
|  | '''''FieldName''Each ''FieldName''entry is converted to [[00160.htm|''Structure-FieldName'']]when processing of the structure definition is complete. If this field is omitted and the '''''Allocation-TypeName''resolves to a [[00173.htm|''Structure-TypeName'']]or [[00175.htm|''Union-TypeName'']], then all of the fields defined within the imbedded structure or union are '''''promoted''to be visible at the same level as other ''FieldName''entries in the current structure given by the ''Structure-Name''.'''''''''
 |  | 
|  |   |  | 
|  | [[00709.htm|''Allocation-TypeName'']]The allowable values for this field are described in detail in the [[00709.htm|Data Allocation]]section. In modes other than [[00105.htm|M510]], the assembler accepts imbedded occurrences of other structures or unions by specifying an identifier that resolves to a [[00173.htm|''Structure-TypeName'']]or [[00175.htm|''Union- TypeName'']]in this field.
 |  | 
|  |   |  | 
|  | '''''InitialValue''The ''InitialValue''field must be an [[00255.htm|''Expression'']]that resolves to an [[00596.htm|''ExpressionType'']]appropriate for the [[00709.htm|''Allocation-TypeName'']]utilized in the ''FieldDeclaration''. The ''InitialValue''expressions become part of the structure type definition. These values are used as default initializers when an instance of the structure is allocated and no explict override values are specified for a particular field.'''
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | Define a [[00173.htm|''Structure-TypeName'']]called '''Numbers''': <br />
 |  | 
|  |   |  | 
|  | <pre>   Numbers     STRUCT 
 |  | 
|  |      One         DB       0 
 |  | 
|  |      Two         WORD     0 
 |  | 
|  |                 BYTE     3 
 |  | 
|  |      Four        DWORD    ? 
 |  | 
|  |    Numbers     ENDS </pre>
 |  | 
|  | Allocate a structure variable called '''Values'''using the '''Numbers'''[[00173.htm|''Structure- TypeName'']], overriding the '''One, Two,'''and '''Four'''[[00160.htm|''Structure-FieldName'']]entries with explicit values, and the third (unnamed) entry is initialized with the default ''InitialValue''inherited from the ''FieldDeclaration'': <br />
 |  | 
|  |   |  | 
|  | <pre>   Values   Numbers   < 1 ,   2 ,   ,   4 > </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00782.htm|prev]]][[[00784.htm|next]]][[[00780.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === TYPEDEF (Create a User-Defined Type Name) ===
 |  | 
|  |   |  | 
|  | Defines a [[00174.htm|''Typedef-TypeName'']]that is an alias for another type declaration.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>TypeName   TYPEDEF   Type - Declaration </pre>
 |  | 
|  |   |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The ''TypeName''entry is a unique globally-scoped [[00149.htm|''Identifier'']]that must be specified. Upon successful processing of the '''TYPEDEF'''directive, the ''TypeName''entry is converted to a [[00174.htm|''Typedef-TypeName'']]which can then be used in expressions or as a directive in data allocation statements.
 |  | 
|  |   |  | 
|  | The '''TYPEDEF'''directive can be used to create a direct alias for another intrinsic type (a [[00125.htm|''Scalar-TypeName'']], [[00172.htm|''Record-TypeName'']], [[00173.htm|''Structure-TypeName'']], [[00175.htm|''Union-TypeName'']], or other [[00174.htm|''Typedef-TypeName'']]), a pointer to another type, or it can be used to create vector types (arrays).
 |  | 
|  |   |  | 
|  | '''Examples'''
 |  | 
|  |   |  | 
|  | The following are examples of '''TYPEDEF'''usage: <br />
 |  | 
|  |   |  | 
|  | <pre>CHAR        typedef   byte                    ;   CHAR   is   an   alias   for   intrinsic   type 
 |  | 
|  | PCHAR       typedef   ptr   CHAR                ;   PCHAR   is   a   pointer   to   CHAR 
 |  | 
|  |   |  | 
|  | BUFFER _ T    struct 
 |  | 
|  |    pLetter   PCHAR     ?                       ;   current   position   in   buffer 
 |  | 
|  |    Letters   CHAR      " ABCDEF " , 0              ;   array   of   characters 
 |  | 
|  | BUFFER _ T    ends 
 |  | 
|  |   |  | 
|  | BUFFER      typedef   BUFFER _ T                ;   alias   for   intrinsic   type 
 |  | 
|  | PBUFFER     typedef   ptr   BUFFER _ T           ;   pointer   to   the   BUFFER   type 
 |  | 
|  |   |  | 
|  | DATA        SEGMENT 
 |  | 
|  | HexChars    BUFFER    < >                      ;   allocate   structure   via   typedef 
 |  | 
|  | pHexChars   PBUFFER   offset   HexChars        ;   point   to   the   allocated   structure 
 |  | 
|  | DATA        ENDS </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00783.htm|prev]]][[[00785.htm|next]]][[[00780.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === UNION (Define a Union Type Name) ===
 |  | 
|  |   |  | 
|  | Defines a [[00175.htm|''Union-TypeName'']]that represents an [[00711.htm|aggregate]]data type containing one or more fields. All of the fields occupy the same physical position in storage.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Union - Name   UNION 
 |  | 
|  |    FieldDeclaration 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  |     . 
 |  | 
|  | Union - Name   ENDS </pre>
 |  | 
|  | Where ''FieldDeclaration''has the following form: <br />
 |  | 
|  |   |  | 
|  | <pre>[ FieldName ]   Allocation - TypeName   InitialValue   [ ,   InitialValue   . . . ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | This directive is not available in [[00105.htm|M510]]mode.
 |  | 
|  |   |  | 
|  | The syntax for the ''FieldDeclaration''is that of a normal data allocation statement. See the section on [[00709.htm|Data Allocation]]for a full description of this syntax.
 |  | 
|  |   |  | 
|  | The various parts of the ''FieldDeclaration''are described as follows:
 |  | 
|  |   |  | 
|  | '''''FieldName''Each ''FieldName''entry is converted to [[00161.htm|''Union-FieldName'']]when processing of the union definition is complete. If this field is omitted and the '''''Allocation-TypeName''resolves to a [[00173.htm|''Structure-TypeName'']]or [[00175.htm|''Union- TypeName'']], then all of the fields defined within the imbedded structure or union are '''''promoted''to be visible at the same level as other ''FieldName'' entries in the current union given by the ''Union-Name''.'''''''''
 |  | 
|  |   |  | 
|  | [[00709.htm|''Allocation-TypeName'']]The allowable values for this field are described in detail in the [[00709.htm|Data Allocation]]section. The assembler accepts imbedded occurrences of other structures or unions by specifying an identifier that resolves to a [[00173.htm|''Structure-TypeName'']]or [[00175.htm|''Union-TypeName'']]in this field.
 |  | 
|  |   |  | 
|  | '''''InitialValue''The ''InitialValue''field must be an [[00255.htm|''Expression'']]that resolves to an [[00596.htm|''ExpressionType'']]appropriate for the [[00709.htm|''Allocation-TypeName'']]utilized in the ''FieldDeclaration''. Only the ''InitialValue''expression for the first field becomes part of the union type definition; expressions specified for the remaining fields are ignored. This value is used as the default initializer when an instance of the union is allocated and no explict override value is specified for the field.'''
 |  | 
|  |   |  | 
|  | '''Example'''<br />
 |  | 
|  |   |  | 
|  | <pre>           . 386 
 |  | 
|  | IS _ sint32    equ   - 4 
 |  | 
|  | IS _ sint16    equ   - 2 
 |  | 
|  | IS _ sint8     equ   - 1 
 |  | 
|  | NO _ TYPE      equ    0 
 |  | 
|  | IS _ uint8     equ    1 
 |  | 
|  | IS _ uint16    equ    2 
 |  | 
|  | IS _ uint32    equ    4 
 |  | 
|  |   |  | 
|  | TYPE _ T       typedef   SBYTE 
 |  | 
|  |   |  | 
|  | DATA _ T       union 
 |  | 
|  |    uint8      BYTE     ? 
 |  | 
|  |    sint8      SBYTE    ? 
 |  | 
|  |    uint16     WORD     ? 
 |  | 
|  |    sint16     SWORD    ? 
 |  | 
|  |    uint32     DWORD    ? 
 |  | 
|  |    sint32     SDWORD   ? 
 |  | 
|  | DATA _ T       ends 
 |  | 
|  |   |  | 
|  | VALUE _ T      struct 
 |  | 
|  |    DataType    TYPE _ T   NO _ TYPE 
 |  | 
|  |    DataValue   DATA _ T   { } 
 |  | 
|  | VALUE _ T      ends 
 |  | 
|  |   |  | 
|  |              . data 
 |  | 
|  | Value        VALUE _ T   {   IS _ uint8 ,   {   1   }   }              ;   unsigned   8 - bit   value   of   1 
 |  | 
|  |   |  | 
|  |            . code 
 |  | 
|  |   |  | 
|  | ;   Procedure :    IsNegative 
 |  | 
|  | ;   Returns    :    1   in   EAX   if   Value . DataValue   holds   a   negative   number 
 |  | 
|  | ;                0   in   EAX   if   Value . DataValue   holds   a   positive   number 
 |  | 
|  |   |  | 
|  | IsNegative   proc 
 |  | 
|  |              cmp     Value . DataType ,   NO _ TYPE           ;   check   sign   of   TYPE _ T 
 |  | 
|  |              jns     short   Positive                     ;   if   positive ,   so   is   value 
 |  | 
|  |   |  | 
|  | ;   check   for   signed   8 - bit   integer 
 |  | 
|  |              cmp     Value . DataType ,   IS _ sint8 
 |  | 
|  |              jne     short   @ F                            ;   not   8 ,   check   for   16 
 |  | 
|  |              movsx   EAX ,   Value . DataValue . sint8        ;   convert   8   bits   to   32 
 |  | 
|  |              jmp     short   Check                         ;   and   check   the   value 
 |  | 
|  |   |  | 
|  | ;   check   for   signed   16 - bit   integer 
 |  | 
|  | @ @ :          cmp     Value . DataType ,   IS _ sint16 
 |  | 
|  |              jne     short   @ F                            ;   not   16 ,   check   for   32 
 |  | 
|  |              movsx   EAX ,   Value . DataValue . sint16       ;   convert   16   bits   to   32 
 |  | 
|  |              jmp     short   Check                         ;   and   check   the   value 
 |  | 
|  |   |  | 
|  | ;   check   for   signed   32 - bit   integer 
 |  | 
|  | @ @ :          cmp     Value . DataType ,   IS _ sint32 
 |  | 
|  |              jne     short   Positive                     ;   unknown ,   assume   positive 
 |  | 
|  |              mov     EAX ,   Value . DataValue . sint32       ;   get   full   32   bit   number 
 |  | 
|  |   |  | 
|  | Check :       or      EAX , EAX                             ;   check   for   negative   value 
 |  | 
|  |              jns     short   Positive                     ;   no   sign   bit ,   positive 
 |  | 
|  |              mov     EAX ,   1                              ;   indicate   negative 
 |  | 
|  |              ret                                        ;   and   return 
 |  | 
|  | Positive :    mov     EAX ,   0                              ;   indicate   positive 
 |  | 
|  |              ret                                        ;   and   return 
 |  | 
|  | IsNegative   endp 
 |  | 
|  | end </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00784.htm|prev]]][[[00786.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Miscellaneous ===
 |  | 
|  |   |  | 
|  | This section describes the following miscellaneous directives:
 |  | 
|  |   |  | 
|  | = <br />.ABORT <br />ASSUME <br />EQU <br />LABEL <br />OPTION <br />.RADIX <br />
 |  | 
|  |   |  | 
|  | [[[00785.htm|prev]]][[[00787.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === = (Assign an Expression to an Assembler Variable) ===
 |  | 
|  |   |  | 
|  | The = directive lets you create a symbolic assembler-time variable. Numeric expressions may be assigned to the variable as many times as necessary.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   =   Expression </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''='''directive is similar to the [[00791.htm|EQU]]assembler directive except you can redefine ''Name''without causing an error condition. However, the = directive is more restrictive about the allowable [[00596.htm|''ExpressionType'']]''s''that can be utilized in the [[00255.htm|''Expression'']]field, and it cannot be used to create [[00157.htm|''Text- EquateName'']]''s''.
 |  | 
|  |   |  | 
|  | ''Name''is a globally-scoped [[00149.htm|''Identifier'']]. The [[00255.htm|''Expression'']]entry must evaluate to an [[00611.htm|''Operand-ExpressionType'']]. If an evaluation error occurs, or if the [[00255.htm|''Expression'']]references an external identifier, or if the [[00255.htm|''Expression'']] evaluates to one of the following [[00611.htm|''Operand-ExpressionType'']]''s'''':''
 |  | 
|  |   |  | 
|  | �[[00604.htm|''Indexed-ExpressionType'']] <br />�[[00605.htm|''Register-ExpressionType'']] <br />�[[00607.htm|''Floating-Point-ExpressionType'']] <br />�[[00609.htm|''Compound-ExpressionType'']] <br />�[[00610.htm|''Duplicated-ExpressionType'']]
 |  | 
|  |   |  | 
|  | then an error message is issued and the assignment does not take place. Otherwise, the [[00149.htm|''Identifier'']]is converted to a [[00156.htm|''Numeric-EquateName'']].
 |  | 
|  |   |  | 
|  | See also the [[00791.htm|EQU]]assembler directive and the [[00683.htm|EQU]]preprocessor directive.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>EMP   =   6         ; Establish   as   redefineable   numeric   equate 
 |  | 
|  | EMP   EQU   6       ; OK ,   value   is   the   same ,   EMP   remains   redefinable 
 |  | 
|  | EMP   EQU   7       ; Error ,   can ' t   change   value   with   EQU 
 |  | 
|  | EMP   =   7         ; OK ,   EMP   is   redefineable   with   = 
 |  | 
|  | EMP   =   EMP + 1     ; Can   refer   to   its   previous   definition </pre>
 |  | 
|  |   |  | 
|  |   |  | 
|  | '''Note:'''The [[00585.htm|''Expression-Attribute'']]''s''inherited from the [[00255.htm|''Expression'']]during an assignment are not retained in subsequent assignments. For example: <br />
 |  | 
|  |   |  | 
|  | <pre>VECTOR   =   WORD   PTR   4            ;   Type - Declaration   attribute 
 |  | 
|  |         MOV   [ BX ] , VECTOR         ;   Store   the   4   as   a   word 
 |  | 
|  | VECTOR   =   6                      ;   Type - Declaration   attribute   discarded 
 |  | 
|  |         MOV   [ BX ] , VECTOR         ;   Error ,   no   size   for   operands </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00786.htm|prev]]][[[00788.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .ABORT (Terminate the Assembly) ===
 |  | 
|  |   |  | 
|  | Terminates the assembly at the point where the '''.ABORT'''directive is encountered. The remainder of the input stream is not read.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. ABORT </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''.ABORT'''directive is only available in [[00105.htm|ALP]]mode <br />
 |  | 
|  |   |  | 
|  | [[[00787.htm|prev]]][[[00789.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ASSUME (Inform Assembler of Register Contents) ===
 |  | 
|  |   |  | 
|  | The '''ASSUME'''directive establishes an assembly-time association between a machine register and a program object or data type. By informing the assembler of the type of information to which a register points, certain programming tasks can be simplified and the assembler can perform some operations automatically.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>ASSUME   Association   [ ,   Association   . . . ] </pre>
 |  | 
|  | '''''Association:'' <br />''Segment-Register-Assocation'' <br />''General-Purpose-Register-Assocation'' <br />'''NOTHING''' <br />'''
 |  | 
|  |   |  | 
|  | '''''Segment-Register-Association:'' <br />[[00122.htm|''Segment-Register'']]: [[00255.htm|''Expression'']] <br />[[00122.htm|''Segment-Register'']]: '''NOTHING''' <br />'''
 |  | 
|  |   |  | 
|  | '''''General-Purpose-Register-Association:'' <br />[[00122.htm|''General-Purpose-Register'']]: [[00250.htm|''Type-Declaration'']] <br />[[00122.htm|''General-Purpose-Register'']]: '''NOTHING''' <br />'''
 |  | 
|  |   |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If the '''NOTHING'''keyword is specified for the ''Association''field, all register associations are cancelled.
 |  | 
|  |   |  | 
|  | If the '''NOTHING'''keyword is specified for a particular ''Segment-Register''or ''General-Purpose-Register'', only the association for that register is cancelled.
 |  | 
|  |   |  | 
|  | The following sections describe the two types of register associations:
 |  | 
|  |   |  | 
|  | �[[00789.htm|''Segment-Register-Association'']]
 |  | 
|  |   |  | 
|  | �[[00790.htm|''General-Purpose-Register-Association'']] <br />
 |  | 
|  |   |  | 
|  | [[[00788.htm|prev]]][[[00790.htm|next]]][[[00788.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Segment Register Association ===
 |  | 
|  |   |  | 
|  | A '''''Segment-Register-Association''establishes an assembly-time association between a [[00122.htm|''Segment-Register'']]and an expression that resolves to a [[00162.htm|''GroupName'']] or [[00170.htm|''SegmentName'']]. It allows the programmer to describe for the assembler what values are held in the segment registers at program run-time.'''
 |  | 
|  |   |  | 
|  | When the user program executes, all instructions that access memory do so through a particular segment register. To generate the correct encoding for an instruction that accesses a memory location, the assembler must know which segment register will be used in the effective memory address. In general, accessing a memory location from within a user program is done by referencing a named variable defined within a particular named segment.
 |  | 
|  |   |  | 
|  | Before accessing a named program variable (in a named memory segment), it is the programmer's responsibility to insure that the desired segment register actually references the correct physical segment at program run- time. Unless the '''ASSUME'''directive is used to describe this association, the assembler has no way of knowing ''which''segment register (if any) is addressing a named segment when a reference to a named variable contained therein is encountered. In this situation, the programmer is forced to use the [[00467.htm|Segment Override (: Operator)]]in every instruction to "reach" the desired variable and cause the assembler to generate the proper instruction encoding. The association established by the '''ASSUME'''directive allows the assembler to take over the task of verifying memory references and generating the appropriate instructions.
 |  | 
|  |   |  | 
|  | If you temporarily use a segment register to contain a value other than the segment or group identified in the '''ASSUME'''association, then you should reflect the change with a new '''ASSUME'''statement, or cancel the association with an '''ASSUME xS:NOTHING'''construct.
 |  | 
|  |   |  | 
|  | When the contents of a segment register are used for addressability, the register value should never contradict the association established for that register.
 |  | 
|  |   |  | 
|  | When the [[00775.htm|Reference]]directive is utilized and the program is designed to follow the conventions that it establishes, the '''ASSUME'''directive is no longer needed in most cases.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Data    SEGMENT 
 |  | 
|  | Stuff   WORD   0 
 |  | 
|  | Data    ENDS 
 |  | 
|  |   |  | 
|  | Code    SEGMENT 
 |  | 
|  |        ASSUME   NOTHING         ;   Cancel   all   register   assumptions 
 |  | 
|  |        mov   ax , Data            ;   Load   general - purpose   register   with   segment   frame , 
 |  | 
|  |        mov   DS , ax               ;     then   establish   addressablity   through   DS 
 |  | 
|  |        mov   ES , ax               ;     and   ES .    The   assembler   doesn ' t   " know "   this   yet 
 |  | 
|  |        mov   Stuff ,   1           ;   Error ,   can ' t   reach   Stuff 
 |  | 
|  |        ASSUME   ES : Data         ;   Associate   ES   register   with   Data   segment 
 |  | 
|  |        add   Stuff ,   bx          ;   Now   we   can   reach   Stuff ,   but   the   assembler   needs 
 |  | 
|  |                               ;     to   generate   an   ES   override   instruction   byte 
 |  | 
|  |        ASSUME   DS : SEG   Stuff    ;   Expression   to   extract   the   segment   value   of   Stuff 
 |  | 
|  |                               ;     This   has   the   same   effect   as   ASSUME   DS : Data 
 |  | 
|  |                               ;     Now   both   DS   and   ES   are   associated   with   Data 
 |  | 
|  |        add   Stuff ,   cx          ;   This   time ,   the   instruction   doesn ' t   need   an 
 |  | 
|  |                               ;     override   byte   because   DS   is   the   default 
 |  | 
|  |                               ;     register   for   normal   accesses   to   memory 
 |  | 
|  |        ASSUME   DS : NOTHING      ;   Cancel   the   association   between   DS   and   Data 
 |  | 
|  |        add   Stuff ,   dx          ;   Once   again ,   the   ES   override   is   generated 
 |  | 
|  |        add   DS : Stuff ,   dx       ;   Must   use   " force "   if   we   want   the   default   encoding 
 |  | 
|  | Code    ends 
 |  | 
|  |        end </pre>
 |  | 
|  | '''Warning''':
 |  | 
|  |   |  | 
|  | If an '''ASSUME CS''':[[00255.htm|''Expression'']]is placed before the code segment it is referencing, the assembler will ignore the '''ASSUME'''. The '''ASSUME CS''':[[00255.htm|''Expression'']]statement must follow the '''SEGMENT'''definition statement of the code segment it is referencing.
 |  | 
|  |   |  | 
|  | The '''ASSUME'''statement for the '''CS'''register should be placed immediately following the code [[00777.htm|SEGMENT]]statement, before any labels are defined in that code segment. <br />
 |  | 
|  |   |  | 
|  | [[[00789.htm|prev]]][[[00791.htm|next]]][[[00788.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === General-Purpose Register Association ===
 |  | 
|  |   |  | 
|  | A '''''General-Purpose-Register-Association''establishes an assembly-time association between a [[00122.htm|''General-Purpose-Register'']]and a [[00250.htm|''Type-Declaration'']]. It allows the programmer to describe for the assembler what type of data is being held in the general purpose register at program run-time.'''
 |  | 
|  |   |  | 
|  | This feature can be very useful when the programmer is treating a general- purpose register as a "pointer" to a particular type of storage. If this " pointer" is being utilized many times in the program, (perhaps changing in value but never in the type of data to which it points), the '''ASSUME''' directive can be used to associate the register with the type of data to which it points. This frees the programmer from having to use an explicit [[00461.htm|Type Conversion (PTR Operator)]]every time the register is used to access memory.
 |  | 
|  |   |  | 
|  | A register may only be associated with a data type whose operand size matches that of the register. For instance, the following construct is illegal: <br />
 |  | 
|  |   |  | 
|  | <pre>     ASSUME   EBX : BYTE            ;   Error ,   EBX   is   a   DWORD   register </pre>
 |  | 
|  | The most useful situation is for the register to contain a pointer to another data type. In this situation, the [[00573.htm|Indirection ([] Operator)]]may be used store or retrieve data through the register without the need for an explicit conversion operation: <br />
 |  | 
|  |   |  | 
|  | <pre>     ASSUME   EDI : NOTHING                ;   This   is   the   assembler   default   setting 
 |  | 
|  |      MOV      [ EDI ] ,   1                   ;   What   is   the   size   supposed   to   be ? 
 |  | 
|  |      MOV      byte   ptr   [ EDI ] ,   1         ;   Fixes   the   problem ,   but   this   can   get   tiring 
 |  | 
|  |      ASSUME   EDI : PTR   BYTE               ;   EDI   is   now   a   pointer   to   a   byte 
 |  | 
|  |      MOV      [ EDI ] ,   1                   ;   assembler   knows   what   to   do   with   this   now 
 |  | 
|  |      INC      [ EDI ]                      ;   and   this   too </pre>
 |  | 
|  | The following constructs are legal but not particularly useful since they simply restate what is already known about the registers (the operand size) , and the assembler doesn't enforce a strict level of type checking against register operands: <br />
 |  | 
|  |   |  | 
|  | <pre>     ASSUME   ECX : SDWORD                 ;   Signed   double - word   matches   size   of   ECX 
 |  | 
|  |      ASSUME   EBX : DWORD                  ;   Unsigned   double - word   matches   size   of   EBX 
 |  | 
|  |      MOV      ECX ,   0FFFFEEEEh           ;   Register   type - checking   is   not   strict 
 |  | 
|  |      MOV      EBX ,   - 1                    ;     enough   to   flag   these   as   errors </pre>
 |  | 
|  | In fact, any data type that matches the size of the register may be used; the assembler checks the sizes and reports mismatches, but effectively ignores any settings that are not pointers to other types. Consider the following example: <br />
 |  | 
|  |   |  | 
|  | <pre>     STRUCT _ T   STRUCT 
 |  | 
|  |        One      BYTE   1 
 |  | 
|  |        Two      BYTE   2 
 |  | 
|  |        Three    BYTE   3 
 |  | 
|  |        Four     BYTE   4 
 |  | 
|  |      STRUCT _ T   ENDS 
 |  | 
|  |   |  | 
|  |      ASSUME   EBX : STRUCT _ T               ;   Ok ,   STRUCT _ T   is   4   bytes   in   size 
 |  | 
|  |      MOV      EBX ,   - 1                    ;   Legal ,   but   not   very   meaningful . . . 
 |  | 
|  |   |  | 
|  |      ;   A   more   useful   situation   ( given   that   EBX   is   now   holding   data   of   type 
 |  | 
|  |      ;   STRUCT _ T )   would   be   for   the   assembler   to   allow   the   following   notation : 
 |  | 
|  |   |  | 
|  |      MOV      EBX ,   {   4 ,   3 ,   2 ,   1   }       ;   Hypothetical   ( UNSUPPORTED ! )   syntax . . . 
 |  | 
|  |   |  | 
|  |      ;   It   would   also   be   nice   at   this   point   if   the   symbolic   debugger   could 
 |  | 
|  |      ;   show   us   the   value   of   EBX   in   the   appropriate   format ,   but   the   assembler 
 |  | 
|  |      ;   does   not   support   the   emitting   of   context - sensitive   symbolic   debugging 
 |  | 
|  |      ;   information . </pre>
 |  | 
|  | [[[00790.htm|prev]]][[[00792.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === EQU (Assign an Expression to a Symbolic Constant) ===
 |  | 
|  |   |  | 
|  | The '''EQU'''directive assigns the value of [[00255.htm|''Expression'']]to ''Name''.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   EQU   Expression </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | If ''Name''has already been defined as a [[00156.htm|''Numeric-EquateName'']]and its currently assigned value differs from the value given by [[00255.htm|''Expression'']], an error message is produced. Unlike symbols created with the = (equal sign) directive, symbols created with the '''EQU'''directive cannot be redefined with different values.
 |  | 
|  |   |  | 
|  | The [[00255.htm|''Expression'']]entry must evaluate to an [[00611.htm|''Operand-ExpressionType'']]. If an evaluation error occurs or if the [[00255.htm|''Expression'']]evaluates to one of the following [[00611.htm|''Operand-ExpressionType'']]''s'''':''
 |  | 
|  |   |  | 
|  | �[[00604.htm|''Indexed-ExpressionType'']] <br />�[[00607.htm|''Floating-Point-ExpressionType'']] <br />�[[00609.htm|''Compound-ExpressionType'']] <br />�[[00610.htm|''Duplicated-ExpressionType'']]
 |  | 
|  |   |  | 
|  | then the [[00149.htm|''Identifier'']]is converted to a [[00157.htm|''Text-EquateName'']]. Otherwise, the [[00149.htm|''Identifier'']]is converted to a [[00156.htm|''Numeric-EquateName'']].
 |  | 
|  |   |  | 
|  | See also [[00683.htm|EQU]]and [[00786.htm|=]].
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>A      EQU     < BP   + >    ; explicit   text   literal ,   A   is   a   text   equate 
 |  | 
|  | B      EQU     BP   +      ; invalid   expression   -   text   equate   equivalent   to   A 
 |  | 
|  | B      EQU     1   +   2     ; valid   expression   -   but   still   a   text   equate   < 1   +   2 > 
 |  | 
|  | C      EQU     1   +   2     ; converted   to   assembler   symbolic   constant ,   value   =   3 
 |  | 
|  | C      EQU     < 3 >       ; illegal ,   cannot   convert   back   to   text   equate </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00791.htm|prev]]][[[00793.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === LABEL (Associate a Symbolic Name With Current Address) ===
 |  | 
|  |   |  | 
|  | The '''LABEL'''directive defines the following attributes of ''Name:''
 |  | 
|  |   |  | 
|  | �Segment: current segment being assembled <br />�Offset: current position within this segment <br />�Type: the operand of the '''LABEL'''directive <br />
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>Name   LABEL   Type - Declaration 
 |  | 
|  |    or 
 |  | 
|  | Name : 
 |  | 
|  |    or 
 |  | 
|  | Name : : </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''LABEL'''directive provides a method of labeling a memory location and assigning it a type without allocating any storage. It can be used to create multiple labels of differing types that are aliases for the same memory location.
 |  | 
|  |   |  | 
|  | The ''Name''entry is an [[00149.htm|''Identifier'']]that is converted to a [[00163.htm|''LabelName'']]according to the value given by [[00250.htm|''Type-Declaration'']]. See the section on [[00163.htm|label names]]for more information on the details of this conversion.
 |  | 
|  |   |  | 
|  | The ''':'''and '''::'''forms of this directive are used for defining code labels. In this case, the ''Name''entry is converted to a [[00165.htm|''Target-LabelName'']]. The double- colon form of the directive is used when the ''Name''must be visible outside of the procedure block in which it is defined.
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | To refer to a data area but use a length different from the original definition of that area: <br />
 |  | 
|  |   |  | 
|  | <pre>BARRAY    LABEL      BYTE 
 |  | 
|  | ARRAY     DW         100   DUP ( 0 ) 
 |  | 
|  |              . 
 |  | 
|  |              . 
 |  | 
|  |              . 
 |  | 
|  |          ADD        AL , BARRAY [ 99 ]     ; ADD   100th   BYTE    TO   AL 
 |  | 
|  |          ADD        AX , ARRAY [ 98 ]      ; ADD   50th   WORD    TO   AX </pre>
 |  | 
|  | To define multiple entry points within a procedure: <br />
 |  | 
|  |   |  | 
|  | <pre>SUBRT     PROC      FAR 
 |  | 
|  |          . 
 |  | 
|  |          . 
 |  | 
|  |          . 
 |  | 
|  | SUB2      LABEL     FAR     ; Should   have   same   attribute   as   containing   PROC 
 |  | 
|  |          . 
 |  | 
|  |          . 
 |  | 
|  |          . 
 |  | 
|  |          RET 
 |  | 
|  | SUBRT     ENDP </pre>
 |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | [[[00792.htm|prev]]][[[00794.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === OPTION (Modify Default Behaviors) ===
 |  | 
|  |   |  | 
|  | The '''OPTION'''directive allows the user to alter certain default behaviors of the assembler, normally to provide backward compatibility with older assemblers. The '''OPTION'''directive is not available when assembling in [[00105.htm|M510]] mode.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>OPTION   Option - Item   [ ,   [ LineBreak ]   Option - Item   . . . ] </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The '''''Option-Item''arguments are defined as follows (the underlined keywords denote the default values):'''
 |  | 
|  |   |  | 
|  | '''DOTNAME'''| ''NODOTNAME''Allows user identifiers to begin with an introductory dot (.) character.
 |  | 
|  |   |  | 
|  | '''EXPR16'''| ''EXPR32''Specifies whether expressions are evaluated using 16-bit or 32-bit arithmetic. Some programs may require reverting back to '''EXPR16'''in order to assemble without problems. Once this value has been set it cannot be changed. The use of a processor selection directive to select a 32-bit processor is equivalent to selecting '''OPTION EXPR32''', which prevents any further attempt to select '''OPTION EXPR16'''.
 |  | 
|  |   |  | 
|  | '''LANGUAGE''':[[00131.htm|''Language-Name'']]Specifies the default language type for identifiers with '''PUBLIC'''or '''EXPORT'''visibility. This option overrides any setting given in the [[00775.htm|.MODEL]]directive.
 |  | 
|  |   |  | 
|  | '''OFFSET''':''Offset-Type''Determines how relocatable offset values are written to the object file output, encoded in the form of a linker "fixup" record. The possible values for ''Offset-Type''are '''SEGMENT''', ''GROUP'', and '''FLAT'''.
 |  | 
|  |   |  | 
|  | '''OLDSTRUCTS'''| ''NOOLDSTRUCTS''The '''OLDSTRUCTS'''keyword causes structure field names to become global identifiers rather than local names private to the structure type. It also prevents the [[00482.htm|Structure/Union Field Selection (. Operator)]]from performing strict checking on its operands, requiring its left operand to have a structure type and its right operand to be the name of a field contained therein.
 |  | 
|  |   |  | 
|  | '''PROC''':''Visibility''Specifies the default visibility for procedure names. This can be one of '''PRIVATE''', ''PUBLIC'', or '''EXPORT'''.
 |  | 
|  |   |  | 
|  | '''SCOPED'''| '''NOSCOPED'''The '''NOSCOPED'''keyword forces all code label names defined within procedures to be visible to the entire module and not just from within the defining procedure.
 |  | 
|  |   |  | 
|  | '''SEGMENT''':''Address-Size''Explicitly sets the default address size value. This is used to control the address size of segments that are opened without explict '''USE16'''or '''USE32'''keywords, and of global identifiers that are declared outside of segment boundaries. The possible values for ''Address- Size''are '''USE16''', '''USE32''', and '''FLAT'''. <br />
 |  | 
|  |   |  | 
|  | [[[00793.htm|prev]]][[[00795.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === .RADIX (Set the Default Base for Numeric Literals) ===
 |  | 
|  |   |  | 
|  | The '''.RADIX'''directive lets you change the default '''RADIX'''(decimal) to base 2, 8, 10, or 16.
 |  | 
|  |   |  | 
|  | '''Syntax'''
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>. RADIX   Expression </pre>
 |  | 
|  | '''Remarks'''
 |  | 
|  |   |  | 
|  | The [[00255.htm|''Expression'']]entry is in decimal radix regardless of the current radix setting.
 |  | 
|  |   |  | 
|  | The '''.RADIX'''directive does not affect real numbers initialized as variables with '''DD''', '''DQ''', or '''DT'''.
 |  | 
|  |   |  | 
|  | When using '''.RADIX 16''', be aware that if the hex constant ends in either B or D, the assembler thinks that the B or D is a request to cancel the current radix specification with a base of binary or decimal, respectively. In such cases, add the H base override (just as if '''.RADIX 16'''were not in use).
 |  | 
|  |   |  | 
|  | '''Example'''
 |  | 
|  |   |  | 
|  | The statement: <br />
 |  | 
|  |   |  | 
|  | <pre>. RADIX     16 
 |  | 
|  | DW     120B </pre>
 |  | 
|  | produces an error because 2 is not a valid binary number. The correct specification is: <br />
 |  | 
|  |   |  | 
|  | <pre>DW     120BH </pre>
 |  | 
|  | The following example: <br />
 |  | 
|  |   |  | 
|  | <pre>. RADIX    16 
 |  | 
|  | DW    89CD </pre>
 |  | 
|  | also produces an error because C is not a valid decimal number. The correct specification is: <br />
 |  | 
|  |   |  | 
|  | <pre>DW    89CDH </pre>
 |  | 
|  | The dangerous case is when no error is produced. For example: <br />
 |  | 
|  |   |  | 
|  | <pre>. RADIX    16 
 |  | 
|  | DW   120D </pre>
 |  | 
|  | produces a constant whose value is 120 decimal, not '120D' hex, which might have been the intended value.
 |  | 
|  |   |  | 
|  | The following two move instructions are the same: <br />
 |  | 
|  |   |  | 
|  | <pre>MOV    BX , OFFH 
 |  | 
|  | . RADIX    16 
 |  | 
|  | MOV    BX , OFF </pre>
 |  | 
|  | The following example: <br />
 |  | 
|  |   |  | 
|  | <pre>. RADIX   8 
 |  | 
|  | DQ   19 . 0      ;   Treated   as   decimal </pre>
 |  | 
|  | produces a constant whose value is 19 decimal because 19.0 is a real number . However, if you leave off the decimal point, the following: <br />
 |  | 
|  |   |  | 
|  | <pre>. RADIX    8 
 |  | 
|  | DQ    19   ;   uses   current   radix </pre>
 |  | 
|  | produces a syntax error because nine is not a valid number in .RADIX 8. <br />
 |  | 
|  |   |  | 
|  | [[[00794.htm|prev]]][[[00796.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Processor Reference ===
 |  | 
|  |   |  | 
|  | This chapter presents an overview of the instruction set and lists the complete instruction set in alphabetical order. For each instruction, the forms are given for each operand combination, including object code produced, operands required, execution time, and a description. For each instruction, there is an operational description and a summary of exceptions generated.
 |  | 
|  |   |  | 
|  | [[[00795.htm|prev]]][[[00797.htm|next]]][[[00795.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Intel Instruction Set Overview ===
 |  | 
|  |   |  | 
|  | This section contains an introduction to the Intel instruction set and presents the terminology necessary to understand the encoding and operation of each individual instruction.
 |  | 
|  |   |  | 
|  | [[[00796.htm|prev]]][[[00798.htm|next]]][[[00796.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operand-Size and Address-Size Attributes ===
 |  | 
|  |   |  | 
|  | When executing an instruction, the processor can address memory using either 16 or 32-bit addresses. Consequently, each instruction that uses memory addresses has associated with it an address-size attribute of either 16 or 32 bits. The use of 16-bit addresses implies both the use of 16-bit displacements in instructions and the generation of 16-bit address offsets (segment relative addresses) as the result of the effective address calculations. 32-bit addresses imply the use of 32-bit displacements and the generation of 32-bit address offsets. Similarly, an instruction that accesses words (16 bits) or doublewords (32 bits) has an operand-size attribute of either 16 or 32 bits.
 |  | 
|  |   |  | 
|  | The attributes are determined by a combination of defaults, instruction prefixes, and (for programs executing in protected mode) size-specification bits in segment descriptors.
 |  | 
|  |   |  | 
|  | [[[00797.htm|prev]]][[[00799.htm|next]]][[[00797.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Default Segment Attribute ===
 |  | 
|  |   |  | 
|  | For programs running in protected mode, the D bit in executable-segment descriptors specifies the default attribute for both address size and operand size. These default attributes apply to the execution of all instructions in the segment. A clear D bit sets the default address size and operand size to 16 bits; a set D bit, to 32 bits.
 |  | 
|  |   |  | 
|  | Programs that execute in real mode or virtual-8086 mode have 16-bit addresses and operands by default.
 |  | 
|  |   |  | 
|  | [[[00798.htm|prev]]][[[00800.htm|next]]][[[00797.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operand-Size and Address-Size Instruction Prefixes ===
 |  | 
|  |   |  | 
|  | The internal encoding of an instruction can include two byte-long prefixes: the address-size prefix, 67H, and the operand-size prefix, 66H. (A later section, "Instruction Format," shows the position of the prefixes in an instruction's encoding.) These prefixes ''override''the default segment attributes for the instruction that follows. The following table shows the effect of each possible combination of defaults and overrides.
 |  | 
|  |   |  | 
|  | '''Effective Size Attributes'''<br />
 |  | 
|  |   |  | 
|  | <pre>/--------------------------------------------------------------------\
 |  | 
|  | |Segment Default D = ...     |0   |0   |0   |0   |1   |1   |1   |1   |
 |  | 
|  | |----------------------------+----+----+----+----+----+----+----+----|
 |  | 
|  | |Operand-Size Prefix 66H     |N   |N   |Y   |Y   |N   |N   |Y   |Y   |
 |  | 
|  | |----------------------------+----+----+----+----+----+----+----+----|
 |  | 
|  | |Address-Size Prefix 67H     |N   |Y   |N   |Y   |N   |Y   |N   |Y   |
 |  | 
|  | |----------------------------+----+----+----+----+----+----+----+----|
 |  | 
|  | |Effective Operand Size      |16  |16  |32  |32  |32  |32  |16  |16  |
 |  | 
|  | |----------------------------+----+----+----+----+----+----+----+----|
 |  | 
|  | |Effective Address Size      |16  |32  |16  |32  |32  |16  |32  |16  |
 |  | 
|  | \--------------------------------------------------------------------/</pre>
 |  | 
|  | Y = Yes, this instruction prefix is present <br />N = No, this instruction prefix is not present
 |  | 
|  |   |  | 
|  | [[[00799.htm|prev]]][[[00801.htm|next]]][[[00797.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Address-Size Attribute for Stack ===
 |  | 
|  |   |  | 
|  | Instructions that use the stack implicitly (for example: POP EAX) also have a stack address-size attribute of either 16 or 32 bits. Instructions with a stack address-size attribute of 16 use the 16-bit SP stack pointer register; instructions with a stack address-size attribute of 32 bits use the 32-bit ESP register to form the address of the top of the stack.
 |  | 
|  |   |  | 
|  | The stack address-size attribute is controlled by the B bit of the data- segment descriptor in the SS register. A value of zero in the B bit selects a stack address-size attribute of 16; a value of one selects a stack address-size attribute of 32.
 |  | 
|  |   |  | 
|  | [[[00800.htm|prev]]][[[00802.htm|next]]][[[00796.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Format ===
 |  | 
|  |   |  | 
|  | All instruction encodings are subsets of the general instruction format shown in the following figure. Instructions consist of optional instruction prefixes (in any order), one or two primary opcode bytes, possibly an address specifier consisting of the ModR/M byte and the SIB (Scale Index Base) byte, a displacement, if required, and an immediate data field, if required. <br />
 |  | 
|  |   |  | 
|  | <pre>Instruction Format 
 |  | 
|  |   |  | 
|  | /-------------------------------------------------------------\
 |  | 
|  | |   /----------------------------------------------------\    |
 |  | 
|  | |   | INSTRUCTION  |  ADDRESS-   | OPERAND-   | SEGMENT  |    |
 |  | 
|  | |   |    PREFIX    | SIZE PREFIX |SIZE PREFIX | OVERRIDE |    |
 |  | 
|  | |   |----------------------------------------------------|    |
 |  | 
|  | |   |    0 OR 1        0 OR 1       0 OR 1       0 OR 1  |    |
 |  | 
|  | |   |----------------------------------------------------|    |
 |  | 
|  | |   |                                                    |    |
 |  | 
|  | |   |                  NUMBER OF BYTES                   |    |
 |  | 
|  | |   \----------------------------------------------------/    |
 |  | 
|  | |                                                             |
 |  | 
|  | |   /----------------------------------------------------\    |
 |  | 
|  | |   |  OPCODE | MODR/M | SIB | DISPLACEMENT | IMMEDIATE  |    |
 |  | 
|  | |   |----------------------------------------------------|    |
 |  | 
|  | |   |  1 OR 2   0 OR 1  0 OR 1   0,1,2 OR 4    0,1,2 OR 4|    |
 |  | 
|  | |   |----------------------------------------------------|    |
 |  | 
|  | |   |                  NUMBER OF BYTES                   |    |
 |  | 
|  | |   \----------------------------------------------------/    |
 |  | 
|  | \-------------------------------------------------------------/</pre>
 |  | 
|  | Smaller encoding fields can be defined within the primary opcode or opcodes . These fields define the direction of the operation, the size of the displacements, the register encoding, or sign extension; encoding fields vary depending on the class of operation.
 |  | 
|  |   |  | 
|  | Most instructions that can refer to an operand in memory have an addressing form byte following the primary opcode byte(s). This byte, called the ModR/ M byte, specifies the address form to be used. Certain encodings of the ModR/M byte indicate a second addressing byte, the SIB (Scale Index Base) byte, which follows the ModR/M byte and is required to fully specify the addressing form.
 |  | 
|  |   |  | 
|  | Addressing forms can include a displacement immediately following either the ModR/M or SIB byte. If a displacement is present, it can be 8-, 16- or 32-bits.
 |  | 
|  |   |  | 
|  | If the instruction specifies an immediate operand, the immediate operand always follows any displacement bytes. The immediate operand, if specified, is always the last field of the instruction.
 |  | 
|  |   |  | 
|  | Zero or one bytes are reserved for each group of prefixes. The prefixes are grouped as follows:
 |  | 
|  |   |  | 
|  | 1.Instruction Prefixes: REP, REPE/REPZ, REPNE/REPNZ, LOCK
 |  | 
|  |   |  | 
|  | 2.Segment Override Prefixes: CS, SS, DS, ES, FS, GS
 |  | 
|  |   |  | 
|  | 3.Operand Size Override
 |  | 
|  |   |  | 
|  | 4.Address Size Override <br />
 |  | 
|  |   |  | 
|  | For each instruction, one prefix may be used from each group. The effect of redundant prefixes (more than one prefix from a group) is undefined and may vary from processor to processor. The prefixes may come in any order.
 |  | 
|  |   |  | 
|  | The following are the allowable instruction prefix codes: <br />
 |  | 
|  |   |  | 
|  | <pre>F3H     REP prefix (used only with string instructions)
 |  | 
|  | F3H     REPE/REPZ prefix (used only with string instructions)
 |  | 
|  | F2H     REPNE/REPNZ prefix (used only with string instructions)
 |  | 
|  | F0H     LOCK prefix </pre>
 |  | 
|  | The following are the segment override prefixes: <br />
 |  | 
|  |   |  | 
|  | <pre>2EH     CS segment override prefix 
 |  | 
|  | 36H     SS segment override prefix 
 |  | 
|  | 3EH     DS segment override prefix 
 |  | 
|  | 26H     ES segment override prefix 
 |  | 
|  | 64H     FS segment override prefix 
 |  | 
|  | 65H     GS segment override prefix 
 |  | 
|  | 66H     Operand-size override 
 |  | 
|  | 67H     Address-size override </pre>
 |  | 
|  | [[[00801.htm|prev]]][[[00803.htm|next]]][[[00801.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ModR/M and SIB Bytes ===
 |  | 
|  |   |  | 
|  | The ModR/M and SIB bytes follow the opcode byte(s) in many of the processor instructions. They contain the following information:
 |  | 
|  |   |  | 
|  | �The indexing type or register number to be used in the instruction
 |  | 
|  |   |  | 
|  | �The register to be used, or more information to select the instruction
 |  | 
|  |   |  | 
|  | �The base, index, and scale information <br />
 |  | 
|  |   |  | 
|  | The ModR/M byte contains three fields of information:
 |  | 
|  |   |  | 
|  | �The '''mod'''field, which occupies the two most significant bits of the byte, combines with the r/m field to form 32 possible values: eight registers and 24 indexing modes.
 |  | 
|  |   |  | 
|  | �The '''reg'''field, which occupies the next three bits following the mod field, specifies either a register number or three more bits of opcode information . The meaning of the reg field is determined by the first (opcode) byte of the instruction.
 |  | 
|  |   |  | 
|  | �The '''r/m'''field, which occupies the three least significant bits of the byte , can specify a register as the location of an operand, or can form part of the addressing-mode encoding in combination with the '''mod'''field as described above. <br />
 |  | 
|  |   |  | 
|  | The based indexed forms of 32-bit addressing require the SIB byte. The presence of the SIB byte is indicated by certain encodings of the ModR/M byte. The SIB byte then includes the following fields:
 |  | 
|  |   |  | 
|  | �The '''ss'''field, which occupies the two most significant bits of the byte, specifies the scale factor.
 |  | 
|  |   |  | 
|  | �The '''index'''field, which occupies the next three bits following the '''ss'''field and specifies the register number of the index register.
 |  | 
|  |   |  | 
|  | �The '''base'''field, which occupies the three least significant bits of the byte, specifies the register number of the base register. <br /><br />
 |  | 
|  |   |  | 
|  | <pre>ModR/M and SIB Byte Formats 
 |  | 
|  |   |  | 
|  | /------------------------------------------------\
 |  | 
|  | |                  MODR/M BYTE                   |
 |  | 
|  | |                                                |
 |  | 
|  | |     7     6    5     4     3   2    1     0    |
 |  | 
|  | |   /------------------------------------------\ |
 |  | 
|  | |   |  MOD     |   REG/OPCODE   |     R/M      | |
 |  | 
|  | |   \------------------------------------------/ |
 |  | 
|  | |                                                |
 |  | 
|  | |            SIB (SCALE INDEX BASE) BYTE         |
 |  | 
|  | |                                                |
 |  | 
|  | |     7     6    5     4     3   2    1     0    |
 |  | 
|  | |   /------------------------------------------\ |
 |  | 
|  | |   |    SS    |     INDEX      |     BASE     | |
 |  | 
|  | |   \------------------------------------------/ |
 |  | 
|  | |                                                |
 |  | 
|  | \------------------------------------------------/</pre>
 |  | 
|  | [[[00802.htm|prev]]][[[00804.htm|next]]][[[00802.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === 16-Bit Addressing Forms with the ModR/M Byte ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------------------------------------------------------------\
 |  | 
|  | | r8(/r)                        | AL  | CL  | DL  | BL  | AH  | CH  | DH  | BH  |
 |  | 
|  | | r16(/r)                       | AX  | CX  | DX  | BX  | SP  | BP  | SI  | DI  |
 |  | 
|  | | r32(/r)                       | EAX | ECX | EDX | EBX | ESP | EBP | ESI | EDI | 
 |  | 
|  | | /digit (Opcode)               | 0   | 1   | 2   | 3   | 4   | 5   | 6   | 7   | 
 |  | 
|  | | REG =                         | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 | 
 |  | 
|  | |-------------------------------+-----------------------------------------------|
 |  | 
|  | | Effective       | MOD |  R/M  |         MODR/M Values in Hexadecimal          |
 |  | 
|  | | Address         |     |       |                                               | 
 |  | 
|  | |-----------------+-----+-------+-----------------------------------------------|
 |  | 
|  | | [BX+SI]         | 00  |  000  | 00  | 08  | 10  | 18  | 20  | 28  | 30  | 38  |
 |  | 
|  | | [BX+DI]         |     |  001  | 01  | 09  | 11  | 19  | 21  | 29  | 31  | 39  |
 |  | 
|  | | [BP+SI]         |     |  010  | 02  | 0A  | 12  | 1A  | 22  | 2A  | 32  | 3A  |
 |  | 
|  | | [BP+DI]         |     |  011  | 03  | 0B  | 13  | 1B  | 23  | 2B  | 33  | 3B  |
 |  | 
|  | | [SI]            |     |  100  | 04  | 0C  | 14  | 1C  | 24  | 2C  | 34  | 3C  |
 |  | 
|  | | [DI]            |     |  101  | 05  | 0D  | 15  | 1D  | 25  | 2D  | 35  | 3D  |
 |  | 
|  | | disp16          |     |  110  | 06  | 0E  | 16  | 1E  | 26  | 2E  | 36  | 3E  |
 |  | 
|  | | [BX]            |     |  111  | 07  | 0F  | 17  | 1F  | 27  | 2F  | 37  | 3F  |
 |  | 
|  | |-----------------+-----+-------+-----+-----+-----+-----+-----+-----+-----+-----|
 |  | 
|  | | [BX+SI]+disp8   | 01  |  000  | 40  | 48  | 50  | 58  | 60  | 68  | 70  | 78  |
 |  | 
|  | | [BX+DI]+disp8   |     |  001  | 41  | 49  | 51  | 59  | 61  | 69  | 71  | 79  |
 |  | 
|  | | [BP+SI]+disp8   |     |  010  | 42  | 4A  | 52  | 5A  | 62  | 6A  | 72  | 7A  |
 |  | 
|  | | [BP+DI]+disp8   |     |  011  | 43  | 4B  | 53  | 5B  | 63  | 6B  | 73  | 7B  |
 |  | 
|  | | [SI]+disp8      |     |  100  | 44  | 4C  | 54  | 5C  | 64  | 6C  | 74  | 7C  |
 |  | 
|  | | [DI]+disp8      |     |  101  | 45  | 4D  | 55  | 5D  | 65  | 6D  | 75  | 7D  |
 |  | 
|  | | [BP]+disp8      |     |  110  | 46  | 4E  | 56  | 5E  | 66  | 6E  | 76  | 7E  |
 |  | 
|  | | [BX]+disp8      |     |  111  | 47  | 4F  | 57  | 5F  | 67  | 6F  | 77  | 7F  |
 |  | 
|  | |-----------------+-----+-------+-----+-----+-----+-----+-----+-----+-----+-----|
 |  | 
|  | | [BX+SI]+disp16  | 10  |  000  | 80  | 88  | 90  | 98  | A0  | A8  | B0  | B8  |
 |  | 
|  | | [BX+DI]+disp16  |     |  001  | 81  | 89  | 91  | 99  | A1  | A9  | B1  | B9  |
 |  | 
|  | | [BP+SI]+disp16  |     |  010  | 82  | 8A  | 92  | 9A  | A2  | AA  | B2  | BA  |
 |  | 
|  | | [BP+DI]+disp16  |     |  011  | 83  | 8B  | 93  | 9B  | A3  | AB  | B3  | BB  |
 |  | 
|  | | [SI]+disp16     |     |  100  | 84  | 8C  | 94  | 9C  | A4  | AC  | B4  | BC  |
 |  | 
|  | | [DI]+disp16     |     |  101  | 85  | 8D  | 95  | 9D  | A5  | AD  | B5  | BD  |
 |  | 
|  | | [BP]+disp16     |     |  110  | 86  | 8E  | 96  | 9E  | A6  | AE  | B6  | BE  |
 |  | 
|  | | [BX]+disp16     |     |  111  | 87  | 8F  | 97  | 9F  | A7  | AF  | B7  | BF  |
 |  | 
|  | |-----------------+-----+-------+-----+-----+-----+-----+-----+-----+-----+-----|
 |  | 
|  | | EAX/AX/AL       | 11  |  000  | C0  | C8  | D0  | D8  | E0  | E8  | F0  | F8  |
 |  | 
|  | | ECX/CX/CL       |     |  001  | C1  | C9  | D1  | D9  | E1  | E9  | F1  | F9  |
 |  | 
|  | | EDX/DX/DL       |     |  010  | C2  | CA  | D2  | DA  | E2  | EA  | F2  | FA  |
 |  | 
|  | | EBX/BX/BL       |     |  011  | C3  | CB  | D3  | DB  | E3  | EB  | F3  | FB  |
 |  | 
|  | | ESP/SP/AH       |     |  100  | C4  | CC  | D4  | DC  | E4  | EC  | F4  | FC  |
 |  | 
|  | | EBP/BP/CH       |     |  101  | C5  | CD  | D5  | DD  | E5  | ED  | F5  | FD  |
 |  | 
|  | | ESI/SI/DH       |     |  110  | C6  | CE  | D6  | DE  | E6  | EE  | F6  | FE  |
 |  | 
|  | | EDI/DI/BH       |     |  111  | C7  | CF  | D7  | DF  | E7  | EF  | F7  | FF  |
 |  | 
|  | \-------------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Notes:'''
 |  | 
|  |   |  | 
|  | 1.'''disp8'''denotes an 8-bit displacement following the ModR/M byte, to be sign-extended and added to the index.
 |  | 
|  |   |  | 
|  | 2.'''disp16'''denotes a 16-bit displacement following the ModR/M byte, to be added to the index. Default segment register is SS for the effective addresses containing a BP index, DS for other effective addresses. <br />
 |  | 
|  |   |  | 
|  | [[[00803.htm|prev]]][[[00805.htm|next]]][[[00802.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === 32-Bit Addressing Forms with the ModR/M Byte ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------------------------------------------------------------\
 |  | 
|  | | r8(/r)                        | AL  | CL  | DL  | BL  | AH  | CH  | DH  | BH  |
 |  | 
|  | | r16(/r)                       | AX  | CX  | DX  | BX  | SP  | BP  | SI  | DI  |
 |  | 
|  | | r32(/r)                       | EAX | ECX | EDX | EBX | ESP | EBP | ESI | EDI | 
 |  | 
|  | | /digit (Opcode)               | 0   | 1   | 2   | 3   | 4   | 5   | 6   | 7   | 
 |  | 
|  | | REG =                         | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 | 
 |  | 
|  | |-------------------------------+-----------------------------------------------|
 |  | 
|  | | Effective       | MOD |  R/M  |         MODR/M Values in Hexadecimal          |
 |  | 
|  | | Address         |     |       |                                               | 
 |  | 
|  | |-----------------+-----+-------+-----------------------------------------------|
 |  | 
|  | | [EAX]           | 00  |  000  | 00  | 08  | 10  | 18  | 20  | 28  | 30  | 38  |
 |  | 
|  | | [ECX]           |     |  001  | 01  | 09  | 11  | 19  | 21  | 29  | 31  | 39  |
 |  | 
|  | | [EDX]           |     |  010  | 02  | 0A  | 12  | 1A  | 22  | 2A  | 32  | 3A  |
 |  | 
|  | | [EBX]           |     |  011  | 03  | 0B  | 13  | 1B  | 23  | 2B  | 33  | 3B  |
 |  | 
|  | | [--][--]        |     |  100  | 04  | 0C  | 14  | 1C  | 24  | 2C  | 34  | 3C  |
 |  | 
|  | | disp32          |     |  101  | 05  | 0D  | 15  | 1D  | 25  | 2D  | 35  | 3D  |
 |  | 
|  | | [ESI]           |     |  110  | 06  | 0E  | 16  | 1E  | 26  | 2E  | 36  | 3E  |
 |  | 
|  | | [EDI]           |     |  111  | 07  | 0F  | 17  | 1F  | 27  | 2F  | 37  | 3F  |
 |  | 
|  | |-----------------+-----+-------+-----+-----+-----+-----+-----+-----+-----+-----|
 |  | 
|  | | disp8[EAX]      | 01  |  000  | 40  | 48  | 50  | 58  | 60  | 68  | 70  | 78  |
 |  | 
|  | | disp8[ECX]      |     |  001  | 41  | 49  | 51  | 59  | 61  | 69  | 71  | 79  |
 |  | 
|  | | disp8[EDX]      |     |  010  | 42  | 4A  | 52  | 5A  | 62  | 6A  | 72  | 7A  |
 |  | 
|  | | disp8[EBX]      |     |  011  | 43  | 4B  | 53  | 5B  | 63  | 6B  | 73  | 7B  |
 |  | 
|  | | disp8[--][--]   |     |  100  | 44  | 4C  | 54  | 5C  | 64  | 6C  | 74  | 7C  |
 |  | 
|  | | disp8[EBP]      |     |  101  | 45  | 4D  | 55  | 5D  | 65  | 6D  | 75  | 7D  |
 |  | 
|  | | disp8[ESI]      |     |  110  | 46  | 4E  | 56  | 5E  | 66  | 6E  | 76  | 7E  |
 |  | 
|  | | disp8[EDI]      |     |  111  | 47  | 4F  | 57  | 5F  | 67  | 6F  | 77  | 7F  |
 |  | 
|  | |-----------------+-----+-------+-----+-----+-----+-----+-----+-----+-----+-----|
 |  | 
|  | | disp32[EAX]     | 10  |  000  | 80  | 88  | 90  | 98  | A0  | A8  | B0  | B8  |
 |  | 
|  | | disp32[ECX]     |     |  001  | 81  | 89  | 91  | 99  | A1  | A9  | B1  | B9  |
 |  | 
|  | | disp32[EDX]     |     |  010  | 82  | 8A  | 92  | 9A  | A2  | AA  | B2  | BA  |
 |  | 
|  | | disp32[EBX]     |     |  011  | 83  | 8B  | 93  | 9B  | A3  | AB  | B3  | BB  |
 |  | 
|  | | disp32[--][--]  |     |  100  | 84  | 8C  | 94  | 9C  | A4  | AC  | B4  | BC  |
 |  | 
|  | | disp32[EBP]     |     |  101  | 85  | 8D  | 95  | 9D  | A5  | AD  | B5  | BD  |
 |  | 
|  | | disp32[ESI]     |     |  110  | 86  | 8E  | 96  | 9E  | A6  | AE  | B6  | BE  |
 |  | 
|  | | disp32[EDI]     |     |  111  | 87  | 8F  | 97  | 9F  | A7  | AF  | B7  | BF  |
 |  | 
|  | |-----------------+-----+-------+-----+-----+-----+-----+-----+-----+-----+-----|
 |  | 
|  | | EAX/AX/AL       | 11  |  000  | C0  | C8  | D0  | D8  | E0  | E8  | F0  | F8  |
 |  | 
|  | | ECX/CX/CL       |     |  001  | C1  | C9  | D1  | D9  | E1  | E9  | F1  | F9  |
 |  | 
|  | | EDX/DX/DL       |     |  010  | C2  | CA  | D2  | DA  | E2  | EA  | F2  | FA  |
 |  | 
|  | | EBX/BX/BL       |     |  011  | C3  | CB  | D3  | DB  | E3  | EB  | F3  | FB  |
 |  | 
|  | | ESP/SP/AH       |     |  100  | C4  | CC  | D4  | DC  | E4  | EC  | F4  | FC  |
 |  | 
|  | | EBP/BP/CH       |     |  101  | C5  | CD  | D5  | DD  | E5  | ED  | F5  | FD  |
 |  | 
|  | | ESI/SI/DH       |     |  110  | C6  | CE  | D6  | DE  | E6  | EE  | F6  | FE  |
 |  | 
|  | | EDI/DI/BH       |     |  111  | C7  | CF  | D7  | DF  | E7  | EF  | F7  | FF  |
 |  | 
|  | \-------------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Notes:'''
 |  | 
|  |   |  | 
|  | 1.[--][--] means a SIB follows the ModR/M byte.
 |  | 
|  |   |  | 
|  | 2.'''disp8'''denotes an 8-bit displacement following the SIB byte, to be sign- extended and added to the index.
 |  | 
|  |   |  | 
|  | '''disp32'''denotes a 32-bit displacement following the SIB byte, to be added to the index. <br />
 |  | 
|  |   |  | 
|  | [[[00804.htm|prev]]][[[00806.htm|next]]][[[00802.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === 32-Bit Addressing Forms with the SIB Byte ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------------------------------------------------------------\
 |  | 
|  | |                               | EAX | ECX | EDX | EBX | ESP | [*] | ESI | EDI | 
 |  | 
|  | | r32                           | 0   | 1   | 2   | 3   | 4   | 5   | 6   | 7   | 
 |  | 
|  | | Base =                        | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 | 
 |  | 
|  | | Base =                        |     |     |     |     |     |     |     |     | 
 |  | 
|  | |-------------------------------+-----------------------------------------------|
 |  | 
|  | | Scaled Index    | SS  | Index |           SIB Values in Hexadecimal           | 
 |  | 
|  | |-----------------+-----+-------+-----------------------------------------------|
 |  | 
|  | | [EAX]           | 00  |  000  | 00  | 01  | 02  | 03  | 04  | 05  | 06  | 07  |
 |  | 
|  | | [ECX]           |     |  001  | 08  | 09  | 0A  | 0B  | 0C  | 0D  | 0E  | 0F  |
 |  | 
|  | | [EDX]           |     |  010  | 10  | 11  | 12  | 13  | 14  | 15  | 16  | 17  |
 |  | 
|  | | [EBX]           |     |  011  | 18  | 19  | 1A  | 1B  | 1C  | 1D  | 1E  | 1F  |
 |  | 
|  | | none            |     |  100  | 20  | 21  | 22  | 23  | 24  | 25  | 26  | 27  |
 |  | 
|  | | [EBP]           |     |  101  | 28  | 29  | 2A  | 2B  | 2C  | 2D  | 2E  | 2F  |
 |  | 
|  | | [ESI]           |     |  110  | 30  | 31  | 32  | 33  | 34  | 35  | 36  | 37  |
 |  | 
|  | | [EDI]           |     |  111  | 38  | 39  | 3A  | 3B  | 3C  | 3D  | 3E  | 3F  |
 |  | 
|  | |-----------------+-----+-------+-----+-----+-----+-----+-----+-----+-----+-----|
 |  | 
|  | | [EAX*2]         | 01  |  000  | 40  | 41  | 42  | 43  | 44  | 45  | 46  | 47  |
 |  | 
|  | | [ECX*2]         |     |  001  | 48  | 49  | 4A  | 4B  | 4C  | 4D  | 4E  | 4F  |
 |  | 
|  | | [EDX*2]         |     |  010  | 50  | 51  | 52  | 53  | 54  | 55  | 56  | 57  |
 |  | 
|  | | [EBX*2]         |     |  011  | 58  | 59  | 5A  | 5B  | 5C  | 5D  | 5E  | 5F  |
 |  | 
|  | | none            |     |  100  | 60  | 61  | 62  | 63  | 64  | 65  | 66  | 67  |
 |  | 
|  | | [EBP*2]         |     |  101  | 68  | 69  | 6A  | 6B  | 6C  | 6D  | 6E  | 6F  |
 |  | 
|  | | [ESI*2]         |     |  110  | 70  | 71  | 72  | 73  | 74  | 75  | 76  | 77  |
 |  | 
|  | | [EDI*2]         |     |  111  | 78  | 79  | 7A  | 7B  | 7C  | 7D  | 7E  | 7F  |
 |  | 
|  | |-----------------+-----+-------+-----+-----+-----+-----+-----+-----+-----+-----|
 |  | 
|  | | [EAX*4]         | 10  |  000  | 80  | 81  | 82  | 83  | 84  | 85  | 86  | 87  |
 |  | 
|  | | [ECX*4]         |     |  001  | 88  | 89  | 8A  | 8B  | 8C  | 8D  | 8E  | 8F  |
 |  | 
|  | | [EDX*4]         |     |  010  | 90  | 91  | 92  | 93  | 94  | 95  | 96  | 97  |
 |  | 
|  | | [EBX*4]         |     |  011  | 98  | 89  | 9A  | 9B  | 9C  | 9D  | 9E  | 9F  |
 |  | 
|  | | none            |     |  100  | A0  | A1  | A2  | A3  | A4  | A5  | A6  | A7  |
 |  | 
|  | | [EBP*4]         |     |  101  | A8  | A9  | AA  | AB  | AC  | AD  | AE  | AF  |
 |  | 
|  | | [ESI*4]         |     |  110  | B0  | B1  | B2  | B3  | B4  | B5  | B6  | B7  |
 |  | 
|  | | [EDI*4]         |     |  111  | B8  | B9  | BA  | BB  | BC  | BD  | BE  | BF  |
 |  | 
|  | |-----------------+-----+-------+-----+-----+-----+-----+-----+-----+-----+-----|
 |  | 
|  | | [EAX*8]         | 11  |  000  | C0  | C1  | C2  | C3  | C4  | C5  | C6  | C7  |
 |  | 
|  | | [ECX*8]         |     |  001  | C8  | C9  | CA  | CB  | CC  | CD  | CE  | CF  |
 |  | 
|  | | [EDX*8]         |     |  010  | D0  | D1  | D2  | D3  | D4  | D5  | D6  | D7  |
 |  | 
|  | | [EBX*8]         |     |  011  | D8  | D9  | DA  | DB  | DC  | DD  | DE  | DF  |
 |  | 
|  | | none            |     |  100  | E0  | E1  | E2  | E3  | E4  | E5  | E6  | E7  |
 |  | 
|  | | [EBP*8]         |     |  101  | E8  | E9  | EA  | EB  | EC  | ED  | EE  | EF  |
 |  | 
|  | | [ESI*8]         |     |  110  | F0  | F1  | F2  | F3  | F4  | F5  | F6  | F7  |
 |  | 
|  | | [EDI*8]         |     |  111  | F8  | F9  | FA  | FB  | FC  | FD  | FE  | FF  |
 |  | 
|  | \-------------------------------------------------------------------------------/</pre>
 |  | 
|  | '''Notes:'''
 |  | 
|  |   |  | 
|  | [*] means a disp32 with no base if MOD is 00, [EBP] otherwise. This provides the following addressing modes: <br />
 |  | 
|  |   |  | 
|  | <pre>disp32[index]           (MOD=00)
 |  | 
|  | disp8[EBP][index]       (MOD=01)
 |  | 
|  | disp32[EBP][index]      (MOD=10)</pre>
 |  | 
|  | [[[00805.htm|prev]]][[[00807.htm|next]]][[[00796.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === How to Read the Instruction Set Pages ===
 |  | 
|  |   |  | 
|  | The following sections describe how to interpret the description pages for each instruction listed in the [[01466.htm|Intel Instruction Set]]section. Each instruction family is introduced by a descriptive heading such as the following:
 |  | 
|  |   |  | 
|  | '''CMC-Complement Carry Flag'''
 |  | 
|  |   |  | 
|  | Each instruction family may be accompanied by descriptive sections labeled as follows: [[00807.htm|Details Table]], [[00854.htm|Operation]], [[00855.htm|Flags Affected]], [[00858.htm|Protected Mode Exceptions]], [[00859.htm|Real Address Mode Exceptions]], [[00860.htm|Virtual-8086 Mode Exceptions]], and optionally, a '''Notes'''section. The following sections explain the notational conventions and abbreviations used in these paragraphs of the instruction descriptions.
 |  | 
|  |   |  | 
|  | [[[00806.htm|prev]]][[[00808.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | For each instruction family, a table is given to list the details of each individual instruction. The following is an example of this table: <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |F5        |CMC                 |2|2|2|2|2|2|Complement carry flag             |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | The [[00808.htm|Encoding]], [[00809.htm|Instruction]], and [[00852.htm|Description]]columns are described in the following sections. The columns labeled '''0, 1, 2, 3, 4,'''and '''5'''are collectively described in the [[00851.htm|Clocks]]section. A timing entry appearing in one of these columns is an indication that the associated processor implements that particular instruction variation. The column names are abbreviated, and are described as follows:
 |  | 
|  |   |  | 
|  | 0The 8088/8086/8087 Processor Family
 |  | 
|  |   |  | 
|  | 1The 80186/8087 Processor Family
 |  | 
|  |   |  | 
|  | 2The 80286/80287 Processor Family
 |  | 
|  |   |  | 
|  | 3The 80386/80387 Processor Family
 |  | 
|  |   |  | 
|  | 4The 80486 Processor Family
 |  | 
|  |   |  | 
|  | 5The Pentium Processor Family <br />
 |  | 
|  |   |  | 
|  | [[[00807.htm|prev]]][[[00809.htm|next]]][[[00807.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Encoding Column ===
 |  | 
|  |   |  | 
|  | The "Encoding" column gives the complete object code produced for each form of the instruction. When possible, the codes are given as hexadecimal bytes , in the same order in which they appear in memory. Definitions of entries other than hexadecimal bytes are as follows:
 |  | 
|  |   |  | 
|  | �'''/digit:'''(digit is between 0 and 7) indicates that the ModR/M byte of the instruction uses only the r/m (register or memory) operand. The '''reg'''field contains the digit that provides an extension to the instruction's opcode.
 |  | 
|  |   |  | 
|  | �'''/r:'''indicates that the ModR/M byte of the instruction contains both a register operand and an r/m operand.
 |  | 
|  |   |  | 
|  | �'''cb, cw, cd, cp:'''a 1-byte (cb), 2-byte (cw), 4-byte (cd) or 6-byte (cp) value following the opcode that is used to specify a code offset and possibly a new value for the code segment register.
 |  | 
|  |   |  | 
|  | �'''ib, iw, id:'''a 1-byte (ib), 2-byte (iw), or 4-byte (id) immediate operand to the instruction that follows the opcode, ModR/M bytes or scale-indexing bytes. The opcode determines if the operand is a signed value. All words and doublewords are given with the low-order byte first.
 |  | 
|  |   |  | 
|  | �'''+rb, +rw, +rd:'''a register code, from 0 through 7, added to the hexadecimal byte given at the left of the plus sign to form a single opcode byte. The codes are-
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/--------------------------------------------------------------\
 |  | 
|  | | rb                 | rw                 | rd                 |
 |  | 
|  | |--------------------+--------------------+--------------------|
 |  | 
|  | |AL   =  0           |AX   =  0           |EAX  =  0           |
 |  | 
|  | |--------------------+--------------------+--------------------|
 |  | 
|  | |CL   =  1           |CX   =  1           |ECX  =  1           |
 |  | 
|  | |--------------------+--------------------+--------------------|
 |  | 
|  | |DL   =  2           |DX   =  2           |EDX  =  2           |
 |  | 
|  | |--------------------+--------------------+--------------------|
 |  | 
|  | |BL   =  3           |BX   =  3           |EBX  =  3           |
 |  | 
|  | |--------------------+--------------------+--------------------|
 |  | 
|  | |AH   =  4           |SP   =  4           |ESP  =  4           |
 |  | 
|  | |--------------------+--------------------+--------------------|
 |  | 
|  | |CH   =  5           |BP   =  5           |EBP  =  5           |
 |  | 
|  | |--------------------+--------------------+--------------------|
 |  | 
|  | |DH   =  6           |SI   =  6           |ESI  =  6           |
 |  | 
|  | |--------------------+--------------------+--------------------|
 |  | 
|  | |BH   =  7           |DI   =  7           |EDI  =  7           |
 |  | 
|  | \--------------------------------------------------------------/</pre>
 |  | 
|  | �'''+i:'''used in floating-point instructions when one of the operands is ST(i) from the FPU register stack. The number i (which can range from 0 to 7) is added to the hexadecimal byte given at the left of the plus sign to form a single opcode byte. <br />
 |  | 
|  |   |  | 
|  | [[[00808.htm|prev]]][[[00810.htm|next]]][[[00807.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Column ===
 |  | 
|  |   |  | 
|  | The "Instruction" column gives the syntax of the instruction statement as it would appear in an assembler program. The following is a list of the symbols used to represent operands in the instruction statements:
 |  | 
|  |   |  | 
|  | [[[00809.htm|prev]]][[[00811.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === rel8 ===
 |  | 
|  |   |  | 
|  | A relative address in the range from 128 bytes before the end of the instruction to 127 bytes after the end of the instruction.
 |  | 
|  |   |  | 
|  | [[[00810.htm|prev]]][[[00812.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === rel16 ===
 |  | 
|  |   |  | 
|  | A relative address in the range from 32768 bytes before the end of the instruction to 32767 bytes after the end of the instruction. Applies to instructions with an operand-size attribute of 16 bits, and must be within the same code segment as the instruction assembled.
 |  | 
|  |   |  | 
|  | [[[00811.htm|prev]]][[[00813.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === rel32 ===
 |  | 
|  |   |  | 
|  | A relative address in the range from 2147483648 bytes before the end of the instruction to 2147483647 bytes after the end of the instruction. Applies to instructions with an operand-size attribute of 32 bits, and must be within the same code segment as the instruction assembled.
 |  | 
|  |   |  | 
|  | [[[00812.htm|prev]]][[[00814.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ptr16:16 ===
 |  | 
|  |   |  | 
|  | A far pointer, typically in a code segment different from that of the instruction. The notation '''16:16'''indicates that the value of the pointer has two parts. The value to the left of the colon is a 16-bit selector or value destined for the code segment register. The value to the right reflects the operand-size attribute of the instruction (16 bits) and corresponds to the offset within the destination segment.
 |  | 
|  |   |  | 
|  | [[[00813.htm|prev]]][[[00815.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ptr16:32 ===
 |  | 
|  |   |  | 
|  | A far pointer, typically in a code segment different from that of the instruction. The notation '''16:32'''indicates that the value of the pointer has two parts. The value to the left of the colon is a 16-bit selector or value destined for the code segment register. The value to the right reflects the operand-size attribute of the instruction (32 bits) and corresponds to the offset within the destination segment.
 |  | 
|  |   |  | 
|  | [[[00814.htm|prev]]][[[00816.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === r8 ===
 |  | 
|  |   |  | 
|  | One of the byte registers AL, CL, DL, BL, AH, CH, DH, or BH.
 |  | 
|  |   |  | 
|  | [[[00815.htm|prev]]][[[00817.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === r16 ===
 |  | 
|  |   |  | 
|  | One of the word registers AX, CX, DX, BX, SP, BP, SI, or DI.
 |  | 
|  |   |  | 
|  | [[[00816.htm|prev]]][[[00818.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === r32 ===
 |  | 
|  |   |  | 
|  | One of the doubleword registers EAX, ECX, EDX, EBX, ESP, EBP, ESI, or EDI.
 |  | 
|  |   |  | 
|  | [[[00817.htm|prev]]][[[00819.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === imm8 ===
 |  | 
|  |   |  | 
|  | An immediate byte value. '''imm8'''is a signed number between -128 and +127 inclusive. For instructions in which '''imm8'''is combined with a word or doubleword operand, the immediate value is sign-extended to form a word or doubleword. The upper byte of the word is filled with the topmost bit of the immediate value.
 |  | 
|  |   |  | 
|  | [[[00818.htm|prev]]][[[00820.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === imm16 ===
 |  | 
|  |   |  | 
|  | An immediate word value used for instructions whose operand-size attribute is 16 bits. This is a number between -32768 and +32767 inclusive.
 |  | 
|  |   |  | 
|  | [[[00819.htm|prev]]][[[00821.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === imm32 ===
 |  | 
|  |   |  | 
|  | An immediate doubleword value used for instructions whose operand-size attribute is 32-bits. It allows the use of a number between +2147483647 and -2147483648 inclusive.
 |  | 
|  |   |  | 
|  | [[[00820.htm|prev]]][[[00822.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === r/m8 ===
 |  | 
|  |   |  | 
|  | A one-byte operand that is either the contents of a byte register (AL, BL, CL, DL, AH, BH, CH, DH), or a byte from memory.
 |  | 
|  |   |  | 
|  | [[[00821.htm|prev]]][[[00823.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === r/m16 ===
 |  | 
|  |   |  | 
|  | A word register or memory operand used for instructions whose operand-size attribute is 16 bits. The word registers are: AX, BX, CX, DX, SP, BP, SI, DI. The contents of memory are found at the address provided by the effective address computation.
 |  | 
|  |   |  | 
|  | [[[00822.htm|prev]]][[[00824.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === r/m32 ===
 |  | 
|  |   |  | 
|  | A doubleword register or memory operand used for instructions whose operand-size attribute is 32-bits. The doubleword registers are: EAX, EBX, ECX, EDX, ESP, EBP, ESI, EDI. The contents of memory are found at the address provided by the effective address computation.
 |  | 
|  |   |  | 
|  | [[[00823.htm|prev]]][[[00825.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === r/m64 ===
 |  | 
|  |   |  | 
|  | A quadword register or memory operand used for instructions whose operand- size attribute is 64-bits. The reg/opcode field represents the opcode. The contents of memory are found at the address provided by the effective address computation.
 |  | 
|  |   |  | 
|  | [[[00824.htm|prev]]][[[00826.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m ===
 |  | 
|  |   |  | 
|  | A 16 or 32-bit memory operand.
 |  | 
|  |   |  | 
|  | [[[00825.htm|prev]]][[[00827.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m8 ===
 |  | 
|  |   |  | 
|  | A memory byte addressed by DS:[E]SI or ES:[E]DI (used only by string instructions).
 |  | 
|  |   |  | 
|  | [[[00826.htm|prev]]][[[00828.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m16 ===
 |  | 
|  |   |  | 
|  | A memory word addressed by DS:[E]SI or ES:[E]DI (used only by string instructions).
 |  | 
|  |   |  | 
|  | [[[00827.htm|prev]]][[[00829.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m32 ===
 |  | 
|  |   |  | 
|  | A memory doubleword addressed by DS:[E]SI or ES:[E]DI (used only by string instructions).
 |  | 
|  |   |  | 
|  | [[[00828.htm|prev]]][[[00830.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m16:16 ===
 |  | 
|  |   |  | 
|  | A memory operand containing a far pointer composed of two numbers. The number to the left of the colon corresponds to the pointer's segment selector. The number to the right corresponds to its offset.
 |  | 
|  |   |  | 
|  | [[[00829.htm|prev]]][[[00831.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m16:32 ===
 |  | 
|  |   |  | 
|  | A memory operand containing a far pointer composed of two numbers. The number to the left of the colon corresponds to the pointer's segment selector. The number to the right corresponds to its offset.
 |  | 
|  |   |  | 
|  | [[[00830.htm|prev]]][[[00832.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m16&16 ===
 |  | 
|  |   |  | 
|  | A memory operand consisting of data item pairs whose sizes are indicated on the left and the right side of the ampersand. All memory addressing modes are allowed. Used by the BOUND instruction to provide an operand containing an upper and lower bounds for array indices.
 |  | 
|  |   |  | 
|  | [[[00831.htm|prev]]][[[00833.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m16&32 ===
 |  | 
|  |   |  | 
|  | A memory operand consisting of data item pairs whose sizes are indicated on the left and the right side of the ampersand. All memory addressing modes are allowed. Used by the by LIDT and LGDT to provide a word with which to load the limit field, and a doubleword with which to load the base field of the corresponding Global and Interrupt Descriptor Table Registers.
 |  | 
|  |   |  | 
|  | [[[00832.htm|prev]]][[[00834.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m32&32 ===
 |  | 
|  |   |  | 
|  | A memory operand consisting of data item pairs whose sizes are indicated on the left and the right side of the ampersand. All memory addressing modes are allowed. Used by the BOUND instruction to provide an operand containing an upper and lower bounds for array indices.
 |  | 
|  |   |  | 
|  | [[[00833.htm|prev]]][[[00835.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === moffs8 ===
 |  | 
|  |   |  | 
|  | The memory offset of a BYTE variable used in some variants of the MOV instruction. The actual address is given by a simple offset relative to the segment base. No ModR/M byte is used in the instruction. The address- size attribute of the instruction determines the size of the offset data.
 |  | 
|  |   |  | 
|  | [[[00834.htm|prev]]][[[00836.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === moffs16 ===
 |  | 
|  |   |  | 
|  | The memory offset of a WORD variable used in some variants of the MOV instruction. The actual address is given by a simple offset relative to the segment base. No ModR/M byte is used in the instruction. The address- size attribute of the instruction determines the size of the offset data.
 |  | 
|  |   |  | 
|  | [[[00835.htm|prev]]][[[00837.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === moffs32 ===
 |  | 
|  |   |  | 
|  | The memory offset of a DWORD variable used in some variants of the MOV instruction. The actual address is given by a simple offset relative to the segment base. No ModR/M byte is used in the instruction. The address- size attribute of the instruction determines the size of the offset data.
 |  | 
|  |   |  | 
|  | [[[00836.htm|prev]]][[[00838.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Sreg ===
 |  | 
|  |   |  | 
|  | A segment register. The segment register bit assignments are ES=0, CS=1, SS=2, DS=3, FS=4, and GS=5.
 |  | 
|  |   |  | 
|  | [[[00837.htm|prev]]][[[00839.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m32real ===
 |  | 
|  |   |  | 
|  | A single-precision floating-point operand in memory.
 |  | 
|  |   |  | 
|  | [[[00838.htm|prev]]][[[00840.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m64real ===
 |  | 
|  |   |  | 
|  | A double-precision floating-point operand in memory.
 |  | 
|  |   |  | 
|  | [[[00839.htm|prev]]][[[00841.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m80real ===
 |  | 
|  |   |  | 
|  | An extended-precision floating-point operand in memory.
 |  | 
|  |   |  | 
|  | [[[00840.htm|prev]]][[[00842.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m80bcd ===
 |  | 
|  |   |  | 
|  | A 80 byte binary-coded decimal operand in memory.
 |  | 
|  |   |  | 
|  | [[[00841.htm|prev]]][[[00843.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m16int ===
 |  | 
|  |   |  | 
|  | A word integer operand in memory. Used in some floating-point instructions.
 |  | 
|  |   |  | 
|  | [[[00842.htm|prev]]][[[00844.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m32int ===
 |  | 
|  |   |  | 
|  | A short integer operand in memory. Used in some floating-point instructions.
 |  | 
|  |   |  | 
|  | [[[00843.htm|prev]]][[[00845.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m64int ===
 |  | 
|  |   |  | 
|  | A long integer operand in memory. Used in some floating-point instructions.
 |  | 
|  |   |  | 
|  | [[[00844.htm|prev]]][[[00846.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m14byte ===
 |  | 
|  |   |  | 
|  | A 14-byte floating-point operand in memory.
 |  | 
|  |   |  | 
|  | [[[00845.htm|prev]]][[[00847.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m28byte ===
 |  | 
|  |   |  | 
|  | A 28-byte floating-point operand in memory.
 |  | 
|  |   |  | 
|  | [[[00846.htm|prev]]][[[00848.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m94byte ===
 |  | 
|  |   |  | 
|  | A 94-byte floating-point operand in memory.
 |  | 
|  |   |  | 
|  | [[[00847.htm|prev]]][[[00849.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === m108byte ===
 |  | 
|  |   |  | 
|  | A 108-byte floating-point operand in memory.
 |  | 
|  |   |  | 
|  | [[[00848.htm|prev]]][[[00850.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ST or ST(0) ===
 |  | 
|  |   |  | 
|  | Top element of the FPU register stack.
 |  | 
|  |   |  | 
|  | [[[00849.htm|prev]]][[[00851.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ST(i) ===
 |  | 
|  |   |  | 
|  | ith element from the top of the FPU register stack. (i=0..7)
 |  | 
|  |   |  | 
|  | [[[00850.htm|prev]]][[[00852.htm|next]]][[[00807.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Clocks Columns ===
 |  | 
|  |   |  | 
|  | Each "Clocks" column gives the approximate number of clock cycles the instruction takes to execute on that particular processor. The clock count calculations makes the following assumptions:
 |  | 
|  |   |  | 
|  | �Data and instruction accesses hit in the cache.
 |  | 
|  |   |  | 
|  | �The target of a jump instruction is in the cache.
 |  | 
|  |   |  | 
|  | �No invalidate cycles contend with the instruction for use of the cache.
 |  | 
|  |   |  | 
|  | �Page translation hits in the TLB.
 |  | 
|  |   |  | 
|  | �Memory operands are aligned.
 |  | 
|  |   |  | 
|  | �Effective address calculations use a base register which is not the destination register of the preceding instruction.
 |  | 
|  |   |  | 
|  | �No exceptions are detected during execution.
 |  | 
|  |   |  | 
|  | �There are no write-buffer delays. <br />
 |  | 
|  |   |  | 
|  | The following symbols are used in the clock count specifications:
 |  | 
|  |   |  | 
|  | �'''n,'''which represents a number of repetitions.
 |  | 
|  |   |  | 
|  | �'''m,'''which represents the number of components in the next instruction executed, where the entire displacement (if any) counts as one component, the entire immediate data (if any) counts as one component, and every other byte of the instruction and prefix(es) each counts as one component.
 |  | 
|  |   |  | 
|  | �'''pm:,'''a clock count that applies when the instruction executes in Protected Mode. '''pm:'''is not given when the clock counts are the same for Protected and Real Address Modes. <br />
 |  | 
|  |   |  | 
|  | When an exception occurs during the execution of an instruction and the exception handler is in another task, the instruction execution time is increased by the number of clocks to effect a task switch. This parameter depends on several factors:
 |  | 
|  |   |  | 
|  | �The type of TSS used to represent the new task (32 bit TSS or 16 bit TSS).
 |  | 
|  |   |  | 
|  | �Whether the current task is in V86 mode.
 |  | 
|  |   |  | 
|  | �Whether the new task is in V86 mode.
 |  | 
|  |   |  | 
|  | �Whether accesses hit in the cache.
 |  | 
|  |   |  | 
|  | �Whether a task gate on an interrupt/trap gate is used. <br />
 |  | 
|  |   |  | 
|  | The following table summarizes the task switch times for exceptions, assuming cache hits and the use of task gates.
 |  | 
|  |   |  | 
|  | '''Task Switch Times for Exceptions'''<br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |            OLD TASK           |                   NEW TASK                   | 
 |  | 
|  | |                               |----------------------------------------------|
 |  | 
|  | |                               | TO 32 BIT TSS | TO 16 BIT TSS |   TO VM TSS  |
 |  | 
|  | |-------------------------------+---------------+---------------+--------------|
 |  | 
|  | |      VM/32 bit/16 bit TSS     |       85      |       87      |      71      |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[00851.htm|prev]]][[[00853.htm|next]]][[[00807.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description Column ===
 |  | 
|  |   |  | 
|  | The "Description" column following the "Clocks" columns briefly explains the various forms of the instruction. The "Operation" and "Description" sections contain more details of the instruction's operation.
 |  | 
|  |   |  | 
|  | [[[00852.htm|prev]]][[[00854.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The "Description" section contains further explanation of the instruction's operation.
 |  | 
|  |   |  | 
|  | [[[00853.htm|prev]]][[[00855.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | The "Operation" section contains an algorithmic description of the instruction which uses a notation similar to the Algol or Pascal language. The algorithms are composed of the following elements:
 |  | 
|  |   |  | 
|  | �Comments are enclosed within the symbol pairs "(*" and "*)".
 |  | 
|  |   |  | 
|  | �Compound statements are enclosed between the keywords of the "if" statement (IF, THEN, ELSE, FI) or of the "do" statement (DO, OD), or of the "case" statement (CASE ... OF, ESAC).
 |  | 
|  |   |  | 
|  | �Execution continues until the END statement is encountered.
 |  | 
|  |   |  | 
|  | �A register name implies the contents of the register. A register name enclosed in brackets implies the contents of the location whose address is contained in that register. For example, ES:[DI] indicates the contents of the location whose ES segment relative address is in register DI. [SI] indicates the contents of the address contained in register SI relative to SI's default segment (DS) or overridden segment.
 |  | 
|  |   |  | 
|  | �Brackets are also used for memory operands, where they mean that the contents of the memory location is a segment-relative offset. For example, [SRC] indicates that the contents of the source operand is a segment- relative offset.
 |  | 
|  |   |  | 
|  | �A � B; indicates that the value of B is assigned to A.
 |  | 
|  |   |  | 
|  | �The symbols =, <>, ò, and ó are relational operators used to compare two values, meaning equal, not equal, greater or equal, less or equal, respectively. A relational expression such as A = B is TRUE if the value of A is equal to B; otherwise it is FALSE.
 |  | 
|  |   |  | 
|  | �A * B indicates that the value of A is multiplied by the value of B. <br />
 |  | 
|  |   |  | 
|  | The following identifiers are used in the algorithmic descriptions:
 |  | 
|  |   |  | 
|  | �'''OperandSize'''represents the operand-size attribute of the instruction, which is either 16 or 32 bits. '''AddressSize'''represents the address-size attribute, which is either 16 or 32 bits. For example,
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF instruction = CMPSW 
 |  | 
|  | THEN OperandSize � 16;
 |  | 
|  | ELSE 
 |  | 
|  |   IF instruction = CMPSD 
 |  | 
|  |   THEN OperandSize � 32;
 |  | 
|  |   FI;
 |  | 
|  | FI;</pre>
 |  | 
|  | indicates that the operand-size attribute depends on the form of the CMPS instruction used. Refer to the explanation of address-size and operand-size attributes at the beginning of this chapter for general guidelines on how these attributes are determined.
 |  | 
|  |   |  | 
|  | �'''StackAddrSize'''represents the stack address-size attribute associated with the instruction, which has a value of 16 or 32 bits, as explained earlier in the chapter.
 |  | 
|  |   |  | 
|  | �'''SRC'''represents the source operand. When there are two operands, SRC is the one on the right.
 |  | 
|  |   |  | 
|  | �'''DEST'''represents the destination operand. When there are two operands, DEST is the one on the left.
 |  | 
|  |   |  | 
|  | �'''LeftSRC, RightSRC'''distinguishes between two operands when both are source operands.
 |  | 
|  |   |  | 
|  | �'''eSP'''represents either the SP register or the ESP register depending on the setting of the B-bit for the current stack segment. <br />
 |  | 
|  |   |  | 
|  | The following functions are used in the algorithmic descriptions:
 |  | 
|  |   |  | 
|  | �'''Truncate to 16 bits(value)'''reduces the size of the value to fit in 16 bits by discarding the uppermost bits as needed.
 |  | 
|  |   |  | 
|  | �'''Addr(operand)'''returns the effective address of the operand (the result of the effective address calculation prior to adding the segment base).
 |  | 
|  |   |  | 
|  | �'''ZeroExtend(value)'''returns a value zero-extended to the operand-size attribute of the instruction. For example, if OperandSize = 32, ZeroExtend of a byte value of -10 converts the byte from F6H to doubleword with hexadecimal value 000000F6H. If the value passed to ZeroExtend and the operand-size attribute are the same size, ZeroExtend returns the value unaltered.
 |  | 
|  |   |  | 
|  | �'''SignExtend(value)'''returns a value sign-extended to the operand-size attribute of the instruction. For example, if OperandSize = 32, SignExtend of a byte containing the value -10 converts the byte from F6H to a doubleword with hexadecimal value FFFFFFF6H. If the value passed to SignExtend and the operand-size attribute are the same size, SignExtend returns the value unaltered.
 |  | 
|  |   |  | 
|  | �'''Push(value)'''pushes a value onto the stack. The number of bytes pushed is determined by the operand-size attribute of the instruction. The action of Push is as follows: <br />
 |  | 
|  |   |  | 
|  | <pre>IF StackAddrSize = 16 
 |  | 
|  | THEN 
 |  | 
|  |    IF OperandSize = 16 
 |  | 
|  |    THEN
 |  | 
|  |       SP � SP -2;
 |  | 
|  |       SS:[SP] � value; (* 2 bytes assigned starting at byte address in SP *)
 |  | 
|  |    ELSE (* OperandSize = 32 *)
 |  | 
|  |       SP � SP -4;
 |  | 
|  |       SS:[SP] � value; (* 4 bytes assigned starting at byte address in SP *)
 |  | 
|  |    FI;
 |  | 
|  | ELSE (* StackAddrSize = 32 *)
 |  | 
|  |    IF OperandSize = 16 
 |  | 
|  |    THEN
 |  | 
|  |    ESP � ESP -2;
 |  | 
|  |       SS:[ESP] � value; (* 2 bytes assigned starting at byte address in ESP*)
 |  | 
|  |    ELSE (* OperandSize = 32 *)
 |  | 
|  |       ESP � ESP -4;
 |  | 
|  |       SS:[ESP] � value; (* 4 bytes assigned starting at byte address in ESP*)
 |  | 
|  |    FI;
 |  | 
|  | FI;</pre>
 |  | 
|  | �'''Pop(value)'''removes the value from the top of the stack and returns it. The statement EAX � Pop( ); assigns to EAX the 32-bit value that Pop took from the top of the stack. Pop will return either a word or a doubleword depending on the operand-size attribute. The action of Pop is as follows: <br />
 |  | 
|  |   |  | 
|  | <pre>IF StackAddrSize = 16 
 |  | 
|  | THEN 
 |  | 
|  |    IF OperandSize = 16 
 |  | 
|  |    THEN
 |  | 
|  |       ret val � SS:[SP]; (* 2-byte value *)
 |  | 
|  |       SP � SP + 2;
 |  | 
|  |    ELSE (* OperandSize = 32 *)
 |  | 
|  |       ret val � SS:[SP]; (* 4-byte value *)
 |  | 
|  |       SP � SP + 4;
 |  | 
|  |    FI;
 |  | 
|  | ELSE (* StackAddrSize = 32 *)
 |  | 
|  |    IF OperandSize = 16 
 |  | 
|  |    THEN
 |  | 
|  |       ret val � SS:[ESP]; (* 2 byte value *)
 |  | 
|  |       ESP � ESP + 2;
 |  | 
|  |    ELSE (* OperandSize = 32 *)
 |  | 
|  |       ret val � SS:[ESP]; (* 4 byte value *)
 |  | 
|  |       ESP � ESP + 4;
 |  | 
|  |    FI;
 |  | 
|  | FI;
 |  | 
|  | RETURN(ret val); (*returns a word or doubleword*)</pre>
 |  | 
|  | Pop ST is used on floating-point instruction pages to mean ''pop the FPU register stack''.
 |  | 
|  |   |  | 
|  | �'''Bit[BitBase, BitOffset]'''returns the value of a bit within a bit string, which is a sequence of bits in memory or a register. Bits are numbered from low-order to high-order within registers and within memory bytes. In memory , the two bytes of a word are stored with the low-order byte at the lower address.
 |  | 
|  |   |  | 
|  | If the base operand is a register, the offset can be in the range 0..31. This offset addresses a bit within the indicated register. An example, 'BIT [EAX, 21]' is illustrated in the following figure. <br />
 |  | 
|  |   |  | 
|  | <pre>Bit Offset for BIT[EAX,21]
 |  | 
|  |   |  | 
|  | /------------------------------------------------------\
 |  | 
|  | |     31            21                            0    |
 |  | 
|  | |   /----------------------------------------------\   |
 |  | 
|  | |   \----------------------------------------------/   |
 |  | 
|  | |                    �                             �   |
 |  | 
|  | |                    |                             |   |
 |  | 
|  | |                    \--------BITOFFSET=21---------/   |
 |  | 
|  | |                                                      |
 |  | 
|  | \------------------------------------------------------/</pre>
 |  | 
|  | If BitBase is a memory address, BitOffset can range from -2 gigabits to 2 gigabits. The addressed bit is numbered (Offset MOD 8) within the byte at address (BitBase + (BitOffset DIV 8)), where DIV is signed division with rounding towards negative infinity, and MOD returns a positive number. This is illustrated in the following figure. <br />
 |  | 
|  |   |  | 
|  | <pre>Memory Bit Indexing 
 |  | 
|  |   |  | 
|  | /------------------------------------------------------\
 |  | 
|  | |   7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0    |
 |  | 
|  | |   /----------------------------------------------\   |
 |  | 
|  | |   \----------------------------------------------/   |
 |  | 
|  | |   |  BITBASE+1   |    BITBASE     |   BITBASE-1  |   |
 |  | 
|  | |       �                           |                  |
 |  | 
|  | |       \------OFFSET=+13-----------/                  |
 |  | 
|  | |                                                      |
 |  | 
|  | |                                                      |
 |  | 
|  | |   7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0    |
 |  | 
|  | |   /----------------------------------------------\   |
 |  | 
|  | |   \----------------------------------------------/   |
 |  | 
|  | |   |  BITBASE     |   BITBASE-1    |   BITBASE-2  |   |
 |  | 
|  | |                  |                      �            |
 |  | 
|  | |                  \-----OFFSET=-11-------/            |
 |  | 
|  | |                                                      |
 |  | 
|  | \------------------------------------------------------/</pre>
 |  | 
|  | �'''I-O-Permission(I-O-Address, width)'''returns TRUE or FALSE depending on the I/O permission bitmap and other factors. This function is defined as follows: <br />
 |  | 
|  |   |  | 
|  | <pre>IF TSS type is 16-bit THEN RETURN FALSE; FI;
 |  | 
|  | Ptr� [TSS+66]; (* fetch bitmap pointer *)
 |  | 
|  | BitStringAddr � SHR (I-O-Address, 3) + Ptr;
 |  | 
|  | MaskShift � I-O-Address AND 7;
 |  | 
|  | CASE width OF:
 |  | 
|  |   BYTE: nBitMask � 1;
 |  | 
|  |   WORD: nBitMask � 3;
 |  | 
|  |   DWORD: nBitMask � 15;
 |  | 
|  | ESAC;
 |  | 
|  | mask � SHL (nBitMask, MaskShift);
 |  | 
|  | CheckString � [BitStringAddr] AND mask;
 |  | 
|  | IF CheckString = 0 
 |  | 
|  | THEN RETURN (TRUE);
 |  | 
|  | ELSE RETURN (FALSE);
 |  | 
|  | FI;</pre>
 |  | 
|  | �'''Switch-Tasks'''is described in detail in the Intel documentation. <br />
 |  | 
|  |   |  | 
|  | [[[00854.htm|prev]]][[[00856.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | Pages describing basic instructions have a "Flags Affected" section the contains a flags information table similar to the following: <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |0 |  |  |* |* |? |* |0 |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The first row of the table lists the mnemonic identifiers for the various flags. The entries in the second row are filled in according to how the flag is affected by the instruction: <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------------------------\
 |  | 
|  | |VALUE   |MEANING                         |
 |  | 
|  | |--------+--------------------------------|
 |  | 
|  | |<blank> |Instruction does not affect flag|
 |  | 
|  | |--------+--------------------------------|
 |  | 
|  | |0       |Instruction clears the flag     |
 |  | 
|  | |--------+--------------------------------|
 |  | 
|  | |1       |Instruction sets the flag       |
 |  | 
|  | |--------+--------------------------------|
 |  | 
|  | |?       |Instruction's effect on the flag|
 |  | 
|  | |        |is undefined                    |
 |  | 
|  | |--------+--------------------------------|
 |  | 
|  | |*       |Instruction modifies the flag   |
 |  | 
|  | |        |(either sets or clears depending|
 |  | 
|  | |        |on operands)                    |
 |  | 
|  | \-----------------------------------------/</pre>
 |  | 
|  | The following table lists the mnemonic identifier, full name, and purpose of the flags that are applicable to all processor families and that are are most commonly used from within application-level programs. Not all flags are included in this table; see the Intel documentation for a more complete description of flag usage from within systems-level programs. <br />
 |  | 
|  |   |  | 
|  | <pre>/--------------------------------------------------------------------------------\
 |  | 
|  | |MNEMONIC|FLAG NAME       |PURPOSE                                               |
 |  | 
|  | |--------+----------------+------------------------------------------------------|
 |  | 
|  | |OF      |Overflow        |Result exceeds positive or negative limit of number   |
 |  | 
|  | |        |                |range                                                 |
 |  | 
|  | |--------+----------------+------------------------------------------------------|
 |  | 
|  | |DF      |Direction       |Setting the DF flag causes string instructions to     |
 |  | 
|  | |        |                |auto-decrement, that is, to process strings from high |
 |  | 
|  | |        |                |addresses.  Clearing the DF flag causes string        |
 |  | 
|  | |        |                |instructions to auto-increment, or to process strings |
 |  | 
|  | |        |                |from low addresses to high addresses.                 |
 |  | 
|  | |--------+----------------+------------------------------------------------------|
 |  | 
|  | |IF      |Interrupt Enable|Controls the acceptance of external interrupts        |
 |  | 
|  | |        |                |signalled via the INTR pin.                           |
 |  | 
|  | |--------+----------------+------------------------------------------------------|
 |  | 
|  | |SF      |Sign            |Result is negative (less than zero)                   |
 |  | 
|  | |--------+----------------+------------------------------------------------------|
 |  | 
|  | |ZF      |Zero            |Result is zero                                        |
 |  | 
|  | |--------+----------------+------------------------------------------------------|
 |  | 
|  | |AF      |Auxiliary carry |Carry out of bit position 3 (used for BCD)            |
 |  | 
|  | |--------+----------------+------------------------------------------------------|
 |  | 
|  | |PF      |Parity          |Low byte of result has even parity (even number of set|
 |  | 
|  | |        |                |bits)                                                 |
 |  | 
|  | |--------+----------------+------------------------------------------------------|
 |  | 
|  | |CF      |Carry           |Carry out of most significant bit of result           |
 |  | 
|  | \--------------------------------------------------------------------------------/</pre>
 |  | 
|  | The flags information table is usually followed by a paragraph description of how the flags are affected:
 |  | 
|  |   |  | 
|  | �If a flag is always cleared or always set by the instruction, the value is given (0 or 1) after the flag name. Arithmetic and logical instructions usually assign values to the status flags in a uniform manner. Nonconventional assignments are described in the [[00854.htm|Operation]]section.
 |  | 
|  |   |  | 
|  | �The values of flags listed as "undefined" may be changed by the instruction in an indeterminate manner. <br />
 |  | 
|  |   |  | 
|  | All flags not listed are unchanged by the instruction.
 |  | 
|  |   |  | 
|  | [[[00855.htm|prev]]][[[00857.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === FPU Flags Affected ===
 |  | 
|  |   |  | 
|  | The floating-point instruction pages have a section called "FPU Flags Affected," which tells how each instruction can affect the four condition code bits of the FPU status word. These pages contain a condition code information table similar to the following: <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------\
 |  | 
|  | |C0|C1|C2|C3|
 |  | 
|  | |--+--+--+--|
 |  | 
|  | |? |* |? |? |
 |  | 
|  | \-----------/</pre>
 |  | 
|  | The first row of the table lists the names of the floating-point condition code flags. The entries in the second row are filled in according to how the flag is affected by the instruction: <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------------------------\
 |  | 
|  | |VALUE   |MEANING                         |
 |  | 
|  | |--------+--------------------------------|
 |  | 
|  | |<blank> |Instruction does not affect flag|
 |  | 
|  | |--------+--------------------------------|
 |  | 
|  | |0       |Instruction clears the flag     |
 |  | 
|  | |--------+--------------------------------|
 |  | 
|  | |1       |Instruction sets the flag       |
 |  | 
|  | |--------+--------------------------------|
 |  | 
|  | |?       |Instruction's effect on the flag|
 |  | 
|  | |        |is undefined                    |
 |  | 
|  | |--------+--------------------------------|
 |  | 
|  | |*       |Instruction modifies the flag   |
 |  | 
|  | |        |(either sets or clears depending|
 |  | 
|  | |        |on operands)                    |
 |  | 
|  | \-----------------------------------------/</pre>
 |  | 
|  | The four FPU condition code bits (C0, C1, C2, and C3) are similar to the flags in a CPU; the processor updates these bits to reflect the outcome of arithmetic operations. The effect of these instructions on the condition code bits is summarized in the following table:
 |  | 
|  |   |  | 
|  | '''Condition Code Interpretation'''<br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | | INSTRUCTION             |      C0     |     C3     |     C2     |     C1     | 
 |  | 
|  | |-------------------------+--------------------------+------------+------------|
 |  | 
|  | | FCOM, FCOMP, FCOMPP,    |   Result of Comparison   | Operands   | Zero or    |
 |  | 
|  | | FTST, FUCOMPP, FICOM,   |                          | is not     | O/U#       | 
 |  | 
|  | | FICOMP                  |                          | Comparable |            |
 |  | 
|  | |-------------------------+---------------------------------------+------------|
 |  | 
|  | | FXAM                    |             Operand class             | Sign or    |
 |  | 
|  | |                         |                                       | O/U#       | 
 |  | 
|  | |-------------------------+---------------------------------------+------------|
 |  | 
|  | | FPREM, FPREM1           |      Q2     |     Q1     | 0=reduction| Q0 or O/U# | 
 |  | 
|  | |                         |             |            |  complete  |            |
 |  | 
|  | |                         |             |            |            |            |
 |  | 
|  | |                         |             |            | 1=reduction|            |
 |  | 
|  | |                         |             |            | incomplete |            |
 |  | 
|  | |-------------------------+---------------------------------------+------------|
 |  | 
|  | | FIST, FBSTP, FRINDINT,  |               UNDEFINED               | Roundup or | 
 |  | 
|  | | FST, FSTP, FADD, FMUL,  |                                       | O/U#       | 
 |  | 
|  | | FDIV, FDIVR, FSUB,      |                                       |            |
 |  | 
|  | | FSUBR, FSCALE, FSQRT,   |                                       |            |
 |  | 
|  | | FPATAN, F2XM1, FYL2X,   |                                       |            |
 |  | 
|  | | FYL2XP1                 |                                       |            |
 |  | 
|  | |-------------------------+---------------------------------------+------------|
 |  | 
|  | | FPTAN, FSIN, FCOS,      |         UNDEFINED        | 0=reduction| Roundup or | 
 |  | 
|  | | FSINCOS                 |                          | complete   | O/U#       | 
 |  | 
|  | |                         |                          |            | (UNDEFINED | 
 |  | 
|  | |                         |                          | 1=reduction| if C2=1)   | 
 |  | 
|  | |                         |                          | incomplete |            |
 |  | 
|  | |-------------------------+---------------------------------------+------------|
 |  | 
|  | | FCHS, FABS, FXCH,       |               UNDEFINED               | Zero or    |
 |  | 
|  | | FINCSTP, FDECSTP, Con-  |                                       | O/U#       | 
 |  | 
|  | | stant Loads, FXTRACT,   |                                       |            |
 |  | 
|  | | FLD, FILD, FBLD, FSTP   |                                       |            |
 |  | 
|  | | (ext. real)             |                                       |            |
 |  | 
|  | |-------------------------+----------------------------------------------------|
 |  | 
|  | | FLDENV, FRSTOR          |             Each bit loaded from memory            |
 |  | 
|  | |-------------------------+----------------------------------------------------|
 |  | 
|  | | FLDCW, FSTENV, FSTCW,   |                      UNDEFINED                     | 
 |  | 
|  | | FSTSW, FCLEX            |                                                    |
 |  | 
|  | |-------------------------+----------------------------------------------------|
 |  | 
|  | | FINIT, FSAVE            |     Zero    |    Zero    |    Zero    |    Zero    |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | '''NOTES:'''
 |  | 
|  |   |  | 
|  | '''O/U#'''When both IE and SF bits of status word are set, this bit distinguishes between stack overflow (C1=1) and underflow (C1=0).
 |  | 
|  |   |  | 
|  | '''Reduction'''If FPREM and FPREM1 produces a remainder that is less than the modulus, reduction is complete. When reduction is incomplete the value at the top of the stack is a parial remainder, which can be used as input to further reduction. For FPTAN, FSIN, FCOS and FSINCOS, the reduction bit is set if the operand at the top of the stack is too large. In this case, the original operand remains at the top of the stack.
 |  | 
|  |   |  | 
|  | '''Roundup'''When the PE bit of the status word is set, this bit indicates whether the last rounding in the instruction was upward.
 |  | 
|  |   |  | 
|  | '''UNDEFINED'''Do not rely on any specific value in these bits. <br />
 |  | 
|  |   |  | 
|  | The condition code bits are used primarily for conditional branching. The FSTSW AX instruction stores the FPU status word directly into the AX register, allowing these condition codes to be inspected efficiently. The SAHF instruction can copy C3 - C0 directly to the CPU's flag bits to simplify conditional branching. The following table shows the mapping of these bits to the CPU flag bits. <br />
 |  | 
|  |   |  | 
|  | <pre>/-------------------------\
 |  | 
|  | |FPU FLAG    |IU FLAG     |
 |  | 
|  | |------------+------------|
 |  | 
|  | |C0          |CF          |
 |  | 
|  | |------------+------------|
 |  | 
|  | |C1          |(None)      |
 |  | 
|  | |------------+------------|
 |  | 
|  | |C2          |PF          |
 |  | 
|  | |------------+------------|
 |  | 
|  | |C3          |ZF          |
 |  | 
|  | \-------------------------/</pre>
 |  | 
|  | [[[00856.htm|prev]]][[[00858.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Numeric Exceptions ===
 |  | 
|  |   |  | 
|  | For floating-point instruction pages, this section lists the exception flags of the FPU status word that each instruction can set. Exceptions are listed in abbreviated form, and are defined as follows:
 |  | 
|  |   |  | 
|  | ISInvalid operand due to stack overflow/underflow
 |  | 
|  |   |  | 
|  | IInvalid operand due to other cause
 |  | 
|  |   |  | 
|  | DDenormalized operand
 |  | 
|  |   |  | 
|  | ZDivide by zero
 |  | 
|  |   |  | 
|  | ONumeric overflow
 |  | 
|  |   |  | 
|  | UNumeric underflow
 |  | 
|  |   |  | 
|  | PInexact result (precision) <br />
 |  | 
|  |   |  | 
|  | [[[00857.htm|prev]]][[[00859.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | This section lists the exceptions that can occur when the instruction is executed in protected mode. The exception names are a pound sign (#) followed by two letters and an optional error code in parentheses. For example, #GP(0) denotes a general protection exception with an error code of 0. The following table associates each two-letter name with the corresponding interrupt number.
 |  | 
|  |   |  | 
|  | '''Exceptions'''<br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |      MNEMONIC     |     INTERRUPT     |              DESCRIPTION             | 
 |  | 
|  | |-------------------+-------------------+--------------------------------------|
 |  | 
|  | |        #UD        |         6         | Invalid opcode                       | 
 |  | 
|  | |        #NM        |         7         | Device not available                 | 
 |  | 
|  | |        #DF        |         8         | Double fault                         | 
 |  | 
|  | |        #TS        |         10        | Invalid TSS                          |
 |  | 
|  | |        #NP        |         11        | Segment or gate not present          |
 |  | 
|  | |        #SS        |         12        | Stack fault                          |
 |  | 
|  | |        #GP        |         13        | General protection fault             | 
 |  | 
|  | |        #PF        |         14        | Page fault                           | 
 |  | 
|  | |        #MF        |         16        | Floating-point error                 | 
 |  | 
|  | |        #AC        |         17        | Alignment check                      |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | Refer to the Intel documentation for a description of the exceptions and the processor state upon entry to the exception.
 |  | 
|  |   |  | 
|  | Application programmers should consult the documentation provided with their operating systems to determine the actions taken when exceptions occur.
 |  | 
|  |   |  | 
|  | [[[00858.htm|prev]]][[[00860.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Because less error checking is performed by the processor in Real Address Mode, this mode has fewer exception conditions. Refer to the Intel documentation for further information on these exceptions.
 |  | 
|  |   |  | 
|  | [[[00859.htm|prev]]][[[00861.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual-8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Virtual 8086 tasks provide the ability to simulate Virtual 8086 machines. Virtual 8086 Mode exceptions are similar to those for the 8086 processor, but there are some differences. Refer to the Intel documentation for complete information on Virtual Mode exceptions.
 |  | 
|  |   |  | 
|  | [[[00860.htm|prev]]][[[00862.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | ì
 |  | 
|  |   |  | 
|  | [[[00861.htm|prev]]][[[00863.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (102-137)+EA
 |  | 
|  |   |  | 
|  | [[[00862.htm|prev]]][[[00864.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (103-139)+EA
 |  | 
|  |   |  | 
|  | [[[00863.htm|prev]]][[[00865.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (108-143)+EA
 |  | 
|  |   |  | 
|  | [[[00864.htm|prev]]][[[00866.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (109-144)+EA
 |  | 
|  |   |  | 
|  | [[[00865.htm|prev]]][[[00867.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (110-125)+EA
 |  | 
|  |   |  | 
|  | [[[00866.htm|prev]]][[[00868.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (12-18)+fw
 |  | 
|  |   |  | 
|  | [[[00867.htm|prev]]][[[00869.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (124-138)+EA
 |  | 
|  |   |  | 
|  | [[[00868.htm|prev]]][[[00870.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (130-144)+EA
 |  | 
|  |   |  | 
|  | [[[00869.htm|prev]]][[[00871.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (154-168)+EA
 |  | 
|  |   |  | 
|  | [[[00870.htm|prev]]][[[00872.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (197-207)+EA
 |  | 
|  |   |  | 
|  | [[[00871.htm|prev]]][[[00873.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (2-8)+fw
 |  | 
|  |   |  | 
|  | [[[00872.htm|prev]]][[[00874.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (215-225)+EA
 |  | 
|  |   |  | 
|  | [[[00873.htm|prev]]][[[00875.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (216-226)+EA
 |  | 
|  |   |  | 
|  | [[[00874.htm|prev]]][[[00876.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (220-230)+EA
 |  | 
|  |   |  | 
|  | [[[00875.htm|prev]]][[[00877.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (221-231)+EA
 |  | 
|  |   |  | 
|  | [[[00876.htm|prev]]][[[00878.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (224-238)+EA
 |  | 
|  |   |  | 
|  | [[[00877.htm|prev]]][[[00879.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (225-239)+EA
 |  | 
|  |   |  | 
|  | [[[00878.htm|prev]]][[[00880.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (230-243)+EA
 |  | 
|  |   |  | 
|  | [[[00879.htm|prev]]][[[00881.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (231-245)+EA
 |  | 
|  |   |  | 
|  | [[[00880.htm|prev]]][[[00882.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (290-310)+EA
 |  | 
|  |   |  | 
|  | [[[00881.htm|prev]]][[[00883.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (35-45)+EA
 |  | 
|  |   |  | 
|  | [[[00882.htm|prev]]][[[00884.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (38-56)+EA
 |  | 
|  |   |  | 
|  | [[[00883.htm|prev]]][[[00885.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (40-60)+EA
 |  | 
|  |   |  | 
|  | [[[00884.htm|prev]]][[[00886.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (46-54)+EA
 |  | 
|  |   |  | 
|  | [[[00885.htm|prev]]][[[00887.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (52-58)+EA
 |  | 
|  |   |  | 
|  | [[[00886.htm|prev]]][[[00888.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (52-60)+EA
 |  | 
|  |   |  | 
|  | [[[00887.htm|prev]]][[[00889.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (520-540)+EA
 |  | 
|  |   |  | 
|  | [[[00888.htm|prev]]][[[00890.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (53-65)+EA
 |  | 
|  |   |  | 
|  | [[[00889.htm|prev]]][[[00891.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (60-68)+EA
 |  | 
|  |   |  | 
|  | [[[00890.htm|prev]]][[[00892.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (60-70)+EA
 |  | 
|  |   |  | 
|  | [[[00891.htm|prev]]][[[00893.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (63-73)+EA
 |  | 
|  |   |  | 
|  | [[[00892.htm|prev]]][[[00894.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (65-75)+EA
 |  | 
|  |   |  | 
|  | [[[00893.htm|prev]]][[[00895.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (67-77)+EA
 |  | 
|  |   |  | 
|  | [[[00894.htm|prev]]][[[00896.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (7-14)+EA
 |  | 
|  |   |  | 
|  | [[[00895.htm|prev]]][[[00897.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (72-86)+EA
 |  | 
|  |   |  | 
|  | [[[00896.htm|prev]]][[[00898.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (74-88)+EA
 |  | 
|  |   |  | 
|  | [[[00897.htm|prev]]][[[00899.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (78-91)+EA
 |  | 
|  |   |  | 
|  | [[[00898.htm|prev]]][[[00900.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (80-90)+EA
 |  | 
|  |   |  | 
|  | [[[00899.htm|prev]]][[[00901.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (80-93)+EA
 |  | 
|  |   |  | 
|  | [[[00900.htm|prev]]][[[00902.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (82-92)+EA
 |  | 
|  |   |  | 
|  | [[[00901.htm|prev]]][[[00903.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (84-90)+EA
 |  | 
|  |   |  | 
|  | [[[00902.htm|prev]]][[[00904.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (84-94)+EA
 |  | 
|  |   |  | 
|  | [[[00903.htm|prev]]][[[00905.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (86-92)+EA
 |  | 
|  |   |  | 
|  | [[[00904.htm|prev]]][[[00906.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (90-120)+EA
 |  | 
|  |   |  | 
|  | [[[00905.htm|prev]]][[[00907.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (94-105)+EA
 |  | 
|  |   |  | 
|  | [[[00906.htm|prev]]][[[00908.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (95-125)+EA
 |  | 
|  |   |  | 
|  | [[[00907.htm|prev]]][[[00909.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (96-104)+EA
 |  | 
|  |   |  | 
|  | [[[00908.htm|prev]]][[[00910.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (98-106)+EA
 |  | 
|  |   |  | 
|  | [[[00909.htm|prev]]][[[00911.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 0
 |  | 
|  |   |  | 
|  | [[[00910.htm|prev]]][[[00912.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1
 |  | 
|  |   |  | 
|  | [[[00911.htm|prev]]][[[00913.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1-3
 |  | 
|  |   |  | 
|  | [[[00912.htm|prev]]][[[00914.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1/2
 |  | 
|  |   |  | 
|  | [[[00913.htm|prev]]][[[00915.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1/3
 |  | 
|  |   |  | 
|  | [[[00914.htm|prev]]][[[00916.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 10
 |  | 
|  |   |  | 
|  | [[[00915.htm|prev]]][[[00917.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 10+3n
 |  | 
|  |   |  | 
|  | [[[00916.htm|prev]]][[[00918.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 10+m
 |  | 
|  |   |  | 
|  | [[[00917.htm|prev]]][[[00919.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 10, pm:4*/24**
 |  | 
|  |   |  | 
|  | [[[00918.htm|prev]]][[[00920.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 10-15
 |  | 
|  |   |  | 
|  | [[[00919.htm|prev]]][[[00921.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 10-16
 |  | 
|  |   |  | 
|  | [[[00920.htm|prev]]][[[00922.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 10-17
 |  | 
|  |   |  | 
|  | [[[00921.htm|prev]]][[[00923.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 10-18
 |  | 
|  |   |  | 
|  | [[[00922.htm|prev]]][[[00924.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 10/13
 |  | 
|  |   |  | 
|  | [[[00923.htm|prev]]][[[00925.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 101-112/ (107-118)+EA
 |  | 
|  |   |  | 
|  | [[[00924.htm|prev]]][[[00926.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 102-137
 |  | 
|  |   |  | 
|  | [[[00925.htm|prev]]][[[00927.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 103-139
 |  | 
|  |   |  | 
|  | [[[00926.htm|prev]]][[[00928.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 108-143
 |  | 
|  |   |  | 
|  | [[[00927.htm|prev]]][[[00929.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 109-144
 |  | 
|  |   |  | 
|  | [[[00928.htm|prev]]][[[00930.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 11
 |  | 
|  |   |  | 
|  | [[[00929.htm|prev]]][[[00931.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 11+fw
 |  | 
|  |   |  | 
|  | [[[00930.htm|prev]]][[[00932.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 11+m
 |  | 
|  |   |  | 
|  | [[[00931.htm|prev]]][[[00933.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 11, pm:5*/25**
 |  | 
|  |   |  | 
|  | [[[00932.htm|prev]]][[[00934.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 11,pm:23
 |  | 
|  |   |  | 
|  | [[[00933.htm|prev]]][[[00935.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 11-17
 |  | 
|  |   |  | 
|  | [[[00934.htm|prev]]][[[00936.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 11/18+EA
 |  | 
|  |   |  | 
|  | [[[00935.htm|prev]]][[[00937.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 110-125
 |  | 
|  |   |  | 
|  | [[[00936.htm|prev]]][[[00938.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 118-133/ (124-139)+EA
 |  | 
|  |   |  | 
|  | [[[00937.htm|prev]]][[[00939.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 12
 |  | 
|  |   |  | 
|  | [[[00938.htm|prev]]][[[00940.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 12+4(n-1)
 |  | 
|  |   |  | 
|  | [[[00939.htm|prev]]][[[00941.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 12+m, pm:27+m
 |  | 
|  |   |  | 
|  | [[[00940.htm|prev]]][[[00942.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 12, pm:6*/26**
 |  | 
|  |   |  | 
|  | [[[00941.htm|prev]]][[[00943.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 12, pm:9*/26**, vm:24
 |  | 
|  |   |  | 
|  | [[[00942.htm|prev]]][[[00944.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 12-18
 |  | 
|  |   |  | 
|  | [[[00943.htm|prev]]][[[00945.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 12-23
 |  | 
|  |   |  | 
|  | [[[00944.htm|prev]]][[[00946.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 12-42/13-42
 |  | 
|  |   |  | 
|  | [[[00945.htm|prev]]][[[00947.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 120-127
 |  | 
|  |   |  | 
|  | [[[00946.htm|prev]]][[[00948.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 120-538
 |  | 
|  |   |  | 
|  | [[[00947.htm|prev]]][[[00949.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 121-128
 |  | 
|  |   |  | 
|  | [[[00948.htm|prev]]][[[00950.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 122-129
 |  | 
|  |   |  | 
|  | [[[00949.htm|prev]]][[[00951.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 122-771
 |  | 
|  |   |  | 
|  | [[[00950.htm|prev]]][[[00952.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 123-772
 |  | 
|  |   |  | 
|  | [[[00951.htm|prev]]][[[00953.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 124-138
 |  | 
|  |   |  | 
|  | [[[00952.htm|prev]]][[[00954.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 128-154/ (134-160)+EA
 |  | 
|  |   |  | 
|  | [[[00953.htm|prev]]][[[00955.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13
 |  | 
|  |   |  | 
|  | [[[00954.htm|prev]]][[[00956.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13, pm:10*/27**, vm:25
 |  | 
|  |   |  | 
|  | [[[00955.htm|prev]]][[[00957.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13, pm:7*/27**
 |  | 
|  |   |  | 
|  | [[[00956.htm|prev]]][[[00958.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13,pm:18
 |  | 
|  |   |  | 
|  | [[[00957.htm|prev]]][[[00959.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13,pm:26
 |  | 
|  |   |  | 
|  | [[[00958.htm|prev]]][[[00960.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13,pm:33
 |  | 
|  |   |  | 
|  | [[[00959.htm|prev]]][[[00961.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13-16
 |  | 
|  |   |  | 
|  | [[[00960.htm|prev]]][[[00962.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13-18
 |  | 
|  |   |  | 
|  | [[[00961.htm|prev]]][[[00963.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13-26
 |  | 
|  |   |  | 
|  | [[[00962.htm|prev]]][[[00964.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13-42
 |  | 
|  |   |  | 
|  | [[[00963.htm|prev]]][[[00965.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13-57
 |  | 
|  |   |  | 
|  | [[[00964.htm|prev]]][[[00966.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13/16
 |  | 
|  |   |  | 
|  | [[[00965.htm|prev]]][[[00967.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13/18
 |  | 
|  |   |  | 
|  | [[[00966.htm|prev]]][[[00968.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13/26
 |  | 
|  |   |  | 
|  | [[[00967.htm|prev]]][[[00969.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13/42
 |  | 
|  |   |  | 
|  | [[[00968.htm|prev]]][[[00970.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 130-144
 |  | 
|  |   |  | 
|  | [[[00969.htm|prev]]][[[00971.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 130-145
 |  | 
|  |   |  | 
|  | [[[00970.htm|prev]]][[[00972.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 131,pm:120
 |  | 
|  |   |  | 
|  | [[[00971.htm|prev]]][[[00973.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | [[[00972.htm|prev]]][[[00974.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 134-148
 |  | 
|  |   |  | 
|  | [[[00973.htm|prev]]][[[00975.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 135-141
 |  | 
|  |   |  | 
|  | [[[00974.htm|prev]]][[[00976.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 136-140
 |  | 
|  |   |  | 
|  | [[[00975.htm|prev]]][[[00977.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 14
 |  | 
|  |   |  | 
|  | [[[00976.htm|prev]]][[[00978.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 14, pm:8*/28**
 |  | 
|  |   |  | 
|  | [[[00977.htm|prev]]][[[00979.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 14, pm:8*/28**, vm:27
 |  | 
|  |   |  | 
|  | [[[00978.htm|prev]]][[[00980.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 14,pm:17
 |  | 
|  |   |  | 
|  | [[[00979.htm|prev]]][[[00981.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 14,pm:25
 |  | 
|  |   |  | 
|  | [[[00980.htm|prev]]][[[00982.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 14,pm:33
 |  | 
|  |   |  | 
|  | [[[00981.htm|prev]]][[[00983.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 14/16
 |  | 
|  |   |  | 
|  | [[[00982.htm|prev]]][[[00984.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 14/17
 |  | 
|  |   |  | 
|  | [[[00983.htm|prev]]][[[00985.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 140-279
 |  | 
|  |   |  | 
|  | [[[00984.htm|prev]]][[[00986.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 144-162/ (150-168)+EA
 |  | 
|  |   |  | 
|  | [[[00985.htm|prev]]][[[00987.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 148-154
 |  | 
|  |   |  | 
|  | [[[00986.htm|prev]]][[[00988.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15
 |  | 
|  |   |  | 
|  | [[[00987.htm|prev]]][[[00989.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15+2n
 |  | 
|  |   |  | 
|  | [[[00988.htm|prev]]][[[00990.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15+4(n-1)
 |  | 
|  |   |  | 
|  | [[[00989.htm|prev]]][[[00991.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15+fw
 |  | 
|  |   |  | 
|  | [[[00990.htm|prev]]][[[00992.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15+m, pm:26+m
 |  | 
|  |   |  | 
|  | [[[00991.htm|prev]]][[[00993.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15, pm:9*/29**
 |  | 
|  |   |  | 
|  | [[[00992.htm|prev]]][[[00994.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15,pm:25
 |  | 
|  |   |  | 
|  | [[[00993.htm|prev]]][[[00995.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15-17
 |  | 
|  |   |  | 
|  | [[[00994.htm|prev]]][[[00996.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15-190
 |  | 
|  |   |  | 
|  | [[[00995.htm|prev]]][[[00997.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15-21
 |  | 
|  |   |  | 
|  | [[[00996.htm|prev]]][[[00998.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15-22
 |  | 
|  |   |  | 
|  | [[[00997.htm|prev]]][[[00999.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 15/16
 |  | 
|  |   |  | 
|  | [[[00998.htm|prev]]][[[01000.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 154-168
 |  | 
|  |   |  | 
|  | [[[00999.htm|prev]]][[[01001.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16
 |  | 
|  |   |  | 
|  | [[[01000.htm|prev]]][[[01002.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16+EA
 |  | 
|  |   |  | 
|  | [[[01001.htm|prev]]][[[01003.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16+fw
 |  | 
|  |   |  | 
|  | [[[01002.htm|prev]]][[[01004.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16, pm:11*/31**, vm:29
 |  | 
|  |   |  | 
|  | [[[01003.htm|prev]]][[[01005.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16-126
 |  | 
|  |   |  | 
|  | [[[01004.htm|prev]]][[[01006.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16-20
 |  | 
|  |   |  | 
|  | [[[01005.htm|prev]]][[[01007.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16-22
 |  | 
|  |   |  | 
|  | [[[01006.htm|prev]]][[[01008.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16-50
 |  | 
|  |   |  | 
|  | [[[01007.htm|prev]]][[[01009.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16-64
 |  | 
|  |   |  | 
|  | [[[01008.htm|prev]]][[[01010.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16/16
 |  | 
|  |   |  | 
|  | [[[01009.htm|prev]]][[[01011.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16/21+EA
 |  | 
|  |   |  | 
|  | [[[01010.htm|prev]]][[[01012.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16/29
 |  | 
|  |   |  | 
|  | [[[01011.htm|prev]]][[[01013.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16/4
 |  | 
|  |   |  | 
|  | [[[01012.htm|prev]]][[[01014.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 165-184/ (171-190)+EA
 |  | 
|  |   |  | 
|  | [[[01013.htm|prev]]][[[01015.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 169
 |  | 
|  |   |  | 
|  | [[[01014.htm|prev]]][[[01016.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17
 |  | 
|  |   |  | 
|  | [[[01015.htm|prev]]][[[01017.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17+3n
 |  | 
|  |   |  | 
|  | [[[01016.htm|prev]]][[[01018.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17+EA
 |  | 
|  |   |  | 
|  | [[[01017.htm|prev]]][[[01019.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17+fw
 |  | 
|  |   |  | 
|  | [[[01018.htm|prev]]][[[01020.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17+m; pm:34+m
 |  | 
|  |   |  | 
|  | [[[01019.htm|prev]]][[[01021.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17, pm:10*/32**, vm:30
 |  | 
|  |   |  | 
|  | [[[01020.htm|prev]]][[[01022.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17, pm:10*32**, vm:30
 |  | 
|  |   |  | 
|  | [[[01021.htm|prev]]][[[01023.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17,pm:19
 |  | 
|  |   |  | 
|  | [[[01022.htm|prev]]][[[01024.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17,pm:31
 |  | 
|  |   |  | 
|  | [[[01023.htm|prev]]][[[01025.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17-137
 |  | 
|  |   |  | 
|  | [[[01024.htm|prev]]][[[01026.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17-173
 |  | 
|  |   |  | 
|  | [[[01025.htm|prev]]][[[01027.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17-22
 |  | 
|  |   |  | 
|  | [[[01026.htm|prev]]][[[01028.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17-23
 |  | 
|  |   |  | 
|  | [[[01027.htm|prev]]][[[01029.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17-24
 |  | 
|  |   |  | 
|  | [[[01028.htm|prev]]][[[01030.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17/19
 |  | 
|  |   |  | 
|  | [[[01029.htm|prev]]][[[01031.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17/20
 |  | 
|  |   |  | 
|  | [[[01030.htm|prev]]][[[01032.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17/5
 |  | 
|  |   |  | 
|  | [[[01031.htm|prev]]][[[01033.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 171-326
 |  | 
|  |   |  | 
|  | [[[01032.htm|prev]]][[[01034.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 172-176
 |  | 
|  |   |  | 
|  | [[[01033.htm|prev]]][[[01035.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 175
 |  | 
|  |   |  | 
|  | [[[01034.htm|prev]]][[[01036.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 177/182
 |  | 
|  |   |  | 
|  | [[[01035.htm|prev]]][[[01037.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 178
 |  | 
|  |   |  | 
|  | [[[01036.htm|prev]]][[[01038.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17;pm:20
 |  | 
|  |   |  | 
|  | [[[01037.htm|prev]]][[[01039.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 18
 |  | 
|  |   |  | 
|  | [[[01038.htm|prev]]][[[01040.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 18+m, pm:32+m
 |  | 
|  |   |  | 
|  | [[[01039.htm|prev]]][[[01041.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 18-124
 |  | 
|  |   |  | 
|  | [[[01040.htm|prev]]][[[01042.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 18-24
 |  | 
|  |   |  | 
|  | [[[01041.htm|prev]]][[[01043.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 18/6
 |  | 
|  |   |  | 
|  | [[[01042.htm|prev]]][[[01044.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 180
 |  | 
|  |   |  | 
|  | [[[01043.htm|prev]]][[[01045.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 180-186
 |  | 
|  |   |  | 
|  | [[[01044.htm|prev]]][[[01046.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 180/185
 |  | 
|  |   |  | 
|  | [[[01045.htm|prev]]][[[01047.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 183
 |  | 
|  |   |  | 
|  | [[[01046.htm|prev]]][[[01048.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 18;pm:20
 |  | 
|  |   |  | 
|  | [[[01047.htm|prev]]][[[01049.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 19
 |  | 
|  |   |  | 
|  | [[[01048.htm|prev]]][[[01050.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 19+TS
 |  | 
|  |   |  | 
|  | [[[01049.htm|prev]]][[[01051.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 19-32
 |  | 
|  |   |  | 
|  | [[[01050.htm|prev]]][[[01052.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 19/20
 |  | 
|  |   |  | 
|  | [[[01051.htm|prev]]][[[01053.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 19/5
 |  | 
|  |   |  | 
|  | [[[01052.htm|prev]]][[[01054.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 191-497
 |  | 
|  |   |  | 
|  | [[[01053.htm|prev]]][[[01055.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 193-203
 |  | 
|  |   |  | 
|  | [[[01054.htm|prev]]][[[01056.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 194-204
 |  | 
|  |   |  | 
|  | [[[01055.htm|prev]]][[[01057.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 194-809
 |  | 
|  |   |  | 
|  | [[[01056.htm|prev]]][[[01058.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 196-329
 |  | 
|  |   |  | 
|  | [[[01057.htm|prev]]][[[01059.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 197-207
 |  | 
|  |   |  | 
|  | [[[01058.htm|prev]]][[[01060.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 198-208
 |  | 
|  |   |  | 
|  | [[[01059.htm|prev]]][[[01061.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2
 |  | 
|  |   |  | 
|  | [[[01060.htm|prev]]][[[01062.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2+EA
 |  | 
|  |   |  | 
|  | [[[01061.htm|prev]]][[[01063.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2+fw
 |  | 
|  |   |  | 
|  | [[[01062.htm|prev]]][[[01064.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2-8
 |  | 
|  |   |  | 
|  | [[[01063.htm|prev]]][[[01065.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/15+EA
 |  | 
|  |   |  | 
|  | [[[01064.htm|prev]]][[[01066.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/2
 |  | 
|  |   |  | 
|  | [[[01065.htm|prev]]][[[01067.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/3
 |  | 
|  |   |  | 
|  | [[[01066.htm|prev]]][[[01068.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/3,pm:2
 |  | 
|  |   |  | 
|  | [[[01067.htm|prev]]][[[01069.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/4
 |  | 
|  |   |  | 
|  | [[[01068.htm|prev]]][[[01070.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/5
 |  | 
|  |   |  | 
|  | [[[01069.htm|prev]]][[[01071.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/5,pm:17/19
 |  | 
|  |   |  | 
|  | [[[01070.htm|prev]]][[[01072.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/5,pm:18/19
 |  | 
|  |   |  | 
|  | [[[01071.htm|prev]]][[[01073.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/6
 |  | 
|  |   |  | 
|  | [[[01072.htm|prev]]][[[01074.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/7
 |  | 
|  |   |  | 
|  | [[[01073.htm|prev]]][[[01075.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/8+EA
 |  | 
|  |   |  | 
|  | [[[01074.htm|prev]]][[[01076.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2/9+EA
 |  | 
|  |   |  | 
|  | [[[01075.htm|prev]]][[[01077.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 20
 |  | 
|  |   |  | 
|  | [[[01076.htm|prev]]][[[01078.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 20+TS
 |  | 
|  |   |  | 
|  | [[[01077.htm|prev]]][[[01079.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 20-24
 |  | 
|  |   |  | 
|  | [[[01078.htm|prev]]][[[01080.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 20-31
 |  | 
|  |   |  | 
|  | [[[01079.htm|prev]]][[[01081.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 20-35
 |  | 
|  |   |  | 
|  | [[[01080.htm|prev]]][[[01082.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 20-55
 |  | 
|  |   |  | 
|  | [[[01081.htm|prev]]][[[01083.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 20-70
 |  | 
|  |   |  | 
|  | [[[01082.htm|prev]]][[[01084.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 20/21
 |  | 
|  |   |  | 
|  | [[[01083.htm|prev]]][[[01085.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 200-273
 |  | 
|  |   |  | 
|  | [[[01084.htm|prev]]][[[01086.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 2000+
 |  | 
|  |   |  | 
|  | [[[01085.htm|prev]]][[[01087.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 205-215
 |  | 
|  |   |  | 
|  | [[[01086.htm|prev]]][[[01088.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 21
 |  | 
|  |   |  | 
|  | [[[01087.htm|prev]]][[[01089.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 21-30
 |  | 
|  |   |  | 
|  | [[[01088.htm|prev]]][[[01090.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 21-303
 |  | 
|  |   |  | 
|  | [[[01089.htm|prev]]][[[01091.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 21/24
 |  | 
|  |   |  | 
|  | [[[01090.htm|prev]]][[[01092.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 21/46
 |  | 
|  |   |  | 
|  | [[[01091.htm|prev]]][[[01093.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 211-476
 |  | 
|  |   |  | 
|  | [[[01092.htm|prev]]][[[01094.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 215-225
 |  | 
|  |   |  | 
|  | [[[01093.htm|prev]]][[[01095.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 216-226
 |  | 
|  |   |  | 
|  | [[[01094.htm|prev]]][[[01096.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 22
 |  | 
|  |   |  | 
|  | [[[01095.htm|prev]]][[[01097.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 22+m; pm:38+m
 |  | 
|  |   |  | 
|  | [[[01096.htm|prev]]][[[01098.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 22,pm:38
 |  | 
|  |   |  | 
|  | [[[01097.htm|prev]]][[[01099.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 22-103
 |  | 
|  |   |  | 
|  | [[[01098.htm|prev]]][[[01100.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 22-111
 |  | 
|  |   |  | 
|  | [[[01099.htm|prev]]][[[01101.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 22-24
 |  | 
|  |   |  | 
|  | [[[01100.htm|prev]]][[[01102.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 22/25
 |  | 
|  |   |  | 
|  | [[[01101.htm|prev]]][[[01103.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 220-230
 |  | 
|  |   |  | 
|  | [[[01102.htm|prev]]][[[01104.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 221-231
 |  | 
|  |   |  | 
|  | [[[01103.htm|prev]]][[[01105.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 224-238
 |  | 
|  |   |  | 
|  | [[[01104.htm|prev]]][[[01106.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 225-239
 |  | 
|  |   |  | 
|  | [[[01105.htm|prev]]][[[01107.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 23
 |  | 
|  |   |  | 
|  | [[[01106.htm|prev]]][[[01108.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 23-27
 |  | 
|  |   |  | 
|  | [[[01107.htm|prev]]][[[01109.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 23-31
 |  | 
|  |   |  | 
|  | [[[01108.htm|prev]]][[[01110.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 23/27
 |  | 
|  |   |  | 
|  | [[[01109.htm|prev]]][[[01111.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 230-243
 |  | 
|  |   |  | 
|  | [[[01110.htm|prev]]][[[01112.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 231-245
 |  | 
|  |   |  | 
|  | [[[01111.htm|prev]]][[[01113.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 24
 |  | 
|  |   |  | 
|  | [[[01112.htm|prev]]][[[01114.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 24+EA
 |  | 
|  |   |  | 
|  | [[[01113.htm|prev]]][[[01115.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 24-25
 |  | 
|  |   |  | 
|  | [[[01114.htm|prev]]][[[01116.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 24-32
 |  | 
|  |   |  | 
|  | [[[01115.htm|prev]]][[[01117.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 24/24
 |  | 
|  |   |  | 
|  | [[[01116.htm|prev]]][[[01118.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 25
 |  | 
|  |   |  | 
|  | [[[01117.htm|prev]]][[[01119.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 25-33
 |  | 
|  |   |  | 
|  | [[[01118.htm|prev]]][[[01120.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 25/26
 |  | 
|  |   |  | 
|  | [[[01119.htm|prev]]][[[01121.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 25/28
 |  | 
|  |   |  | 
|  | [[[01120.htm|prev]]][[[01122.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 250-800
 |  | 
|  |   |  | 
|  | [[[01121.htm|prev]]][[[01123.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 257-354
 |  | 
|  |   |  | 
|  | [[[01122.htm|prev]]][[[01124.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 257-547
 |  | 
|  |   |  | 
|  | [[[01123.htm|prev]]][[[01125.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 26
 |  | 
|  |   |  | 
|  | [[[01124.htm|prev]]][[[01126.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 26-34
 |  | 
|  |   |  | 
|  | [[[01125.htm|prev]]][[[01127.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 266-275
 |  | 
|  |   |  | 
|  | [[[01126.htm|prev]]][[[01128.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 27
 |  | 
|  |   |  | 
|  | [[[01127.htm|prev]]][[[01129.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 27-35
 |  | 
|  |   |  | 
|  | [[[01128.htm|prev]]][[[01130.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 27-55
 |  | 
|  |   |  | 
|  | [[[01129.htm|prev]]][[[01131.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 27/28
 |  | 
|  |   |  | 
|  | [[[01130.htm|prev]]][[[01132.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 28
 |  | 
|  |   |  | 
|  | [[[01131.htm|prev]]][[[01133.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 28-34
 |  | 
|  |   |  | 
|  | [[[01132.htm|prev]]][[[01134.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 29-34
 |  | 
|  |   |  | 
|  | [[[01133.htm|prev]]][[[01135.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 29-37
 |  | 
|  |   |  | 
|  | [[[01134.htm|prev]]][[[01136.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 29-57
 |  | 
|  |   |  | 
|  | [[[01135.htm|prev]]][[[01137.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 290-310
 |  | 
|  |   |  | 
|  | [[[01136.htm|prev]]][[[01138.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 292-365
 |  | 
|  |   |  | 
|  | [[[01137.htm|prev]]][[[01139.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3
 |  | 
|  |   |  | 
|  | [[[01138.htm|prev]]][[[01140.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3+fw
 |  | 
|  |   |  | 
|  | [[[01139.htm|prev]]][[[01141.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/1
 |  | 
|  |   |  | 
|  | [[[01140.htm|prev]]][[[01142.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/12
 |  | 
|  |   |  | 
|  | [[[01141.htm|prev]]][[[01143.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/15+EA
 |  | 
|  |   |  | 
|  | [[[01142.htm|prev]]][[[01144.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/16+EA
 |  | 
|  |   |  | 
|  | [[[01143.htm|prev]]][[[01145.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/3
 |  | 
|  |   |  | 
|  | [[[01144.htm|prev]]][[[01146.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/4
 |  | 
|  |   |  | 
|  | [[[01145.htm|prev]]][[[01147.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/5
 |  | 
|  |   |  | 
|  | [[[01146.htm|prev]]][[[01148.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/6
 |  | 
|  |   |  | 
|  | [[[01147.htm|prev]]][[[01149.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/7
 |  | 
|  |   |  | 
|  | [[[01148.htm|prev]]][[[01150.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/8
 |  | 
|  |   |  | 
|  | [[[01149.htm|prev]]][[[01151.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/9
 |  | 
|  |   |  | 
|  | [[[01150.htm|prev]]][[[01152.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3/9+EA
 |  | 
|  |   |  | 
|  | [[[01151.htm|prev]]][[[01153.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 30
 |  | 
|  |   |  | 
|  | [[[01152.htm|prev]]][[[01154.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 30-32
 |  | 
|  |   |  | 
|  | [[[01153.htm|prev]]][[[01155.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 30-38
 |  | 
|  |   |  | 
|  | [[[01154.htm|prev]]][[[01156.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 30-45
 |  | 
|  |   |  | 
|  | [[[01155.htm|prev]]][[[01157.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 30-540
 |  | 
|  |   |  | 
|  | [[[01156.htm|prev]]][[[01158.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 308
 |  | 
|  |   |  | 
|  | [[[01157.htm|prev]]][[[01159.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 31
 |  | 
|  |   |  | 
|  | [[[01158.htm|prev]]][[[01160.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 310-630
 |  | 
|  |   |  | 
|  | [[[01159.htm|prev]]][[[01161.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 314-487
 |  | 
|  |   |  | 
|  | [[[01160.htm|prev]]][[[01162.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 32
 |  | 
|  |   |  | 
|  | [[[01161.htm|prev]]][[[01163.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 32-38
 |  | 
|  |   |  | 
|  | [[[01162.htm|prev]]][[[01164.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 32-57
 |  | 
|  |   |  | 
|  | [[[01163.htm|prev]]][[[01165.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 33
 |  | 
|  |   |  | 
|  | [[[01164.htm|prev]]][[[01166.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 33+fw
 |  | 
|  |   |  | 
|  | [[[01165.htm|prev]]][[[01167.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 35-45
 |  | 
|  |   |  | 
|  | [[[01166.htm|prev]]][[[01168.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 36
 |  | 
|  |   |  | 
|  | [[[01167.htm|prev]]][[[01169.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 37+EA
 |  | 
|  |   |  | 
|  | [[[01168.htm|prev]]][[[01170.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 37, pm16:32, pm32:33
 |  | 
|  |   |  | 
|  | [[[01169.htm|prev]]][[[01171.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 38
 |  | 
|  |   |  | 
|  | [[[01170.htm|prev]]][[[01172.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 38-36
 |  | 
|  |   |  | 
|  | [[[01171.htm|prev]]][[[01173.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 38-48
 |  | 
|  |   |  | 
|  | [[[01172.htm|prev]]][[[01174.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 38-56
 |  | 
|  |   |  | 
|  | [[[01173.htm|prev]]][[[01175.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 38/41
 |  | 
|  |   |  | 
|  | [[[01174.htm|prev]]][[[01176.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 39
 |  | 
|  |   |  | 
|  | [[[01175.htm|prev]]][[[01177.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4
 |  | 
|  |   |  | 
|  | [[[01176.htm|prev]]][[[01178.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4+5n
 |  | 
|  |   |  | 
|  | [[[01177.htm|prev]]][[[01179.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4/1
 |  | 
|  |   |  | 
|  | [[[01178.htm|prev]]][[[01180.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4/10+EA
 |  | 
|  |   |  | 
|  | [[[01179.htm|prev]]][[[01181.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4/17+EA
 |  | 
|  |   |  | 
|  | [[[01180.htm|prev]]][[[01182.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4/3
 |  | 
|  |   |  | 
|  | [[[01181.htm|prev]]][[[01183.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4/5
 |  | 
|  |   |  | 
|  | [[[01182.htm|prev]]][[[01184.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4/9
 |  | 
|  |   |  | 
|  | [[[01183.htm|prev]]][[[01185.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4/pm:8
 |  | 
|  |   |  | 
|  | [[[01184.htm|prev]]][[[01186.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 40
 |  | 
|  |   |  | 
|  | [[[01185.htm|prev]]][[[01187.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 40-50
 |  | 
|  |   |  | 
|  | [[[01186.htm|prev]]][[[01188.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 40-60
 |  | 
|  |   |  | 
|  | [[[01187.htm|prev]]][[[01189.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 40/40
 |  | 
|  |   |  | 
|  | [[[01188.htm|prev]]][[[01190.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 41
 |  | 
|  |   |  | 
|  | [[[01189.htm|prev]]][[[01191.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 41+TS
 |  | 
|  |   |  | 
|  | [[[01190.htm|prev]]][[[01192.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 42
 |  | 
|  |   |  | 
|  | [[[01191.htm|prev]]][[[01193.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 42+TS
 |  | 
|  |   |  | 
|  | [[[01192.htm|prev]]][[[01194.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 42-52
 |  | 
|  |   |  | 
|  | [[[01193.htm|prev]]][[[01195.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 43
 |  | 
|  |   |  | 
|  | [[[01194.htm|prev]]][[[01196.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 43+TS
 |  | 
|  |   |  | 
|  | [[[01195.htm|prev]]][[[01197.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 43+m, pm:31+m
 |  | 
|  |   |  | 
|  | [[[01196.htm|prev]]][[[01198.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 43/44
 |  | 
|  |   |  | 
|  | [[[01197.htm|prev]]][[[01199.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 44
 |  | 
|  |   |  | 
|  | [[[01198.htm|prev]]][[[01200.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 44, pm:34
 |  | 
|  |   |  | 
|  | [[[01199.htm|prev]]][[[01201.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | [[[01200.htm|prev]]][[[01202.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 45
 |  | 
|  |   |  | 
|  | [[[01201.htm|prev]]][[[01203.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 45+m
 |  | 
|  |   |  | 
|  | [[[01202.htm|prev]]][[[01204.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 45-52
 |  | 
|  |   |  | 
|  | [[[01203.htm|prev]]][[[01205.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 45-55
 |  | 
|  |   |  | 
|  | [[[01204.htm|prev]]][[[01206.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 46
 |  | 
|  |   |  | 
|  | [[[01205.htm|prev]]][[[01207.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 46-54
 |  | 
|  |   |  | 
|  | [[[01206.htm|prev]]][[[01208.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 48-58
 |  | 
|  |   |  | 
|  | [[[01207.htm|prev]]][[[01209.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 49+m
 |  | 
|  |   |  | 
|  | [[[01208.htm|prev]]][[[01210.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5
 |  | 
|  |   |  | 
|  | [[[01209.htm|prev]]][[[01211.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+TS
 |  | 
|  |   |  | 
|  | [[[01210.htm|prev]]][[[01212.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+ts
 |  | 
|  |   |  | 
|  | [[[01211.htm|prev]]][[[01213.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5,pm:20
 |  | 
|  |   |  | 
|  | [[[01212.htm|prev]]][[[01214.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5/11+EA
 |  | 
|  |   |  | 
|  | [[[01213.htm|prev]]][[[01215.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5/3
 |  | 
|  |   |  | 
|  | [[[01214.htm|prev]]][[[01216.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5/5
 |  | 
|  |   |  | 
|  | [[[01215.htm|prev]]][[[01217.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5/6
 |  | 
|  |   |  | 
|  | [[[01216.htm|prev]]][[[01218.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5/8
 |  | 
|  |   |  | 
|  | [[[01217.htm|prev]]][[[01219.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 512-534
 |  | 
|  |   |  | 
|  | [[[01218.htm|prev]]][[[01220.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 52-58
 |  | 
|  |   |  | 
|  | [[[01219.htm|prev]]][[[01221.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 52-60
 |  | 
|  |   |  | 
|  | [[[01220.htm|prev]]][[[01222.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 520-540
 |  | 
|  |   |  | 
|  | [[[01221.htm|prev]]][[[01223.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 53
 |  | 
|  |   |  | 
|  | [[[01222.htm|prev]]][[[01224.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 53-65
 |  | 
|  |   |  | 
|  | [[[01223.htm|prev]]][[[01225.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 55
 |  | 
|  |   |  | 
|  | [[[01224.htm|prev]]][[[01226.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 56-63
 |  | 
|  |   |  | 
|  | [[[01225.htm|prev]]][[[01227.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 56-67
 |  | 
|  |   |  | 
|  | [[[01226.htm|prev]]][[[01228.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 57-72
 |  | 
|  |   |  | 
|  | [[[01227.htm|prev]]][[[01229.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 57-82
 |  | 
|  |   |  | 
|  | [[[01228.htm|prev]]][[[01230.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 58-83
 |  | 
|  |   |  | 
|  | [[[01229.htm|prev]]][[[01231.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6
 |  | 
|  |   |  | 
|  | [[[01230.htm|prev]]][[[01232.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6,5
 |  | 
|  |   |  | 
|  | [[[01231.htm|prev]]][[[01233.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6,pm:4
 |  | 
|  |   |  | 
|  | [[[01232.htm|prev]]][[[01234.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6-103/7-104
 |  | 
|  |   |  | 
|  | [[[01233.htm|prev]]][[[01235.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6-12
 |  | 
|  |   |  | 
|  | [[[01234.htm|prev]]][[[01236.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6-34/6-35
 |  | 
|  |   |  | 
|  | [[[01235.htm|prev]]][[[01237.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6-42/6-43
 |  | 
|  |   |  | 
|  | [[[01236.htm|prev]]][[[01238.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6-42/7-43
 |  | 
|  |   |  | 
|  | [[[01237.htm|prev]]][[[01239.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6/12
 |  | 
|  |   |  | 
|  | [[[01238.htm|prev]]][[[01240.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6/13
 |  | 
|  |   |  | 
|  | [[[01239.htm|prev]]][[[01241.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6/7(=); 6/10(!=)
 |  | 
|  |   |  | 
|  | [[[01240.htm|prev]]][[[01242.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6/8
 |  | 
|  |   |  | 
|  | [[[01241.htm|prev]]][[[01243.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 60
 |  | 
|  |   |  | 
|  | [[[01242.htm|prev]]][[[01244.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 60-68
 |  | 
|  |   |  | 
|  | [[[01243.htm|prev]]][[[01245.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 60-70
 |  | 
|  |   |  | 
|  | [[[01244.htm|prev]]][[[01246.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 61-65
 |  | 
|  |   |  | 
|  | [[[01245.htm|prev]]][[[01247.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 61-82
 |  | 
|  |   |  | 
|  | [[[01246.htm|prev]]][[[01248.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 63-73
 |  | 
|  |   |  | 
|  | [[[01247.htm|prev]]][[[01249.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 65-75
 |  | 
|  |   |  | 
|  | [[[01248.htm|prev]]][[[01250.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 66-80
 |  | 
|  |   |  | 
|  | [[[01249.htm|prev]]][[[01251.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 67-77
 |  | 
|  |   |  | 
|  | [[[01250.htm|prev]]][[[01252.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 67-86
 |  | 
|  |   |  | 
|  | [[[01251.htm|prev]]][[[01253.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 68
 |  | 
|  |   |  | 
|  | [[[01252.htm|prev]]][[[01254.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7
 |  | 
|  |   |  | 
|  | [[[01253.htm|prev]]][[[01255.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7+fw
 |  | 
|  |   |  | 
|  | [[[01254.htm|prev]]][[[01256.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7+m
 |  | 
|  |   |  | 
|  | [[[01255.htm|prev]]][[[01257.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7+m,10+m
 |  | 
|  |   |  | 
|  | [[[01256.htm|prev]]][[[01258.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7+m/10+m
 |  | 
|  |   |  | 
|  | [[[01257.htm|prev]]][[[01259.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7+m/3
 |  | 
|  |   |  | 
|  | [[[01258.htm|prev]]][[[01260.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7, pm:4*/21**, vm:19
 |  | 
|  |   |  | 
|  | [[[01259.htm|prev]]][[[01261.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7,pm:21
 |  | 
|  |   |  | 
|  | [[[01260.htm|prev]]][[[01262.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7,pm:22
 |  | 
|  |   |  | 
|  | [[[01261.htm|prev]]][[[01263.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7,pm:25
 |  | 
|  |   |  | 
|  | [[[01262.htm|prev]]][[[01264.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7-14
 |  | 
|  |   |  | 
|  | [[[01263.htm|prev]]][[[01265.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7-24/9-26
 |  | 
|  |   |  | 
|  | [[[01264.htm|prev]]][[[01266.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7-39/7-40
 |  | 
|  |   |  | 
|  | [[[01265.htm|prev]]][[[01267.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7-71/7-72
 |  | 
|  |   |  | 
|  | [[[01266.htm|prev]]][[[01268.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7/11
 |  | 
|  |   |  | 
|  | [[[01267.htm|prev]]][[[01269.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7/13
 |  | 
|  |   |  | 
|  | [[[01268.htm|prev]]][[[01270.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7/3
 |  | 
|  |   |  | 
|  | [[[01269.htm|prev]]][[[01271.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7/4
 |  | 
|  |   |  | 
|  | [[[01270.htm|prev]]][[[01272.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7/5
 |  | 
|  |   |  | 
|  | [[[01271.htm|prev]]][[[01273.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7/8
 |  | 
|  |   |  | 
|  | [[[01272.htm|prev]]][[[01274.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 70
 |  | 
|  |   |  | 
|  | [[[01273.htm|prev]]][[[01275.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 70-100
 |  | 
|  |   |  | 
|  | [[[01274.htm|prev]]][[[01276.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 70-103
 |  | 
|  |   |  | 
|  | [[[01275.htm|prev]]][[[01277.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 70-138
 |  | 
|  |   |  | 
|  | [[[01276.htm|prev]]][[[01278.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 70-76
 |  | 
|  |   |  | 
|  | [[[01277.htm|prev]]][[[01279.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 70-77/(76-83)+EA
 |  | 
|  |   |  | 
|  | [[[01278.htm|prev]]][[[01280.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 700-1000
 |  | 
|  |   |  | 
|  | [[[01279.htm|prev]]][[[01281.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 71
 |  | 
|  |   |  | 
|  | [[[01280.htm|prev]]][[[01282.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 71-75
 |  | 
|  |   |  | 
|  | [[[01281.htm|prev]]][[[01283.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 71-83
 |  | 
|  |   |  | 
|  | [[[01282.htm|prev]]][[[01284.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 72-167
 |  | 
|  |   |  | 
|  | [[[01283.htm|prev]]][[[01285.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 72-84
 |  | 
|  |   |  | 
|  | [[[01284.htm|prev]]][[[01286.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 72-86
 |  | 
|  |   |  | 
|  | [[[01285.htm|prev]]][[[01287.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 73
 |  | 
|  |   |  | 
|  | [[[01286.htm|prev]]][[[01288.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 74-155
 |  | 
|  |   |  | 
|  | [[[01287.htm|prev]]][[[01289.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 74-88
 |  | 
|  |   |  | 
|  | [[[01288.htm|prev]]][[[01290.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 75-105
 |  | 
|  |   |  | 
|  | [[[01289.htm|prev]]][[[01291.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 75-85
 |  | 
|  |   |  | 
|  | [[[01290.htm|prev]]][[[01292.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 76-87
 |  | 
|  |   |  | 
|  | [[[01291.htm|prev]]][[[01293.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 78-91
 |  | 
|  |   |  | 
|  | [[[01292.htm|prev]]][[[01294.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 79-93
 |  | 
|  |   |  | 
|  | [[[01293.htm|prev]]][[[01295.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 8
 |  | 
|  |   |  | 
|  | [[[01294.htm|prev]]][[[01296.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 8+4 per bit/(20+4 per bit)+EA
 |  | 
|  |   |  | 
|  | [[[01295.htm|prev]]][[[01297.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 8,4
 |  | 
|  |   |  | 
|  | [[[01296.htm|prev]]][[[01298.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 8-20
 |  | 
|  |   |  | 
|  | [[[01297.htm|prev]]][[[01299.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 8-25/10-27
 |  | 
|  |   |  | 
|  | [[[01298.htm|prev]]][[[01300.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 8-30/9-31
 |  | 
|  |   |  | 
|  | [[[01299.htm|prev]]][[[01301.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 8/4
 |  | 
|  |   |  | 
|  | [[[01300.htm|prev]]][[[01302.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 8/int+32
 |  | 
|  |   |  | 
|  | [[[01301.htm|prev]]][[[01303.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 80-90
 |  | 
|  |   |  | 
|  | [[[01302.htm|prev]]][[[01304.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 80-90/(86-96)+EA
 |  | 
|  |   |  | 
|  | [[[01303.htm|prev]]][[[01305.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 80-93
 |  | 
|  |   |  | 
|  | [[[01304.htm|prev]]][[[01306.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 80-97
 |  | 
|  |   |  | 
|  | [[[01305.htm|prev]]][[[01307.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 80-98/(86-104)+EA
 |  | 
|  |   |  | 
|  | [[[01306.htm|prev]]][[[01308.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 82
 |  | 
|  |   |  | 
|  | [[[01307.htm|prev]]][[[01309.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 82-92
 |  | 
|  |   |  | 
|  | [[[01308.htm|prev]]][[[01310.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 82-95
 |  | 
|  |   |  | 
|  | [[[01309.htm|prev]]][[[01311.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 83
 |  | 
|  |   |  | 
|  | [[[01310.htm|prev]]][[[01312.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 83-87
 |  | 
|  |   |  | 
|  | [[[01311.htm|prev]]][[[01313.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 84-86
 |  | 
|  |   |  | 
|  | [[[01312.htm|prev]]][[[01314.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 84-90
 |  | 
|  |   |  | 
|  | [[[01313.htm|prev]]][[[01315.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 84-94
 |  | 
|  |   |  | 
|  | [[[01314.htm|prev]]][[[01316.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 85-89
 |  | 
|  |   |  | 
|  | [[[01315.htm|prev]]][[[01317.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 86+4x
 |  | 
|  |   |  | 
|  | [[[01316.htm|prev]]][[[01318.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 86-92
 |  | 
|  |   |  | 
|  | [[[01317.htm|prev]]][[[01319.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 88
 |  | 
|  |   |  | 
|  | [[[01318.htm|prev]]][[[01320.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 89
 |  | 
|  |   |  | 
|  | [[[01319.htm|prev]]][[[01321.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9
 |  | 
|  |   |  | 
|  | [[[01320.htm|prev]]][[[01322.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9+fw
 |  | 
|  |   |  | 
|  | [[[01321.htm|prev]]][[[01323.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9+m/5
 |  | 
|  |   |  | 
|  | [[[01322.htm|prev]]][[[01324.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9, pm:6*/24**, vm:22
 |  | 
|  |   |  | 
|  | [[[01323.htm|prev]]][[[01325.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9,pm:6
 |  | 
|  |   |  | 
|  | [[[01324.htm|prev]]][[[01326.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9-12
 |  | 
|  |   |  | 
|  | [[[01325.htm|prev]]][[[01327.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9-14
 |  | 
|  |   |  | 
|  | [[[01326.htm|prev]]][[[01328.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9-14/12-17
 |  | 
|  |   |  | 
|  | [[[01327.htm|prev]]][[[01329.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9-16
 |  | 
|  |   |  | 
|  | [[[01328.htm|prev]]][[[01330.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9-20
 |  | 
|  |   |  | 
|  | [[[01329.htm|prev]]][[[01331.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9-22
 |  | 
|  |   |  | 
|  | [[[01330.htm|prev]]][[[01332.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9-22/12-25
 |  | 
|  |   |  | 
|  | [[[01331.htm|prev]]][[[01333.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9-38
 |  | 
|  |   |  | 
|  | [[[01332.htm|prev]]][[[01334.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9-38/12-41
 |  | 
|  |   |  | 
|  | [[[01333.htm|prev]]][[[01335.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9/10
 |  | 
|  |   |  | 
|  | [[[01334.htm|prev]]][[[01336.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9/6
 |  | 
|  |   |  | 
|  | [[[01335.htm|prev]]][[[01337.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9/9
 |  | 
|  |   |  | 
|  | [[[01336.htm|prev]]][[[01338.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 90+4x+m
 |  | 
|  |   |  | 
|  | [[[01337.htm|prev]]][[[01339.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 90-120
 |  | 
|  |   |  | 
|  | [[[01338.htm|prev]]][[[01340.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 900-1100
 |  | 
|  |   |  | 
|  | [[[01339.htm|prev]]][[[01341.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 91
 |  | 
|  |   |  | 
|  | [[[01340.htm|prev]]][[[01342.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 94
 |  | 
|  |   |  | 
|  | [[[01341.htm|prev]]][[[01343.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 94-105
 |  | 
|  |   |  | 
|  | [[[01342.htm|prev]]][[[01344.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 95-125
 |  | 
|  |   |  | 
|  | [[[01343.htm|prev]]][[[01345.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 95-185
 |  | 
|  |   |  | 
|  | [[[01344.htm|prev]]][[[01346.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 96-104
 |  | 
|  |   |  | 
|  | [[[01345.htm|prev]]][[[01347.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 98-106
 |  | 
|  |   |  | 
|  | [[[01346.htm|prev]]][[[01348.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | TS
 |  | 
|  |   |  | 
|  | [[[01347.htm|prev]]][[[01349.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | TS+10
 |  | 
|  |   |  | 
|  | [[[01348.htm|prev]]][[[01350.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | TS+32
 |  | 
|  |   |  | 
|  | [[[01349.htm|prev]]][[[01351.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | hit=12, nohit=11
 |  | 
|  |   |  | 
|  | [[[01350.htm|prev]]][[[01352.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:10/11
 |  | 
|  |   |  | 
|  | [[[01351.htm|prev]]][[[01353.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:20/21
 |  | 
|  |   |  | 
|  | [[[01352.htm|prev]]][[[01354.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:21+ts
 |  | 
|  |   |  | 
|  | [[[01353.htm|prev]]][[[01355.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:22
 |  | 
|  |   |  | 
|  | [[[01354.htm|prev]]][[[01356.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:35
 |  | 
|  |   |  | 
|  | [[[01355.htm|prev]]][[[01357.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:37+ts
 |  | 
|  |   |  | 
|  | [[[01356.htm|prev]]][[[01358.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:37+tx
 |  | 
|  |   |  | 
|  | [[[01357.htm|prev]]][[[01359.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:44
 |  | 
|  |   |  | 
|  | [[[01358.htm|prev]]][[[01360.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:45+2x
 |  | 
|  |   |  | 
|  | [[[01359.htm|prev]]][[[01361.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:52+m
 |  | 
|  |   |  | 
|  | [[[01360.htm|prev]]][[[01362.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:56+m
 |  | 
|  |   |  | 
|  | [[[01361.htm|prev]]][[[01363.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:69
 |  | 
|  |   |  | 
|  | [[[01362.htm|prev]]][[[01364.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:7
 |  | 
|  |   |  | 
|  | [[[01363.htm|prev]]][[[01365.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:77+4x
 |  | 
|  |   |  | 
|  | [[[01364.htm|prev]]][[[01366.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:86+m
 |  | 
|  |   |  | 
|  | [[[01365.htm|prev]]][[[01367.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:90+m
 |  | 
|  |   |  | 
|  | [[[01366.htm|prev]]][[[01368.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:94+ 4x+m
 |  | 
|  |   |  | 
|  | [[[01367.htm|prev]]][[[01369.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | pm:98+ 4x+m
 |  | 
|  |   |  | 
|  | [[[01368.htm|prev]]][[[01370.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | ts
 |  | 
|  |   |  | 
|  | [[[01369.htm|prev]]][[[01371.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | xm16:75, xm32:95; pm:70
 |  | 
|  |   |  | 
|  | [[[01370.htm|prev]]][[[01372.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (197-207)+EA+fw
 |  | 
|  |   |  | 
|  | [[[01371.htm|prev]]][[[01373.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (40-50)+EA+fw
 |  | 
|  |   |  | 
|  | [[[01372.htm|prev]]][[[01374.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 22+16(n-1)
 |  | 
|  |   |  | 
|  | [[[01373.htm|prev]]][[[01375.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 22-25
 |  | 
|  |   |  | 
|  | [[[01374.htm|prev]]][[[01376.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 22-25/29-32
 |  | 
|  |   |  | 
|  | [[[01375.htm|prev]]][[[01377.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 3+5n
 |  | 
|  |   |  | 
|  | [[[01376.htm|prev]]][[[01378.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 33-35
 |  | 
|  |   |  | 
|  | [[[01377.htm|prev]]][[[01379.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+n/17+n
 |  | 
|  |   |  | 
|  | [[[01378.htm|prev]]][[[01380.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 8+9n
 |  | 
|  |   |  | 
|  | [[[01379.htm|prev]]][[[01381.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (10-16)+fw
 |  | 
|  |   |  | 
|  | [[[01380.htm|prev]]][[[01382.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (103-104)+fw
 |  | 
|  |   |  | 
|  | [[[01381.htm|prev]]][[[01383.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (154,pm=143)+fw
 |  | 
|  |   |  | 
|  | [[[01382.htm|prev]]][[[01384.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (205-215)+fw
 |  | 
|  |   |  | 
|  | [[[01383.htm|prev]]][[[01385.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (375-376)+fw
 |  | 
|  |   |  | 
|  | [[[01384.htm|prev]]][[[01386.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (40-50)+EA
 |  | 
|  |   |  | 
|  | [[[01385.htm|prev]]][[[01387.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (40-50)+fw
 |  | 
|  |   |  | 
|  | [[[01386.htm|prev]]][[[01388.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (67,pm=56)+fw
 |  | 
|  |   |  | 
|  | [[[01387.htm|prev]]][[[01389.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (xm16/32=127/151,pm=124)+fw
 |  | 
|  |   |  | 
|  | [[[01388.htm|prev]]][[[01390.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | (xm16/32=50/48,pm16/32=49/50)+fw
 |  | 
|  |   |  | 
|  | [[[01389.htm|prev]]][[[01391.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 10/11
 |  | 
|  |   |  | 
|  | [[[01390.htm|prev]]][[[01392.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 103-104
 |  | 
|  |   |  | 
|  | [[[01391.htm|prev]]][[[01393.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13+fw
 |  | 
|  |   |  | 
|  | [[[01392.htm|prev]]][[[01394.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 154,pm=143
 |  | 
|  |   |  | 
|  | [[[01393.htm|prev]]][[[01395.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 375-376
 |  | 
|  |   |  | 
|  | [[[01394.htm|prev]]][[[01396.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4,pm=3
 |  | 
|  |   |  | 
|  | [[[01395.htm|prev]]][[[01397.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 67,pm=56
 |  | 
|  |   |  | 
|  | [[[01396.htm|prev]]][[[01398.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | ??
 |  | 
|  |   |  | 
|  | [[[01397.htm|prev]]][[[01399.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | xm16/32=127/151,pm=124
 |  | 
|  |   |  | 
|  | [[[01398.htm|prev]]][[[01400.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | xm16/32=50/48,pm16/32=49/50
 |  | 
|  |   |  | 
|  | [[[01399.htm|prev]]][[[01401.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 119
 |  | 
|  |   |  | 
|  | [[[01400.htm|prev]]][[[01402.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 167
 |  | 
|  |   |  | 
|  | [[[01401.htm|prev]]][[[01403.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:119,0:3
 |  | 
|  |   |  | 
|  | [[[01402.htm|prev]]][[[01404.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:13,0:4
 |  | 
|  |   |  | 
|  | [[[01403.htm|prev]]][[[01405.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:168,0:3
 |  | 
|  |   |  | 
|  | [[[01404.htm|prev]]][[[01406.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:19+TS,0:4
 |  | 
|  |   |  | 
|  | [[[01405.htm|prev]]][[[01407.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:24,0:3
 |  | 
|  |   |  | 
|  | [[[01406.htm|prev]]][[[01408.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:27,0:4
 |  | 
|  |   |  | 
|  | [[[01407.htm|prev]]][[[01409.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:28,0:3
 |  | 
|  |   |  | 
|  | [[[01408.htm|prev]]][[[01410.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:35,0:3
 |  | 
|  |   |  | 
|  | [[[01409.htm|prev]]][[[01411.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:39+TS,0:3
 |  | 
|  |   |  | 
|  | [[[01410.htm|prev]]][[[01412.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:41,0:3
 |  | 
|  |   |  | 
|  | [[[01411.htm|prev]]][[[01413.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:44,0:4
 |  | 
|  |   |  | 
|  | [[[01412.htm|prev]]][[[01414.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:46,0:3
 |  | 
|  |   |  | 
|  | [[[01413.htm|prev]]][[[01415.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:53,0:4
 |  | 
|  |   |  | 
|  | [[[01414.htm|prev]]][[[01416.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:56,0:4
 |  | 
|  |   |  | 
|  | [[[01415.htm|prev]]][[[01417.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:59,0:3
 |  | 
|  |   |  | 
|  | [[[01416.htm|prev]]][[[01418.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:73,0:3
 |  | 
|  |   |  | 
|  | [[[01417.htm|prev]]][[[01419.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:79,0:3
 |  | 
|  |   |  | 
|  | [[[01418.htm|prev]]][[[01420.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:84,0:3
 |  | 
|  |   |  | 
|  | [[[01419.htm|prev]]][[[01421.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:99,0:3
 |  | 
|  |   |  | 
|  | [[[01420.htm|prev]]][[[01422.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 1:TS,0:3
 |  | 
|  |   |  | 
|  | [[[01421.htm|prev]]][[[01423.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 23+TS
 |  | 
|  |   |  | 
|  | [[[01422.htm|prev]]][[[01424.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 37
 |  | 
|  |   |  | 
|  | [[[01423.htm|prev]]][[[01425.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 37+TS
 |  | 
|  |   |  | 
|  | [[[01424.htm|prev]]][[[01426.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 48
 |  | 
|  |   |  | 
|  | [[[01425.htm|prev]]][[[01427.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 51
 |  | 
|  |   |  | 
|  | [[[01426.htm|prev]]][[[01428.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 52
 |  | 
|  |   |  | 
|  | [[[01427.htm|prev]]][[[01429.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 56
 |  | 
|  |   |  | 
|  | [[[01428.htm|prev]]][[[01430.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 59
 |  | 
|  |   |  | 
|  | [[[01429.htm|prev]]][[[01431.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 78
 |  | 
|  |   |  | 
|  | [[[01430.htm|prev]]][[[01432.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 86
 |  | 
|  |   |  | 
|  | [[[01431.htm|prev]]][[[01433.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 99
 |  | 
|  |   |  | 
|  | [[[01432.htm|prev]]][[[01434.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 11+3(E)CX, pm:8+3(E)CX*1/25+3(E)CX*2
 |  | 
|  |   |  | 
|  | [[[01433.htm|prev]]][[[01435.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13+4(E)CX, pm:10+4(E)CX*1/27+4(E)CX*2, vm:25+4(E)CX
 |  | 
|  |   |  | 
|  | [[[01434.htm|prev]]][[[01436.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 13+6(E)CX, pm:7+6(E)CX*1/27+6(E)CX*2, vm:27+6(E)CX
 |  | 
|  |   |  | 
|  | [[[01435.htm|prev]]][[[01437.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 16+8(E)CX, pm:10+8(E)CX*1/30+8(E)CX*2, vm:29+8(E)CX
 |  | 
|  |   |  | 
|  | [[[01436.htm|prev]]][[[01438.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 17+5(E)CX, pm:11+5(E)CX*1/31+5(E)CX*2, vm:30+5(E)CX
 |  | 
|  |   |  | 
|  | [[[01437.htm|prev]]][[[01439.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 4+3*CX
 |  | 
|  |   |  | 
|  | [[[01438.htm|prev]]][[[01440.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5*3,13*4,12+3(E)CX*5
 |  | 
|  |   |  | 
|  | [[[01439.htm|prev]]][[[01441.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5*3,7+4(E)CX*6
 |  | 
|  |   |  | 
|  | [[[01440.htm|prev]]][[[01442.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5*3,7+5(E)CX*6
 |  | 
|  |   |  | 
|  | [[[01441.htm|prev]]][[[01443.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5*3,7+7(E)CX*6
 |  | 
|  |   |  | 
|  | [[[01442.htm|prev]]][[[01444.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+12(E)CX, pm:6+5(E)CX*1/26+5(E)CX*2, vm:26+5(E)CX
 |  | 
|  |   |  | 
|  | [[[01443.htm|prev]]][[[01445.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+15*15
 |  | 
|  |   |  | 
|  | [[[01444.htm|prev]]][[[01446.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+15*N
 |  | 
|  |   |  | 
|  | [[[01445.htm|prev]]][[[01447.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+22*N
 |  | 
|  |   |  | 
|  | [[[01446.htm|prev]]][[[01448.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+4(E)CX
 |  | 
|  |   |  | 
|  | [[[01447.htm|prev]]][[[01449.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+4*CX
 |  | 
|  |   |  | 
|  | [[[01448.htm|prev]]][[[01450.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+5(E)CX
 |  | 
|  |   |  | 
|  | [[[01449.htm|prev]]][[[01451.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+8*N
 |  | 
|  |   |  | 
|  | [[[01450.htm|prev]]][[[01452.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 5+9*N
 |  | 
|  |   |  | 
|  | [[[01451.htm|prev]]][[[01453.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6*3,13*4
 |  | 
|  |   |  | 
|  | [[[01452.htm|prev]]][[[01454.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6*3,13*4,13(E)CX*5
 |  | 
|  |   |  | 
|  | [[[01453.htm|prev]]][[[01455.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6*3,9(E)CX*6
 |  | 
|  |   |  | 
|  | [[[01454.htm|prev]]][[[01456.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6+11*N
 |  | 
|  |   |  | 
|  | [[[01455.htm|prev]]][[[01457.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 6+9*N
 |  | 
|  |   |  | 
|  | [[[01456.htm|prev]]][[[01458.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7*3,7+3(E)CX*6
 |  | 
|  |   |  | 
|  | [[[01457.htm|prev]]][[[01459.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7*3,8+4(E)CX*6
 |  | 
|  |   |  | 
|  | [[[01458.htm|prev]]][[[01460.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 7*3,9+4(E)CX*6
 |  | 
|  |   |  | 
|  | [[[01459.htm|prev]]][[[01461.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 8+8*N
 |  | 
|  |   |  | 
|  | [[[01460.htm|prev]]][[[01462.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9+10*CX
 |  | 
|  |   |  | 
|  | [[[01461.htm|prev]]][[[01463.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9+15*N
 |  | 
|  |   |  | 
|  | [[[01462.htm|prev]]][[[01464.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9+17*CX
 |  | 
|  |   |  | 
|  | [[[01463.htm|prev]]][[[01465.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | 9+22*N
 |  | 
|  |   |  | 
|  | [[[01464.htm|prev]]][[[01466.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Instruction Timing ===
 |  | 
|  |   |  | 
|  | N/A
 |  | 
|  |   |  | 
|  | [[[01465.htm|prev]]][[[01467.htm|next]]][[[00795.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Intel Instruction Set ===
 |  | 
|  |   |  | 
|  | The following section describes the individual processor instructions in detail.
 |  | 
|  |   |  | 
|  | [[[01466.htm|prev]]][[[01468.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | None
 |  | 
|  |   |  | 
|  | [[[01467.htm|prev]]][[[01469.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | None
 |  | 
|  |   |  | 
|  | [[[01468.htm|prev]]][[[01470.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | None
 |  | 
|  |   |  | 
|  | [[[01469.htm|prev]]][[[01471.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |  |  |  |  |  |  |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | None
 |  | 
|  |   |  | 
|  | [[[01470.htm|prev]]][[[01472.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === FPU Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------\
 |  | 
|  | |C0|C1|C2|C3|
 |  | 
|  | |--+--+--+--|
 |  | 
|  | |? |* |? |? |
 |  | 
|  | \-----------/</pre>
 |  | 
|  | C1 as described in [[00856.htm|FPU Flags Affected]]; C0, C2, C3 undefined.
 |  | 
|  |   |  | 
|  | [[[01471.htm|prev]]][[[01473.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === FPU Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------\
 |  | 
|  | |C0|C1|C2|C3|
 |  | 
|  | |--+--+--+--|
 |  | 
|  | |? |? |? |? |
 |  | 
|  | \-----------/</pre>
 |  | 
|  | C0, C1, C2, C3 undefined.
 |  | 
|  |   |  | 
|  | [[[01472.htm|prev]]][[[01474.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === FPU Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------\
 |  | 
|  | |C0|C1|C2|C3|
 |  | 
|  | |--+--+--+--|
 |  | 
|  | |* |* |* |* |
 |  | 
|  | \-----------/</pre>
 |  | 
|  | C0, C1, C2, C3 as described in [[00856.htm|FPU Flags Affected]].
 |  | 
|  |   |  | 
|  | [[[01473.htm|prev]]][[[01475.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === FPU Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------\
 |  | 
|  | |C0|C1|C2|C3|
 |  | 
|  | |--+--+--+--|
 |  | 
|  | |* |* |* |* |
 |  | 
|  | \-----------/</pre>
 |  | 
|  | C0, C1, C2, C3 as loaded.
 |  | 
|  |   |  | 
|  | [[[01474.htm|prev]]][[[01476.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === AAA-ASCII Adjust after Addition ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |37        |AAA                 |X|X|X|X|X|X|ASCII adjust AL after addition    |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | Run the AAA instruction only following an ADD instruction that leaves a byte result in the AL register. The lower nibbles of the operands of the ADD instruction should be in the range 0 through 9 (BCD digits). In this case, the AAA instruction adjusts the AL register to contain the correct decimal digit result. If the addition produced a decimal carry, the AH register is incremented, and the CF and AF flags are set. If this same addition also produced FH in the upper nibble of AL then AH is incremented again. If there was no decimal carry, the CF and AF flags are cleared and the AH register is unchanged. In either case, the AL register is left with its top nibble set to 0. To convert the AL register to an ASCII result, follow the AAA instruction with OR AL, 30H.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01477.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01479.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01478.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01475.htm|prev]]][[[01477.htm|next]]][[[01475.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |37        |AAA                 |X|X|X|X|X|X|ASCII adjust AL after addition    |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01476.htm|prev]]][[[01478.htm|next]]][[[01475.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | Run the AAA instruction only following an ADD instruction that leaves a byte result in the AL register. The lower nibbles of the operands of the ADD instruction should be in the range 0 through 9 (BCD digits). In this case, the AAA instruction adjusts the AL register to contain the correct decimal digit result. If the addition produced a decimal carry, the AH register is incremented, and the CF and AF flags are set. If this same addition also produced FH in the upper nibble of AL then AH is incremented again. If there was no decimal carry, the CF and AF flags are cleared and the AH register is unchanged. In either case, the AL register is left with its top nibble set to 0. To convert the AL register to an ASCII result, follow the AAA instruction with OR AL, 30H.
 |  | 
|  |   |  | 
|  | [[[01477.htm|prev]]][[[01479.htm|next]]][[[01475.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>ALcarry � AL > 0F9H; (* 1 if true *)
 |  | 
|  | IF ((AL AND 0FH) > 9) OR (AF = 1)
 |  | 
|  | THEN 
 |  | 
|  |     AL � (AL + 6) AND 0FH;
 |  | 
|  |     AH � AH + 1 + ALcarry;
 |  | 
|  |     AF � 1;
 |  | 
|  |     CF � 1;
 |  | 
|  | ELSE 
 |  | 
|  |     AF � 0;
 |  | 
|  |     CF � 0;
 |  | 
|  |     AL � AL AND 0FH;
 |  | 
|  | FI;</pre>
 |  | 
|  | [[[01478.htm|prev]]][[[01480.htm|next]]][[[01475.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |? |  |  |? |? |* |? |* |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The AF and CF flags are set if there is a decimal carry, cleared if there is no decimal carry; the OF, SF, ZF, and PF flags are undefined.
 |  | 
|  |   |  | 
|  | [[[01479.htm|prev]]][[[01481.htm|next]]][[[01475.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01477.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01479.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01478.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01480.htm|prev]]][[[01482.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === AAD-ASCII Adjust AX before Division ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |D5 0A     |AAD                 |X|X|X|X|X|X|ASCII adjust before division      |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The AAD instruction is used to prepare two unpacked BCD digits (the least- significant digit in the AL register, the most-significant digit in the AH register) for a division operation that will yield an unpacked result. This is accomplished by setting the AL register to AL+ (second byte of opcode * AH), and then clearing the AH register. The AX register is then equal to the binary equivalent of the original unpacked two-digit number.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01483.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01485.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01484.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01481.htm|prev]]][[[01483.htm|next]]][[[01481.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |D5 0A     |AAD                 |X|X|X|X|X|X|ASCII adjust before division      |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01482.htm|prev]]][[[01484.htm|next]]][[[01481.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The AAD instruction is used to prepare two unpacked BCD digits (the least- significant digit in the AL register, the most-significant digit in the AH register) for a division operation that will yield an unpacked result. This is accomplished by setting the AL register to AL+ (second byte of opcode * AH), and then clearing the AH register. The AX register is then equal to the binary equivalent of the original unpacked two-digit number.
 |  | 
|  |   |  | 
|  | [[[01483.htm|prev]]][[[01485.htm|next]]][[[01481.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>regAL = AL;
 |  | 
|  | regAH = AH;
 |  | 
|  | AL � (regAH * imm8 + regAL) AND OFFH;
 |  | 
|  | AH � 0;</pre>
 |  | 
|  | '''Note:'''imm8 has the value of the instruction's second byte. The second byte under normally assembly of this instruction will be 0A, however, explicit modification of this byte will result in the operation described above and may alter results.
 |  | 
|  |   |  | 
|  | [[[01484.htm|prev]]][[[01486.htm|next]]][[[01481.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |? |  |  |* |* |? |* |? |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The SF, ZF, and PF flags are set according to the result; the OF, AF, and CF flags are undefined.
 |  | 
|  |   |  | 
|  | [[[01485.htm|prev]]][[[01487.htm|next]]][[[01481.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01483.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01485.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01484.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01486.htm|prev]]][[[01488.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === AAM-ASCII Adjust AX after Multiply ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |D4 0A     |AAM                 |X|X|X|X|X|X|ASCII adjust AX after             |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | Run the AAM instruction only after running a MUL instruction between two unpacked BCD digits that leaves the result in the AX register. Because the result is less than 100, it is contained entirely in the AL register. The AAM instruction unpacks the AL result by dividing AL by the second byte of the opcode, leaving the quotient (most-significant digit) in the AH register and the remainder (least-significant digit) in the AL register.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01489.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01491.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01490.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01487.htm|prev]]][[[01489.htm|next]]][[[01487.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |D4 0A     |AAM                 |X|X|X|X|X|X|ASCII adjust AX after             |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01488.htm|prev]]][[[01490.htm|next]]][[[01487.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | Run the AAM instruction only after running a MUL instruction between two unpacked BCD digits that leaves the result in the AX register. Because the result is less than 100, it is contained entirely in the AL register. The AAM instruction unpacks the AL result by dividing AL by the second byte of the opcode, leaving the quotient (most-significant digit) in the AH register and the remainder (least-significant digit) in the AL register.
 |  | 
|  |   |  | 
|  | [[[01489.htm|prev]]][[[01491.htm|next]]][[[01487.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>regAL � AL;
 |  | 
|  | AH� regAL / imm8;
 |  | 
|  | AL� regAL MOD imm8;</pre>
 |  | 
|  | '''Note:'''imm8 has the value of the instruction's second byte. The second byte under normally assembly of this instruction will be 0A., however, explicit modification of this byte will result in the operation described above and may alter results.
 |  | 
|  |   |  | 
|  | [[[01490.htm|prev]]][[[01492.htm|next]]][[[01487.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |? |  |  |* |* |? |* |? |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The SF, ZF, and PF flags are set according to the result; the OF, AF, and CF flags are undefined.
 |  | 
|  |   |  | 
|  | [[[01491.htm|prev]]][[[01493.htm|next]]][[[01487.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01489.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01491.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01490.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01492.htm|prev]]][[[01494.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === AAS-ASCII Adjust AL after Subtraction ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3F        |AAS                 |X|X|X|X|X|X|ASCII adjust AL after subtraction |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | Run the AAS instruction only after a SUB instruction that leaves the byte result in the AL register. The lower nibbles of the operands of the SUB instruction must have been in the range of 0 through 9 (BCD digits). In this case, the AAS instruction adjusts the AL register so it contains the correct decimal digit result. If the subtraction produced a decimal carry, the AH register is decremented, and the CF and AF flags are set. If no decimal carry occurred, the CF and AF flags are cleared, and the AH register is unchanged. In either case, the AL register is left with its top nibble set to 0. To convert the AL result to an ASCII result, follow the AAS instruction with OR AL, 30H.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01495.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01497.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01496.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01493.htm|prev]]][[[01495.htm|next]]][[[01493.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3F        |AAS                 |X|X|X|X|X|X|ASCII adjust AL after subtraction |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01494.htm|prev]]][[[01496.htm|next]]][[[01493.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | Run the AAS instruction only after a SUB instruction that leaves the byte result in the AL register. The lower nibbles of the operands of the SUB instruction must have been in the range of 0 through 9 (BCD digits). In this case, the AAS instruction adjusts the AL register so it contains the correct decimal digit result. If the subtraction produced a decimal carry, the AH register is decremented, and the CF and AF flags are set. If no decimal carry occurred, the CF and AF flags are cleared, and the AH register is unchanged. In either case, the AL register is left with its top nibble set to 0. To convert the AL result to an ASCII result, follow the AAS instruction with OR AL, 30H.
 |  | 
|  |   |  | 
|  | [[[01495.htm|prev]]][[[01497.htm|next]]][[[01493.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>ALborrow � AL < 6; (* 1 if true *)
 |  | 
|  | IF (AL AND 0FH) > 9 OR AF = 1 
 |  | 
|  | THEN 
 |  | 
|  |     AL � (AL - 6) AND 0FH;
 |  | 
|  |     AH � AH - 1 - ALborrow;
 |  | 
|  |     AF � 1;
 |  | 
|  |     CF � 1;
 |  | 
|  | ELSE 
 |  | 
|  |     CF � 0;
 |  | 
|  |     AF � 0;
 |  | 
|  |     AL � AL AND 0FH 
 |  | 
|  | FI;</pre>
 |  | 
|  | [[[01496.htm|prev]]][[[01498.htm|next]]][[[01493.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |? |  |  |? |? |* |? |* |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The AF and CF flags are set if there is a decimal carry, cleared if there is no decimal carry; the OF, SF, ZF, and PF flags are undefined.
 |  | 
|  |   |  | 
|  | [[[01497.htm|prev]]][[[01499.htm|next]]][[[01493.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01495.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01497.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01496.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01498.htm|prev]]][[[01500.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ADC-Add with Carry ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |14 ib     |ADC AL,imm8         |X|X|X|X|X|X|Add with carry immediate byte to  |
 |  | 
|  | |          |                    | | | | | | |AL                                |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |15 iw     |ADC AX,imm16        |X|X|X|X|X|X|Add with carry immediate word to  |
 |  | 
|  | |          |                    | | | | | | |AX                                |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |15 id     |ADC EAX,imm32       | | | |X|X|X|Add with carry immediate dword to |
 |  | 
|  | |          |                    | | | | | | |EAX                               |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |80 /2 ib  |ADC r/m8,imm8       |X|X|X|X|X|X|Add with carry immediate byte to  |
 |  | 
|  | |          |                    | | | | | | |r/m byte                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /2 iw  |ADC r/m16,imm16     |X|X|X|X|X|X|Add with carry immediate word to  |
 |  | 
|  | |          |                    | | | | | | |r/m word                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /2 id  |ADC r/m32,imm32     | | | |X|X|X|Add with carry immediate dword to |
 |  | 
|  | |          |                    | | | | | | |r/m dword                         |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /2 ib  |ADC r/m16,imm8      |X|X|X|X|X|X|Add with carry sign-extended      |
 |  | 
|  | |          |                    | | | | | | |immediate byte to r/m word        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /2 ib  |ADC r/m32,imm8      | | | |X|X|X|Add with carry sign-extended      |
 |  | 
|  | |          |                    | | | | | | |immediate byte into r/m dword     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |10 /r     |ADC r/m8,r8         |X|X|X|X|X|X|Add with carry byte register to   |
 |  | 
|  | |          |                    | | | | | | |r/m byte                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |11 /r     |ADC r/m16,r16       |X|X|X|X|X|X|Add with carry word register to   |
 |  | 
|  | |          |                    | | | | | | |r/m word                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |11 /r     |ADC r/m32,r32       | | | |X|X|X|Add with carry dword register to  |
 |  | 
|  | |          |                    | | | | | | |r/m word                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |12 /r     |ADC r8,r/m8         |X|X|X|X|X|X|Add with carry r/m byte to byte   |
 |  | 
|  | |          |                    | | | | | | |register                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |13 /r     |ADC r16,r/m16       |X|X|X|X|X|X|Add with carry r/m word to word   |
 |  | 
|  | |          |                    | | | | | | |register                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |13 /r     |ADC r32,r/m32       | | | |X|X|X|Add with carry r/m dword to dword |
 |  | 
|  | |          |                    | | | | | | |register                          |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The ADC instruction performs an integer addition of the two operands DEST and SRC and the carry flag, CF. The result of the addition is assigned to the first operand (DEST), and the flags are set accordingly. The ADC instruction is usually run as part of a multi-byte or multi-word addition operation. When an immediate byte value is added to a word or doubleword operand, the immediate value is first sign-extended to the size of the word or doubleword operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01501.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01503.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01502.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01504.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01505.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01506.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01499.htm|prev]]][[[01501.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |14 ib     |ADC AL,imm8         |X|X|X|X|X|X|Add with carry immediate byte to  |
 |  | 
|  | |          |                    | | | | | | |AL                                |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |15 iw     |ADC AX,imm16        |X|X|X|X|X|X|Add with carry immediate word to  |
 |  | 
|  | |          |                    | | | | | | |AX                                |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |15 id     |ADC EAX,imm32       | | | |X|X|X|Add with carry immediate dword to |
 |  | 
|  | |          |                    | | | | | | |EAX                               |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |80 /2 ib  |ADC r/m8,imm8       |X|X|X|X|X|X|Add with carry immediate byte to  |
 |  | 
|  | |          |                    | | | | | | |r/m byte                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /2 iw  |ADC r/m16,imm16     |X|X|X|X|X|X|Add with carry immediate word to  |
 |  | 
|  | |          |                    | | | | | | |r/m word                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /2 id  |ADC r/m32,imm32     | | | |X|X|X|Add with carry immediate dword to |
 |  | 
|  | |          |                    | | | | | | |r/m dword                         |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /2 ib  |ADC r/m16,imm8      |X|X|X|X|X|X|Add with carry sign-extended      |
 |  | 
|  | |          |                    | | | | | | |immediate byte to r/m word        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /2 ib  |ADC r/m32,imm8      | | | |X|X|X|Add with carry sign-extended      |
 |  | 
|  | |          |                    | | | | | | |immediate byte into r/m dword     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |10 /r     |ADC r/m8,r8         |X|X|X|X|X|X|Add with carry byte register to   |
 |  | 
|  | |          |                    | | | | | | |r/m byte                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |11 /r     |ADC r/m16,r16       |X|X|X|X|X|X|Add with carry word register to   |
 |  | 
|  | |          |                    | | | | | | |r/m word                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |11 /r     |ADC r/m32,r32       | | | |X|X|X|Add with carry dword register to  |
 |  | 
|  | |          |                    | | | | | | |r/m word                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |12 /r     |ADC r8,r/m8         |X|X|X|X|X|X|Add with carry r/m byte to byte   |
 |  | 
|  | |          |                    | | | | | | |register                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |13 /r     |ADC r16,r/m16       |X|X|X|X|X|X|Add with carry r/m word to word   |
 |  | 
|  | |          |                    | | | | | | |register                          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |13 /r     |ADC r32,r/m32       | | | |X|X|X|Add with carry r/m dword to dword |
 |  | 
|  | |          |                    | | | | | | |register                          |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01500.htm|prev]]][[[01502.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The ADC instruction performs an integer addition of the two operands DEST and SRC and the carry flag, CF. The result of the addition is assigned to the first operand (DEST), and the flags are set accordingly. The ADC instruction is usually run as part of a multi-byte or multi-word addition operation. When an immediate byte value is added to a word or doubleword operand, the immediate value is first sign-extended to the size of the word or doubleword operand.
 |  | 
|  |   |  | 
|  | [[[01501.htm|prev]]][[[01503.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>DEST � DEST + SRC + CF;</pre>
 |  | 
|  | [[[01502.htm|prev]]][[[01504.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |* |  |  |* |* |* |* |* |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The OF, SF, ZF, AF, CF, and PF flags are set according to the result.
 |  | 
|  |   |  | 
|  | [[[01503.htm|prev]]][[[01505.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) if the result is in a nonwritable segment; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS (0) for an illegal address in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01504.htm|prev]]][[[01506.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.
 |  | 
|  |   |  | 
|  | [[[01505.htm|prev]]][[[01507.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01506.htm|prev]]][[[01508.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01501.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01503.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01502.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01504.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01505.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01506.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01507.htm|prev]]][[[01509.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ADD-Add ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |04 ib     |ADD AL,imm8         |X|X|X|X|X|X|Add immediate byte to AL          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |05 iw     |ADD AX,imm16        |X|X|X|X|X|X|Add immediate word to AX          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |05 id     |ADD EAX,imm32       | | | |X|X|X|Add immediate dword to EAX        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |80 /0 ib  |ADD r/m8,imm8       |X|X|X|X|X|X|Add immediate byte to r/m byte    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /0 iw  |ADD r/m16,imm16     |X|X|X|X|X|X|Add immediate word to r/m word    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /0 id  |ADD r/m32,imm32     | | | |X|X|X|Add immediate dword to r/m dword  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /0 ib  |ADD r/m16,imm8      |X|X|X|X|X|X|Add sign-extended immediate byte  |
 |  | 
|  | |          |                    | | | | | | |to r/m word                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /0 ib  |ADD r/m32,imm8      | | | |X|X|X|Add sign-extended immediate byte  |
 |  | 
|  | |          |                    | | | | | | |to r/m dword                      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |00 /r     |ADD r/m8,r8         |X|X|X|X|X|X|Add byte register to r/m byte     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |01 /r     |ADD r/m16,r16       |X|X|X|X|X|X|Add word register to r/m word     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |01 /r     |ADD r/m32,r32       | | | |X|X|X|Add dword register to r/m dword   |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |02 /r     |ADD r8,r/m8         |X|X|X|X|X|X|Add r/m byte to byte register     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |03 /r     |ADD r16,r/m16       |X|X|X|X|X|X|Add r/m word to word register     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |03 /r     |ADD r32,r/m32       | | | |X|X|X|Add r/m dword to dword register   |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The ADD instruction performs an integer addition of the two operands (DEST and SRC). The result of the addition is assigned to the first operand (DEST ), and the flags are set accordingly.
 |  | 
|  |   |  | 
|  | When an immediate byte is added to a word or doubleword operand, the immediate value is sign-extended to the size of the word or doubleword operand.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01510.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01512.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01511.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01513.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01514.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01515.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01508.htm|prev]]][[[01510.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |04 ib     |ADD AL,imm8         |X|X|X|X|X|X|Add immediate byte to AL          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |05 iw     |ADD AX,imm16        |X|X|X|X|X|X|Add immediate word to AX          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |05 id     |ADD EAX,imm32       | | | |X|X|X|Add immediate dword to EAX        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |80 /0 ib  |ADD r/m8,imm8       |X|X|X|X|X|X|Add immediate byte to r/m byte    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /0 iw  |ADD r/m16,imm16     |X|X|X|X|X|X|Add immediate word to r/m word    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /0 id  |ADD r/m32,imm32     | | | |X|X|X|Add immediate dword to r/m dword  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /0 ib  |ADD r/m16,imm8      |X|X|X|X|X|X|Add sign-extended immediate byte  |
 |  | 
|  | |          |                    | | | | | | |to r/m word                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /0 ib  |ADD r/m32,imm8      | | | |X|X|X|Add sign-extended immediate byte  |
 |  | 
|  | |          |                    | | | | | | |to r/m dword                      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |00 /r     |ADD r/m8,r8         |X|X|X|X|X|X|Add byte register to r/m byte     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |01 /r     |ADD r/m16,r16       |X|X|X|X|X|X|Add word register to r/m word     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |01 /r     |ADD r/m32,r32       | | | |X|X|X|Add dword register to r/m dword   |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |02 /r     |ADD r8,r/m8         |X|X|X|X|X|X|Add r/m byte to byte register     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |03 /r     |ADD r16,r/m16       |X|X|X|X|X|X|Add r/m word to word register     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |03 /r     |ADD r32,r/m32       | | | |X|X|X|Add r/m dword to dword register   |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01509.htm|prev]]][[[01511.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The ADD instruction performs an integer addition of the two operands (DEST and SRC). The result of the addition is assigned to the first operand (DEST ), and the flags are set accordingly.
 |  | 
|  |   |  | 
|  | When an immediate byte is added to a word or doubleword operand, the immediate value is sign-extended to the size of the word or doubleword operand.
 |  | 
|  |   |  | 
|  | [[[01510.htm|prev]]][[[01512.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>DEST � DEST + SRC;</pre>
 |  | 
|  | [[[01511.htm|prev]]][[[01513.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |* |  |  |* |* |* |* |* |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The OF, SF, ZF, AF, CF, and PF flags are set according to the result.
 |  | 
|  |   |  | 
|  | [[[01512.htm|prev]]][[[01514.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) is the result is in a nonwritable segment; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS (0) for an illegal address in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01513.htm|prev]]][[[01515.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.
 |  | 
|  |   |  | 
|  | [[[01514.htm|prev]]][[[01516.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01515.htm|prev]]][[[01517.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01510.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01512.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01511.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01513.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01514.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01515.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01516.htm|prev]]][[[01518.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === AND-Logical AND ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |24 ib     |AND AL,imm8         |X|X|X|X|X|X|AND immediate byte to AL          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |25 iw     |AND AX,imm16        |X|X|X|X|X|X|AND immediate word to AX          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |25 id     |AND EAX,imm32       | | | |X|X|X|AND immediate dword to EAX        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |80 /r ib  |AND r/m8,imm8       |X|X|X|X|X|X|AND immediate byte to r/m byte    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /4 iw  |AND r/m16,imm16     |X|X|X|X|X|X|AND immediate word to r/m word    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /r id  |AND r/m32,imm32     | | | |X|X|X|AND immediate dword to r/m dword  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /4 ib  |AND r/m16,imm8      | | | |X|X|X|AND sign-extended immediate byte  |
 |  | 
|  | |          |                    | | | | | | |to r/m word                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /4 ib  |AND r/m32,imm8      | | | |X|X|X|AND sign-extended immediate byte  |
 |  | 
|  | |          |                    | | | | | | |with r/m dword                    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |20 /r     |AND r/m8,r8         |X|X|X|X|X|X|AND byte register to r/m byte     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |21 /r     |AND r/m16,r16       |X|X|X|X|X|X|AND word register to r/m word     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |21 /r     |AND r/m32,r32       | | | |X|X|X|AND dword register to r/m dword   |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |22 /r     |AND r8,r/m8         |X|X|X|X|X|X|AND r/m byte to byte register     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |23 /r     |AND r16,r/m16       |X|X|X|X|X|X|AND r/m word to word register     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |23 /r     |AND r32,r/m32       | | | |X|X|X|AND r/m dword to dword register   |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | Each bit of the result of the AND instruction is a 1 if both corresponding bits of the operands are 1; otherwise, it becomes a 0.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01519.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01521.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01520.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01522.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01523.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01524.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01517.htm|prev]]][[[01519.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |24 ib     |AND AL,imm8         |X|X|X|X|X|X|AND immediate byte to AL          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |25 iw     |AND AX,imm16        |X|X|X|X|X|X|AND immediate word to AX          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |25 id     |AND EAX,imm32       | | | |X|X|X|AND immediate dword to EAX        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |80 /r ib  |AND r/m8,imm8       |X|X|X|X|X|X|AND immediate byte to r/m byte    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /4 iw  |AND r/m16,imm16     |X|X|X|X|X|X|AND immediate word to r/m word    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /r id  |AND r/m32,imm32     | | | |X|X|X|AND immediate dword to r/m dword  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /4 ib  |AND r/m16,imm8      | | | |X|X|X|AND sign-extended immediate byte  |
 |  | 
|  | |          |                    | | | | | | |to r/m word                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /4 ib  |AND r/m32,imm8      | | | |X|X|X|AND sign-extended immediate byte  |
 |  | 
|  | |          |                    | | | | | | |with r/m dword                    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |20 /r     |AND r/m8,r8         |X|X|X|X|X|X|AND byte register to r/m byte     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |21 /r     |AND r/m16,r16       |X|X|X|X|X|X|AND word register to r/m word     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |21 /r     |AND r/m32,r32       | | | |X|X|X|AND dword register to r/m dword   |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |22 /r     |AND r8,r/m8         |X|X|X|X|X|X|AND r/m byte to byte register     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |23 /r     |AND r16,r/m16       |X|X|X|X|X|X|AND r/m word to word register     |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |23 /r     |AND r32,r/m32       | | | |X|X|X|AND r/m dword to dword register   |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01518.htm|prev]]][[[01520.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | Each bit of the result of the AND instruction is a 1 if both corresponding bits of the operands are 1; otherwise, it becomes a 0.
 |  | 
|  |   |  | 
|  | [[[01519.htm|prev]]][[[01521.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>DEST � DEST AND SRC;
 |  | 
|  | CF � 0;
 |  | 
|  | OF � 0;</pre>
 |  | 
|  | [[[01520.htm|prev]]][[[01522.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |0 |  |  |* |* |? |* |0 |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The CF and OF flags are cleared; the PF, SF, and ZF flags are set according to the result; the AF flag is undefined.
 |  | 
|  |   |  | 
|  | [[[01521.htm|prev]]][[[01523.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) if the result is in a nonwritable segment; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS (0) for an illegal address in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01522.htm|prev]]][[[01524.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.
 |  | 
|  |   |  | 
|  | [[[01523.htm|prev]]][[[01525.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01524.htm|prev]]][[[01526.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01519.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01521.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01520.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01522.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01523.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01524.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01525.htm|prev]]][[[01527.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === ARPL-Adjust RPL Field of Selector ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |63 /r     |ARPL r/m16,r16      | | |X|X|X|X|Adjust RPL of r/m16 to not less   |
 |  | 
|  | |          |                    | | | | | | |than RPL of r16                   |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The ARPL instruction has two operands. The first operand is a 16-bit memory variable or word register that contains the value of a selector. The second operand is a word register. If the RPL field ("requested privilege level"- bottom two bits) of the first operand is less than the RPL field of the second operand, the ZF flag is set and the RPL field of the first operand is increased to match the second operand. Otherwise, the ZF flag is cleared and no change is made to the first operand.
 |  | 
|  |   |  | 
|  | The ARPL instruction appears in operating system software, not in application programs. It is used to guarantee that a selector parameter to a subroutine does not request more privilege than the caller is allowed. The second operand of the ARPL instruction is normally a register that contains the CS selector value of the caller.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01528.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01530.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01529.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01531.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01532.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01533.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01526.htm|prev]]][[[01528.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |63 /r     |ARPL r/m16,r16      | | |X|X|X|X|Adjust RPL of r/m16 to not less   |
 |  | 
|  | |          |                    | | | | | | |than RPL of r16                   |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01527.htm|prev]]][[[01529.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The ARPL instruction has two operands. The first operand is a 16-bit memory variable or word register that contains the value of a selector. The second operand is a word register. If the RPL field ("requested privilege level"- bottom two bits) of the first operand is less than the RPL field of the second operand, the ZF flag is set and the RPL field of the first operand is increased to match the second operand. Otherwise, the ZF flag is cleared and no change is made to the first operand.
 |  | 
|  |   |  | 
|  | The ARPL instruction appears in operating system software, not in application programs. It is used to guarantee that a selector parameter to a subroutine does not request more privilege than the caller is allowed. The second operand of the ARPL instruction is normally a register that contains the CS selector value of the caller.
 |  | 
|  |   |  | 
|  | [[[01528.htm|prev]]][[[01530.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF RBL bits(0,1) of DEST < RPL bits(0,1) of SRC 
 |  | 
|  | THEN 
 |  | 
|  |     ZF � 1;
 |  | 
|  |     RPL bits(0,1) of DEST � RPL bits (0,1) of SRC;
 |  | 
|  | ELSE 
 |  | 
|  |     ZF � 0;
 |  | 
|  | FI;</pre>
 |  | 
|  | [[[01529.htm|prev]]][[[01531.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |  |  |* |  |  |  |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The ZF flag is set if the RPL field of the first operand is less than that of the second operand, otherwise ZF is cleared.
 |  | 
|  |   |  | 
|  | [[[01530.htm|prev]]][[[01532.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) if the result is a nonwritable segment; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS(0) for an illegal address in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01531.htm|prev]]][[[01533.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 6; the ARPL instruction is not recognized in Real Address Mode.
 |  | 
|  |   |  | 
|  | [[[01532.htm|prev]]][[[01534.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 6; the ARPL instruction is not recognized in Virtual 8086 Mode.
 |  | 
|  |   |  | 
|  | [[[01533.htm|prev]]][[[01535.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01528.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01530.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01529.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01531.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01532.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01533.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01534.htm|prev]]][[[01536.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === BOUND-Check Array Index Against Bounds ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |62 /r     |BOUND r16,m16&16    | |X|X|X|X|X|Check if r16 is within m16&16     |
 |  | 
|  | |          |                    | | | | | | |bounds (passes test)              |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |62 /r     |BOUND r32,m32&32    | | | |X|X|X|Check if r32 is within m32&32     |
 |  | 
|  | |          |                    | | | | | | |bounds (passes test)              |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The BOUND instruction ensures that a signed array index is within the limits specified by a block of memory consisting of an upper and a lower bound. Each bound uses one word when the operand-size attribute is 16-bits and a doubleword when the operand-size attribute is 32-bits. The first operand (a register) must be greater than or equal to the first bound in memory (lower bound), and less than or equal to the second bound in memory (upper bound) plus the number of bytes occupied for the operand size. If the register is not within bounds, an Interrupt 5 occurs; the return EIP points to the BOUND instruction.
 |  | 
|  |   |  | 
|  | The bounds limit data structure is usually placed just before the array itself, making the limits addressable via a constant offset from the beginning of the array.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01537.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01470.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01538.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01539.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01540.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01541.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01535.htm|prev]]][[[01537.htm|next]]][[[01535.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |62 /r     |BOUND r16,m16&16    | |X|X|X|X|X|Check if r16 is within m16&16     |
 |  | 
|  | |          |                    | | | | | | |bounds (passes test)              |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |62 /r     |BOUND r32,m32&32    | | | |X|X|X|Check if r32 is within m32&32     |
 |  | 
|  | |          |                    | | | | | | |bounds (passes test)              |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01536.htm|prev]]][[[01538.htm|next]]][[[01535.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The BOUND instruction ensures that a signed array index is within the limits specified by a block of memory consisting of an upper and a lower bound. Each bound uses one word when the operand-size attribute is 16-bits and a doubleword when the operand-size attribute is 32-bits. The first operand (a register) must be greater than or equal to the first bound in memory (lower bound), and less than or equal to the second bound in memory (upper bound) plus the number of bytes occupied for the operand size. If the register is not within bounds, an Interrupt 5 occurs; the return EIP points to the BOUND instruction.
 |  | 
|  |   |  | 
|  | The bounds limit data structure is usually placed just before the array itself, making the limits addressable via a constant offset from the beginning of the array.
 |  | 
|  |   |  | 
|  | [[[01537.htm|prev]]][[[01539.htm|next]]][[[01535.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF (LeftSRC < [RightSRC] OR LeftSRC > [RightSRC + 
 |  | 
|  | OperandSize/8])
 |  | 
|  |    (* Under lower bound or over upper bound *)
 |  | 
|  | THEN Interrupt 5;
 |  | 
|  | FI;</pre>
 |  | 
|  | [[[01538.htm|prev]]][[[01540.htm|next]]][[[01535.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 5 if the bounds test fails, as described above; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS(0) for an illegal address in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | The second operand must be a memory operand, not a register. If the BOUND instruction is run with a ModR/M byte representing a register as the second operand, #UD occurs.
 |  | 
|  |   |  | 
|  | [[[01539.htm|prev]]][[[01541.htm|next]]][[[01535.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 5 if the bounds test fails; Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH; Interrupt 6 if the second operand is a register.
 |  | 
|  |   |  | 
|  | [[[01540.htm|prev]]][[[01542.htm|next]]][[[01535.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01541.htm|prev]]][[[01543.htm|next]]][[[01535.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01537.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01470.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01538.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01539.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01540.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01541.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01542.htm|prev]]][[[01544.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === BSF-Bit Scan Forward ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BC     |BSF r16,r/m16       | | | |X|X|X|Bit scan forward on r/m word      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BC     |BSF r32,r/m32       | | | |X|X|X|Bit scan forward on r/m dword     |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The BSF instruction scans the bits in the second word or doubleword operand starting with bit 0. The ZF flag is set if all the bits are 0; otherwise, the ZF flag is cleared and the destination register is loaded with the bit index of the first set bit.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01545.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01547.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01546.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01548.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01549.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01550.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01543.htm|prev]]][[[01545.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BC     |BSF r16,r/m16       | | | |X|X|X|Bit scan forward on r/m word      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BC     |BSF r32,r/m32       | | | |X|X|X|Bit scan forward on r/m dword     |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01544.htm|prev]]][[[01546.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The BSF instruction scans the bits in the second word or doubleword operand starting with bit 0. The ZF flag is set if all the bits are 0; otherwise, the ZF flag is cleared and the destination register is loaded with the bit index of the first set bit.
 |  | 
|  |   |  | 
|  | [[[01545.htm|prev]]][[[01547.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF r/m = 0 
 |  | 
|  | THEN 
 |  | 
|  |     ZF � 1;
 |  | 
|  |     register � UNDEFINED;
 |  | 
|  | ELSE 
 |  | 
|  |     temp � 0;
 |  | 
|  |     ZF � 0;
 |  | 
|  |     WHILE BIT[r/m,temp] = 0 
 |  | 
|  |     DO 
 |  | 
|  |        temp � temp + 1;
 |  | 
|  |        register � temp;
 |  | 
|  |    OD;
 |  | 
|  | FI;</pre>
 |  | 
|  | [[[01546.htm|prev]]][[[01548.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |? |  |  |? |* |? |? |? |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The ZF flag is set if all bits are 0; otherwise, the ZF flag is cleared. OF , SF, AF, PF, CF = undefined.
 |  | 
|  |   |  | 
|  | [[[01547.htm|prev]]][[[01549.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS(0) for an illegal address in the SS segment; #PF( fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01548.htm|prev]]][[[01550.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.
 |  | 
|  |   |  | 
|  | [[[01549.htm|prev]]][[[01551.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01550.htm|prev]]][[[01552.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01545.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01547.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01546.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01548.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01549.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01550.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01551.htm|prev]]][[[01553.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === BSR-Bit Scan Reverse ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BD     |BSR r16,r/m16       | | | |X|X|X|Bit scan reverse on r/m word      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BD     |BSR r32,r/m32       | | | |X|X|X|Bit scan reverse on r/m dword     |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The BSR instruction scans the bits in the second word or doubleword operand from the most significant bit to the least significant bit. The ZF flag is set if all the bits are 0; otherwise, the ZF flag is cleared and the destination register is loaded with the bit index of the first set bit found when scanning in the reverse direction.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01554.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01556.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01555.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01557.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01558.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01559.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01552.htm|prev]]][[[01554.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BD     |BSR r16,r/m16       | | | |X|X|X|Bit scan reverse on r/m word      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BD     |BSR r32,r/m32       | | | |X|X|X|Bit scan reverse on r/m dword     |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01553.htm|prev]]][[[01555.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The BSR instruction scans the bits in the second word or doubleword operand from the most significant bit to the least significant bit. The ZF flag is set if all the bits are 0; otherwise, the ZF flag is cleared and the destination register is loaded with the bit index of the first set bit found when scanning in the reverse direction.
 |  | 
|  |   |  | 
|  | [[[01554.htm|prev]]][[[01556.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF r/m = 0 
 |  | 
|  | THEN 
 |  | 
|  |     ZF � 1;
 |  | 
|  |     register � UNDEFINED;
 |  | 
|  | ELSE 
 |  | 
|  |     temp � OperandSize =1;
 |  | 
|  |     ZF � 0;
 |  | 
|  |     WHILE BIT[r/m,temp] = 0 
 |  | 
|  |     DO 
 |  | 
|  |        temp � temp - 1;
 |  | 
|  |        register � temp;
 |  | 
|  |    OD;
 |  | 
|  | FI;</pre>
 |  | 
|  | [[[01555.htm|prev]]][[[01557.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |? |  |  |? |* |? |? |? |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The ZF flag is set if all bits are 0; otherwise, the ZF flag is cleared. OS , SF, AF, PF, CF = undefined.
 |  | 
|  |   |  | 
|  | [[[01556.htm|prev]]][[[01558.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) if the result is in a nonwritable segment; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS (0) for an illegal address in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01557.htm|prev]]][[[01559.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.
 |  | 
|  |   |  | 
|  | [[[01558.htm|prev]]][[[01560.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01559.htm|prev]]][[[01561.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01554.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01556.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01555.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01557.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01558.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01559.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01560.htm|prev]]][[[01562.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === BSWAP-Byte Swap ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F C8+rd  |BSWAP r32           | | | | |X|X|Swap bytes to convert little/big  |
 |  | 
|  | |          |                    | | | | | | |endian data in a 32-bit register  |
 |  | 
|  | |          |                    | | | | | | |to big/little endian form         |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The BSWAP instruction reverses the byte order of a 32-bit register, converting a value in little/big endian form to big/little endian form. When BSWAP is used with 16-bit operand size, the result left in the destination register is undefined.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01563.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01470.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01565.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01564.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01561.htm|prev]]][[[01563.htm|next]]][[[01561.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F C8+rd  |BSWAP r32           | | | | |X|X|Swap bytes to convert little/big  |
 |  | 
|  | |          |                    | | | | | | |endian data in a 32-bit register  |
 |  | 
|  | |          |                    | | | | | | |to big/little endian form         |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01562.htm|prev]]][[[01564.htm|next]]][[[01561.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The BSWAP instruction reverses the byte order of a 32-bit register, converting a value in little/big endian form to big/little endian form. When BSWAP is used with 16-bit operand size, the result left in the destination register is undefined.
 |  | 
|  |   |  | 
|  | [[[01563.htm|prev]]][[[01565.htm|next]]][[[01561.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>TEMP � r32 
 |  | 
|  | r32(7..0) � TEMP(31..24)
 |  | 
|  | r32(15..8) � TEMP(23..16)
 |  | 
|  | r32(23..16) � TEMP(15..8)
 |  | 
|  | r32(31..24) � TEMP(7.0)</pre>
 |  | 
|  | [[[01564.htm|prev]]][[[01566.htm|next]]][[[01561.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Notes ===
 |  | 
|  |   |  | 
|  | BSWAP is not supported on Intel386 processors. Include functionally- equivalent code for Intel386 CPUs.
 |  | 
|  |   |  | 
|  | [[[01565.htm|prev]]][[[01567.htm|next]]][[[01561.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01563.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01470.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01565.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01564.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01566.htm|prev]]][[[01568.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === BT-Bit Test ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F A3     |BT r/m16,r16        | | | |X|X|X|Save bit in carry flag            |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F A3     |BT r/m32,r32        | | | |X|X|X|Save bit in carry flag            |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /4  |BT r/m16,imm8       | | | |X|X|X|Save bit in carry flag            |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /4  |BT r/m32,imm8       | | | |X|X|X|Save bit in carry flag            |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The BT instruction saves the value of the bit indicated by the base (first operand) and the bit offset (second operand) into the CF flag.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01569.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01571.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01575.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01570.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01572.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01573.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01574.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01567.htm|prev]]][[[01569.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F A3     |BT r/m16,r16        | | | |X|X|X|Save bit in carry flag            |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F A3     |BT r/m32,r32        | | | |X|X|X|Save bit in carry flag            |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /4  |BT r/m16,imm8       | | | |X|X|X|Save bit in carry flag            |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /4  |BT r/m32,imm8       | | | |X|X|X|Save bit in carry flag            |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01568.htm|prev]]][[[01570.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The BT instruction saves the value of the bit indicated by the base (first operand) and the bit offset (second operand) into the CF flag.
 |  | 
|  |   |  | 
|  | [[[01569.htm|prev]]][[[01571.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CF � BIT [LeftSRC, RightSRC];</pre>
 |  | 
|  | [[[01570.htm|prev]]][[[01572.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |  |  |  |  |  |* |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The CF flag contains the value of the selected bit.
 |  | 
|  |   |  | 
|  | [[[01571.htm|prev]]][[[01573.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS(0) for an illegal address in the SS segment; #PF( fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01572.htm|prev]]][[[01574.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.
 |  | 
|  |   |  | 
|  | [[[01573.htm|prev]]][[[01575.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01574.htm|prev]]][[[01576.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Notes ===
 |  | 
|  |   |  | 
|  | The index of the selected bit can be given by the immediate constant in the instruction or by a value in a general register. Only an 8-bit immediate value is used in the instruction. This operand is taken modulo 32, so the range of immediate bit offsets is 0..31. This allows any bit within a register to be selected. For memory bit strings, this immediate field gives only the bit offset within a word or doubleword.
 |  | 
|  |   |  | 
|  | Immediate bit offsets larger than 31 are supported by some assemblers by using the immediate bit offset field in combination with the displacement field of the memory operand. In this case, the low-order 3 to 5 bits (3 for 16 bit operands, 5 for 32-bit operands) of the immediate bit offset are stored in the immediate bit offset field, and the high-order bits are shifted and combined with the byte displacement in the addressing mode by the assembler. The processor will ignore the high-order bits if they are not zero.
 |  | 
|  |   |  | 
|  | When accessing a bit in memory, the processor may access four bytes starting from the memory address given by: <br />
 |  | 
|  |   |  | 
|  | <pre>    Effective Address + (4* (BitOffset DIV 32))</pre>
 |  | 
|  | for a 32-bit operand size, or two bytes starting from the memory address given by: <br />
 |  | 
|  |   |  | 
|  | <pre>    Effective Address + (2 * (BitOffset DIV 16))</pre>
 |  | 
|  | for a 16-bit operand size. It may do so even when only a single byte needs to be accessed in order to reach the given bit. You must therefore avoid referencing areas of memory close to address space holes. In particular, avoid references to memory-mapped I/O registers. Instead, use the MOV instructions to load from or store to these addresses, and use the register form of these instructions to manipulate the data.
 |  | 
|  |   |  | 
|  | [[[01575.htm|prev]]][[[01577.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01569.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01571.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01575.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01570.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01572.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01573.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01574.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01576.htm|prev]]][[[01578.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === BTC-Bit Test and Complement ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BB     |BTC r/m16,r16       | | | |X|X|X|Save bit in carry flag and        |
 |  | 
|  | |          |                    | | | | | | |complement                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BB     |BTC r/m32,r32       | | | |X|X|X|Save bit in carry flag and        |
 |  | 
|  | |          |                    | | | | | | |complement                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /7  |BTC r/m16,imm8      | | | |X|X|X|Save bit in carry flag and        |
 |  | 
|  | |ib        |                    | | | | | | |complement                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /7  |BTC r/m32,imm8      | | | |X|X|X|Save bit in carry flag and        |
 |  | 
|  | |ib        |                    | | | | | | |complement                        |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The BTC instruction saves the value of the bit indicated by the base (first operand) and the bit offset (second operand) into the CF flag and then complements the bit.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01579.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01581.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01585.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01580.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01582.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01583.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01584.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01577.htm|prev]]][[[01579.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BB     |BTC r/m16,r16       | | | |X|X|X|Save bit in carry flag and        |
 |  | 
|  | |          |                    | | | | | | |complement                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BB     |BTC r/m32,r32       | | | |X|X|X|Save bit in carry flag and        |
 |  | 
|  | |          |                    | | | | | | |complement                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /7  |BTC r/m16,imm8      | | | |X|X|X|Save bit in carry flag and        |
 |  | 
|  | |ib        |                    | | | | | | |complement                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /7  |BTC r/m32,imm8      | | | |X|X|X|Save bit in carry flag and        |
 |  | 
|  | |ib        |                    | | | | | | |complement                        |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01578.htm|prev]]][[[01580.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The BTC instruction saves the value of the bit indicated by the base (first operand) and the bit offset (second operand) into the CF flag and then complements the bit.
 |  | 
|  |   |  | 
|  | [[[01579.htm|prev]]][[[01581.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CF � BIT[LeftSRC, RightSRC];
 |  | 
|  | BIT[LeftSRC, RightSRC] � NOT BIT[LeftSrc, RightSRC];</pre>
 |  | 
|  | [[[01580.htm|prev]]][[[01582.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |  |  |  |  |  |* |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The CF flag contains the complement of the selected bit.
 |  | 
|  |   |  | 
|  | [[[01581.htm|prev]]][[[01583.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) if the result is in a nonwritable segment; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, and GS segments; # SS(0) for an illegal address in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01582.htm|prev]]][[[01584.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.
 |  | 
|  |   |  | 
|  | [[[01583.htm|prev]]][[[01585.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01584.htm|prev]]][[[01586.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Notes ===
 |  | 
|  |   |  | 
|  | The index of the selected bit can be given by the immediate constant in the instruction or by a value in a general register. Only an 8-bit immediate value may be used in the instruction. This operand is taken modulo 32, so the range of immediate bit offsets is 0..31. This allows any bit within a register to be selected. For memory bit strings, this immediate field gives only the bit offset within a word or doubleword.
 |  | 
|  |   |  | 
|  | Immediate bit offsets larger then 31 are supported by some assemblers by using the immediate bit offset field in combination with the displacement field of the memory operand. In this case, the low-order 3 to 5 bits (3 for 16-bit operands, 5 for 32-bit operands) of the immediate bit offset are stored in the immediate bit offset field, and the high-order bits are shifted and combined with the byte displacement in the addressing mode by the assembler. The processor will ignore the high order bits if they are not zero.
 |  | 
|  |   |  | 
|  | When accessing a bit in memory, the processor may access four bytes starting from the memory address given by: <br />
 |  | 
|  |   |  | 
|  | <pre>    Effective Address + (4 * (BitOffset DIV 32))</pre>
 |  | 
|  | for a 32-bit operand size, or two bytes starting from the memory address given by: <br />
 |  | 
|  |   |  | 
|  | <pre>    Effective Address + (2 * (BitOffset DIV 16))</pre>
 |  | 
|  | for a 16-bit operand size. It may do so even when only a single byte needs to be accessed in order to reach the given bit. Therefore, referencing areas of memory close to address space holes should be avoided. In particular, avoid references to memory-mapped I/O registers. Instead, use the MOV instructions to load from or store to these addresses, and use the register form of these instructions to manipulate the data.
 |  | 
|  |   |  | 
|  | [[[01585.htm|prev]]][[[01587.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01579.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01581.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01585.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01580.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01582.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01583.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01584.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01586.htm|prev]]][[[01588.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === BTR-Bit Test and Reset ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F B3     |BTR r/m16,r16       | | | |X|X|X|Save bit in carry flag and reset  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F B3     |BTR r/m32,r32       | | | |X|X|X|Save bit in carry flag and reset  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /6  |BTR r/m16,imm8      | | | |X|X|X|Save bit in carry flag and reset  |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /6  |BTR r/m32,imm8      | | | |X|X|X|Save bit in carry flag and reset  |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The BTR instruction saves the value of the bit indicated by the base (first operand) and the bit offset (second operand) into the CF flag and then stores 0 in the bit.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01589.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01591.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01595.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01590.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01592.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01593.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01594.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01587.htm|prev]]][[[01589.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F B3     |BTR r/m16,r16       | | | |X|X|X|Save bit in carry flag and reset  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F B3     |BTR r/m32,r32       | | | |X|X|X|Save bit in carry flag and reset  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /6  |BTR r/m16,imm8      | | | |X|X|X|Save bit in carry flag and reset  |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /6  |BTR r/m32,imm8      | | | |X|X|X|Save bit in carry flag and reset  |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01588.htm|prev]]][[[01590.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The BTR instruction saves the value of the bit indicated by the base (first operand) and the bit offset (second operand) into the CF flag and then stores 0 in the bit.
 |  | 
|  |   |  | 
|  | [[[01589.htm|prev]]][[[01591.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CF � BIT[LeftSRC, RightSRC];
 |  | 
|  | BIT[LeftSRC, RightSRC] � 0;</pre>
 |  | 
|  | [[[01590.htm|prev]]][[[01592.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |  |  |  |  |  |* |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The CF flag contains the value of the selected bit.
 |  | 
|  |   |  | 
|  | [[[01591.htm|prev]]][[[01593.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) if the result is in a nonwritable segment; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS (0) for an illegal address in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01592.htm|prev]]][[[01594.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.
 |  | 
|  |   |  | 
|  | [[[01593.htm|prev]]][[[01595.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01594.htm|prev]]][[[01596.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Notes ===
 |  | 
|  |   |  | 
|  | The index of the selected bit can be given by the immediate constant in the instruction or by a value in a general register. Only an 8-bit immediate value is used in the instruction. This operand is taken modulo 32, so the range of immediate bit offsets is 0..31. This allows any bit within a register to be selected. For memory bit strings, this immediate field gives only the bit offset within a word or doubleword.
 |  | 
|  |   |  | 
|  | Immediate bit offsets larger than 31 are supported by some assemblers by using the immediate bit offset field in combination with the displacement field of the memory operand. In this case, the low-order 3 to 5-bits (3 for 16-bit operands, 5 for 32-bit operands) of the immediate bit offset are stored in the immediate bit offset field, and the high-order bits are shifted and combined with the byte displacement in the addressing mode by the assembler. The processor will ignore the high-order bits if they are not zero.
 |  | 
|  |   |  | 
|  | When accessing a bit in memory, the processor may access four bytes starting from the memory address given by: <br />
 |  | 
|  |   |  | 
|  | <pre>    Effective Address + 4 * (BitOffset DIV 32)</pre>
 |  | 
|  | for a 32-bit operand size, or two bytes starting from the memory address given by: <br />
 |  | 
|  |   |  | 
|  | <pre>    Effective Address + 2 * (BitOffset DIV 16)</pre>
 |  | 
|  | for a 16-bit operand size. It may do so even when only a single byte needs to be accessed in order to reach the given bit. You must therefore avoid referencing areas of memory close to address space holes. In particular, avoid references to memory-mapped I/O registers. Instead, use the MOV instructions to load from or store to these addresses, and use the register form of these instructions to manipulate the data.
 |  | 
|  |   |  | 
|  | [[[01595.htm|prev]]][[[01597.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01589.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01591.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01595.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01590.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01592.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01593.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01594.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01596.htm|prev]]][[[01598.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === BTS-Bit Test and Set ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F AB     |BTS r/m16,r16       | | | |X|X|X|Save bit in carry flag and set    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F AB     |BTS r/m32,r32       | | | |X|X|X|Save bit in carry flag and set    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /5  |BTS r/m16,imm8      | | | |X|X|X|Save bit in carry flag and set    |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /5  |BTS r/m32,imm8      | | | |X|X|X|Save bit in carry flag and set    |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The BTS instruction saves the value of the bit indicated by the base (first operand) and the bit offset (second operand) into the CF flag and then stores 1 in the bit.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01599.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01601.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01605.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01600.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01602.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01603.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01604.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01597.htm|prev]]][[[01599.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F AB     |BTS r/m16,r16       | | | |X|X|X|Save bit in carry flag and set    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F AB     |BTS r/m32,r32       | | | |X|X|X|Save bit in carry flag and set    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /5  |BTS r/m16,imm8      | | | |X|X|X|Save bit in carry flag and set    |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F BA /5  |BTS r/m32,imm8      | | | |X|X|X|Save bit in carry flag and set    |
 |  | 
|  | |ib        |                    | | | | | | |                                  |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01598.htm|prev]]][[[01600.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The BTS instruction saves the value of the bit indicated by the base (first operand) and the bit offset (second operand) into the CF flag and then stores 1 in the bit.
 |  | 
|  |   |  | 
|  | [[[01599.htm|prev]]][[[01601.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CF � BIT[LeftSRC, RightSRC];
 |  | 
|  | BIT[LeftSRC, RightSRC] � 1;</pre>
 |  | 
|  | [[[01600.htm|prev]]][[[01602.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |  |  |  |  |  |* |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The CF flag contains the value of the selected bit.
 |  | 
|  |   |  | 
|  | [[[01601.htm|prev]]][[[01603.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) if the result is in a nonwritable segment; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS (0) for an illegal address in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01602.htm|prev]]][[[01604.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.
 |  | 
|  |   |  | 
|  | [[[01603.htm|prev]]][[[01605.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01604.htm|prev]]][[[01606.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Notes ===
 |  | 
|  |   |  | 
|  | The index of the selected bit can be given by the immediate constant in the instruction or by a value in a general register. Only an 8-bit immediate value is used in the instruction. This operand is taken modulo 32, so the range of immediate bit offsets is 0..31. This allows any bit within a register to be selected. For memory bit strings, this immediate field gives only the bit offset within a word or doubleword.
 |  | 
|  |   |  | 
|  | Immediate bit offsets larger than 31 are supported by some assemblers by using the immediate bit offset field in combination with the displacement field of the memory operand. In this case, the low-order 3 to 5 bits (3 for 16-bit operands, 5 for 32-bit operands) of the immediate bit offset are stored in the immediate bit offset field, and the high-order bits are shifted and combined with the byte displacement in the addressing mode by the assembler. The processor will ignore the high-order bits if they are not zero.
 |  | 
|  |   |  | 
|  | When accessing a bit in memory, the processor may access four bytes starting from the memory address given by: <br />
 |  | 
|  |   |  | 
|  | <pre>    Effective Address + (4 * (BitOffset DIV 32))</pre>
 |  | 
|  | for a 32-bit operand size, or two bytes starting from the memory address given by: <br />
 |  | 
|  |   |  | 
|  | <pre>    Effective Address + (2 * (BitOffset DIV 16))</pre>
 |  | 
|  | for a 16-bit operand size. It may do this even when only a single byte needs to be accessed in order to get at the given bit. You must therefore be careful to avoid referencing areas of memory close to address space holes. In particular, avoid references to memory-mapped I/O registers. Instead, use the MOV instructions to load from or store to these addresses, and use the register form of these instructions to manipulate the data.
 |  | 
|  |   |  | 
|  | [[[01605.htm|prev]]][[[01607.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01599.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01601.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01605.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01600.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01602.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01603.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01604.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01606.htm|prev]]][[[01608.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === CALL-Call Procedure ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |E8 cw     |CALL rel16          |X|X|X|X|X|X|Call near, displacement relative  |
 |  | 
|  | |          |                    | | | | | | |to next instruction               |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /2     |CALL r/m16          |X|X|X|X|X|X|Call near, register               |
 |  | 
|  | |          |                    | | | | | | |indirect/memory indirect          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cd     |CALL ptr16:16       |X|X|X|X|X|X|Call intersegment, to full pointer|
 |  | 
|  | |          |                    | | | | | | |given                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cd     |CALL ptr16:16       | | |X|X|X|X|Call gate, same privilege         |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cd     |CALL ptr16:16       | | |X|X|X|X|Call gate, more privilege, no     |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cd     |CALL ptr16:16       | | |X|X|X|X|Call gate, more privilege, x      |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cd     |CALL ptr16:16       | | |X|X|X|X|Call to task (via task state      |
 |  | 
|  | |          |                    | | | | | | |segment/task gate for 286)        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:16         |X|X|X|X|X|X|Call intersegment, address at r/m |
 |  | 
|  | |          |                    | | | | | | |dword                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:16         | | |X|X|X|X|Call gate, same privilege         |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:16         | | |X|X|X|X|Call gate, more privilege, no     |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:16         | | |X|X|X|X|Call gate, more privilege, x      |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:16         | | |X|X|X|X|Call to task (via task state      |
 |  | 
|  | |          |                    | | | | | | |segment/task gate for 286)        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |E8 cd     |CALL rel32          | | | |X|X|X|Call near, displacement relative  |
 |  | 
|  | |          |                    | | | | | | |to next instruction               |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /2     |CALL r/m32          | | | |X|X|X|Call near, register               |
 |  | 
|  | |          |                    | | | | | | |indirect/memory indirect          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cp     |CALL ptr16:32       | | | |X|X|X|Call intersegment, to full pointer|
 |  | 
|  | |          |                    | | | | | | |given                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cp     |CALL ptr16:32       | | | |X|X|X|Call gate, same privilege         |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cp     |CALL ptr16:32       | | | |X|X|X|Call gate, more privilege, no     |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cp     |CALL ptr16:32       | | | |X|X|X|Call gate, more privilege, x      |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cp     |CALL ptr16:32       | | | |X|X|X|Call to task                      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:32         | | | |X|X|X|Call intersegment, address at r/m |
 |  | 
|  | |          |                    | | | | | | |fword                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:32         | | | |X|X|X|Call gate, same privilege         |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:32         | | | |X|X|X|Call gate, more privilege, no     |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:32         | | | |X|X|X|Call gate, more privilege, x      |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:32         | | | |X|X|X|Call to task                      |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The CALL instruction causes the procedure named in the operand to be run. When the procedure is complete (a return instruction is run within the procedure), processing continues at the instruction that follows the CALL instruction.
 |  | 
|  |   |  | 
|  | The action of the different forms of the instruction are described below.
 |  | 
|  |   |  | 
|  | Near calls are those with destination of type ''r/m16, r/m32, rel16, rel32''; changing or saving the segment register value is not necessary. The CALL ''rel16''and CALL ''rel32''forms add a signed offset to the address of the instruction following the CALL instruction to determine the destination. The ''rel16''form is used when the instruction's operand-size attribute is 16- bits; ''rel32''is used when the operand-size attribute is 32-bits. The result is stored in the 32-bit EIP register. With ''rel16'', the upper 16-bits of the EIP register are cleared, resulting in an offset whose value does not exceed 16-bits. CALL ''r/m16''and CALL ''r/m32''specify a register or memory location from which the absolute segment offset is fetched. The offset fetched from ''r/m''is 32-bits for an operand-size attribute of 32 (''r/m32''), or 16-bits for an operand-size of 16 (''r/m16''). The offset of the instruction following the CALL instruction is pushed onto the stack. It will be popped by a near RET instruction within the procedure. The CS register is not changed by this form of CALL.
 |  | 
|  |   |  | 
|  | The far calls, CALL ''ptr:16''and CALL ''ptr16:32'', use a four-byte or six-byte operand as a long pointer to the procedure called. The CALL ''m16:16''and ''m16: 32''forms fetch the long pointer from the memory location specified ( indirection). In Real Address Mode or Virtual 8086 Mode, the long pointer provides 16-bits for the CS register and 16 or 32-bits for the EIP register (depending on the operand-size attribute). These forms of the instruction push both the CS and IP or EIP registers as a return address.
 |  | 
|  |   |  | 
|  | In Protected Mode, both long pointer forms consult the AR byte in the descriptor indexed by the selector part of the long pointer. Depending on the value of the AR byte, the call will perform one of the following types of control transfers:
 |  | 
|  |   |  | 
|  | �A far call to the same protection level
 |  | 
|  |   |  | 
|  | �An inter-protection level far call
 |  | 
|  |   |  | 
|  | �A task switch <br />
 |  | 
|  |   |  | 
|  | A CALL-indirect-thru-memory, which uses the stack pointer (ESP) as a base register, references memory before the CALL. The base used is the value of the ESP before the instruction runs.
 |  | 
|  |   |  | 
|  | For more information on Protected Mode control transfers, refer to the Intel documentation.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01609.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01611.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01615.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01610.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01612.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01613.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01614.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01607.htm|prev]]][[[01609.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |E8 cw     |CALL rel16          |X|X|X|X|X|X|Call near, displacement relative  |
 |  | 
|  | |          |                    | | | | | | |to next instruction               |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /2     |CALL r/m16          |X|X|X|X|X|X|Call near, register               |
 |  | 
|  | |          |                    | | | | | | |indirect/memory indirect          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cd     |CALL ptr16:16       |X|X|X|X|X|X|Call intersegment, to full pointer|
 |  | 
|  | |          |                    | | | | | | |given                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cd     |CALL ptr16:16       | | |X|X|X|X|Call gate, same privilege         |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cd     |CALL ptr16:16       | | |X|X|X|X|Call gate, more privilege, no     |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cd     |CALL ptr16:16       | | |X|X|X|X|Call gate, more privilege, x      |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cd     |CALL ptr16:16       | | |X|X|X|X|Call to task (via task state      |
 |  | 
|  | |          |                    | | | | | | |segment/task gate for 286)        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:16         |X|X|X|X|X|X|Call intersegment, address at r/m |
 |  | 
|  | |          |                    | | | | | | |dword                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:16         | | |X|X|X|X|Call gate, same privilege         |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:16         | | |X|X|X|X|Call gate, more privilege, no     |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:16         | | |X|X|X|X|Call gate, more privilege, x      |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:16         | | |X|X|X|X|Call to task (via task state      |
 |  | 
|  | |          |                    | | | | | | |segment/task gate for 286)        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |E8 cd     |CALL rel32          | | | |X|X|X|Call near, displacement relative  |
 |  | 
|  | |          |                    | | | | | | |to next instruction               |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /2     |CALL r/m32          | | | |X|X|X|Call near, register               |
 |  | 
|  | |          |                    | | | | | | |indirect/memory indirect          |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cp     |CALL ptr16:32       | | | |X|X|X|Call intersegment, to full pointer|
 |  | 
|  | |          |                    | | | | | | |given                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cp     |CALL ptr16:32       | | | |X|X|X|Call gate, same privilege         |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cp     |CALL ptr16:32       | | | |X|X|X|Call gate, more privilege, no     |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cp     |CALL ptr16:32       | | | |X|X|X|Call gate, more privilege, x      |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |9A cp     |CALL ptr16:32       | | | |X|X|X|Call to task                      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:32         | | | |X|X|X|Call intersegment, address at r/m |
 |  | 
|  | |          |                    | | | | | | |fword                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:32         | | | |X|X|X|Call gate, same privilege         |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:32         | | | |X|X|X|Call gate, more privilege, no     |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:32         | | | |X|X|X|Call gate, more privilege, x      |
 |  | 
|  | |          |                    | | | | | | |parameters                        |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FF /3     |CALL m16:32         | | | |X|X|X|Call to task                      |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01608.htm|prev]]][[[01610.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The CALL instruction causes the procedure named in the operand to be run. When the procedure is complete (a return instruction is run within the procedure), processing continues at the instruction that follows the CALL instruction.
 |  | 
|  |   |  | 
|  | The action of the different forms of the instruction are described below.
 |  | 
|  |   |  | 
|  | Near calls are those with destination of type ''r/m16, r/m32, rel16, rel32''; changing or saving the segment register value is not necessary. The CALL ''rel16''and CALL ''rel32''forms add a signed offset to the address of the instruction following the CALL instruction to determine the destination. The ''rel16''form is used when the instruction's operand-size attribute is 16- bits; ''rel32''is used when the operand-size attribute is 32-bits. The result is stored in the 32-bit EIP register. With ''rel16'', the upper 16-bits of the EIP register are cleared, resulting in an offset whose value does not exceed 16-bits. CALL ''r/m16''and CALL ''r/m32''specify a register or memory location from which the absolute segment offset is fetched. The offset fetched from ''r/m''is 32-bits for an operand-size attribute of 32 (''r/m32''), or 16-bits for an operand-size of 16 (''r/m16''). The offset of the instruction following the CALL instruction is pushed onto the stack. It will be popped by a near RET instruction within the procedure. The CS register is not changed by this form of CALL.
 |  | 
|  |   |  | 
|  | The far calls, CALL ''ptr:16''and CALL ''ptr16:32'', use a four-byte or six-byte operand as a long pointer to the procedure called. The CALL ''m16:16''and ''m16: 32''forms fetch the long pointer from the memory location specified ( indirection). In Real Address Mode or Virtual 8086 Mode, the long pointer provides 16-bits for the CS register and 16 or 32-bits for the EIP register (depending on the operand-size attribute). These forms of the instruction push both the CS and IP or EIP registers as a return address.
 |  | 
|  |   |  | 
|  | In Protected Mode, both long pointer forms consult the AR byte in the descriptor indexed by the selector part of the long pointer. Depending on the value of the AR byte, the call will perform one of the following types of control transfers:
 |  | 
|  |   |  | 
|  | �A far call to the same protection level
 |  | 
|  |   |  | 
|  | �An inter-protection level far call
 |  | 
|  |   |  | 
|  | �A task switch <br />
 |  | 
|  |   |  | 
|  | A CALL-indirect-thru-memory, which uses the stack pointer (ESP) as a base register, references memory before the CALL. The base used is the value of the ESP before the instruction runs.
 |  | 
|  |   |  | 
|  | For more information on Protected Mode control transfers, refer to the Intel documentation.
 |  | 
|  |   |  | 
|  | [[[01609.htm|prev]]][[[01611.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF rel/16 or rel32 type of call 
 |  | 
|  | THEN (* near relative call *)
 |  | 
|  |     IF OperandSize = 16 
 |  | 
|  |     THEN 
 |  | 
|  |        Push(IP);
 |  | 
|  |        EIP � (EIP + rel16) AND 0000FFFFH;
 |  | 
|  |     ELSE (* OperandSize = 32 *)
 |  | 
|  |        Push(EIP);
 |  | 
|  |        EIP � EIP + rel32;
 |  | 
|  |     FI;
 |  | 
|  | FI;
 |  | 
|  | IF r/m16 or r/m32 type of call 
 |  | 
|  | THEN (* near absolute call *)
 |  | 
|  | IF OperandSize = 16 
 |  | 
|  |     THEN 
 |  | 
|  |        Push(IP);
 |  | 
|  |        EIP � [r/m16] AND 0000FFFFH;
 |  | 
|  |     ELSE (*OperandSize = 32 *)
 |  | 
|  |        Push(EIP);
 |  | 
|  |        EIP �[r/m32]
 |  | 
|  |     FI;
 |  | 
|  | FI 
 |  | 
|  |   |  | 
|  | IF (PE = 0 OR (PE = 1 AND VM = 1))
 |  | 
|  | (* real mode or virtual 8086 mode *)
 |  | 
|  |    AND instruction = far CALL 
 |  | 
|  |      (* i.e., operand type is m16:16, m16:32, ptr16:16, ptr16:32*)
 |  | 
|  | THEN 
 |  | 
|  |     IF OperandSize = 16 
 |  | 
|  |     THEN 
 |  | 
|  |        Push(CS);
 |  | 
|  |        Push(IP); (* address of next instruction; 16 bits *)
 |  | 
|  |     ELSE 
 |  | 
|  |        Push(CS); (* padded with 16 high-order bits *)
 |  | 
|  |        Push(EIP); (* address of next instruction; 32 bits *)
 |  | 
|  | FI;
 |  | 
|  | IF operand type is m16:16 or m16:32
 |  | 
|  | THEN (* indirect far call *)
 |  | 
|  |     IF OperandSize = 16 
 |  | 
|  |     THEN 
 |  | 
|  |        CS:IP � [m16:16];
 |  | 
|  |     EIP � EIP AND 0000FFFFH; (* clear upper 16 bits *)
 |  | 
|  |     ELSE (* OperandSize = 32 *)
 |  | 
|  |        CS:EIP � [m16:32[;
 |  | 
|  |     FI;
 |  | 
|  | FI;
 |  | 
|  | IF operand type is ptr:16 or ptr16:32
 |  | 
|  | THEN (* direct far call *)
 |  | 
|  |     IF OperandSize = 16 
 |  | 
|  |     THEN 
 |  | 
|  |        CS:IP � ptr:16;
 |  | 
|  |        EIP � EIP AND 0000FFFFH; (* clear upper 16 bits *)
 |  | 
|  |     ELSE (* OperandSize = 32 *)
 |  | 
|  |        CS:EIP � ptr16:32;
 |  | 
|  |     FI;
 |  | 
|  |   FI;
 |  | 
|  | FI;
 |  | 
|  |   |  | 
|  | IF (PE = 1 AND VM = 0) (* Protected mode, not V86 mode *)
 |  | 
|  |   AND instruction = far CALL 
 |  | 
|  | THEN 
 |  | 
|  |   If indirect, then check access of EA doubleword;
 |  | 
|  |     #GP(0) if limit violation;
 |  | 
|  |   New CS selector must not be null else #GP(0);
 |  | 
|  |   Check that new CS selector index is within its 
 |  | 
|  |     descriptor table limits; else #GP(new CS selector);
 |  | 
|  |   Examine AR byte of selected descriptor for various legal values;
 |  | 
|  |     depending on value:
 |  | 
|  |     go to CONFORMING-CODE-SEGMENT;
 |  | 
|  |     go to NONCONFORMING-CODE-SEGMENT;
 |  | 
|  |     go to CALL-GATE;
 |  | 
|  |     go to TASK-GATE;
 |  | 
|  |     go to TASK-STATE-SEGMENT;
 |  | 
|  |   ELSE #GP(code segment selector);
 |  | 
|  | FI;
 |  | 
|  |   |  | 
|  | CONFORMING-CODE-SEGMENT:
 |  | 
|  |   DPL must be ó CPL ELSE #GP(code segment selector);
 |  | 
|  |   Segment must be present ELSE #NP(code segment selector);
 |  | 
|  |   Stack must be big enough for return address ELSE #SS(0);
 |  | 
|  |   Instruction pointer must be in code segment limit ELSE #GP(0);
 |  | 
|  |   Load code segment descriptor into CS register;
 |  | 
|  |   Load CS with new code segment selector;
 |  | 
|  |   Load EIP with zero-extend(new offset);
 |  | 
|  |   IF OperandSize=16 THEN EIP � EIP AND 0000FFFFH; FI;
 |  | 
|  |   |  | 
|  | NONCONFORMING-CODE-SEGMENT:
 |  | 
|  |   RPL must be ó CPL ELSE #GP(code segment selector)
 |  | 
|  |   DPL must be = CPL ELSE #GP(code segment selector)
 |  | 
|  |   Segment must be present ELSE #NP(code segment selector)
 |  | 
|  |   Stack must be big enough for return address ELSE #SS(0)
 |  | 
|  |   Instruction pointer must be in code segment limit ELSE #GP(0)
 |  | 
|  |   Load code segment descriptor into CS register 
 |  | 
|  |   Load CS with new code segment selector 
 |  | 
|  |   Set RPL of CS to CPL 
 |  | 
|  |   Load EIP with zero-extend(new offset);
 |  | 
|  |   IF OperandSize=16 THEN EIP � EIP AND 0000FFFFH; FI;
 |  | 
|  |   |  | 
|  |   CALL-GATE
 |  | 
|  |   Call gate DPL must be ò CPL ELSE #GP(call gate elector)
 |  | 
|  |   Call gate DPL must be ò RPL ELSE #GP(call gate elector)
 |  | 
|  |   Call gate just be present ELSE #NP(call gate selector)
 |  | 
|  |   Examine code segment selector in call gate descriptor:
 |  | 
|  |     Selector must not be null ELSE #GP(0)
 |  | 
|  |     Selector must be within its descriptor table 
 |  | 
|  |       limits ELSE #GP(code segment selector)
 |  | 
|  |     AR byte of selected descriptor must indicate code 
 |  | 
|  |       segment ELSE #GP(code segment selector)
 |  | 
|  |     DPL of selected descriptor must be ó CPL ELSE 
 |  | 
|  |       #GP(code segment selector)
 |  | 
|  |     IF non-conforming code segment AND DPL < CPL 
 |  | 
|  |     THEN go to MORE-PRIVILEGE
 |  | 
|  |     ELSE go to SAME-PRIVILEGE
 |  | 
|  |     FI;
 |  | 
|  |   |  | 
|  | MORE-PRIVILEGE:
 |  | 
|  |   Get new SS selector for new privilege level from TSS 
 |  | 
|  |     Check selector and descriptor for new SS:
 |  | 
|  |       Selector must not be null ELSE #TS(0)
 |  | 
|  |       Selector index must be within its descriptor 
 |  | 
|  |         table limits ELSE #TS(SS selector)
 |  | 
|  |       Selector's RPL must equal DPL of code segment 
 |  | 
|  |         ELSE #TS(SS selector)
 |  | 
|  |       Stack segment DPL must equal DPL of code 
 |  | 
|  |         segment ELSE #TS(SS selector)
 |  | 
|  |       Descriptor must indicate writable data segment 
 |  | 
|  |         ELSE #TS(SS selector)
 |  | 
|  |       Segment present ELSE #SS(SS selector)
 |  | 
|  | IF OperandSize=32
 |  | 
|  |   THEN 
 |  | 
|  |       New stack must have room for parameters plus 16 bytes 
 |  | 
|  |         ELSE #SS(SS selector)
 |  | 
|  |       EIP must be in code segment limit ELSE #GP(0)
 |  | 
|  |       Load new SS:eSP value from TSS 
 |  | 
|  |       Load new CS:EIP value from gate 
 |  | 
|  |   ELSE 
 |  | 
|  |     New stack must have room for parameters plus 8 bytes 
 |  | 
|  |       ELSE #SS(SS selector)
 |  | 
|  |     IP must be in code segment limit ELSE #GP(0)
 |  | 
|  |     Load new SS:eSP value from TSS 
 |  | 
|  |     Load new CS:IP value from gate 
 |  | 
|  |   FI;
 |  | 
|  |   Load CS descriptor 
 |  | 
|  |   Load SS descriptor 
 |  | 
|  |   Push long pointer of old stack onto new stack 
 |  | 
|  |   Get word count from call gate, mask to 5 bits 
 |  | 
|  |   Copy parameters from old stack onto new stack 
 |  | 
|  |   Push return address onto new stack 
 |  | 
|  |   Set CPL to stack segment DPL 
 |  | 
|  |   Set RPL of CS to CPL 
 |  | 
|  |   |  | 
|  | SAME-PRIVILEGE:
 |  | 
|  |   IF OperandSize=32
 |  | 
|  |   THEN 
 |  | 
|  |     Stack must have room for 6-byte return address (padded to 8 bytes)
 |  | 
|  |       ELSE #SS(0)
 |  | 
|  |     EIP must be within code segment limit ELSE #GP(0)
 |  | 
|  |     Load CS:EIP from gate 
 |  | 
|  |   ELSE 
 |  | 
|  |     Stack must have room for 4-byte return address ELSE #SS(0)
 |  | 
|  |     IP must be within code segment limit ELSE #GP(0)
 |  | 
|  |     Load CS:IP from gate 
 |  | 
|  | FI;
 |  | 
|  | Push return address onto stack 
 |  | 
|  | Load code segment descriptor into CS register 
 |  | 
|  | Set RPL of CS to CPL 
 |  | 
|  |   |  | 
|  | TASK-GATE:
 |  | 
|  |     Task gate DPL must be ó CPL ELSE #TS(gate selector)
 |  | 
|  |     Task gate DPL must be ó RPL ELSE #TS(gate selector)
 |  | 
|  |     Task Gate must be present ELSE #NP(gate selector)
 |  | 
|  |     Examine selector to TSS, given in Task Gate descriptor:
 |  | 
|  |       Must specify global in the local/global bit ELSE #TS(TSS selector)
 |  | 
|  |       Index must be within GDT limits ELSE #TS(TSS selector)
 |  | 
|  |       TSS descriptor AR byte must specify nonbusy TSS 
 |  | 
|  |         ELSE #TS(Tss selector)
 |  | 
|  |       Task State Segment must be present ELSE #NP(TSS selector)
 |  | 
|  |   SWITCH-TASKS (with nesting) to TSS 
 |  | 
|  |   IP must be in code segment limit ELSE #TS(0)
 |  | 
|  |   |  | 
|  | TASK-STATE-SEGMENT
 |  | 
|  |   TSS DPL must be ó CPL ELSE #TS(TSS selector)
 |  | 
|  |   TSS DPL must be ó RPL ELSE #TS(TSS selector)
 |  | 
|  |   TSS descriptor AR byte must specify available TSS 
 |  | 
|  |      ELSE #TS(TSS selector)
 |  | 
|  |   Task State Segment must be present ELSE #NP(TSS selector)
 |  | 
|  |   SWITCH-TASKS (with nesting) to TSS 
 |  | 
|  |   IP must be in code segment limit ELSE #TS(0)</pre>
 |  | 
|  | [[[01610.htm|prev]]][[[01612.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |  |  |  |  |  |  |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | All flags are affected if a task switch occurs; no flags are affected if a task switch does not occur.
 |  | 
|  |   |  | 
|  | [[[01611.htm|prev]]][[[01613.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | For far calls: #GP, #NP, #SS, and #TS, as indicated in the "Operation" section.
 |  | 
|  |   |  | 
|  | For near direct calls: #GP(0) if procedure location is beyond the code segment limits; #SS(0) if pushing the return address exceeds the bounds of the stack segment; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | For a near indirect call: #GP(0) for an illegal memory operand effective address is the CS, DS, ES, FS, or GS segments; #SS(0) for an illegal address in the SS segment; #GP(0) if the indirect offset obtained is beyond the code segment limits; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01612.htm|prev]]][[[01614.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.
 |  | 
|  |   |  | 
|  | [[[01613.htm|prev]]][[[01615.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | 
|  |   |  | 
|  | [[[01614.htm|prev]]][[[01616.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Notes ===
 |  | 
|  |   |  | 
|  | Any far call from a 32-bit code segment to a 16-bit code segment should be made from the first 64 Kbytes of the 32-bit code segment, because the operand-size attribute of the instruction is set to 16, allowing only a 16- bit return address offset to be saved.
 |  | 
|  |   |  | 
|  | [[[01615.htm|prev]]][[[01617.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01609.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01611.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01615.htm|Notes]]
 |  | 
|  |   |  | 
|  | [[01610.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01612.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01613.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01614.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01616.htm|prev]]][[[01618.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === CBW/CWDE-Convert Byte to Word/Convert Word to Doubleword ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |98        |CBW                 |X|X|X|X|X|X|AX � sign extend of AL            |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |98        |CWDE                | | | |X|X|X|EAX � sign-extend of AX           |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The CBW instruction converts the signed byte in the AL register to a signed word in the AX register by extending the most significant bit of the AL register (the sign bit) into all of the bits of the AH register. The CWDE instruction converts the signed word in the AX register to a doubleword in the EAX register by extending the most significant bit of the AX register into the two most significant bytes of the EAX register. Note that the CWDE instruction is different from the CWD instruction. The CWD instruction uses the DX:AX register pair rather than the EAX register as a destination.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01619.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01470.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01620.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01617.htm|prev]]][[[01619.htm|next]]][[[01617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |98        |CBW                 |X|X|X|X|X|X|AX � sign extend of AL            |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |98        |CWDE                | | | |X|X|X|EAX � sign-extend of AX           |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01618.htm|prev]]][[[01620.htm|next]]][[[01617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The CBW instruction converts the signed byte in the AL register to a signed word in the AX register by extending the most significant bit of the AL register (the sign bit) into all of the bits of the AH register. The CWDE instruction converts the signed word in the AX register to a doubleword in the EAX register by extending the most significant bit of the AX register into the two most significant bytes of the EAX register. Note that the CWDE instruction is different from the CWD instruction. The CWD instruction uses the DX:AX register pair rather than the EAX register as a destination.
 |  | 
|  |   |  | 
|  | [[[01619.htm|prev]]][[[01621.htm|next]]][[[01617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF OperandSize = 16 (* instruction = CBW *)
 |  | 
|  | THEN AX � Sign Extend(AL);
 |  | 
|  | ELSE (* OperandSize = 32, instruction = CWDE *)
 |  | 
|  |    EAX � Sign Extend(AX);
 |  | 
|  | FI;</pre>
 |  | 
|  | [[[01620.htm|prev]]][[[01622.htm|next]]][[[01617.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01619.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01470.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01620.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01621.htm|prev]]][[[01623.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === CDQ-Convert Double to Quad ===
 |  | 
|  |   |  | 
|  | See entry for CWD/CDQ-Convert Word to Double/Convert Double to Quad.
 |  | 
|  |   |  | 
|  | [[[01622.htm|prev]]][[[01624.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === CLC-Clear Carry Flag ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |F8        |CLC                 |X|X|X|X|X|X|Clear carry flag                  |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The CLC instruction clears the CF flag. It does not affect other flags or registers.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01625.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01627.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01626.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01623.htm|prev]]][[[01625.htm|next]]][[[01623.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |F8        |CLC                 |X|X|X|X|X|X|Clear carry flag                  |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01624.htm|prev]]][[[01626.htm|next]]][[[01623.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The CLC instruction clears the CF flag. It does not affect other flags or registers.
 |  | 
|  |   |  | 
|  | [[[01625.htm|prev]]][[[01627.htm|next]]][[[01623.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CF � 0;</pre>
 |  | 
|  | [[[01626.htm|prev]]][[[01628.htm|next]]][[[01623.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |  |  |  |  |  |0 |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The CF flag is cleared.
 |  | 
|  |   |  | 
|  | [[[01627.htm|prev]]][[[01629.htm|next]]][[[01623.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01625.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01627.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01626.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01628.htm|prev]]][[[01630.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === CLD-Clear Direction Flag ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FC        |CLD                 |X|X|X|X|X|X|Clear direction flag              |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The CLD instruction clears the direction flag. No other flags or registers are affected. After a CLD instruction is run, string operations will increment the index registers (SI and/or DI) that they use.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01631.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01633.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01632.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01629.htm|prev]]][[[01631.htm|next]]][[[01629.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FC        |CLD                 |X|X|X|X|X|X|Clear direction flag              |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01630.htm|prev]]][[[01632.htm|next]]][[[01629.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The CLD instruction clears the direction flag. No other flags or registers are affected. After a CLD instruction is run, string operations will increment the index registers (SI and/or DI) that they use.
 |  | 
|  |   |  | 
|  | [[[01631.htm|prev]]][[[01633.htm|next]]][[[01629.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>DF � 0;</pre>
 |  | 
|  | [[[01632.htm|prev]]][[[01634.htm|next]]][[[01629.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |0 |  |  |  |  |  |  |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The DF flag is cleared.
 |  | 
|  |   |  | 
|  | [[[01633.htm|prev]]][[[01635.htm|next]]][[[01629.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01631.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01633.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01632.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01634.htm|prev]]][[[01636.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === CLI-Clear Interrupt Flag ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FA        |CLI                 |X|X|X|X|X|X|Clear interrupt flag; interrupts  |
 |  | 
|  | |          |                    | | | | | | |disabled when interrupt flag      |
 |  | 
|  | |          |                    | | | | | | |cleared                           |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The CLI instruction clears the IF flag if the current privilege level is at least as privileged as IOPL. No other flags are affected. External interrupts are not recognized at the end of the CLI instruction from that point on until the IF flag is set.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01639.htm|Decision Table]]
 |  | 
|  |   |  | 
|  | [[01637.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01640.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01638.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01641.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01642.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01635.htm|prev]]][[[01637.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |FA        |CLI                 |X|X|X|X|X|X|Clear interrupt flag; interrupts  |
 |  | 
|  | |          |                    | | | | | | |disabled when interrupt flag      |
 |  | 
|  | |          |                    | | | | | | |cleared                           |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01636.htm|prev]]][[[01638.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The CLI instruction clears the IF flag if the current privilege level is at least as privileged as IOPL. No other flags are affected. External interrupts are not recognized at the end of the CLI instruction from that point on until the IF flag is set.
 |  | 
|  |   |  | 
|  | [[[01637.htm|prev]]][[[01639.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>IF PE = 0 
 |  | 
|  | THEN 
 |  | 
|  |    IF �0;
 |  | 
|  | ELSE 
 |  | 
|  |    IF VM = 0 (* Running in protected Mode *)
 |  | 
|  |    THEN
 |  | 
|  |       IF IOPL = 3 
 |  | 
|  |       THEN IF � 0;
 |  | 
|  |       ELSE IF CPL ó IOPL 
 |  | 
|  |                 THEN IF � 0;
 |  | 
|  |                 ELSE #GP(0);
 |  | 
|  |                 FI;
 |  | 
|  |       FI;
 |  | 
|  |    ELSE (* Running in Virtual-8086 mode *)
 |  | 
|  |       IF IOPL = 3 
 |  | 
|  |       THEN IF � 
 |  | 
|  |       ELSE #GP(0);
 |  | 
|  |       FI;
 |  | 
|  |    FI;
 |  | 
|  | FI;</pre>
 |  | 
|  | [[[01638.htm|prev]]][[[01640.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Decision Table ===
 |  | 
|  |   |  | 
|  | The following decision table indicates which action in the lower portion of the table is taken given the conditions in the upper portion of the table. <br />
 |  | 
|  |   |  | 
|  | <pre>/--------------------------------------------------\
 |  | 
|  | |PE =      |   0   |   1   |   1   |   1   |   1   |
 |  | 
|  | |----------+-------+-------+-------+-------+-------|
 |  | 
|  | |VM =      |   -   |   0   |   -   |   0   |   1   |
 |  | 
|  | |----------+-------+-------+-------+-------+-------|
 |  | 
|  | |CPL       |   -   |óIOPL  |   -   |>IOPL  |   -   |
 |  | 
|  | |----------+-------+-------+-------+-------+-------|
 |  | 
|  | |IOPL      |   -   |   -   |  = 3  |   -   |  < 3  |
 |  | 
|  | |----------+-------+-------+-------+-------+-------|
 |  | 
|  | |IF � 0    |   Y   |   Y   |   Y   |       |       |
 |  | 
|  | |----------+-------+-------+-------+-------+-------|
 |  | 
|  | |#GP(0)    |       |       |       |   Y   |   Y   |
 |  | 
|  | \--------------------------------------------------/</pre>
 |  | 
|  | '''Notes:'''
 |  | 
|  |   |  | 
|  | - Don't care
 |  | 
|  |   |  | 
|  | Blank Action Not Taken
 |  | 
|  |   |  | 
|  | Y Action in Column 1 taken <br />
 |  | 
|  |   |  | 
|  | [[[01639.htm|prev]]][[[01641.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |0 |  |  |  |  |  |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | IF cleared.
 |  | 
|  |   |  | 
|  | [[[01640.htm|prev]]][[[01642.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) if the current privilege level is greater (has less privilege) than the I/O privilege level in the flags register. The I/O privilege level specifies the least privileged level at which I/O can be performed.
 |  | 
|  |   |  | 
|  | [[[01641.htm|prev]]][[[01643.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) as for protected mode.
 |  | 
|  |   |  | 
|  | [[[01642.htm|prev]]][[[01644.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01639.htm|Decision Table]]
 |  | 
|  |   |  | 
|  | [[01637.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01640.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01638.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01641.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01642.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01643.htm|prev]]][[[01645.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === CLTS-Clear Task-Switched Flag in CR0 ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F 06     |CLTS                | | |X|X|X|X|Clear task-switched flag          |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The CLTS instruction clears the task-switched (TS) flag in the CR0 register . This flag is set by the processor every time a task switch occurs. The TS flag is used to manage processor extensions as follows:
 |  | 
|  |   |  | 
|  | �Every processing of an ESC instruction is trapped if the TS flag is set.
 |  | 
|  |   |  | 
|  | �Processing of a WAIT instruction is trapped if the MP flag and the TS flag are both set. <br />
 |  | 
|  |   |  | 
|  | Thus, if a task switch was made after an ESC instruction was begun, the floating-point unit's context may need to be saved before a new ESC instruction can be issued. The fault handler saves the context and clears the TS flag.
 |  | 
|  |   |  | 
|  | The CLTS instruction appears in operating system software, not in application programs. It is a privileged instruction that can only be run at privilege level 0.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01646.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01648.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01647.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01649.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01650.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01651.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01644.htm|prev]]][[[01646.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |0F 06     |CLTS                | | |X|X|X|X|Clear task-switched flag          |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01645.htm|prev]]][[[01647.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The CLTS instruction clears the task-switched (TS) flag in the CR0 register . This flag is set by the processor every time a task switch occurs. The TS flag is used to manage processor extensions as follows:
 |  | 
|  |   |  | 
|  | �Every processing of an ESC instruction is trapped if the TS flag is set.
 |  | 
|  |   |  | 
|  | �Processing of a WAIT instruction is trapped if the MP flag and the TS flag are both set. <br />
 |  | 
|  |   |  | 
|  | Thus, if a task switch was made after an ESC instruction was begun, the floating-point unit's context may need to be saved before a new ESC instruction can be issued. The fault handler saves the context and clears the TS flag.
 |  | 
|  |   |  | 
|  | The CLTS instruction appears in operating system software, not in application programs. It is a privileged instruction that can only be run at privilege level 0.
 |  | 
|  |   |  | 
|  | [[[01646.htm|prev]]][[[01648.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>TS Flag in CR0 � 0;</pre>
 |  | 
|  | [[[01647.htm|prev]]][[[01649.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |  |  |  |  |  |  |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The TS flag is cleared (the TS flag is in the CR0 register, not the flags register).
 |  | 
|  |   |  | 
|  | [[[01648.htm|prev]]][[[01650.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Protected Mode Exceptions ===
 |  | 
|  |   |  | 
|  | #GP(0) if the CLTS instruction is run with a current privilege level other than 0.
 |  | 
|  |   |  | 
|  | [[[01649.htm|prev]]][[[01651.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Real Address Mode Exceptions ===
 |  | 
|  |   |  | 
|  | None (valid in Real Address Mode to allow initialization for Protected Mode ).
 |  | 
|  |   |  | 
|  | [[[01650.htm|prev]]][[[01652.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | 
|  |   |  | 
|  | Same exceptions as in Protected Mode.
 |  | 
|  |   |  | 
|  | [[[01651.htm|prev]]][[[01653.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01646.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01648.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01647.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01649.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01650.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01651.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01652.htm|prev]]][[[01654.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === CMC-Complement Carry Flag ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |F5        |CMC                 |X|X|X|X|X|X|Complement carry flag             |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The CMC instruction reverses the setting of the CF flag. No other flags are affected.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01655.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01657.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01656.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01653.htm|prev]]][[[01655.htm|next]]][[[01653.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |F5        |CMC                 |X|X|X|X|X|X|Complement carry flag             |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01654.htm|prev]]][[[01656.htm|next]]][[[01653.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The CMC instruction reverses the setting of the CF flag. No other flags are affected.
 |  | 
|  |   |  | 
|  | [[[01655.htm|prev]]][[[01657.htm|next]]][[[01653.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>CF � NOT CF;</pre>
 |  | 
|  | [[[01656.htm|prev]]][[[01658.htm|next]]][[[01653.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |  |  |  |  |  |  |  |* |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The CF flag contains the complement of its original value.
 |  | 
|  |   |  | 
|  | [[[01657.htm|prev]]][[[01659.htm|next]]][[[01653.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Related Information ===
 |  | 
|  |   |  | 
|  | [[01655.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01657.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01656.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01467.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01468.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01469.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01658.htm|prev]]][[[01660.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === CMP-Compare Two Operands ===
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3C ib     |CMP AL,imm8         |X|X|X|X|X|X|Compare immediate byte to AL      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3D iw     |CMP AX,imm16        |X|X|X|X|X|X|Compare immediate word to AX      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3D id     |CMP EAX,imm32       | | | |X|X|X|Compare immediate dword to EAX    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |80 /7 ib  |CMP r/m8,imm8       |X|X|X|X|X|X|Compare immediate byte to r/m byte|
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /7 iw  |CMP r/m16,imm16     |X|X|X|X|X|X|Compare immediate word to r/m word|
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /7 id  |CMP r/m32,imm32     | | | |X|X|X|Compare immediate dword to r/m    |
 |  | 
|  | |          |                    | | | | | | |dword                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /7 ib  |CMP r/m16,imm8      |X|X|X|X|X|X|Compare sign-extended immediate   |
 |  | 
|  | |          |                    | | | | | | |byte to r/m word                  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /7 ib  |CMP r/m32,imm8      | | | |X|X|X|Compare sign-extended immediate   |
 |  | 
|  | |          |                    | | | | | | |byte to r/m dword                 |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |38 /r     |CMP r/m8,r8         |X|X|X|X|X|X|Compare byte register to r/m byte |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |39 /r     |CMP r/m16,r16       |X|X|X|X|X|X|Compare word register to r/m word |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |39 /r     |CMP r/m32,r32       | | | |X|X|X|Compare dword register to r/m     |
 |  | 
|  | |          |                    | | | | | | |dword                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3A /r     |CMP r8,r/m8         |X|X|X|X|X|X|Compare r/m byte to byte register |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3B /r     |CMP r16,r/m16       |X|X|X|X|X|X|Compare r/m word to word register |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3B /r     |CMP r32,r/m32       | | | |X|X|X|Compare r/m dword to dword        |
 |  | 
|  | |          |                    | | | | | | |register                          |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | The CMP instruction subtracts the second operand from the first but, unlike the SUB instruction, does not store the result; only the flags are changed. The CMP instruction is typically used in conjunction with conditional jumps and the SETcc instruction. (Refer to Appendix D for the list of signed and unsigned flag tests provided.) If an operand greater than one byte is compared to an immediate byte, the byte value is first sign-extended.
 |  | 
|  |   |  | 
|  |   |  | 
|  | -----
 |  | 
|  |   |  | 
|  | [[01661.htm|Description]]
 |  | 
|  |   |  | 
|  | [[01663.htm|Flags Affected]]
 |  | 
|  |   |  | 
|  | [[01662.htm|Operation]]
 |  | 
|  |   |  | 
|  | [[01664.htm|Protected Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01665.htm|Real Address Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[01666.htm|Virtual 8086 Mode Exceptions]]
 |  | 
|  |   |  | 
|  | [[[01659.htm|prev]]][[[01661.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Details Table ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/------------------------------------------------------------------------------\
 |  | 
|  | |Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3C ib     |CMP AL,imm8         |X|X|X|X|X|X|Compare immediate byte to AL      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3D iw     |CMP AX,imm16        |X|X|X|X|X|X|Compare immediate word to AX      |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3D id     |CMP EAX,imm32       | | | |X|X|X|Compare immediate dword to EAX    |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |80 /7 ib  |CMP r/m8,imm8       |X|X|X|X|X|X|Compare immediate byte to r/m byte|
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /7 iw  |CMP r/m16,imm16     |X|X|X|X|X|X|Compare immediate word to r/m word|
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |81 /7 id  |CMP r/m32,imm32     | | | |X|X|X|Compare immediate dword to r/m    |
 |  | 
|  | |          |                    | | | | | | |dword                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /7 ib  |CMP r/m16,imm8      |X|X|X|X|X|X|Compare sign-extended immediate   |
 |  | 
|  | |          |                    | | | | | | |byte to r/m word                  |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |83 /7 ib  |CMP r/m32,imm8      | | | |X|X|X|Compare sign-extended immediate   |
 |  | 
|  | |          |                    | | | | | | |byte to r/m dword                 |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |38 /r     |CMP r/m8,r8         |X|X|X|X|X|X|Compare byte register to r/m byte |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |39 /r     |CMP r/m16,r16       |X|X|X|X|X|X|Compare word register to r/m word |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |39 /r     |CMP r/m32,r32       | | | |X|X|X|Compare dword register to r/m     |
 |  | 
|  | |          |                    | | | | | | |dword                             |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3A /r     |CMP r8,r/m8         |X|X|X|X|X|X|Compare r/m byte to byte register |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3B /r     |CMP r16,r/m16       |X|X|X|X|X|X|Compare r/m word to word register |
 |  | 
|  | |----------+--------------------+-+-+-+-+-+-+----------------------------------|
 |  | 
|  | |3B /r     |CMP r32,r/m32       | | | |X|X|X|Compare r/m dword to dword        |
 |  | 
|  | |          |                    | | | | | | |register                          |
 |  | 
|  | \------------------------------------------------------------------------------/</pre>
 |  | 
|  | [[[01660.htm|prev]]][[[01662.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Description ===
 |  | 
|  |   |  | 
|  | The CMP instruction subtracts the second operand from the first but, unlike the SUB instruction, does not store the result; only the flags are changed. The CMP instruction is typically used in conjunction with conditional jumps and the SETcc instruction. (Refer to Appendix D for the list of signed and unsigned flag tests provided.) If an operand greater than one byte is compared to an immediate byte, the byte value is first sign-extended.
 |  | 
|  |   |  | 
|  | [[[01661.htm|prev]]][[[01663.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Operation ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>LeftSRC - SignExtend(RightSRC);
 |  | 
|  | (* CMP does not store a result; its purpose is to set the flags *)</pre>
 |  | 
|  | [[[01662.htm|prev]]][[[01664.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | 
|  |   |  | 
|  | === Flags Affected ===
 |  | 
|  |   |  | 
|  | <br />
 |  | 
|  |   |  | 
|  | <pre>/-----------------------\
 |  | 
|  | |OF|DF|IF|SF|ZF|AF|PF|CF|
 |  | 
|  | |--+--+--+--+--+--+--+--|
 |  | 
|  | |*|  |  |* |* |* |* |* |
 |  | 
|  | \-----------------------/</pre>
 |  | 
|  | The OF, SF, ZF, AF, PF, and CF flags are set according to the result.
 |  | 
|  | 
 |  | 
 | 
|  | [[[01663.htm|prev]]][[[01665.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | *[[ALP Programming Guide and Reference/Assembler Directives|Assembler Directives]] | 
|  |  | *[[ALP Programming Guide and Reference/Processor Reference|Processor Reference]] | 
|  | 
 |  | 
 | 
|  | === Protected Mode Exceptions ===
 |  | *[[ALP Programming Guide and Reference/Assembler Messages|Assembler Messages]] | 
|  | 
 |  | 
 | 
|  | #GP(0) for an illegal memory operand effective address in theCS, DS, ES, FS, orGS segments; #SS(0) for an illegal address in the SS segment; #PF( fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is 3.
 |  | ==Return Codes== | 
|  |  | When ALP completes, it passes a return code back to the program that invoked it. This return code shows whether ALP completed successfully or with an error.  | 
|  |  | The return codes are: | 
|  |  | * 0 Normal program completion. | 
|  |  | * 1 User-specified file not found. | 
|  |  | * 2 Unexpected system error. | 
|  |  | * 3 Terminated by user or operating system. | 
|  |  | * 4 Syntax errors in input file. | 
|  |  | * 5 Command line usage error. | 
|  |  | * 6 Internal sanity check failure. | 
|  |  | * 7 Error accessing ALP messages file. | 
|  | 
 |  | 
 | 
|  | [[[01664.htm|prev]]][[[01666.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | ==Notices== | 
|  |  | ''October 1997'' | 
|  | 
 |  | 
 | 
|  | === Real Address Mode Exceptions ===
 |  | The following paragraph does not apply to the United Kingdom or any country where such provisions are inconsistent with local law: | 
|  | 
 |  | 
 | 
|  | Interrupt 13 if any part ofthe operand would lie outside of the effective address space from 0 to0FFFFH.
 |  | INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS". WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. | 
|  | 
 |  | 
 | 
|  | [[[01665.htm|prev]]][[[01667.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]<br />
 |  | This publication could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time. | 
|  | 
 |  | 
 | 
|  | === Virtual 8086 Mode Exceptions ===
 |  | It is possible that this publication may contain reference to, or information about, IBM products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that IBM intends to announce such IBM products, programming, or services in your country. | 
|  | 
 |  | 
 | 
|  | Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference if the current privilege level is3.
 |  | Requests for technical information about IBM products should be made to your IBM authorized reseller or IBM marketing representative.  | 
|  |  | (C) Copyright International Business Machines Corporation 1995-1997. All rights reserved. Note to U.S. Government Users -- Documentation related to restricted rights -- Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. | 
|  | 
 |  | 
 | 
|  | [[[01666.htm|prev]]][[[01668.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]<br /> |  | The [[#Processor Reference]] portion of this manual contains information reprinted with permission from Intel Corporation. | 
|  | 
 |  | 
 | 
|  | === Related Information === |  | ===Disclaimers=== | 
|  |  | References in this publication to IBM products, programs, or services do not imply that IBM intends to make these available in all countries in which IBM operates. Any reference to an IBM product, program or service is not intended to state or imply that only IBM's product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any of IBM's intellectual property rights or other legally protectable rights may be used instead of the IBM product, program, or service. Evaluation and verification of operation in conjunction with other products, programs, or services, except those expressly designated by IBM, are the user's responsibility. | 
|  | 
 |  | 
 | 
|  | [[01661.htm|Description]]
 |  | IBM may have patents or pending patent applications covering subject matter in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to the IBM Director of Licensing, IBM Corporation, 500 Columbus Avenue, Thornwood NY 10594, U.S.A. | 
|  | 
 |  | 
 | 
|  | [[01663.htm|Flags Affected]]
 |  | ===Trademarks=== | 
|  |  | The following terms are trademarks of the IBM Corporation in the United States or other countries:  | 
|  |  | : IBM  | 
|  |  | : Operating System/2  | 
|  |  | : OS/2  | 
|  |  | : Presentation Manager  | 
|  | 
 |  | 
 | 
|  | [[01662.htm|Operation]]
 |  | The following terms are trademarks of other companies:  | 
|  |  | : Microsoft - Microsoft Corporation  | 
|  |  | : Pentium - Intel Corporation Pentium Pro - Intel Corporation  | 
|  |  | : UNIX - UNIX System Laboratories, Inc. | 
|  | 
 |  | 
 | 
|  | [[01664.htm|Protect |  | [[Category:Online Books]] |