Jump to content

Assembly Language Processor (ALP) Assembler Reference: Difference between revisions

From EDM2
No edit summary
Line 96: Line 96:
ALP maintains a set of ''internal variables''that it uses for various purposes . These variables reflect the ALP environment; programmers do not use these variables. Their values may be indirectly affected by the user of ALP , for instance, through the use of various command line options.
ALP maintains a set of ''internal variables''that it uses for various purposes . These variables reflect the ALP environment; programmers do not use these variables. Their values may be indirectly affected by the user of ALP , for instance, through the use of various command line options.


[[[00007.htm|prev]]][[[00009.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />


=== BaseEXE ===
=== BaseEXE ===
Line 104: Line 103:
If the file name of the ALP executable is '''not'''available at run time, then the value of '''BaseEXE'''defaults to &quot;ALP&quot;.
If the file name of the ALP executable is '''not'''available at run time, then the value of '''BaseEXE'''defaults to &quot;ALP&quot;.


[[[00008.htm|prev]]][[[00010.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />
 


=== BasePATH ===
=== BasePATH ===
Line 112: Line 111:
If the file name of the ALP executable is '''not'''available at run time, then the value of '''BasePATH'''is NULL.
If the file name of the ALP executable is '''not'''available at run time, then the value of '''BasePATH'''is NULL.


[[[00009.htm|prev]]][[[00011.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />


=== IncDIR ===
=== IncDIR ===
Line 122: Line 120:
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00053.htm|Fdi - Specify Include File Search Path]] <br />
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00053.htm|Fdi - Specify Include File Search Path]] <br />


[[[00010.htm|prev]]][[[00012.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />


=== IncEXT ===
=== IncEXT ===
Line 132: Line 129:
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00058.htm|Fei - Control Include File Extension (IncEXT)]] <br />
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00058.htm|Fei - Control Include File Extension (IncEXT)]] <br />


[[[00011.htm|prev]]][[[00013.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />
 


=== LstDIR ===
=== LstDIR ===
Line 142: Line 139:
�[[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 />
�[[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 />


[[[00012.htm|prev]]][[[00014.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />
 


=== LstEXT ===
=== LstEXT ===
Line 152: Line 149:
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00059.htm|Fel - Control Listing File Extension (LstEXT)]] <br />
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00059.htm|Fel - Control Listing File Extension (LstEXT)]] <br />


[[[00013.htm|prev]]][[[00015.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />
 


=== LstNAME ===
=== LstNAME ===
Line 162: Line 159:
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00050.htm|Fl - Produce Listing File]] <br />
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00050.htm|Fl - Produce Listing File]] <br />


[[[00014.htm|prev]]][[[00016.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />
 


=== MsgDIR ===
=== MsgDIR ===
Line 172: Line 169:
�[[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 />
�[[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 />


[[[00015.htm|prev]]][[[00017.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />
 


=== MsgEXT ===
=== MsgEXT ===
Line 182: Line 179:
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00060.htm|Fem - Control Messages File Extension (MsgEXT)]] <br />
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00060.htm|Fem - Control Messages File Extension (MsgEXT)]] <br />


[[[00016.htm|prev]]][[[00018.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />
 


=== MsgNAME ===
=== MsgNAME ===
Line 192: Line 189:
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00051.htm|Fm - Produce Messages File]] <br />
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00051.htm|Fm - Produce Messages File]] <br />


[[[00017.htm|prev]]][[[00019.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />
 


=== ObjDIR ===
=== ObjDIR ===
Line 202: Line 199:
�[[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 />
�[[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 />


[[[00018.htm|prev]]][[[00020.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />
 


=== ObjEXT ===
=== ObjEXT ===
Line 212: Line 209:
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00061.htm|Feo - Control Object File Extension (ObjEXT)]] <br />
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00061.htm|Feo - Control Object File Extension (ObjEXT)]] <br />


[[[00019.htm|prev]]][[[00021.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />
 


=== ObjNAME ===
=== ObjNAME ===
Line 222: Line 219:
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00052.htm|Fo - Produce Object File]] <br />
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00052.htm|Fo - Produce Object File]] <br />


[[[00020.htm|prev]]][[[00022.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />


=== SourceNAME ===
=== SourceNAME ===
Line 231: Line 227:


�[[00039.htm|File Names]] <br />
�[[00039.htm|File Names]] <br />
[[[00021.htm|prev]]][[[00023.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />


=== SrcDIR ===
=== SrcDIR ===
Line 242: Line 236:
�[[00039.htm|File Names]] <br />
�[[00039.htm|File Names]] <br />


[[[00022.htm|prev]]][[[00024.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />


=== SrcEXT ===
=== SrcEXT ===
Line 252: Line 245:
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00062.htm|Fes - Control Source File Extension (SrcEXT)]] <br />
�[[00036.htm|Options]] <br />�[[00039.htm|File Names]] <br />�[[00062.htm|Fes - Control Source File Extension (SrcEXT)]] <br />


[[[00023.htm|prev]]][[[00025.htm|next]]][[[00007.htm|parent]]][[[toc.htm|TOC]]]<br />


=== SrcNAME ===
=== SrcNAME ===
Line 262: Line 254:
�[[00039.htm|File Names]] <br />
�[[00039.htm|File Names]] <br />


[[[00024.htm|prev]]][[[00026.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Using ALP ===
=== Using ALP ===
Line 270: Line 261:
1.Invoke and use ALP <br /> 2.Use environment variables to pass information to ALP <br />
1.Invoke and use ALP <br /> 2.Use environment variables to pass information to ALP <br />


[[[00025.htm|prev]]][[[00027.htm|next]]][[[00025.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Invoking ALP ===
=== Invoking ALP ===
Line 278: Line 268:
<pre>alp </pre>
<pre>alp </pre>
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.
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.
[[[00026.htm|prev]]][[[00028.htm|next]]][[[00025.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Using Environment Variables ===
=== Using Environment Variables ===
Line 285: Line 273:
This section describes the environment variables that you can set and that are used by ALP.
This section describes the environment variables that you can set and that are used by ALP.


[[[00027.htm|prev]]][[[00029.htm|next]]][[[00027.htm|parent]]][[[toc.htm|TOC]]]<br />


=== _INCLUDE ===
=== _INCLUDE ===
Line 294: Line 281:
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 of directories in a format identical to that of the standard [[00032.htm|INCLUDE]] environment variable.
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 of directories in a format identical to that of the standard [[00032.htm|INCLUDE]] environment variable.


[[[00028.htm|prev]]][[[00030.htm|next]]][[[00027.htm|parent]]][[[toc.htm|TOC]]]<br />


=== _OPTIONS ===
=== _OPTIONS ===
Line 304: Line 290:


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.
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.
[[[00029.htm|prev]]][[[00031.htm|next]]][[[00027.htm|parent]]][[[toc.htm|TOC]]]<br />


=== _PATH ===
=== _PATH ===


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 &quot;&lt;[[00008.htm|BaseEXE]]&gt;'''_PATH'''.&quot; For example, if the value of [[00008.htm|BaseEXE]]is &quot;alp,&quot; 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.
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 &quot;&lt;[[00008.htm|BaseEXE]]&gt;'''_PATH'''.&quot; For example, if the value of [[00008.htm|BaseEXE]]is &quot;alp,&quot; 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.
[[[00030.htm|prev]]][[[00032.htm|next]]][[[00027.htm|parent]]][[[toc.htm|TOC]]]<br />


=== DPATH ===
=== DPATH ===


The '''DPATH'''environment variable may be utilized for the same purposes as the [[00030.htm|&lt;BaseEXE&gt;_PATH]]internal variable if so desired.
The '''DPATH'''environment variable may be utilized for the same purposes as the [[00030.htm|&lt;BaseEXE&gt;_PATH]]internal variable if so desired.
[[[00031.htm|prev]]][[[00033.htm|next]]][[[00027.htm|parent]]][[[toc.htm|TOC]]]<br />


=== INCLUDE ===
=== INCLUDE ===
Line 323: Line 303:
The '''INCLUDE'''environment variable may be utilized for the same purposes as the [[00028.htm|&lt;BaseEXE&gt;_INCLUDE]]internal variable if so desired.
The '''INCLUDE'''environment variable may be utilized for the same purposes as the [[00028.htm|&lt;BaseEXE&gt;_INCLUDE]]internal variable if so desired.


[[[00032.htm|prev]]][[[00034.htm|next]]][[[00027.htm|parent]]][[[toc.htm|TOC]]]<br />


=== PATH ===
=== PATH ===


The '''PATH'''environment variable may be utilized for the same purposes as the [[00030.htm|&lt;BaseEXE&gt;_PATH]]internal variable if so desired.
The '''PATH'''environment variable may be utilized for the same purposes as the [[00030.htm|&lt;BaseEXE&gt;_PATH]]internal variable if so desired.
[[[00033.htm|prev]]][[[00035.htm|next]]][[[00025.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Using the Command Line ===
=== Using the Command Line ===


This section describes command line parameter types, syntax, and options.
This section describes command line parameter types, syntax, and options.
[[[00034.htm|prev]]][[[00036.htm|next]]][[[00034.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Command Line Parameter Types ===
=== Command Line Parameter Types ===
Line 343: Line 318:
Parameter types are determined by looking at the first character of each individual &quot;word.&quot; Options begin with a plus (+) or minus (-), and file names begin with any other legal file name character (as dictated by the operating system). A special case is a word beginning with the ''at sign''(@) character, which signifies the beginning of the '''@Filename'''(read from a response file) directive.
Parameter types are determined by looking at the first character of each individual &quot;word.&quot; Options begin with a plus (+) or minus (-), and file names begin with any other legal file name character (as dictated by the operating system). A special case is a word beginning with the ''at sign''(@) character, which signifies the beginning of the '''@Filename'''(read from a response file) directive.


[[[00035.htm|prev]]][[[00037.htm|next]]][[[00035.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Options ===
=== Options ===
Line 356: Line 330:


Some options may actually combine both functions of the ''switched''and ''parameterized''variations; for instance, the '''+Fl'''switch option &quot;turns on&quot; 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 of the listing file to create.
Some options may actually combine both functions of the ''switched''and ''parameterized''variations; for instance, the '''+Fl'''switch option &quot;turns on&quot; 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 of the listing file to create.
[[[00036.htm|prev]]][[[00038.htm|next]]][[[00035.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Switch Option ===
=== Switch Option ===
Line 372: Line 344:
+ Fl  
+ Fl  
- Fl - </pre>
- Fl - </pre>
[[[00037.htm|prev]]][[[00039.htm|next]]][[[00035.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Parameterized Option ===
=== Parameterized Option ===
Line 387: Line 358:
+ fo = &quot; \ obj \ dd \ driver . obj &quot;  
+ fo = &quot; \ obj \ dd \ driver . obj &quot;  
- m : 127 - </pre>
- m : 127 - </pre>
[[[00038.htm|prev]]][[[00040.htm|next]]][[[00035.htm|parent]]][[[toc.htm|TOC]]]<br />


=== File Names ===
=== File Names ===
Line 395: Line 365:
Any file name may be &quot;qualified&quot; with drive or path information as appropriate for the host operating system. ALP accepts both the forward slash (/) and the backward slash (\) as legal path name characters, as well as the colon (:) character. Care must be exercised however, because the underlying operating system may reject the usage of some of these characters.
Any file name may be &quot;qualified&quot; with drive or path information as appropriate for the host operating system. ALP accepts both the forward slash (/) and the backward slash (\) as legal path name characters, as well as the colon (:) character. Care must be exercised however, because the underlying operating system may reject the usage of some of these characters.


[[[00039.htm|prev]]][[[00041.htm|next]]][[[00034.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Command Line Syntax ===
=== Command Line Syntax ===
Line 415: Line 384:
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.
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.


[[[00040.htm|prev]]][[[00042.htm|next]]][[[00040.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Global Options ===
=== Global Options ===


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.
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.
[[[00041.htm|prev]]][[[00043.htm|next]]][[[00040.htm|parent]]][[[toc.htm|TOC]]]<br />


=== Group Options ===
=== Group Options ===

Revision as of 02:05, 6 January 2014

By IBM

About this Reference

The following notations are used in this reference:

KEYWORDCommands and language keywords.

KEYWORDThe 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.

ParameterParameters whose actual names or values are to be supplied by the programmer.

DefinitionA 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.

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

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.

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.

Installation

The following components are part of the ALP package:

ALPThe assembler itself. These are the basic files that must be installed before the assembler can be used.

MASM2ALPThe MASM 5.10 Command Line Driver. The ALP component must be installed before the MASM2ALP utility can be utilized.

Installing ALP

ALP consists of two files:

alp . exe 
alp . msg 

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.exeand alp.msgfile names (see BaseEXE) must be spelled identically and the .msgextension 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.

To install ALP on OS/2:

1.Copy alp.exeinto a directory of your 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 PATHenvironment variable.

2.For best performance, the alp.msgfile should be copied into the same directory used in step 1 or in a directory referenced by the <BaseEXE>_PATH environment variable. It is not necessary to set any additional environment variables if the first method is used.

Alternatively, a directory referenced by the DPATHenvironment 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 The ALP Messages Filefor more information.

3.Optionally, default values for command line options may be established. See <BaseEXE>_OPTIONSfor more information.

Installing MASM2ALP

The MASM2ALP utility consists of a single file:

masm2alp . exe 

To install MASM2ALP on OS/2:

1.Copy masmalp.exeinto 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 PATHenvironment variable.

It is recommended that both masm2alp.exeand alp.exebe installed in the same directory, especially in build environments where reliance on environment variables is discouraged. If masm2alp.exeis invoked by absolute path name (rather than via a PATHsearch), it will use that same path when it first attempts to execute alp.exe. This technique allows execution of alp.exewithout requiring it to be referenced in the PATH. If the search fails, the path name prefix will be removed and MASM2ALP will rely on the operating system to locate alp.exe.

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.exeto 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.

3.Optionally, default values for command line options may be established by defining the MASMenvironment variable. MASM2ALP interprets the contents of this environment variable before processing the command line. Any values set in this manner are translated and passed to alp.exevia the command line. The <BaseEXE>_OPTIONSenvironment variable used by alp.exe is not queried or modified by MASM2ALP.

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_ ECHOenvironment variable to any non-empty value will cause MASM2ALP to echo the generated command line to the standard output device.

Understanding ALP

This chapter describes:

  • The ALP message file
  • 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.

The ALP Messages File

Nearly every message displayed by ALP at run time is stored in a separate message file. The exception to this rule are messages that are displayed if the message file cannot be opened: ALP ends if one of these messages is displayed.

When ALP starts, it determines the name of the message file by creating a name of the form <BaseEXE>.msg(see BaseEXE). Once ALP knows the name of the message file, ALP searches the following directories in the following order for the file:

1.Current directory
2.The directory contained in the BasePATHinternal variable
3.Each of the directories specified in the BaseEXEinternal variable
4.Each of the directories specified in the PATHenvironment variable
5.Each of the directories specified in the DPATHenvironment variable

Internal Variables

ALP maintains a set of internal variablesthat it uses for various purposes . These variables reflect the ALP environment; programmers do not use these variables. Their values may be indirectly affected by the user of ALP , for instance, through the use of various command line options.


BaseEXE

When ALP is invoked, if the full path name of the ALP executable was provided by the operating system, then the "base" portion is isolated and used to construct the value of the BaseEXEinternal variable. For instance , if the user invoked ALP and the name of the executable was made available as "C:\TOOLS\ALP.EXE", then the BaseEXEinternal variable would contain the value "ALP". The value of BaseEXEis used to differentiate ALP-specific components in the environment (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.

If the file name of the ALP executable is notavailable at run time, then the value of BaseEXEdefaults to "ALP".


BasePATH

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 BasePATHinternal variable. For instance, if the user invoked ALP and the name of the executable was made available as "C:\TOOLS\ALP.EXE", then the BasePATHinternal variable would contain the value "C:\TOOLS\". The value of BasePATHcan be used to locate ALP-specific components in the environment (such as the ALP messages file) without the need to store this information in an alternate environment variable such as DPATH. Check your operating system documentation to see if it feasible to use the BasePATHmethod of locating ALP components.

If the file name of the ALP executable is notavailable at run time, then the value of BasePATHis NULL.


IncDIR

This variable contains the empty string unless explicitly initialized with the Fdiparameterized command line option; it contains the cumulative value of all the specified include paths.

Related Information:

Options
File Names
Fdi - Specify Include File Search Path


IncEXT

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 IncEXTis ".inc" unless altered by use of the Feiparameterized command line option.

Related Information:

Options
File Names
Fei - Control Include File Extension (IncEXT)


LstDIR

This variable contains the empty string unless explicitly initialized with the Fdlparameterized command line option; it is only used if the value specified by the Flcommand line option did not contain any path information.

Related Information:

Options
File Names
Fl - Produce Listing File
Fdl - Directory to Store Listing File (LstDIR)


LstEXT

This variable contains the default listing file name extension that is conditionally appended to the concatenated values of LstDIRand LstNAME; the assembler treats the resulting string as the fully qualified listing file name. The default value for LstEXTis ".lst" unless altered by use of the Felparameterized command line option.

Related Information:

Options
File Names
Fel - Control Listing File Extension (LstEXT)


LstNAME

This variable contains the same value as the contents of SrcNAME, unless initialized with the Flparameterized command line option.

Related Information:

Options
File Names
Fl - Produce Listing File


MsgDIR

This variable contains the empty string unless explicitly initialized with the Fdmparameterized command line option; it is only used if the value specified by the Fmcommand line option did not contain any path information.

Related Information:

Options
File Names
Fm - Produce Messages File
Fdm - Directory to Store Messages File (MsgDIR)


MsgEXT

This variable contains the default messages file name extension that is conditionally appended to the concatenated values of MsgDIRand MsgNAME; the assembler treats the resulting string as the fully qualified messages file name. The default value for MsgEXTis ".msg" unless altered by use of the Femparameterized command line option.

Related Information:

Options
File Names
Fem - Control Messages File Extension (MsgEXT)


MsgNAME

This variable contains the same value as the contents of SrcNAME, unless initialized with the Fmparameterized command line option.

Related Information:

Options
File Names
Fm - Produce Messages File


ObjDIR

This variable contains the empty string unless explicitly initialized with the Fdoparameterized command line option; it is only used if the value specified by the Focommand line option did not contain any path information.

Related Information:

Options
File Names
Fo - Produce Object File
Fdo - Directory to Store Object File (ObjDIR)


ObjEXT

This variable contains the default object file name extension that is conditionally appended to the concatenated values of ObjDIRand ObjNAME; the assembler treats the resulting string as the fully qualified object file name. The default value for ObjEXTis ".obj" unless altered by use of the Feoparameterized command line option.

Related Information:

Options
File Names
Feo - Control Object File Extension (ObjEXT)


ObjNAME

This variable contains the same value as the contents of SrcNAME, unless initialized with the Foparameterized command line option.

Related Information:

Options
File Names
Fo - Produce Object File


SourceNAME

This variable contains the name of the top-level source file currently being processed by the assembler; its contents appear exactly as the user typed it on the command line. Other internal variables derive their contents from this value.

Related Information:

File Names

SrcDIR

This variable is derived from SourceNAMEand reflects any drive or path information contained therein. For instance, if the value of SourceNAMEis "D:\Source\Dump\DumpMain.asm", then the value of SrcDIRwould be "D:\Source \Dump\". If no drive or path information was specified in the file name, then SrcDIRwill contain the empty string.

Related Information:

File Names


SrcEXT

This variable contains the default source file name extension that is conditionally appended to the concatenated values of SrcDIRand SrcNAME; the assembler treats the resulting string as the fully qualified input file name. The default value for SrcEXTis ".asm" unless altered by use of the Fesparameterized command line option.

Related Information:

Options
File Names
Fes - Control Source File Extension (SrcEXT)


SrcNAME

This variable contains the "root file name" portion of the source file name , which is extracted from the contents of the SourceNAMEvariable. For instance, if the value of SourceNAMEis "D:\Source\Dump\DumpMain.asm", then the value of SrcNAMEwould be "DumpMain". SrcNAMEshould never contain the empty string unless the input file name was incorrectly specified; in which case the assembler will generate an error when it tries to access the file.

Related Information:

File Names


Using ALP

This chapter tells you how to:

1.Invoke and use ALP
2.Use environment variables to pass information to ALP


Invoking ALP

To invoke ALP from the command line, type:

alp 

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 PATHenvironment variable.

Using Environment Variables

This section describes the environment variables that you can set and that are used by ALP.


_INCLUDE

When ALP processes an INCLUDEdirective, ALP translates the value of the BaseEXEinternal variable to uppercase and uses this value to construct the name of an ALP-specific environment variable having the form:

< BaseEXE > _ INCLUDE 

For example, If the value of BaseEXEis alp, then ALP constructs an environment variable called ALP_INCLUDEand tries 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 INCLUDE environment variable.


_OPTIONS

ALP translates the value of the BaseEXEinternal variable to uppercase and uses this value to construct the name of an ALP-specific environment variable having the form:

< BaseEXE > _ OPTIONS 

For example, if the value of BaseEXEis alp, then ALP constructs an environment variable called ALP_OPTIONSand tries to locate it in the environment. If found, its contents are logically prepended to the assembler command line.

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 @ Filenamedirective, which allows the default command line options to be stored in a file rather than in the environment variable itself.

_PATH

Whenever ALP needs to search for one of its own component files (such as the messages file), the value of the BaseEXEinternal variable is translated to uppercase and is used to construct the name of an ALP specific environment variable having the form "<BaseEXE>_PATH." For example, if the value of BaseEXEis "alp," then an environment variable called ALP_PATHwould 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 PATH environment variable. ALP then searches this list of paths when attempting to locate the component file.

DPATH

The DPATHenvironment variable may be utilized for the same purposes as the <BaseEXE>_PATHinternal variable if so desired.

INCLUDE

The INCLUDEenvironment variable may be utilized for the same purposes as the <BaseEXE>_INCLUDEinternal variable if so desired.


PATH

The PATHenvironment variable may be utilized for the same purposes as the <BaseEXE>_PATHinternal variable if so desired.

Using the Command Line

This section describes command line parameter types, syntax, and options.

Command Line Parameter Types

Command line parametersare 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.'

Parameter types are determined by looking at the first character of each individual "word." Options begin with a plus (+) or minus (-), and file names begin with any other legal file name character (as dictated by the operating system). A special case is a word beginning with the at sign(@) character, which signifies the beginning of the @Filename(read from a response file) directive.


Options

Options appear on the command line as mnemonic identifiers prefixed by either of the 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.

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 is to collect information in a cumulative fashion. Options are not cumulative unless documented otherwise on an individual basis.

There are two forms of options:

Switch Option
Parameterized Option

Some options may actually combine both functions of the switchedand parameterizedvariations; for instance, the +Flswitch 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 of the listing file to create.

Switch Option

Switch Optionsrepresent a Boolean value (onor off, yesor no, trueor false) for the identifier specified in the option. 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.

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.

The following are examples of Switch Options:

+ ML 
- ml + 
+ Fl 
- Fl - 

Parameterized Option

Parameterized Optionsare introduced in the same manner as switch options, but are instead followed by a colon (:) or an equals sign (=) (with no intervening blank space) to indicate that the option takes one or more arguments. The format of the argument field is option specific.'

Using the plus (+) character versus the minus (-) character to introduce a parameterized option may or may not have an effect upon how the option is interpreted. Refer to the description of each individual option for details.

The following are examples of Parameterized Options:

- Fl = Zappa . lst 
- Sv : M510 
+ fo = " \ obj \ dd \ driver . obj " 
- m : 127 - 

File Names

A file name may be used as an argument to certain command line options or as a stand-alone command line parameter. The file name character set and naming conventions are operating system dependent, and are treated as transparently as possible by ALP. The use of operating system metacharacters in file names should be avoided, and file names should not begin with the plus (+) or minus (-) characters.

Any file name may be "qualified" with drive or path information as appropriate for the host operating system. ALP accepts both the forward slash (/) and the backward slash (\) as legal path name characters, as well as the colon (:) character. Care must be exercised however, because the underlying operating system may reject the usage of some of these characters.


Command Line Syntax


/-------------------------------------------------------------------------------\
|                                                                               | 
|                                                  /----------------------\     | 
|                                                  |                      |     | 
| >>--ALP-------------------------------------------FileName File Options---->< | 
|          \-Global Options-/  \-Group Options-/                                |
|                                                                               | 
\-------------------------------------------------------------------------------/


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.

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.


Global Options

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.

Group Options

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:

�Requesting a listing file be generated for all files within the group
�Specifying the target directory for all generated object files
�Controlling the display of warning and informational messages for all files within the group

Within a given scope (see Command Line Scope Operator ()) the command line parser assigns the groupclassification 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 fileclassification.

[[[00042.htm|prev]]][[[00044.htm|next]]][[[00040.htm|parent]]][[[toc.htm|TOC]]]

File Options

All options appearing to the right of a file name within a given scope (see Command Line Scope Operator ()) are applied to that file only. File options take precedence over any settings inherited from previously encountered group options.

It should be noted that file names specified using wild-card characters and used in combination with file options may not yield the expected result; the file options will be applied only to the last file in the resulting wild-card expansion file name list.

[[[00043.htm|prev]]][[[00045.htm|next]]][[[00040.htm|parent]]][[[toc.htm|TOC]]]

Command Line Scope Operator ()

At any point on the command line, a new scopemay 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.

[[[00044.htm|prev]]][[[00046.htm|next]]][[[00034.htm|parent]]][[[toc.htm|TOC]]]

Command Line Options

This section describes all the ALP command line options. For each option, a table appears in the description section with the following format:

/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|... |...   |...  |... |...                                               |
\-------------------------------------------------------------------------/

The values appearing in this table are defined as follows:

Type This field specifies the typeof the option described in that row, and can be one of:

S- Switch Option
P- Parameterized Option

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.

Group Specifies whether or not the option is valid in a groupcontext; that is, if the option may be applied to multiple files within a given scope without causing ambiguities.

File Specifies whether or not the option is valid only in a filecontext; that is, if the option may only be applied to a single file within a given scope.

Default This field shows the default value for the option being described.

[[[00045.htm|prev]]][[[00047.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]

Base Options

This section describes the standalone base options that are defined by a single unique mnemonic identifier character.

[[[00046.htm|prev]]][[[00048.htm|next]]][[[00046.htm|parent]]][[[toc.htm|TOC]]]

D - Define Text Macro

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:


Name[=Value]



Name[:Value]


The Nameentry must have the same lexical syntax as a normal assembler Identifier. The Nameentry is converted to a Text-EquateNamebefore 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:

     Name   EQU   < > 

If an explicit value is to be assigned, the Nameentry 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 Valuefield 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 |).

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:

   - D : NAME =   " This   string   will   be   correctly   interpreted " 
   - D : NAME = " This   will   not ;   no   blank   after   the   equals   sign " 


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |(no default value)                                |
\-------------------------------------------------------------------------/

[[[00047.htm|prev]]][[[00049.htm|next]]][[[00046.htm|parent]]][[[toc.htm|TOC]]]

I - Specify Include File Search Path

See Fdi - Specify Include File Search Path.

[[[00048.htm|prev]]][[[00050.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]

File Control Options

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:

iInclude File
lListing File
mMessages File
oObject File
sSource File

[[[00049.htm|prev]]][[[00051.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fl - Produce Listing File

Turn this flag on to produce an assembler listing file. Using the parameterized version of the option allows the listing file to be explicitly named.

Only this option controls the actual creation of a listing file; Listing Control Optionshave no effect if this option has not been turned on.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Fl (no listing file is generated)                |
|----+------+-----+----+--------------------------------------------------|
|P   |No    |No   |Yes |-Fl:<LstDIR><LstNAME>[<LstEXT>]                   |
|    |      |     |    |(A listing file name is generated using the values|
|    |      |     |    |of the referenced internal variables.  The LstEXT |
|    |      |     |    |extension is appended if this feature is turned   |
|    |      |     |    |on.)                                              |
\-------------------------------------------------------------------------/

[[[00050.htm|prev]]][[[00052.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fm - Produce Messages File

Turn this flag on to produce a messages file. Using the parameterized version of the option allows the messages file to be explicitly named.

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 Fmoption allows these messages to be redirected to a separate file; this can be useful when dissecting the output from multiple assemblies. Messages with a severity greater than Errorare printed to the standard error device, and do not appear in the messages file.


/-------------------------------------------------------------------------\
|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.)                                       |
\-------------------------------------------------------------------------/

[[[00051.htm|prev]]][[[00053.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fo - Produce Object File

An object file name is generated using the values of the referenced internal variables. The ObjEXTextension is appended if this feature is turned on.

By default, this switch is turned on and thus 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 to be explicitly named.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Fo (an object file is generated)                 |
|----+------+-----+----+--------------------------------------------------|
|P   |No    |No   |Yes |-Fo:<ObjDIR><ObjNAME>[<ObjEXT>]                   |
\-------------------------------------------------------------------------/

[[[00052.htm|prev]]][[[00054.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fdi - Specify Include File Search Path

This option accepts a path (or list of paths separated by semicolons) that are searched by the assembler while attempting to locate an INCLUDEfile. When multiple occurrences of this option are specified within a given scope , the effect is cumulative rather than destructive; successive occurrences add to the existing list rather than overwriting previous definitions. The more conventional spelling "I" can be used as an alias for the Fdioption.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Fdi:<IncDIR>                                     |
\-------------------------------------------------------------------------/

[[[00053.htm|prev]]][[[00055.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fdl - Directory to Store Listing File (LstDIR)

This option affects the LstDIRvariable and allows the user to specify a target directory where the listing file(s) will be stored; by default this variable is empty and listing file(s) are created in the current working directory. This value is ignored if the Floption was used to explicitly name the listing file, and the name included absolute or relative path information.

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 characterappropriate for the underlying operating system is appended to the string.''''


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Fdl:<LstDIR>                                     |
\-------------------------------------------------------------------------/

[[[00054.htm|prev]]][[[00056.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fdm - Directory to Store Messages File (MsgDIR)

This option affects the MsgDIRvariable and allows the user to specify a target directory 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 Fmoption was used to explicitly name the message file, and the name included absolute or relative path information.

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 characterappropriate for the underlying operating system is appended to the string.''''


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Fdm:<MsgDIR>                                     |
\-------------------------------------------------------------------------/

[[[00055.htm|prev]]][[[00057.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fdo - Directory to Store Object File (ObjDIR)

This option affects the ObjDIRvariable and allows the user to specify a target 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 Fooption was used to explicitly name the object file, and the name included absolute or relative path information.

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 characterappropriate for the underlying operating system is appended to the string.''''


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Fdo:<ObjDIR>                                     |
\-------------------------------------------------------------------------/

[[[00056.htm|prev]]][[[00058.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fds - Directory to Locate Source File (SrcDIR)

This option affects the SrcDIRvariable 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.

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 characterappropriate for the underlying operating system is appended to the string.''''


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Fds:<SrcDIR>                                     |
\-------------------------------------------------------------------------/

[[[00057.htm|prev]]][[[00059.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fei - Control Include File Extension (IncEXT)

This option determines whether or not the value of the IncEXTvariable is appended to file names generated by the preprocessor when processing the INCLUDE directive. The parameterized version of this option affects the actual value of the IncEXTvariable.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Fei                                              |
|    |      |     |    |(the value of IncEXT is not appended to include   |
|    |      |     |    |file names)                                       |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Fei:<IncEXT>                                     |
\-------------------------------------------------------------------------/

[[[00058.htm|prev]]][[[00060.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fel - Control Listing File Extension (LstEXT)

This option determines whether or not the value of the LstEXTvariable is appended to listing file names. The parameterized version of this option affects the actual value of the LstEXTvariable.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Fel                                              |
|    |      |     |    |(the value of LstEXT is appended to listing file  |
|    |      |     |    |names)                                            |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |+Fel:<LstEXT>                                     |
\-------------------------------------------------------------------------/

[[[00059.htm|prev]]][[[00061.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fem - Control Messages File Extension (MsgEXT)

This option determines whether or not the value of the MsgEXTvariable is appended to messages file names. The parameterized version of this option affects the actual value of the MsgEXTvariable.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Fem                                              |
|    |      |     |    |(the value of MsgEXT is appended to messages file |
|    |      |     |    |names)                                            |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |+Fem:<MsgEXT>                                     |
\-------------------------------------------------------------------------/

[[[00060.htm|prev]]][[[00062.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Feo - Control Object File Extension (ObjEXT)

This option determines whether or not the value of the ObjEXTvariable is appended to object file names. The parameterized version of this option affects the actual value of the ObjEXTvariable.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Feo                                              |
|    |      |     |    |(the value of ObjEXT is appended to object file   |
|    |      |     |    |names)                                            |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |+Feo:<ObjEXT>                                     |
\-------------------------------------------------------------------------/

[[[00061.htm|prev]]][[[00063.htm|next]]][[[00049.htm|parent]]][[[toc.htm|TOC]]]

Fes - Control Source File Extension (SrcEXT)

This option determines whether or not the value of the SrcEXTvariable is appended to source file names. The parameterized version of this option affects the actual value of the SrcEXTvariable.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Fes                                              |
|    |      |     |    |(the value of SrcEXT is appended to source file   |
|    |      |     |    |names)                                            |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |+Fes:<SrcEXT>                                     |
\-------------------------------------------------------------------------/

[[[00062.htm|prev]]][[[00064.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]

Listing Control Options

This section describes all options related to controlling the content of the assembler listing file. All listing control options begin with the letter "L".

Options that manipulate the characteristics of individual listing file columns reference a particular column by having a single character mnemonic identifier as part of the option identifier. Listing column mnemonics are as follows:

'C'Conditional assembly nesting levelis a numeric value that appears during processing of a conditional assembly directive and is incremented for each level of nesting that occurs.

'D'Macro definition line numbertracks line numbers for each new MACRO definition introduced into the assembly.

'F'True or false conditional flagappears 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.

'G'Generated machine code datacolumn shows the hexadecimal values for data generated by machine instructions or data allocation statements.

'I'Include file nesting levelis a numeric value that appears during processing of INCLUDE files and is incremented for each level of nesting that occurs.

'L'Macro expansion indentation levelis a text field whose width reflects the current nesting level of expanded macros, and whose value contains a simulated "arrow" using the "--->" characters.

'M'Macro expansion nesting levelis a numeric value that appears during macro expansions and is incremented for each level of nesting that occurs.

'O'Location counter offset valueis a numeric value displayed in hexadecimal notation and indicates the current offset of the location counter within the current segment or structure.

'S'Source line datacolumn contains the text data of the current line in the input source file.

'X'Cumulative listing line numberis incremented for every new line that appears in the listing file.

'Y'Individual source file line numbertracks line numbers for the top-level source file and for each separate INCLUDE file.

'Z'Macro expansion line numbertracks the current line number for each MACRO expanded during the assembly.

[[[00063.htm|prev]]][[[00065.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lc* - Control Display of Individual Columns

This family of options controls whether or not an individual column physically appears in the listing file. The display of each column may be controlled with a switch option by using the standard ON (+) or OFF (-) switch values (see Switch Option) or by using the parameterized option syntax (see Parameterized Option) with one of the following keyword values in the argument field:

BAbbreviation for BLANK.
BLANKThe column will appear as a place-holder in the listing file, but the column data will not be displayed.
OFFThe column will not be displayed.
ONThe column will be displayed.
ZAbbreviation for ZBLANK.
ZBLANKThe column data will only display if its value is nonzero (valid only for numeric fields).


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|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)                   |
\-------------------------------------------------------------------------/

[[[00064.htm|prev]]][[[00066.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lcm* - Specify Left Margin for Individual Columns

This family of options specifies the left margin value for each individual column, which determines the number of blank spaces that will appear to the left of the column data.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|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)                        |
\-------------------------------------------------------------------------/

[[[00065.htm|prev]]][[[00067.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lct* - Specify Truncation of Individual Columns

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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+LcmX (truncate Cumulative Listing Line Number)   |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+LcmY (truncate Individual Source File Line       |
|    |      |     |    |Number)                                           |
|----+------+-----+----+--------------------------------------------------|
|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)                 |
\-------------------------------------------------------------------------/

[[[00066.htm|prev]]][[[00068.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lcw* - Specify Width of Individual Columns

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 a numeric value in column M) if the nesting level value exceeds the column width. This behavior may be avoided by setting the width of column Lsuch that its width never exceeds the value of column M, or by turning off the display of column Laltogether.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|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)                       |
\-------------------------------------------------------------------------/

[[[00067.htm|prev]]][[[00069.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lc - Control display of false Conditional blocks

This switch determines whether or not sections of source code appear in the listing file when they are rendered inactive by a false conditional expression. By default, the assembler 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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Lc (do not list false conditional blocks)        |
\-------------------------------------------------------------------------/

[[[00068.htm|prev]]][[[00070.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Ld - Control Display of Listing Directives

This switch controls whether or not assembler listing directives appear in the listing output. Listing directives are shown by default; turn this switch off to hide them.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Lc (show all listing directives)                 |
\-------------------------------------------------------------------------/

[[[00069.htm|prev]]][[[00071.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Le - Control Display of Error/Warning/Info Messages

By default, any time the assembler prints an Error, Warning, or Info message during the assembly, the message also appears in the listing file following the source line to which it refers. Turn this switch off if such messages are not desired in the listing output.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Le (show messages in listing file)               |
\-------------------------------------------------------------------------/

[[[00070.htm|prev]]][[[00072.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lf - Control Use of FormFeed Characters

When the assembler is generating formatted listing output and it needs to advance to the next page, it inserts the ASCII FormFeed character (0x0C) into the listing 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 the page eject operation.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Lf (the FormFeed character is used)              |
\-------------------------------------------------------------------------/

[[[00071.htm|prev]]][[[00073.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Li - Control Display of INCLUDE Files

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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Li (INCLUDE files are expanded in listing output)|
\-------------------------------------------------------------------------/

[[[00072.htm|prev]]][[[00074.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Llp - Specify Length of Page

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 Lfoption. The default value for this option is 66 lines per page.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Llp:66 (the default page length is 66 lines)     |
\-------------------------------------------------------------------------/

Related Information:

Lf - Control Use of FormFeed Characters
Lwp - Specify Width of Page

[[[00073.htm|prev]]][[[00075.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lm - Control Display of Macro Expansions

This switch controls whether or not the text body of an 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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Lm (macro expansions do not appear in listing    |
|    |      |     |    |output)                                           |
\-------------------------------------------------------------------------/

[[[00074.htm|prev]]][[[00076.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lmb - Specify Bottom Margin

This option determines how many blank lines will appear at the bottom of the page in the listing output; by default this value is 4. The correct behavior of this option depends on the setting of the Llpand Lfoptions, 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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Lmb:4 (4 blank lines at bottom of page)          |
\-------------------------------------------------------------------------/

Related Information:

Lf - Control Use of FormFeed Characters
Llp - Specify Length of Page
Lmb - Specify Middle Margin after Title
Lmt - Specify Top Margin before Title

[[[00075.htm|prev]]][[[00077.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lml - Specify Left Margin

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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Lml:4 (left margin is 4 blank characters wide)   |
\-------------------------------------------------------------------------/

Related Information:

Lmr - Specify Right Margin
Lwp - Specify Width of Page
Lcm* - Specify Left Margin for Individual Columns

[[[00076.htm|prev]]][[[00078.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lmb - Specify Middle Margin after Title

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 the body of the generated listing text. The default value for this option is 2 blank lines.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Lmm:2 (2 blank lines after title and subtitle,   |
|    |      |     |    |and before ruler line)                            |
\-------------------------------------------------------------------------/

Related Information:

Llp - Specify Length of Page
Lmb - Specify Bottom Margin
Lmt - Specify Top Margin before Title
Lr - Control Display of Column Ruler

[[[00077.htm|prev]]][[[00079.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lmr - Specify Right Margin

This option specifies the number of blank characters that are reserved (but not actually printed) to the right of every line of listing output. The default value for this option is 4.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Lmr:4 (right margin is 4 blank characters wide)  |
\-------------------------------------------------------------------------/

Related Information:

Lml - Specify Left Margin
Lwp - Specify Width of Page
Lcm* - Specify Left Margin for Individual Columns

[[[00078.htm|prev]]][[[00080.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lmt - Specify Top Margin before Title

This option specifies the number of blank lines that appear at the top of the page before any other listing output is generated. The default value for this option is 2 blank lines.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Lmt:2 (2 blank lines at the top of the page)     |
\-------------------------------------------------------------------------/

Related Information:

Llp - Specify Length of Page
Lmb - Specify Bottom Margin
Lmb - Specify Middle Margin after Title

[[[00079.htm|prev]]][[[00081.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lp - Generate Listing on Specific Pass

This option allows the user to control 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.

The arguments to this option are either a series of numeric digits (without intervening white space) or the ALLor NONEkeywords. In the default assembler configuration, use of the -Lp:ALLform is equivalent to specifying -Lp:12, because the assembler makes two passes through the source file by default. The NONEkeyword prevents generation of any pass- related information in the listing file; however, symbol table information will still appear if selected.

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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Lp:2 (listing on pass 2 only)                    |
\-------------------------------------------------------------------------/

[[[00080.htm|prev]]][[[00082.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lr - Control Display of Column Ruler

This switch to determines whether or not the column rulerappears at the top of each page in the listing output. This ruler is simply a line of information containing a string 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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Lr (show the column ruler in listing output)     |
\-------------------------------------------------------------------------/

[[[00081.htm|prev]]][[[00083.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Ls - Control Display of Symbol Table

This switch determines whether or not a summary of the symbol table contents is included at the end of the listing file. The default behavior is to omit the symbol table summary; turn this switch on to include it.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Ls (do not include symbol table in listing       |
|    |      |     |    |output)                                           |
\-------------------------------------------------------------------------/

[[[00082.htm|prev]]][[[00084.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lt1 - Specify Title

This option allows the user to specify the text of a default title to be printed at the top of each listing page; there is no default title. Title information must be enclosed in double quotes "" if it contains white space characters.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Lt1:<empty> (no default title information)       |
\-------------------------------------------------------------------------/

[[[00083.htm|prev]]][[[00085.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lt2 - Specify Subtitle

This option allows the user to specify the text of a default subtitle to be printed at the top of each listing page; there is no default subtitle. Subtitle information must be enclosed in double quotes "" if it contains white space characters.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Lt2:<empty> (no default subtitle information)    |
\-------------------------------------------------------------------------/

[[[00084.htm|prev]]][[[00086.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lwp - Specify Width of Page

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. The default value for this option is 132 character positions.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Lwp:132 (the default page width is 132 character |
|    |      |     |    |positions)                                        |
\-------------------------------------------------------------------------/

Related Information:

Lcm* - Specify Left Margin for Individual Columns
Lcw* - Specify Width of Individual Columns

[[[00085.htm|prev]]][[[00087.htm|next]]][[[00063.htm|parent]]][[[toc.htm|TOC]]]

Lwt - Specify Tab Expansion Width

This option specifies the width of a tab character in blank spaces. Tab characters appearing in the source file are always expanded into blank spaces when output to the listing file; the default behavior is to expand tab characters to every eighth character position.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Lwt:8 (tab characters are 8 character positions  |
|    |      |     |    |wide)                                             |
\-------------------------------------------------------------------------/

[[[00086.htm|prev]]][[[00088.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]

Message Control Options

This section describes all options related to the output and control of assembler messages. All Message Control Options begin with the letter "M".

[[[00087.htm|prev]]][[[00089.htm|next]]][[[00087.htm|parent]]][[[toc.htm|TOC]]]

M - Control Individual Messages or Groups

This option controls the types of messages that are displayed by manipulating message group identifier flagsor individual message numbers. Only messages with a severity of Warningor Infoare controllable with this option. Messages with a severity of Error, System, Fatal, Internal, or Usagecannot be suppressed.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-M:W+ (all warning messages are enabled)          |
\-------------------------------------------------------------------------/

All assembler messages are assigned a unique message number, and Warningor Infomessages may belong to one or more message groups. The message group identifier flags are defined as follows:

ALLAll warning and informational messages
BLKMessages regarding block structure violations
CODMessages regarding code generation
FILFile manipulation messages
I All informational messages
PP Preprocessor messages
SRCSource file lexical analyzer messages
STAAssembly statistics
W All warning messages

Any sequence of message groups or message numbers may be specified in the argument field of the Moption; each argument must be followed by a plus (+ ) or minus (-) character to turn the value on or off, and no intervening white space characters may appear between arguments.

See Assembler Messagesfor more information on message number values and the messages groups to which they belong.

[[[00088.htm|prev]]][[[00090.htm|next]]][[[00087.htm|parent]]][[[toc.htm|TOC]]]

Mb - Control Printing of the Assembler Banner

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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |No   |No  |+Mb (Print the assembler banner)                  |
\-------------------------------------------------------------------------/

[[[00089.htm|prev]]][[[00091.htm|next]]][[[00087.htm|parent]]][[[toc.htm|TOC]]]

Me - Set Number of Errors Before Assembler Aborts

This option specifies the maximum number of errors that the assembler will tolerate before ending the assembly. The default value is 50.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Me:50 (abort the assembly after 50 errors are    |
|    |      |     |    |encountered)                                      |
\-------------------------------------------------------------------------/

[[[00090.htm|prev]]][[[00092.htm|next]]][[[00087.htm|parent]]][[[toc.htm|TOC]]]

Mwe - Treat Warnings as Errors

This switch tells the assembler that any Warning messages are to be treated as though they were errors; this causes the assembler to end with a non- zero exit code, and helps prevent any warning conditions from "passing by" unnoticed.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Mwe (warnings are not considered to be errors)   |
\-------------------------------------------------------------------------/

[[[00091.htm|prev]]][[[00093.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]

Object Control Options

This section describes all options related to the output and control of object file information. All Object Control Options begin with the letter "O".

[[[00092.htm|prev]]][[[00094.htm|next]]][[[00092.htm|parent]]][[[toc.htm|TOC]]]

Od - Line Number and Symbolic Debug Information in Object File

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 numberingand symbolicdebug information.'

The parameterized version of this option may be used to specify the format of the debugging information. The setting of this value may be necessary depending on which linker is used to link the object file output, or on the debugger used to debug the executable. The argument must be one of the following keywords:

IBM32Generate debugging information in the 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.
MS16Generate 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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |(see default values for Ods and Odl)              |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |-Od:IBM32 (use the IBM debug format)              |
\-------------------------------------------------------------------------/

Related Information:

Odl - Line Numbering Information in Object File
Ods - Symbolic Debug Information in Object File

[[[00093.htm|prev]]][[[00095.htm|next]]][[[00092.htm|parent]]][[[toc.htm|TOC]]]

Odl - Line Numbering Information in Object File

This switch controls whether or not 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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Odl (line numbering debug information is not     |
|    |      |     |    |included in object file)                          |
\-------------------------------------------------------------------------/

[[[00094.htm|prev]]][[[00096.htm|next]]][[[00092.htm|parent]]][[[toc.htm|TOC]]]

Ods - Symbolic Debug Information in Object File

This switch controls whether or not symbolic debug information is included in the object file, thus allowing variables, labels, and expressions appearing in the assembler source file to be viewed from within a source- level debugger.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Ods (symbolic debug information is not included  |
|    |      |     |    |in object file)                                   |
\-------------------------------------------------------------------------/

[[[00095.htm|prev]]][[[00097.htm|next]]][[[00092.htm|parent]]][[[toc.htm|TOC]]]

Oug - Convert Global Identifiers to Uppercase

This switch controls whether external identifiers (declared with the EXTERN directive) and public identifiers (declared with the PUBLICdirective) are converted 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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Oug (do not convert global identifiers to        |
|    |      |     |    |uppercase in object file)                         |
\-------------------------------------------------------------------------/

Related Information:

Scs - Control Case Sensitivity for Symbol Names
Ous - Convert Group and Segment Names to Uppercase

[[[00096.htm|prev]]][[[00098.htm|next]]][[[00092.htm|parent]]][[[toc.htm|TOC]]]

Ous - Convert Group and Segment Names to Uppercase

This switch controls whether external group names (declared with the GROUP directive) and segment names (declared with the SEGMENTdirective) 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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Ous (do not convert group or segment names to    |
|    |      |     |    |uppercase in object file)                         |
\-------------------------------------------------------------------------/

Related Information:

Scs - Control Case Sensitivity for Symbol Names
Oug - Convert Global Identifiers to Uppercase

[[[00097.htm|prev]]][[[00099.htm|next]]][[[00045.htm|parent]]][[[toc.htm|TOC]]]

Source Control Options

All options related to parsing or processing the input source stream are described in this section. All Source Control Options begin with the letter "S".

[[[00098.htm|prev]]][[[00100.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]

Sc - Control Case Sensitivity for All Identifiers

This switch controls whether or not all identifiers are case sensitive, and is a shorthand method of specifying the options for user identifiers and keywords.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |(see default values for Sck and Scs)              |
\-------------------------------------------------------------------------/

Related Information:

Sck - Control Case Sensitivity for Keywords
Scs - Control Case Sensitivity for Symbol Names

[[[00099.htm|prev]]][[[00101.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]

Sck - Control Case Sensitivity for Keywords

This switch controls whether or not language keywords are case sensitive. By default, this flag is turned off; thus the spellings SEGMENT, Segment, and segmentall refer to the same keyword. Turning this switch on would render the three spellings separate and distinct, and only the uppercase variant would be recognized as a keyword.

This option has no effect on user identifiers (see Scs - Control Case Sensitivity for Symbol Names) or processor mnemonics.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Sck (All language keywords are case insensitive) |
\-------------------------------------------------------------------------/

[[[00100.htm|prev]]][[[00102.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]

Scs - Control Case Sensitivity for Symbol Names

This switch controls whether or not user identifiers are case sensitive. By default, this flag is turned on; thus the identifiers GEORGE, George, and georgeare separate and distinct. Turning this switch off would cause the three spellings to refer to the same identifier.

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 the identifier regardless of whether or not a case -insensitive assembly was performed. The only exception to this rule is when processing a PUBLICdirective under MASM 5.10 emulation; the identifier spelling, which appears in the PUBLICdirective is honored over the one appearing in the actual identifier definition.

This option has no effect on language keywords (see Sck - Control Case Sensitivity for Keywords), processor mnemonics, or register names.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |+Scs (All user identifiers are case sensitive)    |
\-------------------------------------------------------------------------/

Related Information:

Oug - Convert Global Identifiers to Uppercase
Ous - Convert Group and Segment Names to Uppercase

[[[00101.htm|prev]]][[[00103.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]

Sk - Control Use of Reserved Words as Labels

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, and keywords may not be used as labels.

Even when this switch is turned on, there are severe restrictions on this capability. Processor mnemonics classify as the only "keywords" allowed in this situation, and only in the context of a code label(a label followed by a colon); using any reserved word as a directive name or data label is illegal.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Sk (Reserved words may not be used as labels)    |
\-------------------------------------------------------------------------/

[[[00102.htm|prev]]][[[00104.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]

Sfs - SHORT is Default Distance for Forward-Referenced Jumps

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 SHORTvariation of the instruction. Enough space is reserved to generate the NEARversion, and if it is determined later that the target is close enough, the SHORT variation is generated and extra space is padded with NOPinstructions. This helps insure that source files will assemble without "out of range" errors, but wastes space when the NOPinstructions are generated.

Turning this switch on causes the assembler to assume that unqualified 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 NEARoverride.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Sfs (default distance is NEAR)                   |
\-------------------------------------------------------------------------/

[[[00103.htm|prev]]][[[00105.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]

Sme - Control Visibility of MASM 6.00 Extended Mnemonics

This option controls whether or not the following processor mnemonics are recognized as keywords: '


FLDENVD
FLDENVW
FNSAVED
FNSAVEW
FNSTENVD
FNSTENVW
FRSTORD
FRSTORW
FSAVED
FSAVEW
FSTENVD
FSTENVW
IRETF
IRETDF
LOOPD
LOOPW
LOOPED
LOOPEW
LOOPNED
LOOPNEW
LOOPNZD
LOOPNZW
LOOPZD
LOOPZW
POPD
POPW
PUSHD
PUSHW

These mnemonics were introduced in MASM 6.00 to allow explicit word (16-bit ) or double-word (32-bit) operations on 80386 or newer 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 to recognize 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.


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|S   |Yes   |Yes  |Yes |-Sme (extended mnemonics are not enabled)         |
\-------------------------------------------------------------------------/

Related Information:

Sv - Set Version Behavior

[[[00104.htm|prev]]][[[00106.htm|next]]][[[00098.htm|parent]]][[[toc.htm|TOC]]]

Sv - Set Version Behavior

This option controls the various modes of compatibility that the assembler is designed to emulate. The argument to the Svoption must be one of the following keywords:

ALPNative operating mode; don't emulate other assemblers
M510Emulate Microsoft MASM Version 5.10
M600Emulate Microsoft MASM Version 6.00


/-------------------------------------------------------------------------\
|Type|Global|Group|File|Default                                           |
|----+------+-----+----+--------------------------------------------------|
|P   |Yes   |Yes  |Yes |+Sv:ALP (do not emulate other assemblers)         |
\-------------------------------------------------------------------------/

Related Information:

Sme - Control Visibility of MASM 6.00 Extended Mnemonics

[[[00105.htm|prev]]][[[00107.htm|next]]][[[00025.htm|parent]]][[[toc.htm|TOC]]]

The MASM2ALP Utility

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.exeto 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.

MASM2ALP accepts the following MASM 5.10-style command line syntax:

masm2alp   [ Options ]   SourceFile   [ , [ ObjectFile ]   [ , [ ListingFile ]   [ , [ CrossRefFile ] ] ] ]   [ ; ] 

Notes:

Optionsare normally specified first on the command 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.

�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:

SourceFileThis 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.

ObjectFileThe optional name of the object-code output file to be produced. If no filename suffix is supplied, a default value of ".obj" is assumed. If no ObjectFileargument is given, the root portion of the SourceFile argument is used as the name of the object file.''''

ListingFileThe optional name of the listing output file to be produced. If no filename suffix is supplied, a default value of ".lst" is assumed. If no ListingFileargument or -Loption is given, then no listing file is produced; otherwise the root portion of the SourceFileargument is used as the name of the listing file.''''

CrossRefFileThe optional name of the cross-reference output file. Since ALP does not support the creation of a cross-reference file, MASM2ALP ignores this argument.

�The trailing semicolon (;) operator may be used when no more filename arguments are to be specified and the default values are to be utilized for the remaining arguments. Any arguments or command line options that follow the semicolon will be ignored.

�MASM2ALP does not support the "prompting" behavior of Microsoft MASM when insufficient command line arguments are supplied. A syntax error is issued in this event.

Options:

MASM2ALP accepts the following command line options:

-AForces MASM to write segments to the object file in alphabetical order. MASM normally writes segments in source code order. MASM2ALP ignores this option.

-BnumberSets the size of the source file read buffer in 1K increments. MASM2ALP ignores this option.

-CTells MASM to create a cross-reference file. MASM2ALP ignores this option.

-dCauses the assembler to generate listing file information during both pass 1 and 2. By default, the assembler only generates listing file information during pass 2.

-Dsymbol[=value]Defines a symbol visible during assembly. An optional text value may also be specified for the symbol.

-ETells MASM to generate code compatible with floating-point emulation libraries. MASM2ALP ignores this option.

-HPrints the help information panel for the command line syntax.

-IpathSpecifies an INCLUDE file search path.

-L[A]Forces the creation of a listing output file. The -LAoption is an abbreviation for "list all", which forces macro expansions and false conditionals to also be included in the listing output.

- MLDirects the assembler to perform a case-sensitive assembly, and to preserve the case of external identifiers when writing them to the object file.

-MUDirects 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.

-MXDirects the assembler to perform a case-insensitive assembly, yet preserve the case of external identifiers when writing them to the object file.

-NPrevents the symbol table summary from being printed in the listing file .

-PCauses 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.

-SForces MASM to write segments to the object file in source code order, nullifying the effects of any previously encountered -Aoption. MASM2ALP ignores this option.

-XForces false conditionals to be included in the listing file output.

-ZCauses MASM to print the source line of any statement causing an assembly error to the standard output device. MASM2ALP ignores this option .

-ZDCauses line number debugging information to be included in the object file output.

-ZICauses both line number and symbolic debugging information to be included in the object file output.

[[[00106.htm|prev]]][[[00108.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]

Language Elements


The following sections describe the elements you use to build an ALP program source file.

Character Set

All elements in an assembler language source file are built from collections of characters contained in the character set, which are defined as:

�The uppercase and lowercase letters of the English alphabet
�The decimal digits 0 through 9
�The following graphic characters:

~   !   "   #   $   %   ^   &   '   (   )   | 
*   +   ,   -   .   /   :   ;   =   <   >   ? 
[   \   ]   _   {   }   @ 


�The space and horizontal tab characters
�The end of line character(s)

White Space

White space is a character or contiguous stream of characters that is ignored or removed from the input stream by the ALP preprocessor.

White space charactersare 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.



Token':
Reserved-Word
Identifier
Literal
Punctuator

[[[00107.htm|prev]]][[[00109.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]

Description

The following sections describe the elements you use to build an ALP program source file.

Character Set

All elements in an assembler language source file are built from collections of characters contained in the character set, which are defined as:

�The uppercase and lowercase letters of the English alphabet
�The decimal digits 0 through 9
�The following graphic characters:

~   !   "   #   $   %   ^   &   '   (   )   | 
*   +   ,   -   .   /   :   ;   =   <   >   ? 
[   \   ]   _   {   }   @ 


�The space and horizontal tab characters
�The end of line character(s)

White Space

White space is a character or contiguous stream of characters that is ignored or removed from the input stream by the ALP preprocessor.

White space charactersare 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.

[[[00108.htm|prev]]][[[00110.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Token':
Reserved-Word
Identifier
Literal
Punctuator

[[[00109.htm|prev]]][[[00111.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]

Reserved Words


This section describes all of the assembler reserved words.



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

[[[00110.htm|prev]]][[[00112.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Description

This section describes all of the assembler reserved words.

[[[00111.htm|prev]]][[[00113.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

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

[[[00112.htm|prev]]][[[00114.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Preprocessor Directives


Preprocessor Directivesare symbolic names that describe the various assembly-time text processing instructions interpreted by the preprocessor phase of the assembler.



Preprocessor-Directive': one of

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



[[[00113.htm|prev]]][[[00115.htm|next]]][[[00113.htm|parent]]][[[toc.htm|TOC]]]

Description

Preprocessor Directivesare symbolic names that describe the various assembly-time text processing instructions interpreted by the preprocessor phase of the assembler.

[[[00114.htm|prev]]][[[00116.htm|next]]][[[00113.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Preprocessor-Directive': one of

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



[[[00115.htm|prev]]][[[00117.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Assembler Directives


Assembler Directivesare symbolic names that describe the various assembly- time instructions interpreted by the assembler itself.



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



[[[00116.htm|prev]]][[[00118.htm|next]]][[[00116.htm|parent]]][[[toc.htm|TOC]]]

Description

Assembler Directivesare symbolic names that describe the various assembly- time instructions interpreted by the assembler itself.

[[[00117.htm|prev]]][[[00119.htm|next]]][[[00116.htm|parent]]][[[toc.htm|TOC]]]

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



[[[00118.htm|prev]]][[[00120.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Processor Mnemonics


Processor Mnemonicsare symbolic names given to the various instructions in the processor instruction set.



Processor-Mnemonic': one of

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 



[[[00119.htm|prev]]][[[00121.htm|next]]][[[00119.htm|parent]]][[[toc.htm|TOC]]]

Description

Processor Mnemonicsare symbolic names given to the various instructions in the processor instruction set.

[[[00120.htm|prev]]][[[00122.htm|next]]][[[00119.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Processor-Mnemonic': one of

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 



[[[00121.htm|prev]]][[[00123.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Processor Registers


Processor Registersare the symbolic names assigned to the various internal processor registers. They are normally used as operands to processor instructions.



Processor-Register':
General-Purpose-Register
Segment-Register
Control-Register
Debug-Register
Test-Register
MMX-Register
Floating-Point-Register

General-Purpose-Register'
:
8-Bit-Register
16-Bit-Register
32-Bit-Register

8-Bit-Register': one of
AL AH BL BH CL CH DL DH

16-Bit-Register'
: one of
AX BX CX DX DI SI BP SP

32-Bit-Register': one of
EAX EBX ECX EDX EDI ESI EBP ESP

Segment-Register'
: one of
CS DS ES FS GS SS

Control-Register': one of
CR0 CR2 CR3 CR4

Debug-Register'
: one of
DR0 DR1 DR2 DR3 DR4 DR5 DR6 DR7

Test-Register': one of
TR3 TR4 TR5 TR6 TR7

MMX-Register'
: one of
MM0 MM1 MM2 MM3 MM4 MM5 MM6 MM7

Floating-Point-Register':
ST

[[[00122.htm|prev]]][[[00124.htm|next]]][[[00122.htm|parent]]][[[toc.htm|TOC]]]

Description

Processor Registersare the symbolic names assigned to the various internal processor registers. They are normally used as operands to processor instructions.

[[[00123.htm|prev]]][[[00125.htm|next]]][[[00122.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Processor-Register':
General-Purpose-Register
Segment-Register
Control-Register
Debug-Register
Test-Register
MMX-Register
Floating-Point-Register

General-Purpose-Register'
:
8-Bit-Register
16-Bit-Register
32-Bit-Register

8-Bit-Register': one of
AL AH BL BH CL CH DL DH

16-Bit-Register'
: one of
AX BX CX DX DI SI BP SP

32-Bit-Register': one of
EAX EBX ECX EDX EDI ESI EBP ESP

Segment-Register'
: one of
CS DS ES FS GS SS

Control-Register': one of
CR0 CR2 CR3 CR4

Debug-Register'
: one of
DR0 DR1 DR2 DR3 DR4 DR5 DR6 DR7

Test-Register': one of
TR3 TR4 TR5 TR6 TR7

MMX-Register'
: one of
MM0 MM1 MM2 MM3 MM4 MM5 MM6 MM7

Floating-Point-Register':
ST

[[[00124.htm|prev]]][[[00126.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Scalar Type Names


Scalar Type Namesare the symbolic names given to the integral data types. These are the fundamental types of data upon which the processor can directly operate.



Scalar-TypeName':
BYTE
SBYTE
WORD
SWORD
DWORD
SDWORD
REAL4
FWORD
QWORD
REAL8
TBYTE
REAL10

[[[00125.htm|prev]]][[[00127.htm|next]]][[[00125.htm|parent]]][[[toc.htm|TOC]]]

Description

Scalar Type Namesare the symbolic names given to the integral data types. These are the fundamental types of data upon which the processor can directly operate.

[[[00126.htm|prev]]][[[00128.htm|next]]][[[00125.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Scalar-TypeName':
BYTE
SBYTE
WORD
SWORD
DWORD
SDWORD
REAL4
FWORD
QWORD
REAL8
TBYTE
REAL10

[[[00127.htm|prev]]][[[00129.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Distance Type Names


Distance Type Namesare 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 distancerequired to reach the information to which it points.



Distance-TypeName':
NEAR
NEAR16
NEAR32
FAR
FAR16
FAR32

[[[00128.htm|prev]]][[[00130.htm|next]]][[[00128.htm|parent]]][[[toc.htm|TOC]]]

Description

Distance Type Namesare 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 distancerequired to reach the information to which it points.

[[[00129.htm|prev]]][[[00131.htm|next]]][[[00128.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Distance-TypeName':
NEAR
NEAR16
NEAR32
FAR
FAR16
FAR32

[[[00130.htm|prev]]][[[00132.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Language Names


Language Namesrefer 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.



Language-Name':
C
SYSCALL
STDCALL
PASCAL
FORTRAN
BASIC
OPTLINK

[[[00131.htm|prev]]][[[00133.htm|next]]][[[00131.htm|parent]]][[[toc.htm|TOC]]]

Description

Language Namesrefer 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.

[[[00132.htm|prev]]][[[00134.htm|next]]][[[00131.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Language-Name':
C
SYSCALL
STDCALL
PASCAL
FORTRAN
BASIC
OPTLINK

[[[00133.htm|prev]]][[[00135.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Anonymous Label Aliases


The Anonymous Label Aliasesare reserved symbolic names that return a context-sensitive value when referenced in expressions.

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.

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.



Anonymous-Label-Alias':
@B
@F

[[[00134.htm|prev]]][[[00136.htm|next]]][[[00134.htm|parent]]][[[toc.htm|TOC]]]

Description

The Anonymous Label Aliasesare reserved symbolic names that return a context-sensitive value when referenced in expressions.

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.

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.

[[[00135.htm|prev]]][[[00137.htm|next]]][[[00134.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Anonymous-Label-Alias':
@B
@F

[[[00136.htm|prev]]][[[00138.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Location Counter Alias


The Location Counter Aliasis a reserved name used in expressions to return the offset within the current segment or structure being assembled.



Location-Counter-Alias':
$

[[[00137.htm|prev]]][[[00139.htm|next]]][[[00137.htm|parent]]][[[toc.htm|TOC]]]

Description

The Location Counter Aliasis a reserved name used in expressions to return the offset within the current segment or structure being assembled.

[[[00138.htm|prev]]][[[00140.htm|next]]][[[00137.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Location-Counter-Alias':
$

[[[00139.htm|prev]]][[[00141.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Indeterminate Value Alias


The Indeterminate Value Aliasis a reserved name used in expressions to represent an uninitialized value.



Indeterminate-Value-Alias':
?

[[[00140.htm|prev]]][[[00142.htm|next]]][[[00140.htm|parent]]][[[toc.htm|TOC]]]

Description

The Indeterminate Value Aliasis a reserved name used in expressions to represent an uninitialized value.

[[[00141.htm|prev]]][[[00143.htm|next]]][[[00140.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Indeterminate-Value-Alias':
?

[[[00142.htm|prev]]][[[00144.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Directive Keywords


Directive Keywordsare symbolic names recognized and used in the body of various assembler directives.



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



[[[00143.htm|prev]]][[[00145.htm|next]]][[[00143.htm|parent]]][[[toc.htm|TOC]]]

Description

Directive Keywordsare symbolic names recognized and used in the body of various assembler directives.

[[[00144.htm|prev]]][[[00146.htm|next]]][[[00143.htm|parent]]][[[toc.htm|TOC]]]

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



[[[00145.htm|prev]]][[[00147.htm|next]]][[[00110.htm|parent]]][[[toc.htm|TOC]]]

Operator Keywords


Operator Keywordsare symbolic names used in expressions to denote an operation to be performed on one or more operands.



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



[[[00146.htm|prev]]][[[00148.htm|next]]][[[00146.htm|parent]]][[[toc.htm|TOC]]]

Description

Operator Keywordsare 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]]]

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



[[[00148.htm|prev]]][[[00150.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]

Identifiers


This section describes the syntax for identifiers and the various types of information they can be made to represent.



Identifier':
Normal-Identifier
Dot-Identifier

Normal-Identifier
NonDigit
Normal-Identifier Identifer-Character

Dot-Identifier
. Normal-Identifier

Identifier-Character
NonDigit
Digit

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


Digit: one of

 0 1 2 3 4 5 6 7 8 9



[[[00149.htm|prev]]][[[00151.htm|next]]][[[00149.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Syntax

Identifier':
Normal-Identifier
Dot-Identifier

Normal-Identifier
NonDigit
Normal-Identifier Identifer-Character

Dot-Identifier
. Normal-Identifier

Identifier-Character
NonDigit
Digit

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


Digit: one of

 0 1 2 3 4 5 6 7 8 9



[[[00151.htm|prev]]][[[00153.htm|next]]][[[00149.htm|parent]]][[[toc.htm|TOC]]]

Identifier Types


This section describes the various types of identifiers that the assembler will create and manipulate.



Identifier-Type':
EquateName
FieldName
GroupName
LabelName
MacroName
SegmentName
UserDefined-TypeName

[[[00152.htm|prev]]][[[00154.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Definition

Identifier-Type':
EquateName
FieldName
GroupName
LabelName
MacroName
SegmentName
UserDefined-TypeName

[[[00154.htm|prev]]][[[00156.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]

Equate Name

Definition

EquateName':
Numeric-EquateName
Text-EquateName

Description

An EquateNameis a symbolic identifier that is associated with an expression or a body of text. The assembler substitutes the value of the EquateNameat the point of reference.

[[[00155.htm|prev]]][[[00157.htm|next]]][[[00155.htm|parent]]][[[toc.htm|TOC]]]

Numeric Equate Name

An identifier becomes a Numeric-EquateNamewhen it is defined in a EQUor = directive. Procedure parameternames and local variablenames are also created as Numeric-EquateName's, but are visible only from within the procedure where they are defined. All other Numeric-EquateName'sare globally-scoped identifiers visible across the entire module.

A Numeric-EquateNamemay only be referenced from within expressions, as its replacement value is itself an expression.

[[[00156.htm|prev]]][[[00158.htm|next]]][[[00155.htm|parent]]][[[toc.htm|TOC]]]

Text Equate Name

A Text-EquateNameis a globally-scoped identifier created during the processing of a EQUpreprocessor directive. A Text-EquateNameis 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]]]

Field Name

Definition

FieldName':
Record-FieldName
Structure-FieldName
Union-FieldName

Description

An identifier becomes a FieldNamewhen it is defined within a RECORD, STRUCT, or UNIONdirective.

[[[00158.htm|prev]]][[[00160.htm|next]]][[[00158.htm|parent]]][[[toc.htm|TOC]]]

Record Field Name

A Record-FieldNameis a globally-scoped identifier created during the processing of a RECORDdirective. It is a special variation of a Numeric- EquateNameand can be used in the same contexts.

[[[00159.htm|prev]]][[[00161.htm|next]]][[[00158.htm|parent]]][[[toc.htm|TOC]]]

Structure Field Name

An identifier becomes a Structure-FieldNamewhen it is defined in a STRUCT directive. If the assembler is operating in M510mode, or if the OPTION OLDSTRUCTSdirective has been specified, then a Structure-FieldNameis a globally-scoped identifier treated as a special variation of a Numeric- EquateNameand can be used in the same contexts. Otherwise, a Structure- FieldNameis private to the defining structure and is only accessible in expressions through use of the Structure/Union Field Selection (. Operator) .

[[[00160.htm|prev]]][[[00162.htm|next]]][[[00158.htm|parent]]][[[toc.htm|TOC]]]

Union Field Name

An identifier becomes a Union-FieldNamewhen it is defined in a UNION directive. A Union-FieldNameis private to the defining union and is only accessible in expressions through use of the Structure/Union Field Selection (. Operator).

[[[00161.htm|prev]]][[[00163.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]

Group Name

A GroupNameis a globally-scoped identifier created during the processing of a GROUPdirective. It is referenced from within expressions.

[[[00162.htm|prev]]][[[00164.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]

Label Name

Definition

LabelName':
Code-LabelName
Data-LabelName

Description

A LabelNameis 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.


Type Declaration

The type declaration associated with a label name depends on how the label was defined. See the Code-LabelNameand Data-LabelNamesections for descriptions on how this attribute is assigned.


Language Attribute

A LabelNamecan have an assigned Language-Attribute, set either implicitly through the use of a Language-Namekeyword in the body of a .MODELor OPTIONdirective, or explicitly through the use of an overriding Language- Namekeyword in the body of a EXTERN/EXTRN, EXTERNDEF, PROC, or PUBLIC directive. The Language-Attributedetermines the exact spelling of the LabelNameidentifier 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:

/-----------------------------------------------------------\
|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.                 |
\-----------------------------------------------------------/


[[[00163.htm|prev]]][[[00165.htm|next]]][[[00163.htm|parent]]][[[toc.htm|TOC]]]

Code Label Name

Definition

Code-LabelName':
Target-LabelName
Procedure-LabelName

Description

A Code-LabelNameis an identifier that is associated with an executable code address at application run-time. There are two types of Code- LabelName's':Target-LabelNamesand Procedure-LabelNames.

[[[00164.htm|prev]]][[[00166.htm|next]]][[[00164.htm|parent]]][[[toc.htm|TOC]]]

Target Label Name

An identifier becomes a Target-LabelNamewhen it is defined with a :, ::, or LABELdirective.

If a Target-LabelNamecreated 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 M510mode (and no .MODELdirective with a Language-Namehas been specified), or unless the OPTION NOSCOPEDdirective has been specified.

A Target-LabelNamedefined outside the body of a procedure is visible to the entire module, and may also be given PUBLICvisibility.

[[[00165.htm|prev]]][[[00167.htm|next]]][[[00164.htm|parent]]][[[toc.htm|TOC]]]

Procedure Label Name

An identifier becomes a Procedure-LabelNamewhen it is defined in a PROC directive.

[[[00166.htm|prev]]][[[00168.htm|next]]][[[00163.htm|parent]]][[[toc.htm|TOC]]]

Data Label Name

A Data-LabelNameis an identifier that is the address of a program variable at application run-time. An identifier becomes a Data-LabelNamewhen 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 COMMdirective.

[[[00167.htm|prev]]][[[00169.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]

Macro Name

A MacroNameis a globally-scoped identifier created during the processing of a MACROdirective. It is associated with a multi-line body of text. A MacroNamemay only be used in contexts where a normal assembler directive is expected.

[[[00168.htm|prev]]][[[00170.htm|next]]][[[00168.htm|parent]]][[[toc.htm|TOC]]]

Macro Parameter Name

An identifier becomes a Macro-ParameterNamewhen it is named as a parameter to a macro in a MACROdirective. 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]]]

Segment Name

A SegmentNameis a globally-scoped identifier created during the processing of a SEGMENTdirective. It may be referenced from within expressions or in the body of a GROUPdirective.

[[[00170.htm|prev]]][[[00172.htm|next]]][[[00152.htm|parent]]][[[toc.htm|TOC]]]

User-Defined Type Name

Definition

UserDefined-TypeName':
Record-TypeName
Structure-TypeName
Typedef-TypeName
Union-TypeName

Description

An identifier becomes a UserDefined-TypeNamewhen it is defined within a RECORD, STRUCT, TYPEDEF, or UNIONdirective.

[[[00171.htm|prev]]][[[00173.htm|next]]][[[00171.htm|parent]]][[[toc.htm|TOC]]]

Record Type Name

A Record-TypeNameis a globally-scoped identifier created during the processing of a RECORDdirective. It is recognized from within Expressions , Type-Declarations, or as a pseudo-directive in a data allocation statement.

[[[00172.htm|prev]]][[[00174.htm|next]]][[[00171.htm|parent]]][[[toc.htm|TOC]]]

Structure Type Name

A Structure-TypeNameis a globally-scoped identifier created during the processing of a STRUCTdirective. It is recognized from within Expressions , Type-Declarations, or as a pseudo-directive in a data allocation statement.

[[[00173.htm|prev]]][[[00175.htm|next]]][[[00171.htm|parent]]][[[toc.htm|TOC]]]

Typedef Type Name

A Typedef-TypeNameis a globally-scoped identifier created during the processing of a TYPEDEFdirective. It is recognized from within Expressions, Type-Declarations, or as a pseudo-directive in a data allocation statement.

[[[00174.htm|prev]]][[[00176.htm|next]]][[[00171.htm|parent]]][[[toc.htm|TOC]]]

Union Type Name

A Union-TypeNameis a globally-scoped identifier created during the processing of a UNIONdirective. It is recognized from within Expressions, Type-Declarations, or as a pseudo-directive in a data allocation statement.

[[[00175.htm|prev]]][[[00177.htm|next]]][[[00149.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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]]]

@code

The @code'identifier is a Text-EquateNamecreated by the assembler when a . MODELdirective is encountered, at which time the assembler performs an automatic ASSUME CS:@code'operation. The @codesymbol is not defined if a .MODELdirective has not been issued.

Under MASM 5.10 emulation, the @codesymbol 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 @ codesymbol is updated to reflect whatever segment is opened by using .CODE , whether defined implicitly or as an explicit parameter to the .CODE directive.

The value assigned to the @codesymbol when the default code segment is opened is determined by the memory model as follows:

'Memory Model'Value for @code
TINY DGROUP
SMALL _TEXT
MEDIUM module_TEXT
COMPACT_TEXT
LARGE module_TEXT
HUGE module_TEXT
FLAT CODE32

The moduleentry 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]]]

@CodeSize

The @CodeSizeidentifier is a Numeric-EquateNamecreated by the assembler when a .MODELdirective is encountered. @CodeSizeindicates whether code segments created by the .CODEdirective are named such that the linker will combine them into a single (NEAR) segment or into multiple (FAR) segments. The @CodeSizesymbol is set to 0 (NEAR) for the TINY, SMALL, COMPACT,and FLATmemory models, and to 1 (FAR) for the MEDIUM, LARGE,and HUGEmemory models. The @CodeSizesymbol is not defined if a .MODELdirective has not been issued.

[[[00179.htm|prev]]][[[00181.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]

@CurSeg

The @CurSegidentifier is a Text-EquateNamedefined by the assembler to hold the name of the currently opened segment. If no segment is currently open, @CurSegwill expand into an empty string.

[[[00180.htm|prev]]][[[00182.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]

@data

The @dataidentifier is a Text-EquateNamecreated by the assembler when a . MODELdirective is encountered. It expands to the group name shared by all of the near data segments. If a .MODEL FLAThas 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]]]

@DataSize

The @DataSize'identifier is a Numeric-EquateNamecreated by the assembler when a .MODELdirective 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
COMPACT1
MEDIUM 1
LARGE 1
HUGE 2
FLAT 0

[[[00182.htm|prev]]][[[00184.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]

@Model

The @Model'identifier is a Numeric-EquateNamecreated by the assembler when a .MODELdirective is encountered, and is set to a unique value for each memory model. The values are as follows: '


TINY 1
SMALL 2
COMPACT3
MEDIUM 4
LARGE 5
HUGE 6
FLAT 7

[[[00183.htm|prev]]][[[00185.htm|next]]][[[00177.htm|parent]]][[[toc.htm|TOC]]]

@WordSize

The @WordSizeidentifier is a Numeric-EquateNamethat reflects the address size attribute of the current segment. It is set to 2 for a USE16segment, and 4 for a USE32segment. 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]]]

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]]]

@Alp

The @Alpidentifier is a Text-EquateNamethat 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]]]

@AlpMajor

The @AlpMajoridentifier is a Text-EquateNamethat 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 @AlpVersionfor more information.

This identifier is only defined in ALPmode.

[[[00187.htm|prev]]][[[00189.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]

@AlpMinor

The @AlpMinoridentifier is a Text-EquateNamethat 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 @AlpVersionfor more information.

This identifier is only defined in ALPmode.

[[[00188.htm|prev]]][[[00190.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]

@AlpRevision

The @AlpRevisionidentifier is a Text-EquateNamethat 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 @AlpVersionfor more information.

This identifier is only defined in ALPmode.

[[[00189.htm|prev]]][[[00191.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]

@AlpVersion

The @AlpVersionidentifier is a Text-EquateNamethat 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)
2.The minor version number (two digits)
3.The revision number (three digits)

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:

    @AlpVersion   102003
    @AlpMajor     100000
    @AlpMinor       2000
    @AlpRevision     003

This identifier is only defined in ALPmode.

[[[00190.htm|prev]]][[[00192.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]

@Cpu

The @Cpuidentifier is a Numeric-EquateNamethat 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).

/------------------------------------------------------\
|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                         |
\------------------------------------------------------/

[[[00191.htm|prev]]][[[00193.htm|next]]][[[00185.htm|parent]]][[[toc.htm|TOC]]]

@Version

The @Versionidentifier is a Text-EquateNamethat reflects the MASM- compatible version number. The current emulation mode of the assembler affects the value of this symbol as follows:


M510510
M600600
ALP4294967295 (the highest possible value for an unsigned 32-bit integer)

[[[00192.htm|prev]]][[[00194.htm|next]]][[[00176.htm|parent]]][[[toc.htm|TOC]]]

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]]]

@Date

The @Dateidentifier is a Text-EquateNamethat 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 ALPmode, the date is returned in the MM/DD/ YYYY format.

The @Dateidentifier is not available in M510mode.

[[[00194.htm|prev]]][[[00196.htm|next]]][[[00193.htm|parent]]][[[toc.htm|TOC]]]

@Time

The @Timeidentifier is a Text-EquateNamethat is set to the current system time in 24-hour HH:MM:SS format.

The @Timeidentifier is not available in M510mode.

[[[00195.htm|prev]]][[[00197.htm|next]]][[[00176.htm|parent]]][[[toc.htm|TOC]]]

File Information

These identifiers return information about the file(s) being assembled.

[[[00196.htm|prev]]][[[00198.htm|next]]][[[00196.htm|parent]]][[[toc.htm|TOC]]]

@FileName

The @FileNameidentifier is a Text-EquateNamethat 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]]]

@Line

The @Lineidentifier is a Numeric-EquateNamethat is set to the current source line number in the file currently being assembled.

The @Lineidentifier is not available in M510mode.

[[[00198.htm|prev]]][[[00200.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]

Literals


Literalsare 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':
Floating-Point-Literal
Integer-Literal
String-Literal

[[[00199.htm|prev]]][[[00201.htm|next]]][[[00199.htm|parent]]][[[toc.htm|TOC]]]

Description

Literalsare 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]]]

Syntax

Literal':
Floating-Point-Literal
Integer-Literal
String-Literal

[[[00201.htm|prev]]][[[00203.htm|next]]][[[00199.htm|parent]]][[[toc.htm|TOC]]]

Integer Literals


An integer literalrepresents 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 .RADIXdirective can be used to specify an alternate radix.''''



Integer-Literal':
Binary-Integer-Literal
Octal-Integer-Literal
Decimal-Integer-Literal
Hexadecimal-Integer-Literal

[[[00202.htm|prev]]][[[00204.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]

Description

An integer literalrepresents 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 .RADIXdirective can be used to specify an alternate radix.

[[[00203.htm|prev]]][[[00205.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Integer-Literal':
Binary-Integer-Literal
Octal-Integer-Literal
Decimal-Integer-Literal
Hexadecimal-Integer-Literal

[[[00204.htm|prev]]][[[00206.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]

Binary Integer Literals


Description

Examples



A base-2 number containing either of the digits 0and 1.'



Binary-Integer-Literal':
Unqualified-Binary-Integer-Literal
Qualified-Binary-Integer-Literal

Unqualified-Binary-Integer-Literal:
Binary-Digit
Binary-Integer-Literal'
Binary-Digit

Qualified-Binary-Integer-Literal:
Unqualified-Binary-Integer-Literal Binary-Radix

Binary-Digit:
0
1

Binary-Radix:
b
B
y
Y

[[[00205.htm|prev]]][[[00207.htm|next]]][[[00205.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Examples

[[[00206.htm|prev]]][[[00208.htm|next]]][[[00205.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Binary-Integer-Literal':
Unqualified-Binary-Integer-Literal
Qualified-Binary-Integer-Literal

Unqualified-Binary-Integer-Literal:
Binary-Digit
Binary-Integer-Literal'
Binary-Digit

Qualified-Binary-Integer-Literal:
Unqualified-Binary-Integer-Literal Binary-Radix

Binary-Digit:
0
1

Binary-Radix:
b
B
y
Y

[[[00207.htm|prev]]][[[00209.htm|next]]][[[00205.htm|parent]]][[[toc.htm|TOC]]]

Description

A base-2 number containing either of the digits 0and 1.

[[[00208.htm|prev]]][[[00210.htm|next]]][[[00205.htm|parent]]][[[toc.htm|TOC]]]

Examples

The following are examples of unqualified binary integer literals:

10101
0
000001
1111000010101010

The following are examples of qualified binary integer literals:

00001111b
1111Y
00y
1111000010101010B

[[[00209.htm|prev]]][[[00211.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]

Octal Integer Literals


Description

Examples



A base-8 number containing any of the digits 0through 7.'



Octal-Integer-Literal':
Unqualified-Octal-Integer-Literal
Qualified-Octal-Integer-Literal

Unqualified-Octal-Integer-Literal:
Octal-Digit
Octal-Integer-Literal Octal-Digit

Qualified-Octal-Integer-Literal:
Unqualified-Octal-Integer-Literal Octal-Radix

Octal-Digit: one of:

0 1 2 3 4 5 6 7

Octal-Radix:
o
O
q
Q

[[[00210.htm|prev]]][[[00212.htm|next]]][[[00210.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Examples

[[[00211.htm|prev]]][[[00213.htm|next]]][[[00210.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Octal-Integer-Literal':
Unqualified-Octal-Integer-Literal
Qualified-Octal-Integer-Literal

Unqualified-Octal-Integer-Literal:
Octal-Digit
Octal-Integer-Literal Octal-Digit

Qualified-Octal-Integer-Literal:
Unqualified-Octal-Integer-Literal Octal-Radix

Octal-Digit: one of:

0 1 2 3 4 5 6 7

Octal-Radix:
o
O
q
Q

[[[00212.htm|prev]]][[[00214.htm|next]]][[[00210.htm|parent]]][[[toc.htm|TOC]]]

Description

A base-8 number containing any of the digits 0through 7.

[[[00213.htm|prev]]][[[00215.htm|next]]][[[00210.htm|parent]]][[[toc.htm|TOC]]]

Examples

The following are examples of unqualified octal integer literals:

01234567
27
765

The following are examples of qualified octal integer literals:

27q
013o
567O
01234567Q

[[[00214.htm|prev]]][[[00216.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]

Decimal Integer Literals


Description

Examples



A base-10 number containing any of the digits 0through 9.'



Decimal-Integer-Literal':
Unqualified-Decimal-Integer-Literal
Qualified-Decimal-Integer-Literal

Unqualified-Decimal-Integer-Literal:
Decimal-Digit
Decimal-Integer-Literal Decimal-Digit

Qualified-Decimal-Integer-Literal:
Unqualified-Decimal-Integer-Literal Decimal-Radix

Decimal-Digit: one of:

0 1 2 3 4 5 6 7 8 9

Decimal-Radix:
d
D
t
T

[[[00215.htm|prev]]][[[00217.htm|next]]][[[00215.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Examples

[[[00216.htm|prev]]][[[00218.htm|next]]][[[00215.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Decimal-Integer-Literal':
Unqualified-Decimal-Integer-Literal
Qualified-Decimal-Integer-Literal

Unqualified-Decimal-Integer-Literal:
Decimal-Digit
Decimal-Integer-Literal Decimal-Digit

Qualified-Decimal-Integer-Literal:
Unqualified-Decimal-Integer-Literal Decimal-Radix

Decimal-Digit: one of:

0 1 2 3 4 5 6 7 8 9

Decimal-Radix:
d
D
t
T

[[[00217.htm|prev]]][[[00219.htm|next]]][[[00215.htm|parent]]][[[toc.htm|TOC]]]

Description

A base-10 number containing any of the digits 0through 9.

[[[00218.htm|prev]]][[[00220.htm|next]]][[[00215.htm|parent]]][[[toc.htm|TOC]]]

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

[[[00219.htm|prev]]][[[00221.htm|next]]][[[00202.htm|parent]]][[[toc.htm|TOC]]]

Hexadecimal Integer Literals


Description

Constraints

Examples



A base-16 number using any combination of the digits 0through 9and the lowercase letters athrough for the uppercase letters Athrough F. The lowercase and uppercase representations of any given hexadecimal letter are equivalent.



Hexadecimal-Integer-Literal':
Unqualified-Hexadecimal-Integer-Literal
Qualified-Hexadecimal-Integer-Literal

Unqualified-Hexadecimal-Integer-Literal:
Decimal-Digit
Hexadecimal-Integer-Literal Decimal-Digit
Hexadecimal-Integer-Literal Hexadecimal-Digit

Qualified-Hexadecimal-Integer-Literal:
Unqualified-Hexadecimal-Integer-Literal Hexadecimal-Radix

Decimal-Digit: one of:

0 1 2 3 4 5 6 7 8 9

Hexadecimal-Digit: one of:

a b c d e f
A B C D E F

Hexadecimal-Radix:
h
H

[[[00220.htm|prev]]][[[00222.htm|next]]][[[00220.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00221.htm|prev]]][[[00223.htm|next]]][[[00220.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Hexadecimal-Integer-Literal':
Unqualified-Hexadecimal-Integer-Literal
Qualified-Hexadecimal-Integer-Literal

Unqualified-Hexadecimal-Integer-Literal:
Decimal-Digit
Hexadecimal-Integer-Literal Decimal-Digit
Hexadecimal-Integer-Literal Hexadecimal-Digit

Qualified-Hexadecimal-Integer-Literal:
Unqualified-Hexadecimal-Integer-Literal Hexadecimal-Radix

Decimal-Digit: one of:

0 1 2 3 4 5 6 7 8 9

Hexadecimal-Digit: one of:

a b c d e f
A B C D E F

Hexadecimal-Radix:
h
H

[[[00222.htm|prev]]][[[00224.htm|next]]][[[00220.htm|parent]]][[[toc.htm|TOC]]]

Description

A base-16 number using any combination of the digits 0through 9and the lowercase letters athrough for the uppercase letters Athrough 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]]]

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 0digit.

[[[00224.htm|prev]]][[[00226.htm|next]]][[[00220.htm|parent]]][[[toc.htm|TOC]]]

Examples

The following are examples of unqualified hexadecimal integer literals:

01BD
9A
0AB

The following are examples of qualified hexadecimal integer literals:

1234ABCDh
01DH
0bh
1111FFFFH

[[[00225.htm|prev]]][[[00227.htm|next]]][[[00199.htm|parent]]][[[toc.htm|TOC]]]

Floating-Point Literals


A floating-point literalis a notation for representing real numbers. The assembler provides both decimal and hexadecimal floating-point notations for representing real numbers.



Floating-Point-Literal':
Decimal-Floating-Point-Literal
Hexadecimal-Floating-Point-Literal

[[[00226.htm|prev]]][[[00228.htm|next]]][[[00226.htm|parent]]][[[toc.htm|TOC]]]

Description

A floating-point literalis 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]]]

Syntax

Floating-Point-Literal':
Decimal-Floating-Point-Literal
Hexadecimal-Floating-Point-Literal

[[[00228.htm|prev]]][[[00230.htm|next]]][[[00226.htm|parent]]][[[toc.htm|TOC]]]

Decimal Floating-Point Literals


Description

Constraints

Examples



A decimal floating-point literal has a significand partthat 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 (eor E), followed by an optional sign character (+or -), followed by a digit sequence representing the exponent.



Decimal-Floating-Point-Literal':
Significand-Part
Significand-Part Exponent-Part

Significand-Part:
Digit-Sequence
.Digit-Sequence
Digit-Sequence
.

Exponent-Part:
E-Character Digit-Sequence
E-Character Sign Digit-Sequence

E-Character:
e
E

Sign:
-
+

Digit-Sequence:
Digit
Digit-Sequence Digit

Digit: one of:

0 1 2 3 4 5 6 7 8 9

[[[00229.htm|prev]]][[[00231.htm|next]]][[[00229.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00230.htm|prev]]][[[00232.htm|next]]][[[00229.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Decimal-Floating-Point-Literal':
Significand-Part
Significand-Part Exponent-Part

Significand-Part:
Digit-Sequence
.Digit-Sequence
Digit-Sequence
.

Exponent-Part:
E-Character Digit-Sequence
E-Character Sign Digit-Sequence

E-Character:
e
E

Sign:
-
+

Digit-Sequence:
Digit
Digit-Sequence Digit

Digit: one of:

0 1 2 3 4 5 6 7 8 9

[[[00231.htm|prev]]][[[00233.htm|next]]][[[00229.htm|parent]]][[[toc.htm|TOC]]]

Description

A decimal floating-point literal has a significand partthat 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 (eor 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]]]

Constraints

The introductory Digit-Sequencein the Significand-Partmust be specified ( the literal cannot begin with a ".").

[[[00233.htm|prev]]][[[00235.htm|next]]][[[00229.htm|parent]]][[[toc.htm|TOC]]]

Examples


   25 . 23 
   2 . 523E1 
   2523 . 0E - 2 

[[[00234.htm|prev]]][[[00236.htm|next]]][[[00226.htm|parent]]][[[toc.htm|TOC]]]

Hexadecimal Floating-Point Literals


Description

Constraints

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 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.




Hexadecimal-Floating-Point-Literal':
Hexadecimal-Literal Float-Radix

Hexadecimal-Literal:
Decimal-Digit
Hexadecimal-Literal Decimal-Digit
Hexadecimal-Literal Hexadecimal-Digit

Decimal-Digit: one of:

0 1 2 3 4 5 6 7 8 9

Hexadecimal-Digit: one of:

a b c d e f
A B C D E F

Float-Radix:
r
R

[[[00235.htm|prev]]][[[00237.htm|next]]][[[00235.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00236.htm|prev]]][[[00238.htm|next]]][[[00235.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Hexadecimal-Floating-Point-Literal':
Hexadecimal-Literal Float-Radix

Hexadecimal-Literal:
Decimal-Digit
Hexadecimal-Literal Decimal-Digit
Hexadecimal-Literal Hexadecimal-Digit

Decimal-Digit: one of:

0 1 2 3 4 5 6 7 8 9

Hexadecimal-Digit: one of:

a b c d e f
A B C D E F

Float-Radix:
r
R

[[[00237.htm|prev]]][[[00239.htm|next]]][[[00235.htm|parent]]][[[toc.htm|TOC]]]

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.

[[[00238.htm|prev]]][[[00240.htm|next]]][[[00235.htm|parent]]][[[toc.htm|TOC]]]

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 0digit.

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 REAL10variables, 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]]]

Examples


3F800000r 

[[[00240.htm|prev]]][[[00242.htm|next]]][[[00199.htm|parent]]][[[toc.htm|TOC]]]

String Literals


Description

Examples



A string literalcontains 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 characterthat 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':
D-String
S-String

D-String'
:
D-Quote D-Quote
D-Quote D-Char-Sequence D-Quote

S-String':
S-Quote S-Quote
S-Quote S-Char-Sequence S-Quote

D-Char-Sequence'
:
any printable character except D-Quote
D-Quote D-Quote

S-Char-Sequence':
any printable character except S-Quote
S-Quote S-Quote

D-Quote'
:
"

S-Quote':
''


[[[00241.htm|prev]]][[[00243.htm|next]]][[[00241.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Examples

[[[00242.htm|prev]]][[[00244.htm|next]]][[[00241.htm|parent]]][[[toc.htm|TOC]]]

Syntax

String-Literal':
D-String
S-String

D-String'
:
D-Quote D-Quote
D-Quote D-Char-Sequence D-Quote

S-String':
S-Quote S-Quote
S-Quote S-Char-Sequence S-Quote

D-Char-Sequence'
:
any printable character except D-Quote
D-Quote D-Quote

S-Char-Sequence':
any printable character except S-Quote
S-Quote S-Quote

D-Quote'
:
"

S-Quote':
''


[[[00243.htm|prev]]][[[00245.htm|next]]][[[00241.htm|parent]]][[[toc.htm|TOC]]]

Description

A string literalcontains 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 characterthat 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]]]

Examples


'Hello, world'
"That's the way it is"
'Unless it''s not'
"SuperStringCon \
catenated"

[[[00245.htm|prev]]][[[00247.htm|next]]][[[00107.htm|parent]]][[[toc.htm|TOC]]]

Punctuators


Punctuators are used as operators and separator characters.



Punctuator': one of
[ ] ( ) { } * , : = ; %

[[[00246.htm|prev]]][[[00248.htm|next]]][[[00246.htm|parent]]][[[toc.htm|TOC]]]

Description

Punctuators are used as operators and separator characters.

[[[00247.htm|prev]]][[[00249.htm|next]]][[[00246.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Punctuator': one of
[ ] ( ) { } * , : = ; %

[[[00248.htm|prev]]][[[00250.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]

Declarations

A Type Declarationis 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]]]

Type Declarations


A Type-Declarationis a common construct used in various assembler directives to establish type attribute information for a program object. A Type-Declarationis needed to determine the data type of a variable or labeled address. The TYPEDEFdirective offers a method of assigning a name to a Type-Declaration.



Type-Declaration':
TypeName
TypeName'
Array-Spec
Pointer-Spec
Pointer-Spec'TypeName
Pointer-Spec'
TypeName'Array-Spec

Pointer-Spec'
:
PTR
Distance-TypeNamePTR
Pointer-Spec'Array-Spec

Array-Spec'
:
[Expression]
Array-Spec[Expression]

TypeName':
Distance-TypeName
Scalar-TypeName
UserDefined-TypeName



The TYPEDEFdirective is used to illustrate the type declaration syntax:

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 

[[[00250.htm|prev]]][[[00252.htm|next]]][[[00250.htm|parent]]][[[toc.htm|TOC]]]

Description

A Type-Declarationis a common construct used in various assembler directives to establish type attribute information for a program object. A Type-Declarationis needed to determine the data type of a variable or labeled address. The TYPEDEFdirective offers a method of assigning a name to a Type-Declaration.

[[[00251.htm|prev]]][[[00253.htm|next]]][[[00250.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Type-Declaration':
TypeName
TypeName'
Array-Spec
Pointer-Spec
Pointer-Spec'TypeName
Pointer-Spec'
TypeName'Array-Spec

Pointer-Spec'
:
PTR
Distance-TypeNamePTR
Pointer-Spec'Array-Spec

Array-Spec'
:
[Expression]
Array-Spec[Expression]

TypeName':
Distance-TypeName
Scalar-TypeName
UserDefined-TypeName

[[[00252.htm|prev]]][[[00254.htm|next]]][[[00250.htm|parent]]][[[toc.htm|TOC]]]

Examples

The TYPEDEFdirective is used to illustrate the type declaration syntax:

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 

[[[00253.htm|prev]]][[[00255.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]

Expressions

An expression is a sequence of operatorsand operandsthat 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 precedenceand 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]]]

Expression Syntax


This section describes the complete expression syntax.



Expression':
Duplicative-Expression

Duplicative-Expression:
Attribute-Expression
Attribute-ExpressionDUP
(Initializer-List)

Attribute-Expression:
OR-Expression
SHORTAdditive-Expression
.TYPEOR-Expression
OPATTROR-Expression

OR-Expression:
AND-Expression
OR-ExpressionORAND-Expression
OR-ExpressionXORAND-Expression

AND-Expression:
NOT-Expression
AND-ExpressionANDNOT-Expression

NOT-Expression:
Relational-Expression
NOTRelational-Expression

Relational-Expression:
Additive-Expression
Relational-ExpressionEQAdditive-Expression
Relational-ExpressionNEAdditive-Expression
Relational-ExpressionGTAdditive-Expression
Relational-ExpressionGEAdditive-Expression
Relational-ExpressionLTAdditive-Expression
Relational-ExpressionLEAdditive-Expression

Additive-Expression:
Multiplicative-Expression
Additive-Expression+Multiplicative-Expression
Additive-Expression-Multiplicative-Expression

Multiplicative-Expression:
Narrowed-Expression
Multiplicative-Expression*Narrowed-Expression
Multiplicative-Expression/Narrowed-Expression
Multiplicative-ExpressionMODNarrowed-Expression
Multiplicative-ExpressionSHLNarrowed-Expression
Multiplicative-ExpressionSHRNarrowed-Expression

Narrowed-Expression:
Cast-Expression
HIGHCast-Expression
HIGHWORDCast-Expression
LOWCast-Expression
LOWWORDCast-Expression

Cast-Expression:
Element-Selection-Expression
OFFSETCast-Expression
SEGCast-Expression
THISElement-Selection-Expression
TYPEElement-Selection-Expression
Cast-ExpressionPTRCast-Expression
Cast-Expression:Cast-Expression

Element-Selection-Expression:
Sign-Expression
Element-Selection-Expression[Sign-Expression00476.htm]
Element-Selection-Expression.Sign-Expression

Sign-Expression:
Primary-Expression
-Primary-Expression
+Primary-Expression

Primary-Expression:
Literal-Operand
Record-Constant
Identifier-Operand
Register-Operand
Integral-TypeName-Operand
Value-Substitution-Operand
LENGTHIdentifier-Operand
LENGTHOFIdentifier-Operand
MASKIdentifier-Operand
SIZEElement-Selection-Expression
SIZEOFElement-Selection-Expression
WIDTHIdentifier-Operand
Parenthesized-Expression
Indirected-Expression
Compound-Initializer

Literal-Operand:
Floating-Point-Literal
Integer-Literal
String-Literal

Record-Constant:
Identifier-Operand
<Field-List>
Identifier-Operand
{Field-List}

Field-List:
Attribute-Expression
Field-List
,Attribute-Expression

Identifier-Operand:
Identifier

Register-Operand:
Processor-Register

Integral-TypeName-Operand:
Scalar-TypeName
Distance-TypeName

Value-Substitution-Operand:
Anonymous-Label-Alias
Location-Counter-Alias
Indeterminate-Value-Alias
FLAT

Parenthesized-Expression:
(Attribute-Expression)

Indirected-Expression:
[Attribute-Expression]

Compound-Initializer:
<Initializer-List>
{Initializer-List}

Initializer-List:
Duplicative-Expression
Initializer-List
,Duplicative-Expression

[[[00255.htm|prev]]][[[00257.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Description

This section describes the complete expression syntax.

[[[00256.htm|prev]]][[[00258.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Expression':
Duplicative-Expression

Duplicative-Expression:
Attribute-Expression
Attribute-ExpressionDUP
(Initializer-List)

Attribute-Expression:
OR-Expression
SHORTAdditive-Expression
.TYPEOR-Expression
OPATTROR-Expression

OR-Expression:
AND-Expression
OR-ExpressionORAND-Expression
OR-ExpressionXORAND-Expression

AND-Expression:
NOT-Expression
AND-ExpressionANDNOT-Expression

NOT-Expression:
Relational-Expression
NOTRelational-Expression

Relational-Expression:
Additive-Expression
Relational-ExpressionEQAdditive-Expression
Relational-ExpressionNEAdditive-Expression
Relational-ExpressionGTAdditive-Expression
Relational-ExpressionGEAdditive-Expression
Relational-ExpressionLTAdditive-Expression
Relational-ExpressionLEAdditive-Expression

Additive-Expression:
Multiplicative-Expression
Additive-Expression+Multiplicative-Expression
Additive-Expression-Multiplicative-Expression

Multiplicative-Expression:
Narrowed-Expression
Multiplicative-Expression*Narrowed-Expression
Multiplicative-Expression/Narrowed-Expression
Multiplicative-ExpressionMODNarrowed-Expression
Multiplicative-ExpressionSHLNarrowed-Expression
Multiplicative-ExpressionSHRNarrowed-Expression

Narrowed-Expression:
Cast-Expression
HIGHCast-Expression
HIGHWORDCast-Expression
LOWCast-Expression
LOWWORDCast-Expression

Cast-Expression:
Element-Selection-Expression
OFFSETCast-Expression
SEGCast-Expression
THISElement-Selection-Expression
TYPEElement-Selection-Expression
Cast-ExpressionPTRCast-Expression
Cast-Expression:Cast-Expression

Element-Selection-Expression:
Sign-Expression
Element-Selection-Expression[Sign-Expression00476.htm]
Element-Selection-Expression.Sign-Expression

Sign-Expression:
Primary-Expression
-Primary-Expression
+Primary-Expression

Primary-Expression:
Literal-Operand
Record-Constant
Identifier-Operand
Register-Operand
Integral-TypeName-Operand
Value-Substitution-Operand
LENGTHIdentifier-Operand
LENGTHOFIdentifier-Operand
MASKIdentifier-Operand
SIZEElement-Selection-Expression
SIZEOFElement-Selection-Expression
WIDTHIdentifier-Operand
Parenthesized-Expression
Indirected-Expression
Compound-Initializer

Literal-Operand:
Floating-Point-Literal
Integer-Literal
String-Literal

Record-Constant:
Identifier-Operand
<Field-List>
Identifier-Operand
{Field-List}

Field-List:
Attribute-Expression
Field-List
,Attribute-Expression

Identifier-Operand:
Identifier

Register-Operand:
Processor-Register

Integral-TypeName-Operand:
Scalar-TypeName
Distance-TypeName

Value-Substitution-Operand:
Anonymous-Label-Alias
Location-Counter-Alias
Indeterminate-Value-Alias
FLAT

Parenthesized-Expression:
(Attribute-Expression)

Indirected-Expression:
[Attribute-Expression]

Compound-Initializer:
<Initializer-List>
{Initializer-List}

Initializer-List:
Duplicative-Expression
Initializer-List
,Duplicative-Expression

[[[00257.htm|prev]]][[[00259.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Duplicative Initialization Expression


A Duplicative Initialization Expressionis one that can be optionally used during the initialization of variables such that the operand is duplicated a specified number of times.



Duplicative-Expression':
Attribute-Expression
Attribute-ExpressionDUP
(Initializer-List)

Initializer-List:
Duplicative-Expression
Initializer-List
,Duplicative-Expression

[[[00258.htm|prev]]][[[00260.htm|next]]][[[00258.htm|parent]]][[[toc.htm|TOC]]]

Description

A Duplicative Initialization Expressionis 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]]]

Syntax

Duplicative-Expression':
Attribute-Expression
Attribute-ExpressionDUP
(Initializer-List)

Initializer-List:
Duplicative-Expression
Initializer-List
,Duplicative-Expression

[[[00260.htm|prev]]][[[00262.htm|next]]][[[00258.htm|parent]]][[[toc.htm|TOC]]]

Duplicative Initialization (DUP Operator)


Description

Constraints

Examples



The DUPoperator creates a Duplicated-ExpressionTypefrom the Initializer- Listenclosed in parentheses. This construct can be used to create arrays of information during data allocation.



Attribute-ExpressionDUP (Initializer-List)

Initializer-List:
Duplicative-Expression
Initializer-List,Duplicative-Expression

[[[00261.htm|prev]]][[[00263.htm|next]]][[[00261.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00262.htm|prev]]][[[00264.htm|next]]][[[00261.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Attribute-ExpressionDUP (Initializer-List)

Initializer-List:
Duplicative-Expression
Initializer-List,Duplicative-Expression

[[[00263.htm|prev]]][[[00265.htm|next]]][[[00261.htm|parent]]][[[toc.htm|TOC]]]

Description

The DUPoperator creates a Duplicated-ExpressionTypefrom the Initializer- Listenclosed 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]]]

Constraints

The left hand operand of the DUPoperator must evaluate to an Absolute- ExpressionType.

Each Duplicative-Expressionin the Initializer-Listmust evaluate to an Initializer-ExpressionType.

[[[00265.htm|prev]]][[[00267.htm|next]]][[[00261.htm|parent]]][[[toc.htm|TOC]]]

Examples


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 

[[[00266.htm|prev]]][[[00268.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Attribute Expression


An Attribute Expressionis one that optionally extracts or modifies one or more of the basic properties of its operand.



Attribute-Expression':
OR-Expression
SHORTAdditive-Expression
.TYPEOR-Expression
OPATTROR-Expression

[[[00267.htm|prev]]][[[00269.htm|next]]][[[00267.htm|parent]]][[[toc.htm|TOC]]]

Description

An Attribute Expressionis 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]]]

Syntax

Attribute-Expression':
OR-Expression
SHORTAdditive-Expression
.TYPEOR-Expression
OPATTROR-Expression

[[[00269.htm|prev]]][[[00271.htm|next]]][[[00267.htm|parent]]][[[toc.htm|TOC]]]

Expression Descriptor Bitmap (.TYPE Operator)


Description

Examples



The .TYPEoperator is considered obsolete. The OPATTRoperator should be used instead.

The .TYPEoperator 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:

/------------------------------------------------------------------\
|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                    |
\------------------------------------------------------------------/

.TYPEOR-Expression

[[[00270.htm|prev]]][[[00272.htm|next]]][[[00270.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Examples

[[[00271.htm|prev]]][[[00273.htm|next]]][[[00270.htm|parent]]][[[toc.htm|TOC]]]

Syntax

.TYPEOR-Expression

[[[00272.htm|prev]]][[[00274.htm|next]]][[[00270.htm|parent]]][[[toc.htm|TOC]]]

Description

The .TYPEoperator is considered obsolete. The OPATTRoperator should be used instead.

The .TYPEoperator 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:

/------------------------------------------------------------------\
|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                    |
\------------------------------------------------------------------/

[[[00273.htm|prev]]][[[00275.htm|next]]][[[00270.htm|parent]]][[[toc.htm|TOC]]]

Examples


BumpCounter   macro   bump 
   if   ( ( ( . TYPE   ( bump ) )   and   07h )   eq   04h ) 
      Counter   =   Counter   +   bump 
   else 
      . err   < Non - constant   value   passed   to   BumpCounter > 
   endif 
endm 

[[[00274.htm|prev]]][[[00276.htm|next]]][[[00267.htm|parent]]][[[toc.htm|TOC]]]

Extended Descriptor Bitmap (OPATTR Operator)


Description

Constraints

Examples



The OPATTRoperator returns a superset of the information returned by the . TYPEoperator, which should be considered obsolete.

The OPATTRoperator 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:

/----------------------------------------------------------------------\
|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)               |
\----------------------------------------------------------------------/

The LLLfield (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
001C
010SYSCALL
011STDCALL
100PASCAL
101FORTRAN
110BASIC
111OPTLINK



OPATTROR-Expression

[[[00275.htm|prev]]][[[00277.htm|next]]][[[00275.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00276.htm|prev]]][[[00278.htm|next]]][[[00275.htm|parent]]][[[toc.htm|TOC]]]

Syntax

OPATTROR-Expression

[[[00277.htm|prev]]][[[00279.htm|next]]][[[00275.htm|parent]]][[[toc.htm|TOC]]]

Description

The OPATTRoperator returns a superset of the information returned by the . TYPEoperator, which should be considered obsolete.

The OPATTRoperator 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:

/----------------------------------------------------------------------\
|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)               |
\----------------------------------------------------------------------/

The LLLfield (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
001C
010SYSCALL
011STDCALL
100PASCAL
101FORTRAN
110BASIC
111OPTLINK

[[[00278.htm|prev]]][[[00280.htm|next]]][[[00275.htm|parent]]][[[toc.htm|TOC]]]

Constraints

This operator is not available in M510mode.

[[[00279.htm|prev]]][[[00281.htm|next]]][[[00275.htm|parent]]][[[toc.htm|TOC]]]

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 

[[[00280.htm|prev]]][[[00282.htm|next]]][[[00267.htm|parent]]][[[toc.htm|TOC]]]

Force Short Relative Address (SHORT Operator)


Description

Constraints

Examples



The SHORToperator 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 NEARdistance when the target is an unqualified forward reference.



SHORTAdditive-Expression

[[[00281.htm|prev]]][[[00283.htm|next]]][[[00281.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00282.htm|prev]]][[[00284.htm|next]]][[[00281.htm|parent]]][[[toc.htm|TOC]]]

Syntax

SHORTAdditive-Expression

[[[00283.htm|prev]]][[[00285.htm|next]]][[[00281.htm|parent]]][[[toc.htm|TOC]]]

Description

The SHORToperator 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 NEARdistance when the target is an unqualified forward reference.

[[[00284.htm|prev]]][[[00286.htm|next]]][[[00281.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The Additive-Expressionmust evaluate to a Direct-ExpressionType.

[[[00285.htm|prev]]][[[00287.htm|next]]][[[00281.htm|parent]]][[[toc.htm|TOC]]]

Examples


   JMP     Forward                 ;   target   unknown ,   NEAR   jump   generated 
   JMP     SHORT   Forward          ;   force   SHORT   encoding 
   . 
   .                      ;   fewer   than   128   bytes   of   instructions 
   . 
Forward :                         ;   definition   of   target 

[[[00286.htm|prev]]][[[00288.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Bitwise OR Expression


A Bitwise OR Expressionis one where an optional binary bitwise OR operation between the left and right operands is performed and the result returned.



OR-Expression':
AND-Expression
OR-ExpressionORAND-Expression
OR-ExpressionXORAND-Expression

[[[00287.htm|prev]]][[[00289.htm|next]]][[[00287.htm|parent]]][[[toc.htm|TOC]]]

Description

A Bitwise OR Expressionis 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]]]

Syntax

OR-Expression':
AND-Expression
OR-ExpressionORAND-Expression
OR-ExpressionXORAND-Expression

[[[00289.htm|prev]]][[[00291.htm|next]]][[[00287.htm|parent]]][[[toc.htm|TOC]]]

Bitwise Inclusive OR (OR Operator)


Description

Constraints

Examples



The ORoperator performs a binary bitwise OR operation on the left and right hand operands.



OR-ExpressionORAND-Expression

[[[00290.htm|prev]]][[[00292.htm|next]]][[[00290.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00291.htm|prev]]][[[00293.htm|next]]][[[00290.htm|parent]]][[[toc.htm|TOC]]]

Syntax

OR-ExpressionORAND-Expression

[[[00292.htm|prev]]][[[00294.htm|next]]][[[00290.htm|parent]]][[[toc.htm|TOC]]]

Description

The ORoperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00294.htm|prev]]][[[00296.htm|next]]][[[00290.htm|parent]]][[[toc.htm|TOC]]]

Examples


   One    EQU    1 
   Two    EQU    2 

   MOV    AX ,   One   OR   Two          ;   moves   3   into   AX 

[[[00295.htm|prev]]][[[00297.htm|next]]][[[00287.htm|parent]]][[[toc.htm|TOC]]]

Bitwise Exclusive OR (XOR Operator)


Description

Constraints

Examples



The XORoperator performs a binary bitwise XOR operation on the left and right hand operands.



OR-ExpressionXORAND-Expression

[[[00296.htm|prev]]][[[00298.htm|next]]][[[00296.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00297.htm|prev]]][[[00299.htm|next]]][[[00296.htm|parent]]][[[toc.htm|TOC]]]

Syntax

OR-ExpressionXORAND-Expression

[[[00298.htm|prev]]][[[00300.htm|next]]][[[00296.htm|parent]]][[[toc.htm|TOC]]]

Description

The XORoperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00300.htm|prev]]][[[00302.htm|next]]][[[00296.htm|parent]]][[[toc.htm|TOC]]]

Examples


   Lower    EQU    0101y            ;   7h   -   binary   radix   suffix 
   Upper    EQU    1100y            ;   Eh   -   binary   radix   suffix 

   MOV    AX ,   Upper   XOR   Lower     ;   moves   1001   into   AX 

[[[00301.htm|prev]]][[[00303.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Bitwise AND Expression


A Bitwise AND Expressionis one where an optional binary bitwise AND operation between the left and right operands is performed and the result returned.



AND-Expression':
NOT-Expression
AND-ExpressionANDNOT-Expression

[[[00302.htm|prev]]][[[00304.htm|next]]][[[00302.htm|parent]]][[[toc.htm|TOC]]]

Description

A Bitwise AND Expressionis 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]]]

Syntax

AND-Expression':
NOT-Expression
AND-ExpressionANDNOT-Expression

[[[00304.htm|prev]]][[[00306.htm|next]]][[[00302.htm|parent]]][[[toc.htm|TOC]]]

Bitwise AND (AND Operator)


Description

Constraints

Examples



The ANDoperator performs a binary bitwise AND operation on the left and right hand operands.



AND-ExpressionANDNOT-Expression

[[[00305.htm|prev]]][[[00307.htm|next]]][[[00305.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00306.htm|prev]]][[[00308.htm|next]]][[[00305.htm|parent]]][[[toc.htm|TOC]]]

Syntax

AND-ExpressionANDNOT-Expression

[[[00307.htm|prev]]][[[00309.htm|next]]][[[00305.htm|parent]]][[[toc.htm|TOC]]]

Description

The ANDoperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00309.htm|prev]]][[[00311.htm|next]]][[[00305.htm|parent]]][[[toc.htm|TOC]]]

Examples


   Lower    EQU    0111y            ;   7h   -   binary   radix   suffix 
   Upper    EQU    1110y            ;   Eh   -   binary   radix   suffix 

   MOV    AX ,   Upper   XOR   Lower     ;   moves   0110   into   AX 

[[[00310.htm|prev]]][[[00312.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Bitwise One's Complement Expression


A Bitwise One's Complement Expressionis one that performs an optional unary bitwise negation of its operand and returns the result.



NOT-Expression':
Relational-Expression
NOTRelational-Expression

[[[00311.htm|prev]]][[[00313.htm|next]]][[[00311.htm|parent]]][[[toc.htm|TOC]]]

Description

A Bitwise One's Complement Expressionis 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]]]

Syntax

NOT-Expression':
Relational-Expression
NOTRelational-Expression

[[[00313.htm|prev]]][[[00315.htm|next]]][[[00311.htm|parent]]][[[toc.htm|TOC]]]

Bitwise One's Complement (NOT Operator)


Description

Constraints

Examples



The NOToperator performs a unary bitwise negation on its operand.



NOTRelational-Expression

[[[00314.htm|prev]]][[[00316.htm|next]]][[[00314.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00315.htm|prev]]][[[00317.htm|next]]][[[00314.htm|parent]]][[[toc.htm|TOC]]]

Syntax

NOTRelational-Expression

[[[00316.htm|prev]]][[[00318.htm|next]]][[[00314.htm|parent]]][[[toc.htm|TOC]]]

Description

The NOToperator performs a unary bitwise negation on its operand.

[[[00317.htm|prev]]][[[00319.htm|next]]][[[00314.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The operand must evaluate to a Constant-ExpressionType.

[[[00318.htm|prev]]][[[00320.htm|next]]][[[00314.htm|parent]]][[[toc.htm|TOC]]]

Examples


   Value    EQU    0111y            ;   7h   -   binary   radix   suffix 

   MOV    EAX ,   NOT   Value          ;   moves   FFFFFFF8   into   EAX 

[[[00319.htm|prev]]][[[00321.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Relational Expression


A Relational Expressionis one where an optional binary comparision operation between the left and right operands is performed and the result returned.



Relational-Expression':
Additive-Expression
Relational-ExpressionEQAdditive-Expression
Relational-ExpressionNEAdditive-Expression
Relational-ExpressionGTAdditive-Expression
Relational-ExpressionGEAdditive-Expression
Relational-ExpressionLTAdditive-Expression
Relational-ExpressionLEAdditive-Expression

[[[00320.htm|prev]]][[[00322.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]

Description

A Relational Expressionis 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]]]

Syntax

Relational-Expression':
Additive-Expression
Relational-ExpressionEQAdditive-Expression
Relational-ExpressionNEAdditive-Expression
Relational-ExpressionGTAdditive-Expression
Relational-ExpressionGEAdditive-Expression
Relational-ExpressionLTAdditive-Expression
Relational-ExpressionLEAdditive-Expression

[[[00322.htm|prev]]][[[00324.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]

Equal To (EQ Operator)


Description

Constraints

Examples



The EQoperator 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.



Relational-ExpressionEQAdditive-Expression

[[[00323.htm|prev]]][[[00325.htm|next]]][[[00323.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00324.htm|prev]]][[[00326.htm|next]]][[[00323.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Relational-ExpressionEQAdditive-Expression

[[[00325.htm|prev]]][[[00327.htm|next]]][[[00323.htm|parent]]][[[toc.htm|TOC]]]

Description

The EQoperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00327.htm|prev]]][[[00329.htm|next]]][[[00323.htm|parent]]][[[toc.htm|TOC]]]

Examples


   IF   1234   EQ   5678 
       TRUE   =   1 
   ELSE 
       TRUE   =   0                  ;   Sets   TRUE   to   0 
   ENDIF 

[[[00328.htm|prev]]][[[00330.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]

Not Equal To (NE Operator)


Description

Constraints

Examples



The NEoperator 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.



Relational-ExpressionNEAdditive-Expression

[[[00329.htm|prev]]][[[00331.htm|next]]][[[00329.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00330.htm|prev]]][[[00332.htm|next]]][[[00329.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Relational-ExpressionNEAdditive-Expression

[[[00331.htm|prev]]][[[00333.htm|next]]][[[00329.htm|parent]]][[[toc.htm|TOC]]]

Description

The NEoperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00333.htm|prev]]][[[00335.htm|next]]][[[00329.htm|parent]]][[[toc.htm|TOC]]]

Examples


   IF   1234   NE   5678 
       TRUE   =   1                  ;   Sets   TRUE   to   1 
   ELSE 
       TRUE   =   0 
   ENDIF 

[[[00334.htm|prev]]][[[00336.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]

Greater Than (GT Operator)


Description

Constraints

Examples



The GToperator 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.



Relational-ExpressionGTAdditive-Expression

[[[00335.htm|prev]]][[[00337.htm|next]]][[[00335.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00336.htm|prev]]][[[00338.htm|next]]][[[00335.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Relational-ExpressionGTAdditive-Expression

[[[00337.htm|prev]]][[[00339.htm|next]]][[[00335.htm|parent]]][[[toc.htm|TOC]]]

Description

The GToperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00339.htm|prev]]][[[00341.htm|next]]][[[00335.htm|parent]]][[[toc.htm|TOC]]]

Examples


   IF   1234   GT   5678 
       TRUE   =   1 
   ELSE 
       TRUE   =   0                  ;   Sets   TRUE   to   0 
   ENDIF 

[[[00340.htm|prev]]][[[00342.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]

Greater Than or Equal To (GE Operator)


Description

Constraints

Examples



The GEoperator 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.



Relational-ExpressionGEAdditive-Expression

[[[00341.htm|prev]]][[[00343.htm|next]]][[[00341.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00342.htm|prev]]][[[00344.htm|next]]][[[00341.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Relational-ExpressionGEAdditive-Expression

[[[00343.htm|prev]]][[[00345.htm|next]]][[[00341.htm|parent]]][[[toc.htm|TOC]]]

Description

The GEoperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00345.htm|prev]]][[[00347.htm|next]]][[[00341.htm|parent]]][[[toc.htm|TOC]]]

Examples


   IF   1234   GE   1234 
       TRUE   =   1                  ;   Sets   TRUE   to   1 
   ELSE 
       TRUE   =   0 
   ENDIF 

[[[00346.htm|prev]]][[[00348.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]

Less Than (LT Operator)


Description

Constraints

Examples



The LToperator 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.



Relational-ExpressionLTAdditive-Expression

[[[00347.htm|prev]]][[[00349.htm|next]]][[[00347.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00348.htm|prev]]][[[00350.htm|next]]][[[00347.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Relational-ExpressionLTAdditive-Expression

[[[00349.htm|prev]]][[[00351.htm|next]]][[[00347.htm|parent]]][[[toc.htm|TOC]]]

Description

The LToperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00351.htm|prev]]][[[00353.htm|next]]][[[00347.htm|parent]]][[[toc.htm|TOC]]]

Examples


   IF   1234   LT   5678 
       TRUE   =   1                  ;   Sets   TRUE   to   1 
   ELSE 
       TRUE   =   0 
   ENDIF 

[[[00352.htm|prev]]][[[00354.htm|next]]][[[00320.htm|parent]]][[[toc.htm|TOC]]]

Less Than or Equal To (LE Operator)


Description

Constraints

Examples



The LEoperator 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.



Relational-ExpressionLEAdditive-Expression

[[[00353.htm|prev]]][[[00355.htm|next]]][[[00353.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00354.htm|prev]]][[[00356.htm|next]]][[[00353.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Relational-ExpressionLEAdditive-Expression

[[[00355.htm|prev]]][[[00357.htm|next]]][[[00353.htm|parent]]][[[toc.htm|TOC]]]

Description

The LEoperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00357.htm|prev]]][[[00359.htm|next]]][[[00353.htm|parent]]][[[toc.htm|TOC]]]

Examples


   IF   1234   LE   1234 
       TRUE   =   1                  ;   Sets   TRUE   to   1 
   ELSE 
       TRUE   =   0 
   ENDIF 

[[[00358.htm|prev]]][[[00360.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Additive Expression


A Additive Expressionis one where an optional binary additive arithmetic operation between the left and right operands is performed and the result returned.



Additive-Expression':
Multiplicative-Expression
Additive-Expression+Multiplicative-Expression
Additive-Expression-Multiplicative-Expression

[[[00359.htm|prev]]][[[00361.htm|next]]][[[00359.htm|parent]]][[[toc.htm|TOC]]]

Description

A Additive Expressionis 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]]]

Syntax

Additive-Expression':
Multiplicative-Expression
Additive-Expression+Multiplicative-Expression
Additive-Expression-Multiplicative-Expression

[[[00361.htm|prev]]][[[00363.htm|next]]][[[00359.htm|parent]]][[[toc.htm|TOC]]]

Addition (+ Operator)


Description

Constraints

Examples



The +operator performs a binary addition operation on the left and right hand operands, and returns the result.



Additive-Expression+Multiplicative-Expression

[[[00362.htm|prev]]][[[00364.htm|next]]][[[00362.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00363.htm|prev]]][[[00365.htm|next]]][[[00362.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Additive-Expression+Multiplicative-Expression

[[[00364.htm|prev]]][[[00366.htm|next]]][[[00362.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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-ExpressionTypewithout an external reference. Both operands must be of scalar type.

[[[00366.htm|prev]]][[[00368.htm|next]]][[[00362.htm|parent]]][[[toc.htm|TOC]]]

Examples


   VALUE   =   100   +   11              ;   sets   VALUE   to   111 

[[[00367.htm|prev]]][[[00369.htm|next]]][[[00359.htm|parent]]][[[toc.htm|TOC]]]

Subtraction (- Operator)


Description

Constraints

Examples



The -operator performs a binary subtraction operation on the left and right hand operands, and returns the result.



Additive-Expression-Multiplicative-Expression

[[[00368.htm|prev]]][[[00370.htm|next]]][[[00368.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00369.htm|prev]]][[[00371.htm|next]]][[[00368.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Additive-Expression-Multiplicative-Expression

[[[00370.htm|prev]]][[[00372.htm|next]]][[[00368.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Constraints

The right operand must evaluate to a Constant-ExpressionTypeand 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.

[[[00372.htm|prev]]][[[00374.htm|next]]][[[00368.htm|parent]]][[[toc.htm|TOC]]]

Examples


   VALUE   =   111   -   11              ;   sets   VALUE   to   100 

[[[00373.htm|prev]]][[[00375.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Multiplicative Expression


A Multiplicative Expressionis one where an optional binary multiplicative arithmetic operation between the left and right operands is performed and the result returned.



Multiplicative-Expression':
Narrowed-Expression
Multiplicative-Expression*Narrowed-Expression
Multiplicative-Expression/Narrowed-Expression
Multiplicative-ExpressionMODNarrowed-Expression
Multiplicative-ExpressionSHLNarrowed-Expression
Multiplicative-ExpressionSHRNarrowed-Expression

[[[00374.htm|prev]]][[[00376.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]

Description

A Multiplicative Expressionis 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]]]

Syntax

Multiplicative-Expression':
Narrowed-Expression
Multiplicative-Expression*Narrowed-Expression
Multiplicative-Expression/Narrowed-Expression
Multiplicative-ExpressionMODNarrowed-Expression
Multiplicative-ExpressionSHLNarrowed-Expression
Multiplicative-ExpressionSHRNarrowed-Expression

[[[00376.htm|prev]]][[[00378.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]

Multiplication (* Operator)


Description

Constraints

Examples



The *operator performs a binary multiplication operation on the left and right hand operands, and returns the result.



Multiplicative-Expression*Narrowed-Expression

[[[00377.htm|prev]]][[[00379.htm|next]]][[[00377.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00378.htm|prev]]][[[00380.htm|next]]][[[00377.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Multiplicative-Expression*Narrowed-Expression

[[[00379.htm|prev]]][[[00381.htm|next]]][[[00377.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00381.htm|prev]]][[[00383.htm|next]]][[[00377.htm|parent]]][[[toc.htm|TOC]]]

Examples


   VALUE   =   9   *   3                 ;   sets   VALUE   to   27 

[[[00382.htm|prev]]][[[00384.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]

Division (/ Operator)


Description

Constraints

Examples



The /operator performs a binary division operation on the left and right hand operands, and returns the result.



Multiplicative-Expression/Narrowed-Expression

[[[00383.htm|prev]]][[[00385.htm|next]]][[[00383.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00384.htm|prev]]][[[00386.htm|next]]][[[00383.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Multiplicative-Expression/Narrowed-Expression

[[[00385.htm|prev]]][[[00387.htm|next]]][[[00383.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00387.htm|prev]]][[[00389.htm|next]]][[[00383.htm|parent]]][[[toc.htm|TOC]]]

Examples


   VALUE   =   27   /   9                ;   sets   VALUE   to   3 

[[[00388.htm|prev]]][[[00390.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]

Remainder (MOD Operator)


Description

Constraints

Examples



The MODoperator performs a binary modulus division operation on the left and right hand operands, and returns the remainder as the result.



Multiplicative-ExpressionMODNarrowed-Expression

[[[00389.htm|prev]]][[[00391.htm|next]]][[[00389.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00390.htm|prev]]][[[00392.htm|next]]][[[00389.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Multiplicative-ExpressionMODNarrowed-Expression

[[[00391.htm|prev]]][[[00393.htm|next]]][[[00389.htm|parent]]][[[toc.htm|TOC]]]

Description

The MODoperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00393.htm|prev]]][[[00395.htm|next]]][[[00389.htm|parent]]][[[toc.htm|TOC]]]

Examples


   VALUE   =   18   MOD   4              ;   sets   VALUE   to   2 

[[[00394.htm|prev]]][[[00396.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]

Bitwise Left Shift (SHL Operator)


Description

Constraints

Examples



The SHLoperator 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.



Multiplicative-ExpressionSHLNarrowed-Expression

[[[00395.htm|prev]]][[[00397.htm|next]]][[[00395.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00396.htm|prev]]][[[00398.htm|next]]][[[00395.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Multiplicative-ExpressionSHLNarrowed-Expression

[[[00397.htm|prev]]][[[00399.htm|next]]][[[00395.htm|parent]]][[[toc.htm|TOC]]]

Description

The SHLoperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00399.htm|prev]]][[[00401.htm|next]]][[[00395.htm|parent]]][[[toc.htm|TOC]]]

Examples


   VALUE   =   1111y   SHL   4          ;   sets   VALUE   to   11110000y 

[[[00400.htm|prev]]][[[00402.htm|next]]][[[00374.htm|parent]]][[[toc.htm|TOC]]]

Bitwise Right Shift (SHR Operator)


Description

Constraints

Examples



The SHRoperator 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.



Multiplicative-ExpressionSHRNarrowed-Expression

[[[00401.htm|prev]]][[[00403.htm|next]]][[[00401.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00402.htm|prev]]][[[00404.htm|next]]][[[00401.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Multiplicative-ExpressionSHRNarrowed-Expression

[[[00403.htm|prev]]][[[00405.htm|next]]][[[00401.htm|parent]]][[[toc.htm|TOC]]]

Description

The SHRoperator 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]]]

Constraints

Each operand must evaluate to a Constant-ExpressionType.

[[[00405.htm|prev]]][[[00407.htm|next]]][[[00401.htm|parent]]][[[toc.htm|TOC]]]

Examples


   VALUE   =   11110000y   SHR   4           ;   sets   VALUE   to   00001111y 

[[[00406.htm|prev]]][[[00408.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Narrowed Expression


A Narrowed Expressionis one that performs an optional unary narrowing operation on its operand and returns the result.



Narrowed-Expression':
Cast-Expression
HIGHCast-Expression
HIGHWORDCast-Expression
LOWCast-Expression
LOWWORDCast-Expression

[[[00407.htm|prev]]][[[00409.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]

Description

A Narrowed Expressionis 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]]]

Syntax

Narrowed-Expression':
Cast-Expression
HIGHCast-Expression
HIGHWORDCast-Expression
LOWCast-Expression
LOWWORDCast-Expression

[[[00409.htm|prev]]][[[00411.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]

Upper 8 Bits of WORD Expression (HIGH Operator)


Description

Constraints

Examples



The HIGHoperator 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.



HIGHCast-Expression

[[[00410.htm|prev]]][[[00412.htm|next]]][[[00410.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00411.htm|prev]]][[[00413.htm|next]]][[[00410.htm|parent]]][[[toc.htm|TOC]]]

Syntax

HIGHCast-Expression

[[[00412.htm|prev]]][[[00414.htm|next]]][[[00410.htm|parent]]][[[toc.htm|TOC]]]

Description

The HIGHoperator 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]]]

Constraints

The operand must evaluate to a Constant-ExpressionType.

[[[00414.htm|prev]]][[[00416.htm|next]]][[[00410.htm|parent]]][[[toc.htm|TOC]]]

Examples


   FIRST    =   1234h 
   SECOND   =   HIGH   FIRST          ;   Sets   SECOND   to   12h 

[[[00415.htm|prev]]][[[00417.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]

Upper 16 Bits of DWORD Expression (HIGHWORD Operator)


Description

Constraints

Examples



The HIGHWORDoperator 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.



HIGHWORDCast-Expression

[[[00416.htm|prev]]][[[00418.htm|next]]][[[00416.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00417.htm|prev]]][[[00419.htm|next]]][[[00416.htm|parent]]][[[toc.htm|TOC]]]

Syntax

HIGHWORDCast-Expression

[[[00418.htm|prev]]][[[00420.htm|next]]][[[00416.htm|parent]]][[[toc.htm|TOC]]]

Description

The HIGHWORDoperator 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]]]

Constraints

The operand must evaluate to a Constant-ExpressionType.

This operator is not available in M510mode.

[[[00420.htm|prev]]][[[00422.htm|next]]][[[00416.htm|parent]]][[[toc.htm|TOC]]]

Examples


   FIRST    =   12345678h 
   SECOND   =   HIGHWORD   FIRST      ;   Sets   SECOND   to   1234h 

[[[00421.htm|prev]]][[[00423.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]

Lower 8 Bits of WORD Expression (LOW Operator)


Description

Constraints

Examples



The LOWoperator returns the lower 8 bits of its operand.



LOWCast-Expression

[[[00422.htm|prev]]][[[00424.htm|next]]][[[00422.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00423.htm|prev]]][[[00425.htm|next]]][[[00422.htm|parent]]][[[toc.htm|TOC]]]

Syntax

LOWCast-Expression

[[[00424.htm|prev]]][[[00426.htm|next]]][[[00422.htm|parent]]][[[toc.htm|TOC]]]

Description

The LOWoperator returns the lower 8 bits of its operand.

[[[00425.htm|prev]]][[[00427.htm|next]]][[[00422.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The operand must evaluate to a Constant-ExpressionType.

[[[00426.htm|prev]]][[[00428.htm|next]]][[[00422.htm|parent]]][[[toc.htm|TOC]]]

Examples


   FIRST    =   1234h 
   SECOND   =   LOW   FIRST           ;   Sets   SECOND   to   34h 

[[[00427.htm|prev]]][[[00429.htm|next]]][[[00407.htm|parent]]][[[toc.htm|TOC]]]

Lower 16 Bits of DWORD Expression (LOWWORD Operator)


Description

Constraints

Examples



The LOWWORDoperator returns the lower 16 bits of its operand.



LOWWORDCast-Expression

[[[00428.htm|prev]]][[[00430.htm|next]]][[[00428.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00429.htm|prev]]][[[00431.htm|next]]][[[00428.htm|parent]]][[[toc.htm|TOC]]]

Syntax

LOWWORDCast-Expression

[[[00430.htm|prev]]][[[00432.htm|next]]][[[00428.htm|parent]]][[[toc.htm|TOC]]]

Description

The LOWWORDoperator returns the lower 16 bits of its operand.

[[[00431.htm|prev]]][[[00433.htm|next]]][[[00428.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The operand must evaluate to a Constant-ExpressionType.

This operator is not available in M510mode.

[[[00432.htm|prev]]][[[00434.htm|next]]][[[00428.htm|parent]]][[[toc.htm|TOC]]]

Examples


   FIRST    =   12345678h 
   SECOND   =   LOWWORD   FIRST       ;   Sets   SECOND   to   5678h 

[[[00433.htm|prev]]][[[00435.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Type Conversion Expression


A Type Conversion Expressionis one that performs an optional type conversion operation on its operand and returns the result.



Cast-Expression':
Element-Selection-Expression
OFFSETCast-Expression
SEGCast-Expression
THISElement-Selection-Expression
TYPEElement-Selection-Expression
Cast-ExpressionPTRCast-Expression
Cast-Expression:Cast-Expression

[[[00434.htm|prev]]][[[00436.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]

Description

A Type Conversion Expressionis 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]]]

Syntax

Cast-Expression':
Element-Selection-Expression
OFFSETCast-Expression
SEGCast-Expression
THISElement-Selection-Expression
TYPEElement-Selection-Expression
Cast-ExpressionPTRCast-Expression
Cast-Expression:Cast-Expression

[[[00436.htm|prev]]][[[00438.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]

Address Offset (OFFSET Operator)


Description

Constraints

Examples



The OFFSEToperator 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.



OFFSETCast-Expression

[[[00437.htm|prev]]][[[00439.htm|next]]][[[00437.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00438.htm|prev]]][[[00440.htm|next]]][[[00437.htm|parent]]][[[toc.htm|TOC]]]

Syntax

OFFSETCast-Expression

[[[00439.htm|prev]]][[[00441.htm|next]]][[[00437.htm|parent]]][[[toc.htm|TOC]]]

Description

The OFFSEToperator 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]]]

Constraints

The operand may evaluate to any one of the following ExpressionTypes':

Absolute-ExpressionType
Constant-ExpressionType
Immediate-ExpressionType
Direct-ExpressionType
Indirect-ExpressionType

[[[00441.htm|prev]]][[[00443.htm|next]]][[[00437.htm|parent]]][[[toc.htm|TOC]]]

Examples


   CodeLabel : 
               MOV   AX , CodeLabel            ;   illegal ,   no   data   at   address 
               MOV   AX , OFFSET   CodeLabel     ;   we   want   the   address   itself 

[[[00442.htm|prev]]][[[00444.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]

Address Segment (SEG Operator)


Description

Constraints

Examples



The SEGoperator returns the segment or group to which a relocatable expression is relative.



SEGCast-Expression

[[[00443.htm|prev]]][[[00445.htm|next]]][[[00443.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00444.htm|prev]]][[[00446.htm|next]]][[[00443.htm|parent]]][[[toc.htm|TOC]]]

Syntax

SEGCast-Expression

[[[00445.htm|prev]]][[[00447.htm|next]]][[[00443.htm|parent]]][[[toc.htm|TOC]]]

Description

The SEGoperator returns the segment or group to which a relocatable expression is relative.

[[[00446.htm|prev]]][[[00448.htm|next]]][[[00443.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The operand must evaluate to one of the following ExpressionTypes':

Immediate-ExpressionType
Direct-ExpressionType
Indirect-ExpressionType
Indexed-ExpressionType

[[[00447.htm|prev]]][[[00449.htm|next]]][[[00443.htm|parent]]][[[toc.htm|TOC]]]

Examples


DATA      SEGMENT 
Stuff     DB      ? 
         MOV     AX ,   SEG   Stuff    ;   This   construct   is 
         MOV     AX ,   DATA         ;   equivalent   to   this 
DATA      ENDS 

[[[00448.htm|prev]]][[[00450.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]

Address Alias (THIS Operator)


Description

Constraints

Examples



The THISoperator returns an operand whose:

Relative Frameattribute is set to that of the current segment
Displacementattribute is set to the current location counter
Type Declarationattribute is set to that of the expression given by the Element-Selection-Expressionoperand.



THISElement-Selection-Expression

[[[00449.htm|prev]]][[[00451.htm|next]]][[[00449.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00450.htm|prev]]][[[00452.htm|next]]][[[00449.htm|parent]]][[[toc.htm|TOC]]]

Syntax

THISElement-Selection-Expression

[[[00451.htm|prev]]][[[00453.htm|next]]][[[00449.htm|parent]]][[[toc.htm|TOC]]]

Description

The THISoperator returns an operand whose:

Relative Frameattribute is set to that of the current segment
Displacementattribute is set to the current location counter
Type Declarationattribute is set to that of the expression given by the Element-Selection-Expressionoperand.

[[[00452.htm|prev]]][[[00454.htm|next]]][[[00449.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The operand must evaluate to a Type-ExpressionType.

[[[00453.htm|prev]]][[[00455.htm|next]]][[[00449.htm|parent]]][[[toc.htm|TOC]]]

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 

[[[00454.htm|prev]]][[[00456.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]

Datatype Extraction (TYPE Operator)


Description

Constraints

Examples



The TYPEoperator returns the Type-ExpressionTypeattribute of its operand.



TYPEElement-Selection-Expression

[[[00455.htm|prev]]][[[00457.htm|next]]][[[00455.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00456.htm|prev]]][[[00458.htm|next]]][[[00455.htm|parent]]][[[toc.htm|TOC]]]

Syntax

TYPEElement-Selection-Expression

[[[00457.htm|prev]]][[[00459.htm|next]]][[[00455.htm|parent]]][[[toc.htm|TOC]]]

Description

The TYPEoperator returns the Type-ExpressionTypeattribute of its operand.

[[[00458.htm|prev]]][[[00460.htm|next]]][[[00455.htm|parent]]][[[toc.htm|TOC]]]

Constraints

None

[[[00459.htm|prev]]][[[00461.htm|next]]][[[00455.htm|parent]]][[[toc.htm|TOC]]]

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 

[[[00460.htm|prev]]][[[00462.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]

Type Conversion (PTR Operator)


Description

Constraints

Examples



The PTRoperator converts the right operand to the type specified by the left operand.



Cast-ExpressionPTRCast-Expression

[[[00461.htm|prev]]][[[00463.htm|next]]][[[00461.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00462.htm|prev]]][[[00464.htm|next]]][[[00461.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Cast-ExpressionPTRCast-Expression

[[[00463.htm|prev]]][[[00465.htm|next]]][[[00461.htm|parent]]][[[toc.htm|TOC]]]

Description

The PTRoperator converts the right operand to the type specified by the left operand.

[[[00464.htm|prev]]][[[00466.htm|next]]][[[00461.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The left operand must be a Type-ExpressionType.

[[[00465.htm|prev]]][[[00467.htm|next]]][[[00461.htm|parent]]][[[toc.htm|TOC]]]

Examples


CODE      SEGMENT 
         MOV     BYTE   PTR   [ BX ] ,   1      ;   stores   1   as   a   BYTE   at   [ BX ] 
CODE      ENDS 

[[[00466.htm|prev]]][[[00468.htm|next]]][[[00434.htm|parent]]][[[toc.htm|TOC]]]

Segment Override (: Operator)


Description

Constraints

Examples



The :(colon) operator forces the right operand to have the Relative Frame attribute of the left operand.



Cast-Expression:Cast-Expression

[[[00467.htm|prev]]][[[00469.htm|next]]][[[00467.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00468.htm|prev]]][[[00470.htm|next]]][[[00467.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Cast-Expression:Cast-Expression

[[[00469.htm|prev]]][[[00471.htm|next]]][[[00467.htm|parent]]][[[toc.htm|TOC]]]

Description

The :(colon) operator forces the right operand to have the Relative Frame attribute of the left operand.

[[[00470.htm|prev]]][[[00472.htm|next]]][[[00467.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The left operand must evaluate to one of the following ExpressionTypes':

Register-ExpressionTypewhere the Register Valueattribute is that of a Segment-Register
Immediate-ExpressionTypewhere the Relative Frameattribute is that of a GroupNameor SegmentName.

[[[00471.htm|prev]]][[[00473.htm|next]]][[[00467.htm|parent]]][[[toc.htm|TOC]]]

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 

[[[00472.htm|prev]]][[[00474.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Element Selection Expression


A Element Selection Expressionis one that optionally selects a specific element of its operand and returns a reference to it.



Element-Selection-Expression':
Sign-Expression
Element-Selection-Expression[Sign-Expression00476.htm]
Element-Selection-Expression.Sign-Expression

[[[00473.htm|prev]]][[[00475.htm|next]]][[[00473.htm|parent]]][[[toc.htm|TOC]]]

Description

A Element Selection Expressionis 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]]]

Syntax

Element-Selection-Expression':
Sign-Expression
Element-Selection-Expression[Sign-Expression00476.htm]
Element-Selection-Expression.Sign-Expression

[[[00475.htm|prev]]][[[00477.htm|next]]][[[00473.htm|parent]]][[[toc.htm|TOC]]]

Subscript ([] Operator)


Description

Constraints

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 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 Indirected-Expressionas described in the section on Primary- Expressions.



Element-Selection-Expression[Sign-Expression]

[[[00476.htm|prev]]][[[00478.htm|next]]][[[00476.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00477.htm|prev]]][[[00479.htm|next]]][[[00476.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Element-Selection-Expression[Sign-Expression]

[[[00478.htm|prev]]][[[00480.htm|next]]][[[00476.htm|parent]]][[[toc.htm|TOC]]]

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 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 Indirected-Expressionas described in the section on Primary- Expressions.

[[[00479.htm|prev]]][[[00481.htm|next]]][[[00476.htm|parent]]][[[toc.htm|TOC]]]

Constraints

Only one of the operands may specify a relocatable value.

[[[00480.htm|prev]]][[[00482.htm|next]]][[[00476.htm|parent]]][[[toc.htm|TOC]]]

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 ] 

   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 

[[[00481.htm|prev]]][[[00483.htm|next]]][[[00473.htm|parent]]][[[toc.htm|TOC]]]

Structure/Union Field Selection (. Operator)


Description

Constraints

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 Indirect-ExpressionType, Indexed-ExpressionType, or Type-ExpressionTypewhose Type Declarationattribute resolves to that of a Structure-TypeNameor Union-TypeName. The right operand should refer to a FieldNamedefined within the referenced type.

The Operand Sizeattribute of the result depends on the operands involved. If both operands have an operand size, a Structure-FieldNameappearing as the right hand operand would override the operand size of the left operand and would dictate the operand size of the resulting expression.



Element-Selection-Expression.Sign-Expression

[[[00482.htm|prev]]][[[00484.htm|next]]][[[00482.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00483.htm|prev]]][[[00485.htm|next]]][[[00482.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Element-Selection-Expression.Sign-Expression

[[[00484.htm|prev]]][[[00486.htm|next]]][[[00482.htm|parent]]][[[toc.htm|TOC]]]

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-ExpressionTypewhose Type Declarationattribute resolves to that of a Structure-TypeNameor Union-TypeName. The right operand should refer to a FieldNamedefined within the referenced type.

The Operand Sizeattribute of the result depends on the operands involved. If both operands have an operand size, a Structure-FieldNameappearing 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]]]

Constraints

Only one of the operands may specify a relocatable value.

[[[00486.htm|prev]]][[[00488.htm|next]]][[[00482.htm|parent]]][[[toc.htm|TOC]]]

Examples


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 

[[[00487.htm|prev]]][[[00489.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Unary Arithmetic Expression


A Unary Arithmetic Expressionis one that optionally alters the sign of its operand and returns the result.



Sign-Expression':
Primary-Expression
-Primary-Expression
+Primary-Expression

[[[00488.htm|prev]]][[[00490.htm|next]]][[[00488.htm|parent]]][[[toc.htm|TOC]]]

Description

A Unary Arithmetic Expressionis 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]]]

Syntax

Sign-Expression':
Primary-Expression
-Primary-Expression
+Primary-Expression

[[[00490.htm|prev]]][[[00492.htm|next]]][[[00488.htm|parent]]][[[toc.htm|TOC]]]

Unary Minus (- Operator)


Description

Constraints

Examples



The -operator makes its operand into a negative number and returns the result.



-Primary-Expression

[[[00491.htm|prev]]][[[00493.htm|next]]][[[00491.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00492.htm|prev]]][[[00494.htm|next]]][[[00491.htm|parent]]][[[toc.htm|TOC]]]

Syntax

-Primary-Expression

[[[00493.htm|prev]]][[[00495.htm|next]]][[[00491.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Constraints

The operand must evaluate to a Constant-ExpressionType.

[[[00495.htm|prev]]][[[00497.htm|next]]][[[00491.htm|parent]]][[[toc.htm|TOC]]]

Examples


   Value    EQU    1 

   MOV    AX , - Value     ;   move   - 1   into   AX 

[[[00496.htm|prev]]][[[00498.htm|next]]][[[00488.htm|parent]]][[[toc.htm|TOC]]]

Unary Plus (+ Operator)


Description

Constraints

Examples



The +operator returns its operand.



+Primary-Expression

[[[00497.htm|prev]]][[[00499.htm|next]]][[[00497.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00498.htm|prev]]][[[00500.htm|next]]][[[00497.htm|parent]]][[[toc.htm|TOC]]]

Syntax

+Primary-Expression

[[[00499.htm|prev]]][[[00501.htm|next]]][[[00497.htm|parent]]][[[toc.htm|TOC]]]

Description

The +operator returns its operand.

[[[00500.htm|prev]]][[[00502.htm|next]]][[[00497.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The operand must evaluate to a Constant-ExpressionType.

[[[00501.htm|prev]]][[[00503.htm|next]]][[[00497.htm|parent]]][[[toc.htm|TOC]]]

Examples


   Value    EQU    1 
   MOV    AX , + Value     ;   move   1   into   AX 

[[[00502.htm|prev]]][[[00504.htm|next]]][[[00255.htm|parent]]][[[toc.htm|TOC]]]

Primary Expression


A Primary Expressionis one that returns an expression operand.



Primary-Expression':
Literal-Operand
Record-Constant
Identifier-Operand
Register-Operand
Integral-TypeName-Operand
Value-Substitution-Operand
LENGTHIdentifier-Operand
LENGTHOFIdentifier-Operand
MASKIdentifier-Operand
SIZEElement-Selection-Expression
SIZEOFElement-Selection-Expression
WIDTHIdentifier-Operand
Parenthesized-Expression
Indirected-Expression
Compound-Initializer

[[[00503.htm|prev]]][[[00505.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Description

A Primary Expressionis one that returns an expression operand.

[[[00504.htm|prev]]][[[00506.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Primary-Expression':
Literal-Operand
Record-Constant
Identifier-Operand
Register-Operand
Integral-TypeName-Operand
Value-Substitution-Operand
LENGTHIdentifier-Operand
LENGTHOFIdentifier-Operand
MASKIdentifier-Operand
SIZEElement-Selection-Expression
SIZEOFElement-Selection-Expression
WIDTHIdentifier-Operand
Parenthesized-Expression
Indirected-Expression
Compound-Initializer

[[[00505.htm|prev]]][[[00507.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Literal Operand


Description

Constraints



The assembler accepts several types of literal values as operands within expressions. Literal-Operand'sare converted to ExpressionTypesaccording to the following table:

/-------------------------------------------------------------------------------\
|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.                      |
\-------------------------------------------------------------------------------/

The context where the expression is used determines whether or not a particular type of literal is legal.



Literal-Operand':
Floating-Point-Literal
Integer-Literal
String-Literal

[[[00506.htm|prev]]][[[00508.htm|next]]][[[00506.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00507.htm|prev]]][[[00509.htm|next]]][[[00506.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Literal-Operand':
Floating-Point-Literal
Integer-Literal
String-Literal

[[[00508.htm|prev]]][[[00510.htm|next]]][[[00506.htm|parent]]][[[toc.htm|TOC]]]

Description

The assembler accepts several types of literal values as operands within expressions. Literal-Operand'sare converted to ExpressionTypesaccording to the following table:

/-------------------------------------------------------------------------------\
|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.                      |
\-------------------------------------------------------------------------------/

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]]]

Constraints

Arithmetic operations cannot be performed on Floating-Point-Literals, thus they cannot be the operand of a unary or binary operator.

[[[00510.htm|prev]]][[[00512.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Value Substitution Operand


Description

Constraints



These operands are used to retrieve specialized values that are calculated internally by the assembler.

The FLAToperator returns an expression whose Relative Frameis set to that of the predefined FLAT pseudo-group.



Value-Substitution-Operand':
Anonymous-Label-Alias
Location-Counter-Alias
Indeterminate-Value-Alias
FLAT

[[[00511.htm|prev]]][[[00513.htm|next]]][[[00511.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00512.htm|prev]]][[[00514.htm|next]]][[[00511.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Value-Substitution-Operand':
Anonymous-Label-Alias
Location-Counter-Alias
Indeterminate-Value-Alias
FLAT

[[[00513.htm|prev]]][[[00515.htm|next]]][[[00511.htm|parent]]][[[toc.htm|TOC]]]

Description

These operands are used to retrieve specialized values that are calculated internally by the assembler.

The FLAToperator returns an expression whose Relative Frameis set to that of the predefined FLAT pseudo-group.

[[[00514.htm|prev]]][[[00516.htm|next]]][[[00511.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The FLAToperand is only active when a 32-bit processor has been selected.

[[[00515.htm|prev]]][[[00517.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Record Constant Operand


Description

Constraints

Examples



A Record-Constantprovides a method of calculating a single numeric result value from a list of Record-FieldNamevalues, and combining them together according to the definition of the Record-TypeNamegiven by the Identifier- Operand. The result value is a Constant-ExpressionTypesuitable for use as an instruction operand, or for assigning to a record variable.

The Record-TypeNamegiven by the Identifier-Operanddetermines how the Field-Listwill be evaluated. The Attribute-Expressionentries are position-dependent, and are matched with the corresponding Record-FieldName entries from the Record-TypeNamedefinition to determine their width and shift values. Attribute-Expressionentries may be omitted, in which case the default values from the record definition are used in the calculation.



Record-Constant':
Identifier-Operand
<Field-List>
Identifier-Operand
{Field-List}

Field-List:
Attribute-Expression
Field-List
,Attribute-Expression

[[[00516.htm|prev]]][[[00518.htm|next]]][[[00516.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00517.htm|prev]]][[[00519.htm|next]]][[[00516.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Record-Constant':
Identifier-Operand
<Field-List>
Identifier-Operand
{Field-List}

Field-List:
Attribute-Expression
Field-List
,Attribute-Expression

[[[00518.htm|prev]]][[[00520.htm|next]]][[[00516.htm|parent]]][[[toc.htm|TOC]]]

Description

A Record-Constantprovides a method of calculating a single numeric result value from a list of Record-FieldNamevalues, and combining them together according to the definition of the Record-TypeNamegiven by the Identifier- Operand. The result value is a Constant-ExpressionTypesuitable for use as an instruction operand, or for assigning to a record variable.

The Record-TypeNamegiven by the Identifier-Operanddetermines how the Field-Listwill be evaluated. The Attribute-Expressionentries are position-dependent, and are matched with the corresponding Record-FieldName entries from the Record-TypeNamedefinition to determine their width and shift values. Attribute-Expressionentries 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]]]

Constraints

The Identifier-Operandmust resolve to a Record-TypeName.

[[[00520.htm|prev]]][[[00522.htm|next]]][[[00516.htm|parent]]][[[toc.htm|TOC]]]

Examples


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 

[[[00521.htm|prev]]][[[00523.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Register Operand


Description

Constraints



Processor registers are valid expression operands. The context where the expression is used determines the allowable register operands.



Register-Operand':
Processor-Register

[[[00522.htm|prev]]][[[00524.htm|next]]][[[00522.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00523.htm|prev]]][[[00525.htm|next]]][[[00522.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Register-Operand':
Processor-Register

[[[00524.htm|prev]]][[[00526.htm|next]]][[[00522.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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]]]

Identifier Operand


Description

Constraints



When an Identifieris used in an expression, it returns a value according to its Identifier-Type, as shown in the following table:

/-------------------------------------------------------------------------------\
|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.                |
\-------------------------------------------------------------------------------/

Identifier-Operand':
Identifier

[[[00527.htm|prev]]][[[00529.htm|next]]][[[00527.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00528.htm|prev]]][[[00530.htm|next]]][[[00527.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Identifier-Operand':
Identifier

[[[00529.htm|prev]]][[[00531.htm|next]]][[[00527.htm|parent]]][[[toc.htm|TOC]]]

Description

When an Identifieris used in an expression, it returns a value according to its Identifier-Type, as shown in the following table:

/-------------------------------------------------------------------------------\
|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.                |
\-------------------------------------------------------------------------------/

[[[00530.htm|prev]]][[[00532.htm|next]]][[[00527.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The Identifiermust resolve to one of the following Identifier-Types':

Numeric-EquateName
FieldName
GroupName
LabelName
SegmentName
UserDefined-TypeName

[[[00531.htm|prev]]][[[00533.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Integral Type-Name Operand


Description

Constraints



When an Integral-TypeName-Operandis used in an expression, it is converted to a Type-ExpressionType. If used in a numeric context, the following numeric values are returned:

/-------------------------------------------------------------------------------\
|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.                              |
\-------------------------------------------------------------------------------/

Integral-TypeName-Operand':
Scalar-TypeName
Distance-TypeName

[[[00532.htm|prev]]][[[00534.htm|next]]][[[00532.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00533.htm|prev]]][[[00535.htm|next]]][[[00532.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Integral-TypeName-Operand':
Scalar-TypeName
Distance-TypeName

[[[00534.htm|prev]]][[[00536.htm|next]]][[[00532.htm|parent]]][[[toc.htm|TOC]]]

Description

When an Integral-TypeName-Operandis used in an expression, it is converted to a Type-ExpressionType. If used in a numeric context, the following numeric values are returned:

/-------------------------------------------------------------------------------\
|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.                              |
\-------------------------------------------------------------------------------/

[[[00535.htm|prev]]][[[00537.htm|next]]][[[00532.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The NEAR32and FAR32keywords are only valid if a 32-bit processor has been selected.

[[[00536.htm|prev]]][[[00538.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Number of Data Elements (LENGTH Operator)


Description

Constraints



The LENGTHoperator 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.



LENGTHIdentifier-Operand

[[[00537.htm|prev]]][[[00539.htm|next]]][[[00537.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00538.htm|prev]]][[[00540.htm|next]]][[[00537.htm|parent]]][[[toc.htm|TOC]]]

Syntax

LENGTHIdentifier-Operand

[[[00539.htm|prev]]][[[00541.htm|next]]][[[00537.htm|parent]]][[[toc.htm|TOC]]]

Description

The LENGTHoperator 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]]]

Constraints

The operand must evaluate to a Data-LabelName.

[[[00541.htm|prev]]][[[00543.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Number of Data Elements (LENGTHOF Operator)


Description

Constraints



The LENGTHOFoperator returns the number of data elements allocated to the operand.



LENGTHOFIdentifier-Operand

[[[00542.htm|prev]]][[[00544.htm|next]]][[[00542.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00543.htm|prev]]][[[00545.htm|next]]][[[00542.htm|parent]]][[[toc.htm|TOC]]]

Syntax

LENGTHOFIdentifier-Operand

[[[00544.htm|prev]]][[[00546.htm|next]]][[[00542.htm|parent]]][[[toc.htm|TOC]]]

Description

The LENGTHOFoperator returns the number of data elements allocated to the operand.

[[[00545.htm|prev]]][[[00547.htm|next]]][[[00542.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The operand must evaluate to a Data-LabelName.

This operator is not available in M510mode.

[[[00546.htm|prev]]][[[00548.htm|next]]][[[00542.htm|parent]]][[[toc.htm|TOC]]]

Examples

<none>

[[[00547.htm|prev]]][[[00549.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Record or Field Bit-Mask (MASK Operator)


Description

Constraints



The MASKoperator returns the bit mask required to isolate a field within a record.



MASKIdentifier-Operand

[[[00548.htm|prev]]][[[00550.htm|next]]][[[00548.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00549.htm|prev]]][[[00551.htm|next]]][[[00548.htm|parent]]][[[toc.htm|TOC]]]

Syntax

MASKIdentifier-Operand

[[[00550.htm|prev]]][[[00552.htm|next]]][[[00548.htm|parent]]][[[toc.htm|TOC]]]

Description

The MASKoperator returns the bit mask required to isolate a field within a record.

[[[00551.htm|prev]]][[[00553.htm|next]]][[[00548.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The Identifier-Operandmust resolve to a Record-TypeNameor Record- FieldName; otherwise the result is zero.

[[[00552.htm|prev]]][[[00554.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Size of Variable in Bytes (SIZE Operator)


Description

Constraints



The SIZEoperator 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.



SIZEElement-Selection-Expression

[[[00553.htm|prev]]][[[00555.htm|next]]][[[00553.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00554.htm|prev]]][[[00556.htm|next]]][[[00553.htm|parent]]][[[toc.htm|TOC]]]

Syntax

SIZEElement-Selection-Expression

[[[00555.htm|prev]]][[[00557.htm|next]]][[[00553.htm|parent]]][[[toc.htm|TOC]]]

Description

The SIZEoperator 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]]]

Constraints

None

[[[00557.htm|prev]]][[[00559.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Size of Variable in Bytes (SIZEOF Operator)


Description

Constraints



The SIZEOFoperator returns the number of bytes allocated to the operand.



SIZEOFElement-Selection-Expression

[[[00558.htm|prev]]][[[00560.htm|next]]][[[00558.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00559.htm|prev]]][[[00561.htm|next]]][[[00558.htm|parent]]][[[toc.htm|TOC]]]

Syntax

SIZEOFElement-Selection-Expression

[[[00560.htm|prev]]][[[00562.htm|next]]][[[00558.htm|parent]]][[[toc.htm|TOC]]]

Description

The SIZEOFoperator returns the number of bytes allocated to the operand.

[[[00561.htm|prev]]][[[00563.htm|next]]][[[00558.htm|parent]]][[[toc.htm|TOC]]]

Constraints

This operator is not available in M510mode.

[[[00562.htm|prev]]][[[00564.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Record or Field Width (WIDTH Operator)


Description

Constraints



The WIDTHoperator returns the width of a record or a record field name.



WIDTHIdentifier-Operand

[[[00563.htm|prev]]][[[00565.htm|next]]][[[00563.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00564.htm|prev]]][[[00566.htm|next]]][[[00563.htm|parent]]][[[toc.htm|TOC]]]

Syntax

WIDTHIdentifier-Operand

[[[00565.htm|prev]]][[[00567.htm|next]]][[[00563.htm|parent]]][[[toc.htm|TOC]]]

Description

The WIDTHoperator returns the width of a record or a record field name.

[[[00566.htm|prev]]][[[00568.htm|next]]][[[00563.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The Identifier-Operandmust resolve to a Record-TypeNameor Record- FieldName; otherwise the result is zero.

[[[00567.htm|prev]]][[[00569.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Precedence (() Operator)


Description

Examples



Parentheses forces the Attribute-Expressionoperand to be evaluated at a higher precedence level.



Parenthesized-Expression':
(Attribute-Expression)

[[[00568.htm|prev]]][[[00570.htm|next]]][[[00568.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Examples

[[[00569.htm|prev]]][[[00571.htm|next]]][[[00568.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Parenthesized-Expression':
(Attribute-Expression)

[[[00570.htm|prev]]][[[00572.htm|next]]][[[00568.htm|parent]]][[[toc.htm|TOC]]]

Description

Parentheses forces the Attribute-Expressionoperand to be evaluated at a higher precedence level.

[[[00571.htm|prev]]][[[00573.htm|next]]][[[00568.htm|parent]]][[[toc.htm|TOC]]]

Examples


   Value   =   2   +   3   *   4       ;   Value   =   14 
   Value   =   ( 2   +   3 )   *   4     ;   Value   =   20 

[[[00572.htm|prev]]][[[00574.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Indirection ([] Operator)


Description

Constraints

Examples



During evaluation of the Attribute-Expression, the [](indirection) operator will convert a Register-ExpressionTypeto a Indexed-ExpressionType by moving the Register Valueattribute to either the Base Registeror Index Registerattribute 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':
[Attribute-Expression]

[[[00573.htm|prev]]][[[00575.htm|next]]][[[00573.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00574.htm|prev]]][[[00576.htm|next]]][[[00573.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Indirected-Expression':
[Attribute-Expression]

[[[00575.htm|prev]]][[[00577.htm|next]]][[[00573.htm|parent]]][[[toc.htm|TOC]]]

Description

During evaluation of the Attribute-Expression, the [](indirection) operator will convert a Register-ExpressionTypeto a Indexed-ExpressionType by moving the Register Valueattribute to either the Base Registeror Index Registerattribute 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]]]

Constraints

See the Indexed-ExpressionTypesection for information on registers that are valid for use in this context.

[[[00577.htm|prev]]][[[00579.htm|next]]][[[00573.htm|parent]]][[[toc.htm|TOC]]]

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 

[[[00578.htm|prev]]][[[00580.htm|next]]][[[00503.htm|parent]]][[[toc.htm|TOC]]]

Compound Initializer List (<> Operator)


Description

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':
<Initializer-List>
{Initializer-List}

Initializer-List:
Duplicative-Expression
Initializer-List
,Duplicative-Expression

[[[00579.htm|prev]]][[[00581.htm|next]]][[[00579.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Examples

[[[00580.htm|prev]]][[[00582.htm|next]]][[[00579.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Compound-Initializer':
<Initializer-List>
{Initializer-List}

Initializer-List:
Duplicative-Expression
Initializer-List
,Duplicative-Expression

[[[00581.htm|prev]]][[[00583.htm|next]]][[[00579.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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 

[[[00583.htm|prev]]][[[00585.htm|next]]][[[00254.htm|parent]]][[[toc.htm|TOC]]]

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 Expression-Attributes, to which an ExpressionTypeis assigned.

[[[00584.htm|prev]]][[[00586.htm|next]]][[[00584.htm|parent]]][[[toc.htm|TOC]]]

Expression Attributes

This section describes the Expression-Attribute'sthat are associated with an expression after it is evaluated.

[[[00585.htm|prev]]][[[00587.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]

Address Size

If an expression refers to an effective address, then it also has an associated address size. The following ExpressionTypesnormally reference an effective address, and thus have an associated address size:

Immediate-ExpressionType
Direct-ExpressionType
Indirect-ExpressionType
Indexed-ExpressionType

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]]]

Operand Size

The Operand Sizeof 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:

/-------------------------------------------------------------\
|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 Sizeis 0 for all other identifier types.

[[[00587.htm|prev]]][[[00589.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]

Displacement

The Displacementvalue 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 Frameand/or an External Referenceattribute. A Displacementmay be used in the calculation of an effective address, either alone or in combination with a Base Registerand/or an Index Register.

[[[00588.htm|prev]]][[[00590.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]

Relative Frame

The Relative Frameattribute will be present if the expression contains a direct or indirect reference to any of the following Identifier-Types':

GroupName
LabelName
SegmentName

The Relative Frameattribute indicates that the expression is relocatable, and specifies the GroupNameor SegmentNameto which the expression is relative.

[[[00589.htm|prev]]][[[00591.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]

External Reference

The External Referenceattribute will be present if the expression references any external identifiers.

[[[00590.htm|prev]]][[[00592.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]

Register Value

The Register Valueattribute specifies the value of the Processor-Register referenced in a Register-ExpressionType.

[[[00591.htm|prev]]][[[00593.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]

Base Register

The Base Registerattribute specifies the value for the base register used in an Indexed-ExpressionType.

[[[00592.htm|prev]]][[[00594.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]

Index Register

The Index Registerattribute specifies the value for the index register used in an Indexed-ExpressionType.

[[[00593.htm|prev]]][[[00595.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]

Scale Factor

The Scale Factorattribute specifies the scaling value used (if any) in an Indexed-ExpressionType.

[[[00594.htm|prev]]][[[00596.htm|next]]][[[00585.htm|parent]]][[[toc.htm|TOC]]]

Type Declaration

The Type Declarationattribute 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).

[[[00595.htm|prev]]][[[00597.htm|next]]][[[00584.htm|parent]]][[[toc.htm|TOC]]]

Expression Types


An ExpressionTypeis assigned to every expression during evaluation. The ExpressionTypeis 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':
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

[[[00596.htm|prev]]][[[00598.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

Description

An ExpressionTypeis assigned to every expression during evaluation. The ExpressionTypeis 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]]]

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

[[[00598.htm|prev]]][[[00600.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

Absolute Expression Type

An Absolute-ExpressionTypeis an expression that evaluates to an integer quantity. Its value must be representable using one of the following types of scalar data:

BYTE
SBYTE
WORD
SWORD
DWORD
SDWORD
FWORD
QWORD
TBYTE

The following restrictions apply to an Absolute-ExpressionType':

�It cannot be relocatable (it may not contain references to a GroupName, SegmentNameor LabelName).
�It cannot reference any externalsymbols.
�It cannot contain any forward references.

[[[00599.htm|prev]]][[[00601.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

Constant Expression Type

A Constant-ExpressionTypeis an Absolute-ExpressionTypewith the following restrictions relaxed:

�It may contain forward references to identifiers defined later in the source stream.
�It may reference a single externalsymbol, provided that the symbol was declared in an EXTERNdirective with the ABSattribute.

[[[00600.htm|prev]]][[[00602.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

Immediate Expression Type

An Immediate-ExpressionTypehas all the properties of a Constant- ExpressionTypewith the following restrictions relaxed:

�It may contain references to a GroupName, SegmentNameor LabelName(it may be relocatable).
�It may reference a relocatable externalsymbol.

An Immediate-ExpressionTypemust 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

[[[00601.htm|prev]]][[[00603.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

Direct Expression Type

A Direct-ExpressionTypeis 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- ExpressionTyperepresents, 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]]]

Indirect Expression Type

An Indirect-ExpressionTypeis an expression that references a 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]]]

Indexed Expression Type

An Indexed-ExpressionTypeis an expression that calculates an effective memory address using the contents of a Base-Register, an Index-Register, or both. A Processor-Registermust first be converted to a Base-Registeror Index-Registerby specifying it as the operand of the Indirection ([] Operator)before the expression can be converted to an Indexed- ExpressionType.'

When calculating a 16-bit effective address, only the BPand BXregisters may be used as Base-Registers, and only the DIand SIregisters may be used as Index-Registers.

When calculating a 32-bit effective address, only the EAX, EBX, ECX, EDX, EDI, ESI, EBP, and ESPregisters may be used as Base-Registers, and only the EAX, EBX, ECX, EDX, EDI, ESI, and EBPregisters may be used as Index- Registers.

Note:Only a single Base-Registerand a single Index-Registermay be used in a given expression.


On 80386 (and higher) processors, the Multiplication (* Operator)may be used with an Index-Registeroperand and an Absolute-ExpressionTypeoperand to establish a scaling factor that is applied to the Index-Registerduring effective address calculation. The scaling factor effectively causes the Index-Registerto be multiplied by a fixed value at run time. The scaling Expressionmust evaluate to 1 (no scale factor), 2, 4, or 8.

A Direct-ExpressionTypeor an Indirect-ExpressionTypemay be a sub- expression of an Indexed-ExpressionType.

[[[00604.htm|prev]]][[[00606.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

Register Expression Type

A Register-ExpressionTypeis an expression that specifies a single Processor-Register.

[[[00605.htm|prev]]][[[00607.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

String Expression Type

A String-ExpressionTypeis an expression that specifies a single String- Literal.

[[[00606.htm|prev]]][[[00608.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

Floating-Point Expression Type

A Floating-Point-ExpressionTypeis an expression that specifies a single Floating-Point-Literal.

[[[00607.htm|prev]]][[[00609.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

Type Expression Type

A Type-ExpressionTypeis an expression that specifies one of the following:

�A Scalar-TypeName
�A Distance-TypeName
�A UserDefined-TypeName

[[[00608.htm|prev]]][[[00610.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

Compound Expression Type

A Compound-ExpressionTypeevaluates to a list of (possibly nested) expressions collected together as a unit by the Compound Initializer List ( <> Operator). A Compound-ExpressionTypeis used to initialize aggregate data types (such as records, structures, and unions) and vectordata types (arrays).

[[[00609.htm|prev]]][[[00611.htm|next]]][[[00596.htm|parent]]][[[toc.htm|TOC]]]

Duplicated Expression Type

A Duplicated-ExpressionTypeevaluates 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).

[[[00610.htm|prev]]][[[00612.htm|next]]][[[00584.htm|parent]]][[[toc.htm|TOC]]]

Operand Expression Type


An Operand-ExpressionTypeconsists of those ExpressionTypesthat are valid for use as operands in processor instructions. The following ExpressionTypesare not valid for use as an Operand-ExpressionType':

Compound-ExpressionType
Duplicated-ExpressionType

A String-ExpressionTypeis only valid as an Operand-ExpressionTypeif it is short enough to be converted to an Absolute-ExpressionTypehaving an Operand Sizeless than or equal to the current Address Sizesetting.



Operand-ExpressionType':
Absolute-ExpressionType
Constant-ExpressionType
Immediate-ExpressionType
Direct-ExpressionType
Indirect-ExpressionType
Indexed-ExpressionType
Register-ExpressionType
String-ExpressionType
Floating-Point-ExpressionType
Type-ExpressionType

[[[00611.htm|prev]]][[[00613.htm|next]]][[[00611.htm|parent]]][[[toc.htm|TOC]]]

Description

An Operand-ExpressionTypeconsists of those ExpressionTypesthat are valid for use as operands in processor instructions. The following ExpressionTypesare not valid for use as an Operand-ExpressionType':

Compound-ExpressionType
Duplicated-ExpressionType

A String-ExpressionTypeis only valid as an Operand-ExpressionTypeif it is short enough to be converted to an Absolute-ExpressionTypehaving an Operand Sizeless than or equal to the current Address Sizesetting.

[[[00612.htm|prev]]][[[00614.htm|next]]][[[00611.htm|parent]]][[[toc.htm|TOC]]]

Definition

Operand-ExpressionType':
Absolute-ExpressionType
Constant-ExpressionType
Immediate-ExpressionType
Direct-ExpressionType
Indirect-ExpressionType
Indexed-ExpressionType
Register-ExpressionType
String-ExpressionType
Floating-Point-ExpressionType
Type-ExpressionType

[[[00613.htm|prev]]][[[00615.htm|next]]][[[00584.htm|parent]]][[[toc.htm|TOC]]]

Initializer Expression Type


An Initializer-ExpressionTypeconsists of those ExpressionTypesthat are valid for use in initializing variables. The following ExpressionTypesare not valid Initializer-ExpressionType's':

Indexed-ExpressionType
Register-ExpressionType



Initializer-ExpressionType':
Scalar-Initializer-ExpressionType
Compound-ExpressionType
Duplicated-ExpressionType

Scalar-Initializer-ExpressionType':
Absolute-ExpressionType
Constant-ExpressionType
Immediate-ExpressionType
Direct-ExpressionType
Indirect-ExpressionType
String-ExpressionType
Floating-Point-ExpressionType
Type-ExpressionType

[[[00614.htm|prev]]][[[00616.htm|next]]][[[00614.htm|parent]]][[[toc.htm|TOC]]]

Description

An Initializer-ExpressionTypeconsists of those ExpressionTypesthat are valid for use in initializing variables. The following ExpressionTypesare not valid Initializer-ExpressionType's':

Indexed-ExpressionType
Register-ExpressionType

[[[00615.htm|prev]]][[[00617.htm|next]]][[[00614.htm|parent]]][[[toc.htm|TOC]]]

Definition

Initializer-ExpressionType':
Scalar-Initializer-ExpressionType
Compound-ExpressionType
Duplicated-ExpressionType

Scalar-Initializer-ExpressionType':
Absolute-ExpressionType
Constant-ExpressionType
Immediate-ExpressionType
Direct-ExpressionType
Indirect-ExpressionType
String-ExpressionType
Floating-Point-ExpressionType
Type-ExpressionType

[[[00616.htm|prev]]][[[00618.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]

Text Preprocessor

The text preprocessor is a functional unit within the assembler that performs the text preprocessingtranslation phase. During text preprocessing, the following actions are performed:

1.Language Elementsare recognized.

2.Text equates and macros are expanded.

3.Macro directivesand conditional assembly directivesare recognized and processed.

4.The preprocessed output is passed on to the assembler for final processing.


This section also describes the various types of preprocessor directives:

/-----------------------------------------------------------------------------\
|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                  |
\-----------------------------------------------------------------------------/

[[[00617.htm|prev]]][[[00619.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]

Text Operators


The Text Preprocessorrecognizes certain punctuator characters as text operators. The programmer may use these operators to force the Text Preprocessorto perform various operations such as delineating text, expanding arguments, and converting expressions into their text representations.



Text-Operator':
Literal-Character-Operator
Literal-Text-Operator
Text-Expansion-Operator
Text-Substitution-Operator

[[[00618.htm|prev]]][[[00620.htm|next]]][[[00618.htm|parent]]][[[toc.htm|TOC]]]

Description

The Text Preprocessorrecognizes certain punctuator characters as text operators. The programmer may use these operators to force the Text Preprocessorto 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]]]

Syntax

Text-Operator':
Literal-Character-Operator
Literal-Text-Operator
Text-Expansion-Operator
Text-Substitution-Operator

[[[00620.htm|prev]]][[[00622.htm|next]]][[[00618.htm|parent]]][[[toc.htm|TOC]]]

Literal Character Operator (!)


Description

Constraints

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':
!any printable character

[[[00621.htm|prev]]][[[00623.htm|next]]][[[00621.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00622.htm|prev]]][[[00624.htm|next]]][[[00621.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Literal-Character-Operator':
!any printable character

[[[00623.htm|prev]]][[[00625.htm|next]]][[[00621.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Constraints

The Literal-Character-Operatorhas no effect when used inside of a String- Literal.

[[[00625.htm|prev]]][[[00627.htm|next]]][[[00621.htm|parent]]][[[toc.htm|TOC]]]

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 

[[[00626.htm|prev]]][[[00628.htm|next]]][[[00618.htm|parent]]][[[toc.htm|TOC]]]

Literal Text Operator (<>)


Description

Examples



The literal-text operator directs the assembler to treat Char-Sequenceas 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':
<Char-Sequence>

Char-Sequence
any printable character
Char-Sequenceany printable character

[[[00627.htm|prev]]][[[00629.htm|next]]][[[00627.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Examples

[[[00628.htm|prev]]][[[00630.htm|next]]][[[00627.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Literal-Text-Operator':
<Char-Sequence>

Char-Sequence
any printable character
Char-Sequenceany printable character

[[[00629.htm|prev]]][[[00631.htm|next]]][[[00627.htm|parent]]][[[toc.htm|TOC]]]

Description

The literal-text operator directs the assembler to treat Char-Sequenceas 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]]]

Examples

The following example illustrates how to pass arbitrary text to a macro as a single parameter:

   MACRONAME   First ,   < Second   Argument > ,   < Third ,   < Nested > ,   Argument > 

The macro will receive three separate arguments:

1.First
2.Second Argument
3.Third, <Nested>, Argument

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]]]

Text Expansion Operator (%)


Description

Constraints

Examples



The %Text-Expansion-Operatorhas 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-Operatorcauses the following types of conversions:

Line Expansion

When used as the first token on the line, the %operator forces expansion of Text-EquateNamesin contexts where they would otherwise be left unexpanded. Text-EquateNamespassed 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 Text-EquateNames. This can be useful when expansion of all Text-EquateNameson the line is not desired.

Conversion of Numeric Expression to Text

If the Text-Expansion-Operatoris 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.



Text-Expansion-Operator':
%2nd through Nth token on line
%Text-EquateName
%Expression

[[[00632.htm|prev]]][[[00634.htm|next]]][[[00632.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00633.htm|prev]]][[[00635.htm|next]]][[[00632.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Text-Expansion-Operator':
%2nd through Nth token on line
%Text-EquateName
%Expression

[[[00634.htm|prev]]][[[00636.htm|next]]][[[00632.htm|parent]]][[[toc.htm|TOC]]]

Description

The %Text-Expansion-Operatorhas 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-Operatorcauses the following types of conversions:

Line Expansion

When used as the first token on the line, the %operator forces expansion of Text-EquateNamesin contexts where they would otherwise be left unexpanded. Text-EquateNamespassed 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 Text-EquateNames. This can be useful when expansion of all Text-EquateNameson the line is not desired.

Conversion of Numeric Expression to Text

If the Text-Expansion-Operatoris 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.

[[[00635.htm|prev]]][[[00637.htm|next]]][[[00632.htm|parent]]][[[toc.htm|TOC]]]

Constraints

When the %Expressionform of the expansion operator is used, the Expressionmust evaluate to an Immediate-ExpressionType.

[[[00636.htm|prev]]][[[00638.htm|next]]][[[00632.htm|parent]]][[[toc.htm|TOC]]]

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 

[[[00637.htm|prev]]][[[00639.htm|next]]][[[00618.htm|parent]]][[[toc.htm|TOC]]]

Text Substitution Operator (&)


Description

Constraints

Examples



An ampersand (&) is used in the body of a macro to force the substitution of a Macro-ParameterNamewith the value of its argument during expansion of the macro.



Text-Substitution-Operator':
Macro-ParameterName
&
&Macro-ParameterName

[[[00638.htm|prev]]][[[00640.htm|next]]][[[00638.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

Examples

[[[00639.htm|prev]]][[[00641.htm|next]]][[[00638.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Text-Substitution-Operator':
Macro-ParameterName
&
&Macro-ParameterName

[[[00640.htm|prev]]][[[00642.htm|next]]][[[00638.htm|parent]]][[[toc.htm|TOC]]]

Description

An ampersand (&) is used in the body of a macro to force the substitution of a Macro-ParameterNamewith the value of its argument during expansion of the macro.

[[[00641.htm|prev]]][[[00643.htm|next]]][[[00638.htm|parent]]][[[toc.htm|TOC]]]

Constraints

The assembler does not substitute a Macro-ParameterNamethat 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 Macro-ParameterNamefrom other Identifer- Characterswith an ampersand (&) before any substitution or paste operations are performed.

[[[00642.htm|prev]]][[[00644.htm|next]]][[[00638.htm|parent]]][[[toc.htm|TOC]]]

Examples


ErrGen      MACRO      X 
Error & X :    push      bx 
ABX         mov        BX ,   " A " 
AB & X        jmp        ERROR 
           ENDM 

The statement ErrGen Aproduces this code:

ErrorA :    push       bx 
ABX         mov        BX ,   " A " 
ABA        jmp        ERROR 

[[[00643.htm|prev]]][[[00645.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]

Preprocessor Tokens


During the text preprocessing translation phase, certain conditions will cause the preprocessor to convert raw Language Elements(Tokens) into Preprocessing-Token's. The act of text preprocessing typically causes Preprocessing-Token'sto either be removed from the input stream or converted back into Tokensbefore being passed on to the assembler for final processing.




Preprocessing-Token':
Identifier
Text-Literal
FileName
Comment

[[[00644.htm|prev]]][[[00646.htm|next]]][[[00644.htm|parent]]][[[toc.htm|TOC]]]

Description

During the text preprocessing translation phase, certain conditions will cause the preprocessor to convert raw Language Elements(Tokens) into Preprocessing-Token's. The act of text preprocessing typically causes Preprocessing-Token'sto either be removed from the input stream or converted back into Tokensbefore being passed on to the assembler for final processing.

[[[00645.htm|prev]]][[[00647.htm|next]]][[[00644.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Preprocessing-Token':
Identifier
Text-Literal
FileName
Comment

[[[00646.htm|prev]]][[[00648.htm|next]]][[[00644.htm|parent]]][[[toc.htm|TOC]]]

Text Literals


Description

Constraints



A Text-Literalis a single unit of text that is used by the Text Preprocessorin many different text handling contexts. In some contexts ( such as the processing of arguments to be passed to a macro), normal language Tokensare 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 Literal-Text-Operator.



Text-Literal':
operand of Literal-Character-Operator
operand of Literal-Text-Operator

[[[00647.htm|prev]]][[[00649.htm|next]]][[[00647.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Constraints

[[[00648.htm|prev]]][[[00650.htm|next]]][[[00647.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Text-Literal':
operand of Literal-Character-Operator
operand of Literal-Text-Operator

[[[00649.htm|prev]]][[[00651.htm|next]]][[[00647.htm|parent]]][[[toc.htm|TOC]]]

Description

A Text-Literalis a single unit of text that is used by the Text Preprocessorin many different text handling contexts. In some contexts ( such as the processing of arguments to be passed to a macro), normal language Tokensare 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 Literal-Text-Operator.

[[[00650.htm|prev]]][[[00652.htm|next]]][[[00647.htm|parent]]][[[toc.htm|TOC]]]

Constraints

A normal language Tokenis never implicitly considered to be a Text-Literal if a Text-Literalis explicitly required in the syntax of the construct being parsed.

[[[00651.htm|prev]]][[[00653.htm|next]]][[[00644.htm|parent]]][[[toc.htm|TOC]]]

File Names


Description

Examples



FileNamearguments may be coded as an arbitrary sequence of printable characters, or as a Text-Literal; use the Text-Literalform 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':
FileName-Text
Text-Literal

FileName-Text'
:
FileName-Character
FileName-Text'FileName-Character

FileName-Character.:
any printable character except blank (ASCII 32)

[[[00652.htm|prev]]][[[00654.htm|next]]][[[00652.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Examples

[[[00653.htm|prev]]][[[00655.htm|next]]][[[00652.htm|parent]]][[[toc.htm|TOC]]]

Syntax

FileName':
FileName-Text
Text-Literal

FileName-Text'
:
FileName-Character
FileName-Text'FileName-Character

FileName-Character.:
any printable character except blank (ASCII 32)

[[[00654.htm|prev]]][[[00656.htm|next]]][[[00652.htm|parent]]][[[toc.htm|TOC]]]

Description

FileNamearguments may be coded as an arbitrary sequence of printable characters, or as a Text-Literal; use the Text-Literalform 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]]]

Examples


   INCLUDE      < inc \ macros . inc > 
   INCLUDELIB   os2386 . lib 

[[[00656.htm|prev]]][[[00658.htm|next]]][[[00644.htm|parent]]][[[toc.htm|TOC]]]

Comments


Description

Examples



Commentsare 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 COMMENT directive for a description of Block-Comments.


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-Commentscan significantly reduce the amount of memory workspace used by the definition of a macro. As a macro definition is read, Macro-Commentsare discarded and not entered into the macro definition, whereas NonMacro-Commentsare 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.



Comment':
EndOfLine-Comment
Block-Comment

EndOfLine-Comment'
:
NonMacro-Comment
Macro-Comment

NonMacro-Comment':
;Char-Sequence

Macro-Comment'
:
;;Char-Sequence

Char-Sequence':
any printable character
Char-Sequenceany printable character

Block-Comment:
See the COMMENTdirective

[[[00657.htm|prev]]][[[00659.htm|next]]][[[00657.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Examples

[[[00658.htm|prev]]][[[00660.htm|next]]][[[00657.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Comment':
EndOfLine-Comment
Block-Comment

EndOfLine-Comment'
:
NonMacro-Comment
Macro-Comment

NonMacro-Comment':
;Char-Sequence

Macro-Comment'
:
;;Char-Sequence

Char-Sequence':
any printable character
Char-Sequenceany printable character

Block-Comment:
See the COMMENTdirective

[[[00659.htm|prev]]][[[00661.htm|next]]][[[00657.htm|parent]]][[[toc.htm|TOC]]]

Description

Commentsare 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 COMMENT directive for a description of Block-Comments.


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-Commentscan significantly reduce the amount of memory workspace used by the definition of a macro. As a macro definition is read, Macro-Commentsare discarded and not entered into the macro definition, whereas NonMacro-Commentsare 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.

[[[00660.htm|prev]]][[[00662.htm|next]]][[[00657.htm|parent]]][[[toc.htm|TOC]]]

Examples

The following are examples of EndOfLine-Comment's':

;   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 

[[[00661.htm|prev]]][[[00663.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]

Text Arguments


Many preprocessing directives operate on sequences of raw text characters called Text-Argument's. A Text-Argumentmay be specified using any one of several methods:

�Specifying the text directly using a raw Text-Literal.

�Using the Text-Expansion-Operatorto convert a numeric expression to its text representation.

�Using a Text-EquateNamein those contexts where a Text-Argumentis expected. In this case the preprocessor will automatically resolve the Text-EquateNameand use its value as the Text-Argument.




Text-Argument':
Text-Literal
%Expression
Text-EquateName

[[[00662.htm|prev]]][[[00664.htm|next]]][[[00662.htm|parent]]][[[toc.htm|TOC]]]

Description

Many preprocessing directives operate on sequences of raw text characters called Text-Argument's. A Text-Argumentmay be specified using any one of several methods:

�Specifying the text directly using a raw Text-Literal.

�Using the Text-Expansion-Operatorto convert a numeric expression to its text representation.

�Using a Text-EquateNamein those contexts where a Text-Argumentis expected. In this case the preprocessor will automatically resolve the Text-EquateNameand use its value as the Text-Argument.

[[[00663.htm|prev]]][[[00665.htm|next]]][[[00662.htm|parent]]][[[toc.htm|TOC]]]

Syntax

Text-Argument':
Text-Literal
%Expression
Text-EquateName

[[[00664.htm|prev]]][[[00666.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]

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 IFxxand ENDIFdirectives enclose the statements to be considered for conditional assembly. The optional ELSEIFxxand ELSEblocks follow the IFxxdirective. There are many forms of the IFxxand ELSEIFxxdirectives.

This section describes the following conditional assembly directives:

IF
IFB
IFDEF
IFDIF
IFDIFI
IFE
IFIDN
IFIDNI
IFNB
IFNDEF
IF1
IF2
ELSE
ENDIF

[[[00665.htm|prev]]][[[00667.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IFxx (Begin Primary Conditional Block)

You can use each IFxxconditional directive with the ELSExx, ELSEand ENDIF directives to provide the statements to be considered for conditional assembly. ALP assembles the statements following the IFxxdirective only if this condition is true.

Syntax


IFxx   operand 
    . 
    . 
    . 
[ ELSEIFxx ]   ( optional ) 
    . 
    . 
    . 
[ ELSE ]   ( optional ) 
    . 
    . 
    . 
ENDIF 

Remarks

The following directives are members of the IFxxfamily:

IF
IFB
IFDEF
IFDIF
IFDIFI
IFE
IFIDN
IFIDNI
IFNB
IFNDEF
IF1
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.

[[[00666.htm|prev]]][[[00668.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IF (If Expression is True)

IFstarts a conditional assembly statement, which is ended by the corresponding ENDIFconditional assembly directive. Each IFdirective must be ended by a matching ENDIFdirective.

Syntax


IF   Expression 
    . 
    . 
    . 
[ ELSEIFxx ]   ( optional ) 
    . 
    . 
    . 
[ ELSE ]   ( optional ) 
    . 
    . 
    . 
ENDIF 

Remarks

If the IFxxconditional assembly statement is not ended by an ENDIF directive, an unterminated conditionalmessage is produced by the assembler . An ENDIFwithout a matching IFcauses an error. ENDIFdoes 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 


[[[00667.htm|prev]]][[[00669.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IFB (If Argument is Blank)

This is true if Text-Argumentis blank (contains no characters).

Syntax


IFB   Text - Argument 

Remarks

A Text-Argumentmust be specified, the contents of which are checked for the presence of characters. An error is generated if a Text-Argumentis not supplied.

[[[00668.htm|prev]]][[[00670.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IFDEF (If Identifier is Defined)

This is true if Identifierhas been defined as a label, variable, or symbol .

Syntax


IFDEF   Identifier 


[[[00669.htm|prev]]][[[00671.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IFDIF (If Arguments Are Different)

This is true if Text-Argument-1and Text-Argument-2are different in a case -sensitive comparison.

Syntax


IFDIF   Text - Argument - 1 ,   Text - Argument - 2 

Remarks

Both Text-Argumentarguments must be specified. An error is generated if a either argument is not supplied.

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.

[[[00670.htm|prev]]][[[00672.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IFDIFI (If Arguments Are Spelled Differently)

This is true if Text-Argument-1and Text-Argument-2are different in a case -insensitive comparison.

Syntax


IFDIFI   Text - Argument - 1 ,   Text - Argument - 2 

Remarks

Both Text-Argumentarguments must be specified. An error is generated if a either argument is not supplied.

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.

[[[00671.htm|prev]]][[[00673.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IFE (If Expression is Not True)

This is true if expressionis 0.

Syntax


IFE   Expression 


[[[00672.htm|prev]]][[[00674.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IFIDN (If Arguments Are Identical)

This is true if Text-Argument-1and Text-Argument-2are identical in a case -sensitive comparison.

Syntax


IFIDN   Text - Argument - 1 ,   Text - Argument - 2 

Remarks

Both Text-Argumentarguments must be specified. An error is generated if a either argument is not supplied.

Example

In the following example:

IFIDN   < EAGLES > , < Eagles > 
   value   =   1 
ENDIF 

the condition would be false; the arguments are not identical because they are compared using a case-insensitive algorithm.

[[[00673.htm|prev]]][[[00675.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IFIDNI (If Arguments Are Spelled Identically)

This is true if Text-Argument-1and Text-Argument-2are identical in a case -insensitive comparison.

Syntax


IFIDNI   Text - Argument - 1 ,   Text - Argument - 2 

Remarks

Both Text-Argumentarguments must be specified. An error is generated if a either argument is not supplied.

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.

[[[00674.htm|prev]]][[[00676.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IFNB (If Argument is Not Blank)

This is true if Text-Argumentis not blank (characters are present).

Syntax


IFNB   Text - Argument 

Remarks

A Text-Argumentmust be specified, the contents of which are checked for the presence of characters. An error is generated if a Text-Argumentis not supplied.

[[[00675.htm|prev]]][[[00677.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IFNDEF (If Identifier is Not Defined)

This is true if symbolhas not yet been defined as a label, variable, or symbol.

Syntax


IFNDEF   symbol 


[[[00676.htm|prev]]][[[00678.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IF1 (If Assembling On Pass 1)

This is true on pass one.

Syntax


IF1 

Remarks

IF1does not have an operand.

[[[00677.htm|prev]]][[[00679.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

IF2 (If Assembling On Pass 2)

This is true on pass two.

Syntax


IF2 

Remarks

IF2does not have an operand.

[[[00678.htm|prev]]][[[00680.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

ELSEIFxx/ELSE (Begin Alternate Conditional Block)

Each conditional directive can be used with the ELSEdirective 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 ELSEIFxxconditions are false.

Syntax


IFxx 
    . 
    . 
    . 
[ ELSEIFxx ]   ( optional ) 
    . 
    . 
    . 
[ ELSE ]   ( optional ) 
    . 
    . 
    . 
ENDIF 

Remarks

There is a corresponding ELSEIFxxdirective to match all forms of the IFxx family of directives:

ELSEIF
ELSEIFB
ELSEIFDEF
ELSEIFDIF
ELSEIFDIFI
ELSEIFE
ELSEIFIDN
ELSEIFIDNI
ELSEIFNB
ELSEIFNDEF
ELSEIF1
ELSEIF2

For information about the meaning of the conditional tests performed by the ELSEIFxxdirectives, refer to the definitions for the corresponding IFxx directives.

Any number of ELSEIFxxblocks may be used within a given IFxxstatement. Only one ELSEblock is permitted for a given IFxx. A conditional directive with more than one ELSEor an ELSEwithout a conditional directive causes an error. ELSEdoes 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   DEFBUF 

    BUF   DB   100   DUP ( 0 ) 

ELSE 

    EXTERN   BUF : BYTE 

ENDIF 


[[[00679.htm|prev]]][[[00681.htm|next]]][[[00665.htm|parent]]][[[toc.htm|TOC]]]

ENDIF (End a Conditional Assembly Statement)

ENDIFends the conditional assembly statement begun by the corresponding IFxxconditional assembly directive. Each IFxxdirective must be ended by a matching ENDIFdirective.

Syntax


IFxx 
    . 
    . 
    . 
[ ELSEIFxx ]   ( optional ) 
    . 
    . 
    . 
[ ELSE ]   ( optional ) 
    . 
    . 
    . 
ENDIF 

Remarks

If the IFxxconditional assembly statement is not ended by an ENDIF directive, an unterminated conditionalmessage is produced by the assembler . An ENDIFwithout a matching IFxxcauses an error. ENDIFdoes 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 


[[[00680.htm|prev]]][[[00682.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]

Text Equate Directives

A Text Equateis 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
CATSTR
INSTR
SIZESTR
SUBSTR

[[[00681.htm|prev]]][[[00683.htm|next]]][[[00681.htm|parent]]][[[toc.htm|TOC]]]

CATSTR (Concatenate Strings)

CATSTRconcatenates a list of text values specified by stringinto a single text value and assigns it to Name.

Syntax


Name   CATSTR   string [ ,   string ]   . . . 


[[[00682.htm|prev]]][[[00684.htm|next]]][[[00681.htm|parent]]][[[toc.htm|TOC]]]

EQU Directive (Assign Text to a Symbolic Constant)

The EQUdirective assigns the contents of a text literal to Name.

Syntax


Name   EQU   Text - Literal 

Remarks

The value of the Text-Literalis assigned to the Nameentry. In normal contexts, subsequent references to Namewill cause the preprocessor to replace Namewith the value specified by the Text-Literalentry. This is a simple text substitution operation.

The Nameentry is a globally-scoped Identifierthat is converted to a Text- EquateName. The Namecannot have been previously defined as a different Identifier-Type. However, the Nameentry can be redefined as many times as desired with different values for the Text-Literalentry.

See also EQUand =.

Example


A      EQU     < BP   + >    ; explicit   text   literal ,   A   is   a   text   equate 
A      EQU     < 3 >       ; redefinition   of   A   with   different   value 


[[[00683.htm|prev]]][[[00685.htm|next]]][[[00681.htm|parent]]][[[toc.htm|TOC]]]

INSTR (Search In String For Value)

INSTRsearches a specified Stringfor an occurrence of a given Sub-String and assigns its position (1-based) to Name. The search is case sensitive. Startis the position in Stringto start the search for Sub-String. If Startis not given, it is assumed to be 1 (the start of the string). If Sub-Stringis not found, the position assigned to Nameis 0.

Syntax


Name   INSTR   [ Start , ] String , Sub - String 

Remarks

INSTRassigns the position value to a name as if it were a numeric equate.

Example


pos   INSTR   < person > ,   < son > 


[[[00684.htm|prev]]][[[00686.htm|next]]][[[00681.htm|parent]]][[[toc.htm|TOC]]]

SIZESTR (Return Size Of String)

Assigns the number of characters given by the Text-Argumentto Name.

Syntax


Name   SIZESTR   Text - Argument 


[[[00685.htm|prev]]][[[00687.htm|next]]][[[00681.htm|parent]]][[[toc.htm|TOC]]]

SUBSTR (Extract a Sub-string From a String)

Assigns a substring of Text-Argumentstarting at Positionto the symbol given by Name..

Syntax


Name   SUBSTR   Text - Argument , Position [ , Length ] 

Remarks

The Positionparameter indicates the starting character of the substring to extract from the Text-Argument, and must be 1 or greater. If specified, the Lengthparameter indicates how many characters are desired, otherwise the remainder of the string is extracted.

[[[00686.htm|prev]]][[[00688.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]

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
�Repeat blocks, which generate a group of statements a specified number of times or until a condition becomes true

This section describes the following macro directives:

ENDM
EXITM
FOR/IRP
FORC/IRPC
LOCAL
MACRO
PURGE
REPEAT/REPT

[[[00687.htm|prev]]][[[00689.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]

ENDM (End Current Macro Definition)

End each MACRO, REPEAT/REPT, FOR/IRP, and FORC/IRPCdirective with the ENDM directive.

Syntax


ENDM 

Remarks

If the ENDMdirective is not used with the MACRO, REPEAT/REPT, FOR/IRP, and FORC/IRPCdirectives, an error occurs. An unmatched ENDMalso 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 ENDstatement when there was an END, the likely cause is a missing ENDMor ENDIF statement. Without ENDM, the assembler treats the rest of the source as part of the MACROdefinition.

Note:The name fieldis not allowed. Do not confuse the ENDMdirective 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 


[[[00688.htm|prev]]][[[00690.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]

EXITM (End Current Macro Expansion)

Use the EXITMdirective 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 EXITMdirective is run, the expansion is stopped immediately, and any remaining expansion or repetition is not produced.

Syntax


EXITM 

Remarks

Only the block containing the EXITMdirective is ended; outer levels of a nested macro expansion continue unaffected.

EXITMis executed at macro expansion time and is not a substitute for the ENDMdirective, which marks the end of the macro body and is recognized at macro definition time.

Example


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 


[[[00689.htm|prev]]][[[00691.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]

FOR/IRP (Iterative Macro Expansion Using List of Arguments)

The FORdirective, used in combination with the ENDMdirective, 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 Parameterin the block.

Syntax


FOR   Parameter ,   < Argument - List > 
    . 
    . 
    . 
ENDM 

Remarks

The obsolete spelling for the FORdirective is IRP.

You must enclose the <Argument-List> entry in angle brackets. It has the following format:

< [ Argument   [ ,   Argument   . . . ] ] > 

If an empty (<>) Argumentis found in <Argument-List>, the Parametername 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 Argumentin the <Argument-List>, replacing each occurrence of Parameterin the macro body with the current Argumentvalue.

The FOR/IRP-ENDMblock does not have to be within a macro definition.

Example

In this example, the assembler produces the code DB1 through DB10.

FOR     X ,   < 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 > 
DB      X 
ENDM 

In the next example:

FOR      ARGUMENT , < " first   line " , 13 , 10 , 
" second   line " , 13 , 10 > 
DB      ARGUMENT 
ENDM 

The assembler produces the code:

DB     " first   line " 
DB     13 
DB     10 
DB     " second   line " 
DB     13 
DB     10 


[[[00690.htm|prev]]][[[00692.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]

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 Parameterin the block.

Syntax


FORC   Parameter ,   String   ( or   < String > ) 
    . 
    . 
    . 
ENDM 

Remarks

The obsolete spelling for the FORCdirective is IRPC.

The FORCdirective is similar to the FOR/IRPdirective 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 FORC/IRPC-ENDMblock does not have to be within a macro definition.

Example

In this example, the assembler produces the code DB1 through DB8:

FORC      X , 12345678 
DB        X 
ENDM 


[[[00691.htm|prev]]][[[00693.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]

LOCAL (Identify Names Local to a Macro Definition)

The LOCALdirective 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 LOCALdirective 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


LOCAL   Name   [ ,   Name . . . . ] 

Remarks

The LOCALdirective is recognized only within the body of a macro given by a MACRO, FOR/IRP, FORC/IRPC, or REPEAT/REPTdefinition. The symbols created by the preprocessor are of the form ??nnnn, where nnnnis 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, LOCALstatements 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 LOCALstatements.

You can use multiple LOCALstatements if the argument list is too long to fit on one line, or if you want a vertical list of LOCALsymbols.

Example


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 


[[[00692.htm|prev]]][[[00694.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]

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 Definitionand Macro Expansion.

[[[00693.htm|prev]]][[[00695.htm|next]]][[[00693.htm|parent]]][[[toc.htm|TOC]]]

Macro Definition

A macro definition consists of three essential parts:

�The MACROdirective, defining the Nameand the Parameter-List
�The body of the macro, containing the prototypes of statements to produce when you invoke the macro for expansion.
�The ENDMdirective, ending the definition of the macro.

Syntax


Name   MACRO   [ Parameter   [ ,   Parameter   . . . ] ] 
   . 
   . 
   . 
ENDM 

Remarks

The Namefield must be a valid preprocessor identifier and specifies the symbolic name that the user will refer to when invoking the macro for expansion. If Nameis 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-Listis the complete comma-separated list of all Parametervaluess 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.

[[[00694.htm|prev]]][[[00696.htm|next]]][[[00693.htm|parent]]][[[toc.htm|TOC]]]

Macro Expansion

To expand the macro, the macro Name(defined in the Namefield 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


Name   [ Argument   [ ,   Argument   . . . ] ] 

Remarks

The Namefield must be the name of a macro defined previously with a MACRO directive.

Each Argumentfield denotes a text value that you want to pass to the macro . The relative positions of the elements are important, because each Argumentis associated in left-to-right fashion with the corresponding Parameteras defined in the Parameter-Listduring the macro definition.

The number of Argumententries given when the macro is invoked need not be the same as the number of Parameterentries. If you pass extra Arguments to the macro, they are ignored; if too few are supplied, empty text values are associated with the remaining Parameters. You may also associate an empty text value with a Parameterby 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:

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 


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-Listof the macro definition) are replaced with the corresponding Argument(if any) passed through the argument-listat the time the macro was invoked.

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 


[[[00695.htm|prev]]][[[00697.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]

PURGE (Remove Macro Definition)

The PURGEdirective 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 PURGEto recover memory during assembly by deleting the contents of unreferenced macros. An Out of Memorycondition can occur if a large, general-purpose macro library is included.

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 


[[[00696.htm|prev]]][[[00698.htm|next]]][[[00687.htm|parent]]][[[toc.htm|TOC]]]

REPEAT/REPT (Iterative Macro Expansion Using a Count Expression)

REPEATspecifies the number of times to generate the statements inside the macro.

Syntax


REPEAT   Expression 
   Statements 
ENDM 

Remarks

The Expressionfield 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.

[[[00697.htm|prev]]][[[00699.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]

ECHO Directive (Display Message on Standard Output Device)

The ECHOdirective displays progress through a long assembly or displays the value of conditional assembly parameters.

Syntax


ECHO   Text 

Remarks

The assembler lists the Textentry on the standard output device during assembly when the assembler encounters the ECHOdirective.

ECHOis not available under MASM 5.10 emulation; you must use %OUT,which is the obsolete spelling for the ECHOdirective.

Example

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 


[[[00698.htm|prev]]][[[00700.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]

INCLUDE Directive (Insert File Contents into Input Stream)

The INCLUDEdirective "stacks" the current source file and begins reading tokens from the source file given by the FileNameargument. If you use the INCLUDEdirective, 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 INCLUDEfile:

1.If the FileNameargument 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 FileNamebegins with a relative path name or contains no path information, the assembler begins searching for the INCLUDEfile by looking in the directory of the source file that issued the INCLUDEdirective.

3.The assembler searches for FileNamein the list of directories given by any -Fdior -Ioptions found on the command line.

4.The assembler searches for FileNamein the list of directories given by the <BaseEXE>_INCLUDEenvironment variable.

5.The assembler searches for FileNamein the list of directories given by the INCLUDEenvironment variable.

6.Lastly, the assembler searches for FileNamein 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 FileNamewhen performing search steps 2 through 6.

When the file named in the INCLUDEdirective 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 INCLUDEdirective.

An INCLUDEfile should not contain an ENDassembler directive to denote the end of the included module; the assembler closes the included module when its physical end of file is reached.

INCLUDEfiles may be nested to any reasonable level, and is limited only by the operating system's ability to provide the necessary resources.

Example


INCLUDE   OS2 . INC 


[[[00699.htm|prev]]][[[00701.htm|next]]][[[00617.htm|parent]]][[[toc.htm|TOC]]]

COMMENT Directive (Program Information Block)

COMMENTlets you enter comments about your program without having to enter semicolons (;) for each line.

Syntax


COMMENT   Delimiter   Text   Delimiter 

Remarks

The first non-blank character after COMMENTis the first delimiter. The COMMENTdirective causes the assembler to treat all Textbetween Delimiter and Delimiteras 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 .LALLis requested.

Example

COMMENT   * You   can   enter   as   many   lines 
of   text   between   the   delimiters 
    . 
    . 
    . 
as   you   need   to   describe   your   program . * 


[[[00700.htm|prev]]][[[00702.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]

Assembler Directives

This section describes the various types of ALP directives:

/-----------------------------------------------------------------------------\
|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                   |
\-----------------------------------------------------------------------------/

[[[00701.htm|prev]]][[[00703.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]

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
.ERR1
.ERR2
.ERRB
.ERRDEF
.ERRDIF
.ERRDIFI
.ERRE
.ERRIDN
.ERRIDNI
.ERRNB
.ERRNDEF
.ERRNZ

[[[00702.htm|prev]]][[[00704.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]

.ERR/.ERR1/.ERR2 (Force Assembly Error Condition)

The .ERR, .ERR1, and .ERR2directives cause errors at the points at which they occur in the source file.

Syntax


. ERR 
    or 
. ERR1 
    or 
. ERR2 

Remarks

The .ERRdirective causes an error regardless of the pass. .ERR1causes an error on the first pass only. .ERR2causes an error on the second pass only. If you use the -Lp:1option to request a first pass listing, the . ERR1error message appears on the screen and in the listing file. Like other error conditions occurring during pass one, the error generated by . ERR1does 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 ELSEcondition and produces an error message. The .ERRdirective causes an error on each pass.

IFDEF   DOS 
       . 
       . 
       . 
ELSE 
       IFDEF   OS2 
          . 
          . 
          . 
       ELSE 
          . ERR 
       ENDIF 
ENDIF 


[[[00703.htm|prev]]][[[00705.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]

.ERRB/.ERRNB (Error if Argument Blank/Non-Blank)

The .ERRBand .ERRNBdirectives test the given Text-Argument.

Syntax


. ERRB   Text - Argument 
    or 
. ERRNB   Text - Argument 

Remarks

If Text-Argumentis blank, the .ERRBdirective produces an error. If Text- Argumentis not blank, .ERRNBproduces 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 .ERRBdirective produces an error. If more than one argument is passed, the .ERRNB directive produces an error.

WORK      MACRO      REALARG , TESTARG 
         . ERRB      < REALARG >    ; ;   Error   if   no   parameters 
         . ERRNB     < TESTARG >    ; ;   Error   if   more   than   one   parameter 
                  . 
                  . 
                  . 
         ENDM 


[[[00704.htm|prev]]][[[00706.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]

.ERRDEF/.ERRNDEF (Error if Symbol Defined/Not Defined)

The .ERRDEFand .ERRNDEFdirectives test whether a symbol has been defined.

Syntax


. ERRDEF   Identifier 
    or 
. ERRNDEF   Identifier 

Remarks

If Identifieris defined as a label, a variable, or a symbol, the .ERRDEF directive produces an error. If you have not defined Identifier, .ERRNDEF produces an error. When Identifieris a forward reference, the assembler considers it undefined on the first pass and defined on the second pass.

Example

In this example, .ERRDEFensures that SYMBOLis not defined before entering the blocks, and .ERRNDEFensures that you defined SYMBOLsomewhere within the blocks.

. ERRDEF      SYMBOL 
IFDEF        CONFIG1 
             . 
             .     SYMBOL   EQU   0 
             . 
ENDIF 
IFDEF        CONFIG2 
             . 
             .    SYMBOL    EQU   1 
             . 
ENDIF 
. ERRNDEF      SYMBOL 


[[[00705.htm|prev]]][[[00707.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]

.ERRDIF/.ERRDIFI (Error if Arguments are Different)

The .ERRDIFand .ERRDIFIdirectives generate an assembler error if the two Text-Argumentsare different.

Syntax


. ERRDIF   Text - Argument - 1 ,   Text - Argument - 2 
    or 
. ERRDIFI   Text - Argument - 1 ,   Text - Argument - 2 

Remarks

The .ERRDIFdirective performs a case-sensitive comparision, and the . ERRDIFIdirective 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).

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 


[[[00706.htm|prev]]][[[00708.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]

.ERRE/.ERRNZ (Error if Expression False/True)

The .ERREand .ERRNZdirectives test the value of an Expression.

Syntax


. ERRE   Expression 
    or 
. ERRNZ   Expression 

Remarks

If the Expressionevaluates to be false (zero), the .ERREdirective produces an error. If the Expressionevaluates to be true (not zero), the .ERRNZdirective produces an error. The Expressionmust evaluate to an absolute value and cannot contain forward references.

Example

In this example, .ERREchecks 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 COUNTis greater than 128, the expression is false (zero) and the directive produces an error.

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 


[[[00707.htm|prev]]][[[00709.htm|next]]][[[00702.htm|parent]]][[[toc.htm|TOC]]]

.ERRIDN/.ERRIDNI (Error if Arguments are Identical)

The .ERRIDNand .ERRIDNIdirectives generate an assembly error if the two Text-Argumentsare identical.

Syntax


. ERRIDN   Text - Argument - 1 ,   Text - Argument - 2 
    or 
. ERRIDNI   Text - Argument - 1 ,   Text - Argument - 2 

Remarks

The .ERRIDNdirective performs a case-sensitive comparision, and the . ERRIDNIdirective performs a case-insensitive comparision.

Example

In this example, .ERRIDNprotects against the passing the AX register as the second parameter, because the macro does not work if this happens. This example uses the .ERRIDNIdirective since the macro needs to check for all possible spellings of the AX register.

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 


[[[00708.htm|prev]]][[[00710.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]

Data Allocation

Data allocation statements allow you to reserve storage for your program data. To initiate a data allocation statement, an Old-Style-Allocation- Directivemay be used, but in modes other than M510it is preferable to use a Scalar-TypeNameor 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-TypeNamethat 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


[ Name ]   Allocation - TypeName   Initializer   [ ,   Initializer   . . . ] 

Allocation-TypeName:
Old-Style-Allocation-Directive
Scalar-TypeName
Record-TypeName
Structure-TypeName
Union-TypeName
Typedef-TypeName

Old-Style-Allocation-Directive:one of
'
'

DB DW DD DF DQ DT


Remarks

The various fields of the data allocation statement are described as follows:

NameIf the Nameentry is present, it must be specified as a valid Identifierunique to the scope in which it appears. If the allocation statement is assembled into an open segment, the assembler converts the identifier to a Data-LabelNameto allow referencing the storage by a symbolic variable name. If the allocation statement is assembled into the body of a STRUCTor UNIONtype definition, then the assembler converts the identifier to a Structure-FieldNameor Union-FieldName.

Allocation-TypeNameIf the Allocation-TypeNameis specified as a Typedef- TypeName, the assembler resolvesit to its underlying data type to determine what type of initialization is to be performed.

If the Allocation-TypeNameentry resolves to a Scalar-TypeNameor a pointer to some other type, then the Initializerfield must be specified using an expression syntax that can be resolved to a Scalar-Initializer- ExpressionType. See the following section on Initialization of Scalar Typesfor a full description of this topic.

If the Allocation-TypeNameentry resolves to a Record-TypeName, Structure- TypeName, or Union-TypeName, then the Initializerfield must be specified using the Compound-Initializersyntax. See the following section on Initialization of Aggregate Typesfor a full description of this topic.

If the Allocation-TypeNameentry resolves to an array of any other type, then the Initializerfield must be specified using the Compound-Initializer syntax. See the following section on Initialization of Vector Typesfor a full description of this topic.

InitializerEach Initializerentry is an Expressionthat must resolve to an Initializer-ExpressionTypeappropriate for the type of data described by the Allocation-TypeNamefield.

Each Initializerentry may also be duplicated by making it the operand of a Duplicative-Expression. When assembling in ALPmode however, the DUP operator is considered obsolete and its use is discouraged. Instead, a Typedef-TypeNameassociated with the declaration of a true array should be used in the Allocation-TypeNamefield along with the appropriate compound initializer.

[[[00709.htm|prev]]][[[00711.htm|next]]][[[00709.htm|parent]]][[[toc.htm|TOC]]]

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 Initializerexpression for a scalar data item must be coded such that it resolves to a single scalar value. See the section on Scalar-Initializer-ExpressionTypefor 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 M510, the Scalar-TypeNamekeywords should be used instead.

When the Scalar-TypeNamekeywords 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. Scalar-TypeNamesmay only be used as allocation directives in the ALPor M600modes.

To allocate an uninitialized scalar data item, use the Indeterminate-Value- Alias($) in the Initializerfield.

/-----------------------------------------------------------------------\
|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.                              |
\-----------------------------------------------------------------------/

Examples

Here are some examples of scalar initialization:

;   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 


[[[00710.htm|prev]]][[[00712.htm|next]]][[[00709.htm|parent]]][[[toc.htm|TOC]]]

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 RECORD, STRUCT, and UNIONdirectives.

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':
{[Initializer-List] }
<[Initializer-List] >

Initializer-List'
:
Initializer-Item
Initializer-List, [LineBreak] Initializer-Item

Initializer-Item':
[Scalar-Initializer]
[Aggregate-Initializer]
[Array-Initializer]

The syntax requires that an Aggregate-Initializerbe enclosed in an outer set of braces or angle brackets, but the Initializer-Listor individual comma-separated Initializer-Items 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:

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 


[[[00711.htm|prev]]][[[00713.htm|next]]][[[00709.htm|parent]]][[[toc.htm|TOC]]]

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 0to n - 1and 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 Type-Declarationsyntax.''''''''''

The syntax required to initialize a vector is similar to that used for an aggegrate data type, and is as follows:

Array-Initializer':
{[Initializer-List] }
<[Initializer-List] >

Initializer-List'
:
Initializer-Item
Initializer-List, [LineBreak] Initializer-Item

Initializer-Item':
[Scalar-Initializer]
[Aggregate-Initializer]
[Array-Initializer]

The syntax requires that an Array-Initializerbe enclosed in an outer set of braces or angle brackets, but the Initializer-Listor individual comma- separated Initializer-Items 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:

;   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 


[[[00712.htm|prev]]][[[00714.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]

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
END
EXTERN/EXTRN
EXTERNDEF
INCLUDELIB
NAME
PUBLIC

[[[00713.htm|prev]]][[[00715.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]

COMM (Declare Communal Variable)

Declares an uninitialized commonor communalvariable that is allocated by the linker.'

Syntax


COMM   [ Language - Name ]   [ Distance ]   Name [ [ Count ] ] : TypeName [ : Size ]   [ ,   . . . ] 

Remarks

The arguments to the COMMdirective are as follows:

Language-NameOptional parameter that determines how Nameis 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 .MODELor OPTION LANGUAGE.

DistanceOne of NEARor FAR; determines the distance of allocated variable. If not specified, the current memory model determines the distance. The default is NEARif no memory model is active.

NameThe 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 Countparameter can be thought of as a major (row) array dimension. It defaults to 1 if not specified.

TypeNameRequired parameter that specifies the type of the variable being allocated. It must be a single keyword or identifier that specifies a Distance-TypeName, Scalar-TypeName, or UserDefined-TypeName.

Size'Sizeis 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 COMMdirective need not be declared in all referencing modules as communal; the linker matches all EXTERN/EXTRN references with that of the communal variable. Similarly, a variable allocated in one module with the PUBLICdirective may be declared in other modules as communal.

Since communal variables cannot be initialized and their address positions cannot be compared, use of the COMMdirective is discouraged. The EXTERNDEFdirective should be used instead.

[[[00714.htm|prev]]][[[00716.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]

END (Define End of Module and Entry Point)

The ENDdirective has two functions:

�Identifies the end of the source program.
�Identifies the symbol that is the name of the entry point (through the Expressionon the ENDdirective)

Syntax


END   [ Expression ] 

Remarks

All source files must have the ENDdirective as the last statement. Any lines following the ENDstatement 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 ENDstatement. Any module not defining an operating system entry point must not have an entry point identified on its ENDstatement. 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 ENDstatement for the section of code that starts with the name BEGIN.

END   BEGIN 


[[[00715.htm|prev]]][[[00717.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]

EXTERN/EXTRN (Declare External Identifier)

The EXTERNdirective 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


EXTERN   [ Language - Name ]   Name   [ ( Default - Resolution ) ]   : Type   [ ,   . . . ] 

Where Typeis one of:

ABS
Type-Declaration

Remarks

The obsolete spelling for the EXTERNdirective 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 COMMdirective, defining the symbol in association with an EXTERNDEFor PUBLICdirective, or by specifying the PUBLICor EXPORTattributes in a PROCdirective.

If the EXTERNdirective is given within a segment, the assembler assumes that the symbol is located within that segment. If the segment is not known, place the EXTERNdirective outside all segments and either use an explicit segment prefix or an ASSUMEdirective.

A Typevalue of ABSindicates that Nameis an externally-defined constant value. Local references to Nameare treated as immediate values having an Operand Sizeequal to the Address Sizeof the segment containing the reference.

Note:If the Typeof EXTERNis ABS, it may not be used anywhere in this module where conversion to an immediate value of type BYTEis required. Additionally, the defining module must define the value as a constant symbol.

For example:

FOO      EQU      5 
PUBLIC   FOO 

Use of the (default_resolution)syntax declares the external symbol Nameto be a "weak" symbol, in which case the linker will pair all such declarations with the symbol default_resolutionunless a standard "strong" public definition for Nameis encountered during the link.

Example

/-----------------------------------------------------------------------\
|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                         |
\-----------------------------------------------------------------------/


[[[00716.htm|prev]]][[[00718.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]

EXTERNDEF (Declare Global Identifier)

The EXTERNDEFdirective combines the functionality of the EXTERN/EXTRNand PUBLICdirectives. It provides a uniform way to declare global symbols that are to be shared across multiple modules.

Syntax


EXTERNDEF   [ Language - Name ]   Name : Type   [ ,   . . . ] 

Where Typeis one of:

ABS
Type-Declaration

Remarks

A symbol declared with EXTERNDEFis treated as PUBLICif 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 EXTERN/EXTRNdirective.

Example

The following example shows how a declaration for the ReturnCodesymbol can be shared between two modules (Main.asm and FileErr.asm) by way of a common header file (ErrNum.inc):

;   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
;   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 


[[[00717.htm|prev]]][[[00719.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]

INCLUDELIB (Pass Library Name to Linker through Object File)

The INCLUDELIBdirective 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


INCLUDELIB   FileName 

Remarks

The FileNameargument 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 FileNameshould 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 FileNameentry. 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


INCLUDELIB   OS2386 . LIB 


[[[00718.htm|prev]]][[[00720.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]

NAME (Specify Module Name)

The NAMEdirective assigns a module a name.

Syntax


NAME   module - name 

Remarks

The NAMEdirective is ignored; it is provided for backward compatibility with other assemblers.

[[[00719.htm|prev]]][[[00721.htm|next]]][[[00713.htm|parent]]][[[toc.htm|TOC]]]

PUBLIC (Make Symbol Visible to Other Modules)

The PUBLICdirective makes defined symbols available to other programs that are to be linked. The information referred to by the PUBLICdirective is passed to the linker.

Syntax


PUBLIC   [ Language - Name ]   Identifier [ , . . . ] 

Remarks

Identifiercan be a variable or a label (including PROClabels). Register names and any symbols defined by EQUor = to floating-point numbers or integers larger than 4 bytes are incorrect entries.

Example


         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 


[[[00720.htm|prev]]][[[00722.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]

Listing Control

ALP creates an assembler listing of your source file whenever you use a related source code directive or specify the +Floption on the ALP command line.

The assembler listing contains:

�Cumulative Listing Line Number
�Individual Source File Line Number
�Macro Expansion Line Number
�Macro Definition Line Number
�Macro Expansion Indentation Level
�Macro Expansion Nesting Level
�Include File Nesting Level
�Conditional Assembly Nesting Level
�True or False Conditional Flag
�Location Counter Offset Value
�Generated Machine Code Data
�Source Line Data

If requested (via the +Lscommand 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
�Text Equate Names
�Structures/Union Type Names
�Orphaned Structure Fields
�Record Type Names
�Typedef Type Names
�Group Names
�Segment Names
�Numeric Equate Names
�Code Label Names
�Procedure Names
�Variable Names

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 Namessection is omitted from the listing output.

This section describes the following listing control directives:

%BIN
.CREF
.LALL
.LFCOND
.LIST
.LISTALL
.LISTIF
.LISTMACRO
.LISTMACROALL
.NOCREF
.NOLIST
.NOLISTIF
.NOLISTMACRO
PAGE
.SALL
.SFCOND
SUBTITLE
SUBTTL
.TFCOND
TITLE
.XALL
.XCREF
.XLIST

[[[00721.htm|prev]]][[[00723.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

%BIN (Set Listing Width for Object Code Field)

Sets the width of the object code field in the listing file to sizecolumns .

Syntax


% BIN   size 


[[[00722.htm|prev]]][[[00724.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.CREF/.XCREF (Control Symbol Cross Referencing)

The output of the cross-reference information is controlled by these directives. The default condition is the .CREFdirective. When the assembler finds a .XCREFdirective, 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


. CREF 
    or 
. XCREF   [ [ operand   [ , . . . ] ] 

Remarks

The .XCREFdirective can have an optional operand consisting of a list of one or more variable names suppressed in the cross-reference listing.

[[[00723.htm|prev]]][[[00725.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.LFCOND (List False Conditionals)

You use the .LFCOND(List False Conditionals) directive to list conditional blocks that are evaluated as false.

Syntax


. LFCOND 

Remarks

Equivalent to the .LISTIFdirective.

.LFCONDdoes 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 .LALLis set.

[[[00724.htm|prev]]][[[00726.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.LIST/.XLIST (Control Listing File Output)

These two directives control output to the listing file.

Syntax


. LIST 
    or 
. XLIST 

Remarks

If a listing is not being created, these directives have no effect. The . LISTis the default condition. When the assembler finds an .XLIST, the assembler does not list the source and the object code until it finds a . LISTdirective.

[[[00725.htm|prev]]][[[00727.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.LISTALL (List All Statements)

Starts the listing of all statements.

Syntax


. LISTALL 

Remarks

Equivalent to the combination of .LIST, .LISTIF, and .LISTMACROALL.

[[[00726.htm|prev]]][[[00728.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.LISTIF (List False Conditionals)

Starts the listing of all statements, including those in false conditional blocks.

Syntax


. LISTIF 

Remarks

Equivalent to the combination of .LIST, .LISTIF, and .LISTMACROALL.

[[[00727.htm|prev]]][[[00729.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.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


. LISTMACRO 
    or 
. XALL 

Remarks

ALP does not support this mode; it is provided for compatibility with other assemblers.

[[[00728.htm|prev]]][[[00730.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.LISTMACROALL/.LALL (List All Statements in Macros)

Starts listing of all statements when processing macros expansions.

Syntax


. LISTMACROALL 
    or 
. LALL 


[[[00729.htm|prev]]][[[00731.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.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


. NOCREF   [ name [ , name ] . . . ] 

Remarks

If names are specified, only the given names are suppressed. Same as .XCREF .

[[[00730.htm|prev]]][[[00732.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.NOLIST (Suppress List Output)

Suppresses program listing.

Syntax


. NOLIST 

Remarks

Same as .XLIST.

[[[00731.htm|prev]]][[[00733.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.NOLISTIF (Do Not List False Conditionals)

Suppresses listing of conditional blocks whose condition evaluates to false (0).

Syntax


. NOLISTIF 

Remarks

This is the default. Same as .SFCOND.

[[[00732.htm|prev]]][[[00734.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.NOLISTMACRO (Do Not List Macro Expansions)

Suppresses listing of macro expansion.

Syntax


. NOLISTMACRO 

Remarks

Same as .SALL.

This is the default setting for ALP.

[[[00733.htm|prev]]][[[00735.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

PAGE (Control Listing Page Length and Width)

The PAGE directive controls the length and width of each listing page. Place the PAGEdirective in the source file to control the format of the listing file produced during assembly.

Syntax


PAGE   [ operand - 1 ] [ , operand - 2 ] 
    or 
PAGE   + 

Remarks

Using PAGE+ or the PAGEdirective 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-1entry specifies the actual number of lines that can be physically printed on the page; the default value is 66.

Use the operand-2entry to control the width of the page. The page width without a specified number is 132.

Note:The PAGEdirective 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.

[[[00734.htm|prev]]][[[00736.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

SUBTITLE/SUBTTL (Specify Listing Page Subtitle)

Defines the subtitle displayed in the user area of each page in the listing output.

Syntax


SUBTITLE   text 
    or 
SUBTTL   text 


[[[00735.htm|prev]]][[[00737.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

.TFCOND (Toggle Listing of False Conditionals)

Toggles listing of false conditional blocks.

Syntax


. TFCOND 


[[[00736.htm|prev]]][[[00738.htm|next]]][[[00721.htm|parent]]][[[toc.htm|TOC]]]

TITLE (Specify Listing Page Title)

Defines the title displayed in the user area of each page in the listing output.

Syntax


TITLE   text 


[[[00737.htm|prev]]][[[00739.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]

Procedure Control

Procedure control directives allow you to organize your code into procedures. The PROCand ENDPdirectives mark the beginning and end of a procedure. Also, PROCcan automatically:

�Preserve higher register values that should not change but that the procedure might otherwise alter
�Set up a local stack pointer, so that you can access parameters and local variables placed on the stack
�Adjust the stack when the procedure ends

This section describes the following procedure control directives:

PROC
LOCAL
ENDP

[[[00738.htm|prev]]][[[00740.htm|next]]][[[00738.htm|parent]]][[[toc.htm|TOC]]]

PROC (Identify Code Procedure)

The PROCdirective 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 PROCdirective also identifies the procedure distanceto 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


Procedure - Name   PROC   [ Attributes ]   [ Register - List ]   [ Parameter - List ] 
    . 
    . 
    . 
RET   [ Constant ] 
    . 
    . 
    . 
Procedure - Name   ENDP 


Refer to the following sections for descriptions of the optional arguments to the PROCdirective:

Attributes
Register-List
Parameter-List

Remarks

You can execute the block of code identified by the PROCdirective in-line, jump to it, or start it with a CALLinstruction. If the PROCis called from code that has another ASSUME CSvalue, you must use the appropriate FAR, FAR16, or FAR32distance attribute.

The NEARattribute causes any RETinstruction coded within the procedure to be an intra-segment return that pops a return offsetfrom the stack. You can call a NEARsubroutine only from the same segment. However, the FAR attribute causes RETto be an inter-segment return that pops both a return offsetand a segment basefrom the stack. You can call a FARsubroutine from any segment; a FARsubroutine is usually called from a segment other than the one containing the subroutine.''''

Example

In this example, the Near_Namesubroutine is called by the Far_Name subroutine.

           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 

You can call the Near_Namesubroutine directly from a NEARsegment by using :

CALL   Near _ Name 

A FARsegment can indirectly call the second subroutine by first calling the Far_Namesubroutine with:

CALL   Far _ Name 

A CALLto a forward-referenced symbol assumes the symbol is NEAR. If that symbol is FAR, the CALLmust have an override, for example:

CALL   FAR   PTR   Forward _ Reference 


[[[00739.htm|prev]]][[[00741.htm|next]]][[[00739.htm|parent]]][[[toc.htm|TOC]]]

Attributes

The optional fields in the Attributesargument control how the procedure is defined.

Syntax


[ Distance ]   [ Language ]   [ Visibility ] 

Remarks

The various Attributefields are defined as follows:

DistanceDetermines the type of CALLinstruction that should be used to invoke the procedure, and the type of RETinstruction generated by the assembler. The default is NEARif no .MODELdirective has been specified, or if the model has been set to TINY, SMALL, COMPACT, or FLAT. The default is FARif the model has been set to LARGE, MEDIUM, or HUGE. If the programmer is using segments with mixed address sizes (USE16and USE32) on a 32-bit processor, then the NEAR16, FAR16, NEAR32, and FAR32keywords may also be used.

LanguageDetermines 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 LabelNamesfor more information on language naming conventions.

With the BASIC, FORTRAN, and PASCALcalling 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'''Constantinstruction when the procedure exits. Such procedures are unable to accept a variable number of arguments.

With the C, STDCALL, SYSCALL, and OPTLINKcalling 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 (STDCALLrequires the called procedure to restore the stack if a fixed number of arguments is being passed).

With the OPTLINK32-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 OPTLINKcalling convention.

VisibilityDetermines 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 M510 mode and no .MODELdirective with a Language-Namehas been specified, then the default visibility is PRIVATE. In all other situations, the default visibility is PUBLICunless the default has been overridden by an OPTION LANGUAGEdirective.

When the PRIVATEkeyword 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 EXPORTvisibility, 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.

[[[00740.htm|prev]]][[[00742.htm|next]]][[[00739.htm|parent]]][[[toc.htm|TOC]]]

Register List

The optional Register-Listdefines 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


USES   Register   [   Register . . . ] 

Register:
16-Bit-Register
32-Bit-Register
Segment-Register

Remarks

When more than one register is specified, do not use commas to separate the register keywords; use blanks or tabs instead.

[[[00741.htm|prev]]][[[00743.htm|next]]][[[00739.htm|parent]]][[[toc.htm|TOC]]]

Parameter List

The optional Parameter-Listdefines the parameters that the caller passes to the procedure on the run-time stack.

Syntax


[ ,   [ LineBreak ] ]   Parm - List 

Parm-List:
Parm-Spec[, [LineBreak] Parm-Spec...]

Parm-Spec:
Parameter-Name[:Type]

The introductory comma in front of the Parm-Listis only required if a LineBreakis used to put the first Parm-Specon the line following the PROC directive.

The optional LineBreakentry allows you to end a Parm-Specentry with a comma, enter an optional EndOfLine-Commentfollowed by a physical NewLine character, then continue the Parm-Liston the next line.

Remarks

Each Parameter-Nameis defined as a Numeric-EquateNamethat 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 Typefield is specified as a Type-Declarationand defines the data type associated with the Parameter-Name. If this field is omitted, the data type defaults to WORDif the procedure is defined within a USE16segment, and DWORDif the procedure is defined within a USE32segment.

The programmer can read from and store into the locations defined by the Parm-Specentries 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 ReadBufferprocedure to accept four arguments passed on the stack.

         . 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 


[[[00742.htm|prev]]][[[00744.htm|next]]][[[00738.htm|parent]]][[[toc.htm|TOC]]]

LOCAL (Define Local Procedure Variables)

The LOCALdirective defines local stack variables from within a code procedure.

Syntax


LOCAL   Local - Spec   [ ,   [ LineBreak ]   Local - Spec   . . . ] 

Local-Spec:
Local-Name[:Type-Declaration]
Local-Name[Count][:Type-Declaration]

The optional LineBreakentry allows you to end a Local-Specentry with a comma, enter an optional EndOfLine-Commentfollowed by a physical NewLine character, then continue with a new Local-Specon the next line.

Remarks

The LOCALassembler directive can only appear within the body of a procedure. If used, the LOCALdirective(s) must immediately follow the PROCstatement that encloses them, and they must appear before any instructions, code labels, or directives that modify the location counter. Multiple LOCALdirectives may appear in succession.

Each Local-Nameis defined as a Numeric-EquateNamethat 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- Specentries 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 Countis a constant expression. If used, the square brackets surrounding the Countmust 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 Type-Declarationsyntax.

The Type-Declarationfield 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 USE16segment, and DWORDif the procedure is defined within a USE32segment.

Example

;   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 


[[[00743.htm|prev]]][[[00745.htm|next]]][[[00738.htm|parent]]][[[toc.htm|TOC]]]

ENDP (Close a Procedure Definition Block)

Every procedure block opened with the PROCdirective must be ended with the ENDPdirective.

Syntax


procedure - name   ENDP 

Remarks

If the ENDPdirective is not used with the PROCdirective, an error occurs. An unmatched ENDPalso causes an error.


Note:See the PROCdirective in this chapter for more detail and examples of ENDPuse.

Example


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 

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.

[[[00744.htm|prev]]][[[00746.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]

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
.8087
.186
.286
.286P
.287
.386
.386P
.387
.486
.486P
.586
.586P
.686
.686P
.MMX
.NOMMX

[[[00745.htm|prev]]][[[00747.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.8086 (Select 8086 Processor Instruction Set)

The .8086directive 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


. 8086 

Remarks

The .8086directive does not have an operand.

Note:The .8086directive does not end ALP 8087/80287 mode.

[[[00746.htm|prev]]][[[00748.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.8087 (Select 8087 Coprocessor Instruction Set)

The .8087directive tells the assembler to recognize and assemble 8087 instructions and data formats. ALP assembles 8087 instructions by default.

Syntax


. 8087 

Remarks

The .8087directive does not have an operand.

[[[00747.htm|prev]]][[[00749.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.186 (Select 80186 Processor Instruction Set)

The .186directive tells the assembler to recognize and assemble 8086 or 8088 instructions and the additional instructions for the 80186 microprocessor.

Syntax


. 186 

Remarks

The .186directive does not have an operand. Use it only for programs that run on an 80186 microprocessor.

[[[00748.htm|prev]]][[[00750.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.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

. 286 


[[[00749.htm|prev]]][[[00751.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.286P (Select 80286 Processor Protected Mode Instruction Set)

The .286Pdirective tells the assembler to recognize and assemble the protected instructions of the 80286 in addition to the 8086, 8088, and nonprotected 80286 instructions.

Syntax


. 286P 

Remarks

The .286Pdirective does not have an operand. Use it only for programs run on an 80286 processor using both protected and nonprotected instructions.

[[[00750.htm|prev]]][[[00752.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.287 (Select 80287 Coprocessor Instruction Set)

The .287directive 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


. 287 

Remarks

The .287directive does not have an operand. Use it only for programs that have 80287 floating point instructions and run on an 80287 math coprocessor .

[[[00751.htm|prev]]][[[00753.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.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


. 386 


[[[00752.htm|prev]]][[[00754.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.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


. 386P 


[[[00753.htm|prev]]][[[00755.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.387 (Select 80387 Coprocessor Instruction Set)

Enables assembly of instructions for the 80387 coprocessor.

Syntax


. 387 


[[[00754.htm|prev]]][[[00756.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.486 (Select 80486 Processor Instruction Set)

Enables assembly of instructions for the 80486 processor. Also enables 80387 (and later) floating point instructions.

Syntax


. 486 

Remarks

The .486directive is not available in M510mode.

[[[00755.htm|prev]]][[[00757.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.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


. 486P 

Remarks

The .486Pdirective is not available in M510mode.

[[[00756.htm|prev]]][[[00758.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.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


. 586 

Remarks

The .586directive is not available in M510mode or M600mode.

[[[00757.htm|prev]]][[[00759.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.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


. 586P 

Remarks

The .586Pdirective is not available in M510mode or M600mode.

[[[00758.htm|prev]]][[[00760.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.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


. 686 

Remarks

The .686directive is not available in M510mode or M600mode.

[[[00759.htm|prev]]][[[00761.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.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


. 686P 

Remarks

The .686Pdirective is not available in M510mode or M600mode.

[[[00760.htm|prev]]][[[00762.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.MMX (Select MMX Processor Instruction Set Extensions)

Enables recognition of mnenomics for the MMX instruction set extensions.

Syntax


. MMX 

Remarks

If 586 mnemonics (or later) are not already being recognized, the .MMX directive also causes an implicit .586directive 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 .NOMMXdirective.

The .MMXdirective is not available in M510mode or M600mode.

[[[00761.htm|prev]]][[[00763.htm|next]]][[[00745.htm|parent]]][[[toc.htm|TOC]]]

.NOMMX (Deselect MMX Processor Instruction Set Extensions)

Disables recognition of mnenomics for the MMX instruction set extensions.

Syntax


. NOMMX 

Remarks

Does not affect recognition of instruction mnemonics for the currently selected primary processor; it only disables recognition of the MMX mnemonics.

The .NOMMXdirective is not available in M510mode or M600mode.

Example

;   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 


[[[00762.htm|prev]]][[[00764.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]

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
.CODE
.CONST
.DATA
.DATA?
DOSSEG
.DOSSEG
ENDS
EVEN
.FARDATA
.FARDATA?
GROUP
.MODEL
ORG
SEGMENT
.SEQ
.STACK

[[[00763.htm|prev]]][[[00765.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

ALIGN (Align Code or Data Item)

Advances the current location counter to the next byte boundary that is a multiple of Expression.

Syntax


ALIGN   Expression 

Example

To align to a 2-byte boundary:

ALIGN   2 

To align to a 4-byte boundary:

ALIGN   4 


[[[00764.htm|prev]]][[[00766.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

.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 .CODEdirective may only be used if previous .MODEL directive has been processed.

Syntax


. CODE   [ SegmentName ] 

Remarks

When the SegmentNameparameter is omitted from the .CODEdirective, the assembler generates a default code segment whose name is determined by the memory model as follows:

'Memory Model'Value for @code
TINY _TEXT
SMALL _TEXT
MEDIUM module_TEXT
COMPACT_TEXT
LARGE module_TEXT
HUGE module_TEXT
FLAT CODE32

The moduleentry is replaced with base file name of the top-level module being assembled.

When operating in M510mode, the SegmentNameparameter may only be specified for those memory models that allow multiple code segments (MEDIUM , LARGE, and HUGE), and the value of the @codesymbol is not altered from the default. For other modes of operation, the SegmentNameparameter is allowed for any model other than TINY, and the @codesymbol is updated to reflect the SegmentNamevalue.

[[[00765.htm|prev]]][[[00767.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

.CONST (Opens Default Constant Data Segment)

When used with .MODEL, starts a constant data segment for initialized read- only data.

Syntax


. CONST 

Remarks

The name of the segment is CONST32 in flat model, and CONST for all other models.

[[[00766.htm|prev]]][[[00768.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

.DATA (Opens Default Data Segment)

When used with .MODEL, starts a near data segment for initialized data.

Syntax


. DATA 

Remarks

The name of the segment is DATA32 in flat model, and _DATA for all other models.

[[[00767.htm|prev]]][[[00769.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

.DATA? (Opens Default Uninitialized Data Segment)

When used with .MODEL, starts a near data segment for uninitialized data.

Syntax


. DATA ? 

Remarks

The name of the segment is BSS32 in flat model, and _BSS for all other models.

[[[00768.htm|prev]]][[[00770.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

.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
2.BSS segments
3.STACK segments

Syntax


. DOSSEG   ( preferred   form ) 
    or 
DOSSEG 

Remarks

.DOSSEGis the preferred form.

Use of this directive allows the linker to control the segment ordering according to conventions used in many high-level languages.

[[[00769.htm|prev]]][[[00771.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

ENDS (Close a Segment, Structure, or Union Declaration)

Closes a program segment opened with SEGMENTdirective, or ends a structure or union definition opened with the STRUCTor UNIONdirectives. Every SEGMENT, STRUCT, and UNIONdirective must end with a corresponding ENDS directive.

Syntax


Segment - Name   ENDS 
    or 
Structure - Name   ENDS 
    or 
Union - Name   ENDS 

Remarks

If the ENDSdirective is not used with the corresponding SEGMENT, STRUCT, or UNIONdirective, an error occurs. An unmatched ENDSalso causes an error.


Note:See the SEGMENT, STRUCT, and UNIONdirectives for more details and examples of the use of ENDS.

Example


CONST      SEGMENT      word   public   ' CONST ' 
SEG1       DW           ARRAY _ DATA 
SEG2       DW           MESSAGE _ DATA 
CONST      ENDS 


[[[00770.htm|prev]]][[[00772.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

EVEN (Align Code or Data Item on an Even Boundary)

The EVENdirective 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


EVEN 

Remarks

If the program counter is not already at an even boundary, EVENcauses the assembler to add a NOP(no operation) instruction so that the counter reaches an even boundary. An error message occurs if EVENis used with a byte-aligned segment. If the program counter is already at an even boundary, EVENdoes nothing.

Example

Before: PC points to 0019 hex (25 decimal).


EVEN 

After: PC points to 001A hex (26 decimal).

[[[00771.htm|prev]]][[[00773.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

.FARDATA (Opens Default or Named Far Data Segment)

When used with .MODEL, starts a far data segment for initialized data.

Syntax


. FARDATA   [ SegmentName ] 

Remarks

If the SegmentNameparameter is not specified, the assembler sets it to FAR _DATA.

[[[00772.htm|prev]]][[[00774.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

.FARDATA? (Opens Default or Named Uninitialized Far Data Segment)

When used with .MODEL, starts a far data segment for uninitialized data.

Syntax


. FARDATA ?   [ SegmentName ] 

Remarks

If the SegmentNameparameter is not specified, the assembler sets it to FAR _BSS.

[[[00773.htm|prev]]][[[00775.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

GROUP (Treat Multiple Segments as a Single Unit)

The GROUPdirective associates a group Namewith 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


Name   GROUP   Segment - Name   [ , . . . ] 

Remarks

Each Segment-Nameentry must be a unique segment name assigned by the SEGMENTdirective. A Segment-Nameentry may be a forward reference to a subsequently declared segment name.

An additional occurrence of a given group Namein a subsequent GROUP directive does not constitute a redefinition, but instead the effect is cumulative. The group Nameitself is declared the first time it appears in a GROUPdirective, 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 ASSUMEdirective and as an operand prefix with the segment override operation (:).

Example

The following example shows how to use the GROUPdirective to combine segments:

In Module A:

CGROUP     GROUP      XXX , YYY 
XXX        SEGMENT 
          ASSUME     CS : CGROUP 
          . 
          . 
          . 
XXX        ENDS 
YYY        SEGMENT 
          ASSUME     CS : CGROUP 
          . 
          . 
          . 
YYY        ENDS 

In Module B:

CGROUP     GROUP      ZZZ 
ZZZ        SEGMENT 
          ASSUME     CS : CGROUP 
          . 
          . 
          . 
ZZZ        ENDS 

The next example shows how to set DSwith the paragraph number of the group called DGROUP.

As immediate:

MOV        AX , DGROUP 
MOV        DS , AX 

In assume:

ASSUME      DS : DGROUP 

As an operand prefix:

MOV      BX , OFFSET   DGROUP : FOO 
DW       FOO 
DW       DGROUP : FOO 

Note:

1.DW FOOreturns the offset of the symbol within its segment.

2.DW DGROUP:FOOreturns the offset of the symbol within the group.

The next example shows how you can use the GROUPdirective to create a .COM file type.

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 


[[[00774.htm|prev]]][[[00776.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

.MODEL (Define Program Memory Segmentation Model)

The .MODELdirective 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


. MODEL   Memory - Model [ , Language - Type ] [ , OS - Type ] [ , Stack - Distance ] 

Memory-Model:
TINY
SMALL
COMPACT
MEDIUM
LARGE
HUGE
FLAT

Language-Type:
BASIC
C
FORTRAN
OPTLINK
PASCAL
STDCALL
SYSCALL

OS-Type:
OS_DOS
OS_OS2

Stack-Distance:
FARSTACK
NEARSTACK

Remarks

The .MODELdirective should be placed at the top of the file, after any processor controldirectives, but before any of the following simplified segmentation directives are encountered:

.CODE
.CONST
.DATA
.DATA?
.FARDATA
.FARDATA?
.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-Modelargument.


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.

/------------------------------------------------------------\
|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      |
\------------------------------------------------------------/

The assembler creates the default code and data segments, then automatically generates an ASSUMECS:@codeand an ASSUMEDS:@datastatement 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 PROCdirective for a detailed explanation of the effects of the Language-Typesetting.


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 NEARSTACKparameter 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 ASSUMESS:@datastatement when a near stack is used.

The FARSTACKparameter 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 ASSUMESS:STACK when this keyword is used.

[[[00775.htm|prev]]][[[00777.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

ORG (Adjust Segment Location Counter)

The ORGdirective sets the location counter to the value of Expression. Subsequent instructions are generated beginning at this new location.

Syntax


ORG   Expression 

Remarks

The assembler must know all names used in Expressionon pass 1, and the value must be either absolute or in the same segment as the location counter.

The numeric value of Expressionmust 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


ORG      120H 
ORG      $ + 2       ; SKIP   NEXT   2   BYTES 

To conditionally skip to the next 256-byte boundary:

CSEG      SEGMENT      PAGE 
BEGIN     =            $ 
         . 
         . 
         . 
         IF   ( $ - BEGIN )   MOD   256 
; IF   NOT   ALREADY   ON   256   BYTE   BOUNDARY 
         ORG   ( $ - BEGIN ) + 256 - ( ( $ - BEGIN )   MOD   256 ) 
         ENDIF 


[[[00776.htm|prev]]][[[00778.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

SEGMENT (Open a Program Information Segment)

Defines or reopens a segment called Segment-Namewhich will contain all subsequently emitted code or data.

Syntax


Segment - Name   SEGMENT   [ align ] [ combine ] [ use ] [ ' class ' ] 

Remarks

A segment definition may be followed by zero or more segment attributes, at most one from each of the following selections:

alignInstructs the linker to align the segment at the next alignboundary. One of:

BYTEThe next 8-bit boundary.
DWORDThe next 32-bit boundary.
PAGEThe next 256-byte boundary (4096 under 32-bit OS/2).
PARAThe next 16-byte boundary (default).
WORDThe next 16-bit boundary.

combineControls how the linker will combine this segment with identically- named segments from other modules. One of:

ATaddressLocates the segment at the absolute paragraph given by address.
COMMONUnioned with segments from other modules.
PRIVATEWill not be combined with other segments (default).
PUBLICConcatenated to segments from other modules.
STACKConcatenated to segments from other modules. At load time:

SS=beginning of segment
SS:(E)SP=end of segment

useWord size of the segment.

USE16The segment will have a 16-bit word size.
USE32The segment will have a 32-bit word size.

classInstructs the linker to order segments according to the class name given by class. Segments will not be combined if their class names differ.

[[[00777.htm|prev]]][[[00779.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

.SEQ (Specifies Sequential Segment Ordering)

Orders segments sequentially (the default order).

Syntax


. SEQ 


[[[00778.htm|prev]]][[[00780.htm|next]]][[[00763.htm|parent]]][[[toc.htm|TOC]]]

.STACK (Defines Default Stack Segment With Optional Size)

When used with .MODEL, defines a stack segment with the segment name STACK. The optional Sizespecifies the number of bytes for the stack (default 1024 ).

Syntax


. STACK   [ Size ] 

Remarks

The .STACKdirective 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.

[[[00779.htm|prev]]][[[00781.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]

Type Definition

Type definition directives allow the creation of user-defined data types.

This section describes the following type definition directives:

RECORD
STRUCT/STRUC
TYPEDEF
UNION

[[[00780.htm|prev]]][[[00782.htm|next]]][[[00780.htm|parent]]][[[toc.htm|TOC]]]

RECORD (Define a Record Type Name)

A record is a bit pattern you define to format bytes, words, or dwords for bit-packing. The RecordNamebecomes a Record-TypeNamethat can be used create record variables.

Syntax


RecordName   RECORD   FieldDeclaration   [ ,   [ LineBreak ]   FieldDeclaration   . . . ] 

Where FieldDeclarationhas the following form:

FieldName : Width [   =   InitialValue ] 

The optional LineBreakentry allows you to end a FieldDeclarationwith a comma, enter an optional EndOfLine-Commentfollowed by a physical NewLine character, then continue the record definition on the next line.

Remarks

The RecordNameand FieldNameentries are unique globally-scoped Identifiers that must be specified. Upon successful processing of the RECORD definition, the RecordNameentry is converted to a Record-TypeName, and all FieldNamesare converted to Record-FieldNames.

Each Widthentry in a FieldDeclarationis specified as an Expressionwhich must evaluate to an Absolute-ExpressionType. The cumulative value of all Widthentries becomes the total RecordWidthand must not exceed 32, the size of a DWORD, the maximum size for a Record-TypeName. The Operand Size of the record becomes 1 (BYTE) if the RecordWidthis from 1 through 8, 2 ( WORD) if the RecordWidthis from 9 through 16, and 4 (DWORD) if the RecordWidthis from 17 through 32. Any other value causes an error. If the total number of bits in the RecordWidthis not evenly divisible by the Operand Size, the assembler right-justifies the fields into the least- significant bit positions of the record.

When a Record-FieldNameis referenced in an expression, the value returned is the shift value required to access the field. The WIDTHoperator is used on the Record-FieldNameto return the width of the field in bits, and the MASKoperator is used to obtain the value necessary for isolating the field within the record.

The InitialValueentry 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:

[ Identifier ]   Record - TypeName   Expression   [ ,   Expression   . . . ] 

The Identifierentry is an optional name for the first byte, word, or dword of the reserved memory. The Record-TypeNamedefines the format and default field values, and is the RecordNameyou assigned to the record in the RECORDdirective.

At least one Expressionentry must be specified; additional entries are optional. The Expressionmust resolve to a Compound-ExpressionType, which may also be be duplicated by specifying it as a sub-expression of a Duplicated-ExpressionType. Each Compound-ExpressionTyperepresents a single allocated record entry; each explicit sub-expression of the Compound -ExpressionTyperepresents a field value which overrides the default InitialValuefor the field given in the record definition.

Example

Define the record fields; begin with the most significant fields first:

MODULE   RECORD   R : 7 ,       ;   First   field .    " ,   LineBreak "   syntax 
                E : 4 ,       ;   may   be   used   to   split   RECORD 
                D : 5        ;   definition   across   multiple   lines 

Fields are 7 bits, 4 bits, and 5 bits; the assembler gives no default value . Most significant byte first, this looks like:

RRRR   RRRE   EEED   DDDD 

To reserve its memory:

STG _ FLD     MODULE      < 7 , , 2 >     ;   Initializer   is   a   Compound - ExpressionType 

This defines R=7 and D=2 and leaves E unknown; it produces 2 bytes, the least significant byte first:

02   0E 

Define the record fields:

AREA     RECORD     FLA : 8 = ' A ' , FLB : 8 = ' B ' 

To reserve its memory:

CHAR _ FLD     AREA   < , ' P ' > 

This defines FLA='A' (the default) and changes FLB='P'.

To use a field in the record:

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 


[[[00781.htm|prev]]][[[00783.htm|next]]][[[00780.htm|parent]]][[[toc.htm|TOC]]]

STRUCT/STRUC (Define a Structure Type Name)

Defines a Structure-TypeNamethat represents an aggregatedata type containing one or more fields.

Syntax


Structure - Name   STRUCT 
   FieldDeclaration 
    . 
    . 
    . 
Structure - Name   ENDS 

Where FieldDeclarationhas the following form:

[ FieldName ]   Allocation - TypeName   InitialValue   [ ,   InitialValue   . . . ] 

Remarks

The obsolete spelling for the STRUCTdirective is STRUC.

The syntax for the FieldDeclarationis that of a normal data allocation statement. See the section on Data Allocationfor a full description of this syntax.

The various parts of the FieldDeclarationare described as follows:

FieldNameEach FieldNameentry is converted to Structure-FieldNamewhen processing of the structure definition is complete. If this field is omitted and the Allocation-TypeNameresolves to a Structure-TypeNameor Union-TypeName, then all of the fields defined within the imbedded structure or union are promotedto be visible at the same level as other FieldNameentries in the current structure given by the Structure-Name.''''

Allocation-TypeNameThe allowable values for this field are described in detail in the Data Allocationsection. In modes other than M510, the assembler accepts imbedded occurrences of other structures or unions by specifying an identifier that resolves to a Structure-TypeNameor Union- TypeNamein this field.

InitialValueThe InitialValuefield must be an Expressionthat resolves to an ExpressionTypeappropriate for the Allocation-TypeNameutilized in the FieldDeclaration. The InitialValueexpressions 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 Structure-TypeNamecalled Numbers:

   Numbers     STRUCT 
     One         DB       0 
     Two         WORD     0 
                BYTE     3 
     Four        DWORD    ? 
   Numbers     ENDS 

Allocate a structure variable called Valuesusing the NumbersStructure- TypeName, overriding the One, Two,and FourStructure-FieldNameentries with explicit values, and the third (unnamed) entry is initialized with the default InitialValueinherited from the FieldDeclaration:

   Values   Numbers   < 1 ,   2 ,   ,   4 > 


[[[00782.htm|prev]]][[[00784.htm|next]]][[[00780.htm|parent]]][[[toc.htm|TOC]]]

TYPEDEF (Create a User-Defined Type Name)

Defines a Typedef-TypeNamethat is an alias for another type declaration.

Syntax


TypeName   TYPEDEF   Type - Declaration 


Remarks

The TypeNameentry is a unique globally-scoped Identifierthat must be specified. Upon successful processing of the TYPEDEFdirective, the TypeNameentry is converted to a Typedef-TypeNamewhich can then be used in expressions or as a directive in data allocation statements.

The TYPEDEFdirective can be used to create a direct alias for another intrinsic type (a Scalar-TypeName, Record-TypeName, Structure-TypeName, Union-TypeName, or other Typedef-TypeName), a pointer to another type, or it can be used to create vector types (arrays).

Examples

The following are examples of TYPEDEFusage:

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 


[[[00783.htm|prev]]][[[00785.htm|next]]][[[00780.htm|parent]]][[[toc.htm|TOC]]]

UNION (Define a Union Type Name)

Defines a Union-TypeNamethat represents an aggregatedata type containing one or more fields. All of the fields occupy the same physical position in storage.

Syntax


Union - Name   UNION 
   FieldDeclaration 
    . 
    . 
    . 
Union - Name   ENDS 

Where FieldDeclarationhas the following form:

[ FieldName ]   Allocation - TypeName   InitialValue   [ ,   InitialValue   . . . ] 

Remarks

This directive is not available in M510mode.

The syntax for the FieldDeclarationis that of a normal data allocation statement. See the section on Data Allocationfor a full description of this syntax.

The various parts of the FieldDeclarationare described as follows:

FieldNameEach FieldNameentry is converted to Union-FieldNamewhen processing of the union definition is complete. If this field is omitted and the Allocation-TypeNameresolves to a Structure-TypeNameor Union- TypeName, then all of the fields defined within the imbedded structure or union are promotedto be visible at the same level as other FieldName entries in the current union given by the Union-Name.''''

Allocation-TypeNameThe allowable values for this field are described in detail in the Data Allocationsection. The assembler accepts imbedded occurrences of other structures or unions by specifying an identifier that resolves to a Structure-TypeNameor Union-TypeNamein this field.

InitialValueThe InitialValuefield must be an Expressionthat resolves to an ExpressionTypeappropriate for the Allocation-TypeNameutilized in the FieldDeclaration. Only the InitialValueexpression 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

           . 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 


[[[00784.htm|prev]]][[[00786.htm|next]]][[[00701.htm|parent]]][[[toc.htm|TOC]]]

Miscellaneous

This section describes the following miscellaneous directives:

=
.ABORT
ASSUME
EQU
LABEL
OPTION
.RADIX

[[[00785.htm|prev]]][[[00787.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]

= (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


Name   =   Expression 

Remarks

The =directive is similar to the EQUassembler directive except you can redefine Namewithout causing an error condition. However, the = directive is more restrictive about the allowable ExpressionTypesthat can be utilized in the Expressionfield, and it cannot be used to create Text- EquateNames.

Nameis a globally-scoped Identifier. The Expressionentry must evaluate to an Operand-ExpressionType. If an evaluation error occurs, or if the Expressionreferences an external identifier, or if the Expression evaluates to one of the following Operand-ExpressionTypes':

Indexed-ExpressionType
Register-ExpressionType
Floating-Point-ExpressionType
Compound-ExpressionType
Duplicated-ExpressionType

then an error message is issued and the assignment does not take place. Otherwise, the Identifieris converted to a Numeric-EquateName.

See also the EQUassembler directive and the EQUpreprocessor directive.

Example


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 


Note:The Expression-Attributesinherited from the Expressionduring an assignment are not retained in subsequent assignments. For example:

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 


[[[00786.htm|prev]]][[[00788.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]

.ABORT (Terminate the Assembly)

Terminates the assembly at the point where the .ABORTdirective is encountered. The remainder of the input stream is not read.

Syntax


. ABORT 

Remarks

The .ABORTdirective is only available in ALPmode

[[[00787.htm|prev]]][[[00789.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]

ASSUME (Inform Assembler of Register Contents)

The ASSUMEdirective 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


ASSUME   Association   [ ,   Association   . . . ] 

Association:
Segment-Register-Assocation
General-Purpose-Register-Assocation
NOTHING

Segment-Register-Association:
Segment-Register: Expression
Segment-Register:
NOTHING

General-Purpose-Register-Association:
General-Purpose-Register: Type-Declaration
General-Purpose-Register:
NOTHING

Remarks

If the NOTHINGkeyword is specified for the Associationfield, all register associations are cancelled.

If the NOTHINGkeyword is specified for a particular Segment-Registeror General-Purpose-Register, only the association for that register is cancelled.

The following sections describe the two types of register associations:

Segment-Register-Association

General-Purpose-Register-Association

[[[00788.htm|prev]]][[[00790.htm|next]]][[[00788.htm|parent]]][[[toc.htm|TOC]]]

Segment Register Association

A Segment-Register-Associationestablishes an assembly-time association between a Segment-Registerand an expression that resolves to a GroupName or 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 ASSUMEdirective is used to describe this association, the assembler has no way of knowing whichsegment 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 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 ASSUMEdirective 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 ASSUMEassociation, then you should reflect the change with a new ASSUMEstatement, or cancel the association with an ASSUME xS:NOTHINGconstruct.

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 Referencedirective is utilized and the program is designed to follow the conventions that it establishes, the ASSUMEdirective is no longer needed in most cases.

Example


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 

Warning:

If an ASSUME CS:Expressionis placed before the code segment it is referencing, the assembler will ignore the ASSUME. The ASSUME CS:Expressionstatement must follow the SEGMENTdefinition statement of the code segment it is referencing.

The ASSUMEstatement for the CSregister should be placed immediately following the code SEGMENTstatement, before any labels are defined in that code segment.

[[[00789.htm|prev]]][[[00791.htm|next]]][[[00788.htm|parent]]][[[toc.htm|TOC]]]

General-Purpose Register Association

A General-Purpose-Register-Associationestablishes an assembly-time association between a General-Purpose-Registerand a 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 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:

     ASSUME   EBX : BYTE            ;   Error ,   EBX   is   a   DWORD   register 

The most useful situation is for the register to contain a pointer to another data type. In this situation, the Indirection ([] Operator)may be used store or retrieve data through the register without the need for an explicit conversion operation:

     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 

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:

     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 

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:

     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 . 

[[[00790.htm|prev]]][[[00792.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]

EQU (Assign an Expression to a Symbolic Constant)

The EQUdirective assigns the value of Expressionto Name.

Syntax


Name   EQU   Expression 

Remarks

If Namehas already been defined as a Numeric-EquateNameand its currently assigned value differs from the value given by Expression, an error message is produced. Unlike symbols created with the = (equal sign) directive, symbols created with the EQUdirective cannot be redefined with different values.

The Expressionentry must evaluate to an Operand-ExpressionType. If an evaluation error occurs or if the Expressionevaluates to one of the following Operand-ExpressionTypes':

Indexed-ExpressionType
Floating-Point-ExpressionType
Compound-ExpressionType
Duplicated-ExpressionType

then the Identifieris converted to a Text-EquateName. Otherwise, the Identifieris converted to a Numeric-EquateName.

See also EQUand =.

Example


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 


[[[00791.htm|prev]]][[[00793.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]

LABEL (Associate a Symbolic Name With Current Address)

The LABELdirective defines the following attributes of Name:

�Segment: current segment being assembled
�Offset: current position within this segment
�Type: the operand of the LABELdirective

Syntax


Name   LABEL   Type - Declaration 
   or 
Name : 
   or 
Name : : 

Remarks

The LABELdirective 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 Nameentry is an Identifierthat is converted to a LabelNameaccording to the value given by Type-Declaration. See the section on label namesfor more information on the details of this conversion.

The :and ::forms of this directive are used for defining code labels. In this case, the Nameentry is converted to a Target-LabelName. The double- colon form of the directive is used when the Namemust 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:

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 

To define multiple entry points within a procedure:

SUBRT     PROC      FAR 
         . 
         . 
         . 
SUB2      LABEL     FAR     ; Should   have   same   attribute   as   containing   PROC 
         . 
         . 
         . 
         RET 
SUBRT     ENDP 


[[[00792.htm|prev]]][[[00794.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]

OPTION (Modify Default Behaviors)

The OPTIONdirective allows the user to alter certain default behaviors of the assembler, normally to provide backward compatibility with older assemblers. The OPTIONdirective is not available when assembling in M510 mode.

Syntax


OPTION   Option - Item   [ ,   [ LineBreak ]   Option - Item   . . . ] 

Remarks

The Option-Itemarguments are defined as follows (the underlined keywords denote the default values):

DOTNAME| NODOTNAMEAllows user identifiers to begin with an introductory dot (.) character.

EXPR16| EXPR32Specifies whether expressions are evaluated using 16-bit or 32-bit arithmetic. Some programs may require reverting back to EXPR16in 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:Language-NameSpecifies the default language type for identifiers with PUBLICor EXPORTvisibility. This option overrides any setting given in the .MODELdirective.

OFFSET:Offset-TypeDetermines 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-Typeare SEGMENT, GROUP, and FLAT.

OLDSTRUCTS| NOOLDSTRUCTSThe OLDSTRUCTSkeyword causes structure field names to become global identifiers rather than local names private to the structure type. It also prevents the 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:VisibilitySpecifies the default visibility for procedure names. This can be one of PRIVATE, PUBLIC, or EXPORT.

SCOPED| NOSCOPEDThe NOSCOPEDkeyword 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-SizeExplicitly sets the default address size value. This is used to control the address size of segments that are opened without explict USE16or USE32keywords, and of global identifiers that are declared outside of segment boundaries. The possible values for Address- Sizeare USE16, USE32, and FLAT.

[[[00793.htm|prev]]][[[00795.htm|next]]][[[00785.htm|parent]]][[[toc.htm|TOC]]]

.RADIX (Set the Default Base for Numeric Literals)

The .RADIXdirective lets you change the default RADIX(decimal) to base 2, 8, 10, or 16.

Syntax


. RADIX   Expression 

Remarks

The Expressionentry is in decimal radix regardless of the current radix setting.

The .RADIXdirective 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 16were not in use).

Example

The statement:

. RADIX     16 
DW     120B 

produces an error because 2 is not a valid binary number. The correct specification is:

DW     120BH 

The following example:

. RADIX    16 
DW    89CD 

also produces an error because C is not a valid decimal number. The correct specification is:

DW    89CDH 

The dangerous case is when no error is produced. For example:

. RADIX    16 
DW   120D 

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:

MOV    BX , OFFH 
. RADIX    16 
MOV    BX , OFF 

The following example:

. RADIX   8 
DQ   19 . 0      ;   Treated   as   decimal 

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:

. RADIX    8 
DQ    19   ;   uses   current   radix 

produces a syntax error because nine is not a valid number in .RADIX 8.

[[[00794.htm|prev]]][[[00796.htm|next]]][[[toc.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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]]]

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]]]

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]]]

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 overridethe 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

/--------------------------------------------------------------------\
|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  |
\--------------------------------------------------------------------/

Y = Yes, this instruction prefix is present
N = No, this instruction prefix is not present

[[[00799.htm|prev]]][[[00801.htm|next]]][[[00797.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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.

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                   |    |
|   \----------------------------------------------------/    |
\-------------------------------------------------------------/

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

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:

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 

The following are the segment override prefixes:

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 

[[[00801.htm|prev]]][[[00803.htm|next]]][[[00801.htm|parent]]][[[toc.htm|TOC]]]

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

The ModR/M byte contains three fields of information:

�The modfield, 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 regfield, 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/mfield, 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 modfield as described above.

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 ssfield, which occupies the two most significant bits of the byte, specifies the scale factor.

�The indexfield, which occupies the next three bits following the ssfield and specifies the register number of the index register.

�The basefield, which occupies the three least significant bits of the byte, specifies the register number of the base register.

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     | |
|   \------------------------------------------/ |
|                                                |
\------------------------------------------------/

[[[00802.htm|prev]]][[[00804.htm|next]]][[[00802.htm|parent]]][[[toc.htm|TOC]]]

16-Bit Addressing Forms with the ModR/M Byte


/-------------------------------------------------------------------------------\
| 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  |
\-------------------------------------------------------------------------------/

Notes:

1.disp8denotes an 8-bit displacement following the ModR/M byte, to be sign-extended and added to the index.

2.disp16denotes 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.

[[[00803.htm|prev]]][[[00805.htm|next]]][[[00802.htm|parent]]][[[toc.htm|TOC]]]

32-Bit Addressing Forms with the ModR/M Byte


/-------------------------------------------------------------------------------\
| 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  |
\-------------------------------------------------------------------------------/

Notes:

1.[--][--] means a SIB follows the ModR/M byte.

2.disp8denotes an 8-bit displacement following the SIB byte, to be sign- extended and added to the index.

disp32denotes a 32-bit displacement following the SIB byte, to be added to the index.

[[[00804.htm|prev]]][[[00806.htm|next]]][[[00802.htm|parent]]][[[toc.htm|TOC]]]

32-Bit Addressing Forms with the SIB Byte


/-------------------------------------------------------------------------------\
|                               | 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  |
\-------------------------------------------------------------------------------/

Notes:

[*] means a disp32 with no base if MOD is 00, [EBP] otherwise. This provides the following addressing modes:

disp32[index]           (MOD=00)
disp8[EBP][index]       (MOD=01)
disp32[EBP][index]      (MOD=10)

[[[00805.htm|prev]]][[[00807.htm|next]]][[[00796.htm|parent]]][[[toc.htm|TOC]]]

How to Read the Instruction Set Pages

The following sections describe how to interpret the description pages for each instruction listed in the Intel Instruction Setsection. 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: Details Table, Operation, Flags Affected, Protected Mode Exceptions, Real Address Mode Exceptions, Virtual-8086 Mode Exceptions, and optionally, a Notessection. 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]]]

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:

/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|F5        |CMC                 |2|2|2|2|2|2|Complement carry flag             |
\------------------------------------------------------------------------------/

The Encoding, Instruction, and Descriptioncolumns are described in the following sections. The columns labeled 0, 1, 2, 3, 4,and 5are collectively described in the Clockssection. 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

[[[00807.htm|prev]]][[[00809.htm|next]]][[[00807.htm|parent]]][[[toc.htm|TOC]]]

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 regfield 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-


/--------------------------------------------------------------\
| 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           |
\--------------------------------------------------------------/

+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.

[[[00808.htm|prev]]][[[00810.htm|next]]][[[00807.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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]]]

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]]]

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]]]

ptr16:16

A far pointer, typically in a code segment different from that of the instruction. The notation 16:16indicates 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]]]

ptr16:32

A far pointer, typically in a code segment different from that of the instruction. The notation 16:32indicates 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]]]

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]]]

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]]]

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]]]

imm8

An immediate byte value. imm8is a signed number between -128 and +127 inclusive. For instructions in which imm8is 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]]]

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]]]

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]]]

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]]]

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]]]

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]]]

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]]]

m

A 16 or 32-bit memory operand.

[[[00825.htm|prev]]][[[00827.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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]]]

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]]]

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]]]

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]]]

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]]]

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]]]

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]]]

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]]]

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]]]

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]]]

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]]]

m32real

A single-precision floating-point operand in memory.

[[[00838.htm|prev]]][[[00840.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]

m64real

A double-precision floating-point operand in memory.

[[[00839.htm|prev]]][[[00841.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]

m80real

An extended-precision floating-point operand in memory.

[[[00840.htm|prev]]][[[00842.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]

m80bcd

A 80 byte binary-coded decimal operand in memory.

[[[00841.htm|prev]]][[[00843.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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]]]

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]]]

m14byte

A 14-byte floating-point operand in memory.

[[[00845.htm|prev]]][[[00847.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]

m28byte

A 28-byte floating-point operand in memory.

[[[00846.htm|prev]]][[[00848.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]

m94byte

A 94-byte floating-point operand in memory.

[[[00847.htm|prev]]][[[00849.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]

m108byte

A 108-byte floating-point operand in memory.

[[[00848.htm|prev]]][[[00850.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]

ST or ST(0)

Top element of the FPU register stack.

[[[00849.htm|prev]]][[[00851.htm|next]]][[[00809.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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.

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.

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.

The following table summarizes the task switch times for exceptions, assuming cache hits and the use of task gates.

Task Switch Times for Exceptions

/------------------------------------------------------------------------------\
|            OLD TASK           |                   NEW TASK                   | 
|                               |----------------------------------------------|
|                               | TO 32 BIT TSS | TO 16 BIT TSS |   TO VM TSS  |
|-------------------------------+---------------+---------------+--------------|
|      VM/32 bit/16 bit TSS     |       85      |       87      |      71      |
\------------------------------------------------------------------------------/

[[[00851.htm|prev]]][[[00853.htm|next]]][[[00807.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Description

The "Description" section contains further explanation of the instruction's operation.

[[[00853.htm|prev]]][[[00855.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]

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.

The following identifiers are used in the algorithmic descriptions:

OperandSizerepresents the operand-size attribute of the instruction, which is either 16 or 32 bits. AddressSizerepresents the address-size attribute, which is either 16 or 32 bits. For example,


IF instruction = CMPSW 
THEN OperandSize � 16;
ELSE 
  IF instruction = CMPSD 
  THEN OperandSize � 32;
  FI;
FI;

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.

StackAddrSizerepresents the stack address-size attribute associated with the instruction, which has a value of 16 or 32 bits, as explained earlier in the chapter.

SRCrepresents the source operand. When there are two operands, SRC is the one on the right.

DESTrepresents the destination operand. When there are two operands, DEST is the one on the left.

LeftSRC, RightSRCdistinguishes between two operands when both are source operands.

eSPrepresents either the SP register or the ESP register depending on the setting of the B-bit for the current stack segment.

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:

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;

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:

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*)

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.

Bit Offset for BIT[EAX,21]

/------------------------------------------------------\
|     31            21                            0    |
|   /----------------------------------------------\   |
|   \----------------------------------------------/   |
|                    �                             �   |
|                    |                             |   |
|                    \--------BITOFFSET=21---------/   |
|                                                      |
\------------------------------------------------------/

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.

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-------/            |
|                                                      |
\------------------------------------------------------/

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:

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;

Switch-Tasksis described in detail in the Intel documentation.

[[[00854.htm|prev]]][[[00856.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected

Pages describing basic instructions have a "Flags Affected" section the contains a flags information table similar to the following:

/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|0 |  |  |* |* |? |* |0 |
\-----------------------/

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:

/-----------------------------------------\
|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)                    |
\-----------------------------------------/

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.

/--------------------------------------------------------------------------------\
|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           |
\--------------------------------------------------------------------------------/

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 Operationsection.

�The values of flags listed as "undefined" may be changed by the instruction in an indeterminate manner.

All flags not listed are unchanged by the instruction.

[[[00855.htm|prev]]][[[00857.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]

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:

/-----------\
|C0|C1|C2|C3|
|--+--+--+--|
|? |* |? |? |
\-----------/

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:

/-----------------------------------------\
|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)                    |
\-----------------------------------------/

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

/------------------------------------------------------------------------------\
| 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    |
\------------------------------------------------------------------------------/

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).

ReductionIf 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.

RoundupWhen the PE bit of the status word is set, this bit indicates whether the last rounding in the instruction was upward.

UNDEFINEDDo not rely on any specific value in these bits.

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.

/-------------------------\
|FPU FLAG    |IU FLAG     |
|------------+------------|
|C0          |CF          |
|------------+------------|
|C1          |(None)      |
|------------+------------|
|C2          |PF          |
|------------+------------|
|C3          |ZF          |
\-------------------------/

[[[00856.htm|prev]]][[[00858.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]

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)

[[[00857.htm|prev]]][[[00859.htm|next]]][[[00806.htm|parent]]][[[toc.htm|TOC]]]

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

/------------------------------------------------------------------------------\
|      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                      |
\------------------------------------------------------------------------------/

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]]]

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]]]

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]]]

Instruction Timing

ì

[[[00861.htm|prev]]][[[00863.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(102-137)+EA

[[[00862.htm|prev]]][[[00864.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(103-139)+EA

[[[00863.htm|prev]]][[[00865.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(108-143)+EA

[[[00864.htm|prev]]][[[00866.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(109-144)+EA

[[[00865.htm|prev]]][[[00867.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(110-125)+EA

[[[00866.htm|prev]]][[[00868.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(12-18)+fw

[[[00867.htm|prev]]][[[00869.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(124-138)+EA

[[[00868.htm|prev]]][[[00870.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(130-144)+EA

[[[00869.htm|prev]]][[[00871.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(154-168)+EA

[[[00870.htm|prev]]][[[00872.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(197-207)+EA

[[[00871.htm|prev]]][[[00873.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(2-8)+fw

[[[00872.htm|prev]]][[[00874.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(215-225)+EA

[[[00873.htm|prev]]][[[00875.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(216-226)+EA

[[[00874.htm|prev]]][[[00876.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(220-230)+EA

[[[00875.htm|prev]]][[[00877.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(221-231)+EA

[[[00876.htm|prev]]][[[00878.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(224-238)+EA

[[[00877.htm|prev]]][[[00879.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(225-239)+EA

[[[00878.htm|prev]]][[[00880.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(230-243)+EA

[[[00879.htm|prev]]][[[00881.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(231-245)+EA

[[[00880.htm|prev]]][[[00882.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(290-310)+EA

[[[00881.htm|prev]]][[[00883.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(35-45)+EA

[[[00882.htm|prev]]][[[00884.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(38-56)+EA

[[[00883.htm|prev]]][[[00885.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(40-60)+EA

[[[00884.htm|prev]]][[[00886.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(46-54)+EA

[[[00885.htm|prev]]][[[00887.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(52-58)+EA

[[[00886.htm|prev]]][[[00888.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(52-60)+EA

[[[00887.htm|prev]]][[[00889.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(520-540)+EA

[[[00888.htm|prev]]][[[00890.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(53-65)+EA

[[[00889.htm|prev]]][[[00891.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(60-68)+EA

[[[00890.htm|prev]]][[[00892.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(60-70)+EA

[[[00891.htm|prev]]][[[00893.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(63-73)+EA

[[[00892.htm|prev]]][[[00894.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(65-75)+EA

[[[00893.htm|prev]]][[[00895.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(67-77)+EA

[[[00894.htm|prev]]][[[00896.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(7-14)+EA

[[[00895.htm|prev]]][[[00897.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(72-86)+EA

[[[00896.htm|prev]]][[[00898.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(74-88)+EA

[[[00897.htm|prev]]][[[00899.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(78-91)+EA

[[[00898.htm|prev]]][[[00900.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(80-90)+EA

[[[00899.htm|prev]]][[[00901.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(80-93)+EA

[[[00900.htm|prev]]][[[00902.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(82-92)+EA

[[[00901.htm|prev]]][[[00903.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(84-90)+EA

[[[00902.htm|prev]]][[[00904.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(84-94)+EA

[[[00903.htm|prev]]][[[00905.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(86-92)+EA

[[[00904.htm|prev]]][[[00906.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(90-120)+EA

[[[00905.htm|prev]]][[[00907.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(94-105)+EA

[[[00906.htm|prev]]][[[00908.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(95-125)+EA

[[[00907.htm|prev]]][[[00909.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(96-104)+EA

[[[00908.htm|prev]]][[[00910.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(98-106)+EA

[[[00909.htm|prev]]][[[00911.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

0

[[[00910.htm|prev]]][[[00912.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1

[[[00911.htm|prev]]][[[00913.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1-3

[[[00912.htm|prev]]][[[00914.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1/2

[[[00913.htm|prev]]][[[00915.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1/3

[[[00914.htm|prev]]][[[00916.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

10

[[[00915.htm|prev]]][[[00917.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

10+3n

[[[00916.htm|prev]]][[[00918.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

10+m

[[[00917.htm|prev]]][[[00919.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

10, pm:4*/24**

[[[00918.htm|prev]]][[[00920.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

10-15

[[[00919.htm|prev]]][[[00921.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

10-16

[[[00920.htm|prev]]][[[00922.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

10-17

[[[00921.htm|prev]]][[[00923.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

10-18

[[[00922.htm|prev]]][[[00924.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

10/13

[[[00923.htm|prev]]][[[00925.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

101-112/ (107-118)+EA

[[[00924.htm|prev]]][[[00926.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

102-137

[[[00925.htm|prev]]][[[00927.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

103-139

[[[00926.htm|prev]]][[[00928.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

108-143

[[[00927.htm|prev]]][[[00929.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

109-144

[[[00928.htm|prev]]][[[00930.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

11

[[[00929.htm|prev]]][[[00931.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

11+fw

[[[00930.htm|prev]]][[[00932.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

11+m

[[[00931.htm|prev]]][[[00933.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

11, pm:5*/25**

[[[00932.htm|prev]]][[[00934.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

11,pm:23

[[[00933.htm|prev]]][[[00935.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

11-17

[[[00934.htm|prev]]][[[00936.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

11/18+EA

[[[00935.htm|prev]]][[[00937.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

110-125

[[[00936.htm|prev]]][[[00938.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

118-133/ (124-139)+EA

[[[00937.htm|prev]]][[[00939.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

12

[[[00938.htm|prev]]][[[00940.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

12+4(n-1)

[[[00939.htm|prev]]][[[00941.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

12+m, pm:27+m

[[[00940.htm|prev]]][[[00942.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

12, pm:6*/26**

[[[00941.htm|prev]]][[[00943.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

12, pm:9*/26**, vm:24

[[[00942.htm|prev]]][[[00944.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

12-18

[[[00943.htm|prev]]][[[00945.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

12-23

[[[00944.htm|prev]]][[[00946.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

12-42/13-42

[[[00945.htm|prev]]][[[00947.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

120-127

[[[00946.htm|prev]]][[[00948.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

120-538

[[[00947.htm|prev]]][[[00949.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

121-128

[[[00948.htm|prev]]][[[00950.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

122-129

[[[00949.htm|prev]]][[[00951.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

122-771

[[[00950.htm|prev]]][[[00952.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

123-772

[[[00951.htm|prev]]][[[00953.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

124-138

[[[00952.htm|prev]]][[[00954.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

128-154/ (134-160)+EA

[[[00953.htm|prev]]][[[00955.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13

[[[00954.htm|prev]]][[[00956.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13, pm:10*/27**, vm:25

[[[00955.htm|prev]]][[[00957.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13, pm:7*/27**

[[[00956.htm|prev]]][[[00958.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13,pm:18

[[[00957.htm|prev]]][[[00959.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13,pm:26

[[[00958.htm|prev]]][[[00960.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13,pm:33

[[[00959.htm|prev]]][[[00961.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13-16

[[[00960.htm|prev]]][[[00962.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13-18

[[[00961.htm|prev]]][[[00963.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13-26

[[[00962.htm|prev]]][[[00964.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13-42

[[[00963.htm|prev]]][[[00965.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13-57

[[[00964.htm|prev]]][[[00966.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13/16

[[[00965.htm|prev]]][[[00967.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13/18

[[[00966.htm|prev]]][[[00968.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13/26

[[[00967.htm|prev]]][[[00969.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13/42

[[[00968.htm|prev]]][[[00970.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

130-144

[[[00969.htm|prev]]][[[00971.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

130-145

[[[00970.htm|prev]]][[[00972.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

131,pm:120

[[[00971.htm|prev]]][[[00973.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

[[[00972.htm|prev]]][[[00974.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

134-148

[[[00973.htm|prev]]][[[00975.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

135-141

[[[00974.htm|prev]]][[[00976.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

136-140

[[[00975.htm|prev]]][[[00977.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

14

[[[00976.htm|prev]]][[[00978.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

14, pm:8*/28**

[[[00977.htm|prev]]][[[00979.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

14, pm:8*/28**, vm:27

[[[00978.htm|prev]]][[[00980.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

14,pm:17

[[[00979.htm|prev]]][[[00981.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

14,pm:25

[[[00980.htm|prev]]][[[00982.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

14,pm:33

[[[00981.htm|prev]]][[[00983.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

14/16

[[[00982.htm|prev]]][[[00984.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

14/17

[[[00983.htm|prev]]][[[00985.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

140-279

[[[00984.htm|prev]]][[[00986.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

144-162/ (150-168)+EA

[[[00985.htm|prev]]][[[00987.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

148-154

[[[00986.htm|prev]]][[[00988.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15

[[[00987.htm|prev]]][[[00989.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15+2n

[[[00988.htm|prev]]][[[00990.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15+4(n-1)

[[[00989.htm|prev]]][[[00991.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15+fw

[[[00990.htm|prev]]][[[00992.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15+m, pm:26+m

[[[00991.htm|prev]]][[[00993.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15, pm:9*/29**

[[[00992.htm|prev]]][[[00994.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15,pm:25

[[[00993.htm|prev]]][[[00995.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15-17

[[[00994.htm|prev]]][[[00996.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15-190

[[[00995.htm|prev]]][[[00997.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15-21

[[[00996.htm|prev]]][[[00998.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15-22

[[[00997.htm|prev]]][[[00999.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

15/16

[[[00998.htm|prev]]][[[01000.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

154-168

[[[00999.htm|prev]]][[[01001.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16

[[[01000.htm|prev]]][[[01002.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16+EA

[[[01001.htm|prev]]][[[01003.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16+fw

[[[01002.htm|prev]]][[[01004.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16, pm:11*/31**, vm:29

[[[01003.htm|prev]]][[[01005.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16-126

[[[01004.htm|prev]]][[[01006.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16-20

[[[01005.htm|prev]]][[[01007.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16-22

[[[01006.htm|prev]]][[[01008.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16-50

[[[01007.htm|prev]]][[[01009.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16-64

[[[01008.htm|prev]]][[[01010.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16/16

[[[01009.htm|prev]]][[[01011.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16/21+EA

[[[01010.htm|prev]]][[[01012.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16/29

[[[01011.htm|prev]]][[[01013.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

16/4

[[[01012.htm|prev]]][[[01014.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

165-184/ (171-190)+EA

[[[01013.htm|prev]]][[[01015.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

169

[[[01014.htm|prev]]][[[01016.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17

[[[01015.htm|prev]]][[[01017.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17+3n

[[[01016.htm|prev]]][[[01018.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17+EA

[[[01017.htm|prev]]][[[01019.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17+fw

[[[01018.htm|prev]]][[[01020.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17+m; pm:34+m

[[[01019.htm|prev]]][[[01021.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17, pm:10*/32**, vm:30

[[[01020.htm|prev]]][[[01022.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17, pm:10*32**, vm:30

[[[01021.htm|prev]]][[[01023.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17,pm:19

[[[01022.htm|prev]]][[[01024.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17,pm:31

[[[01023.htm|prev]]][[[01025.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17-137

[[[01024.htm|prev]]][[[01026.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17-173

[[[01025.htm|prev]]][[[01027.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17-22

[[[01026.htm|prev]]][[[01028.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17-23

[[[01027.htm|prev]]][[[01029.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17-24

[[[01028.htm|prev]]][[[01030.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17/19

[[[01029.htm|prev]]][[[01031.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17/20

[[[01030.htm|prev]]][[[01032.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17/5

[[[01031.htm|prev]]][[[01033.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

171-326

[[[01032.htm|prev]]][[[01034.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

172-176

[[[01033.htm|prev]]][[[01035.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

175

[[[01034.htm|prev]]][[[01036.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

177/182

[[[01035.htm|prev]]][[[01037.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

178

[[[01036.htm|prev]]][[[01038.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

17;pm:20

[[[01037.htm|prev]]][[[01039.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

18

[[[01038.htm|prev]]][[[01040.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

18+m, pm:32+m

[[[01039.htm|prev]]][[[01041.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

18-124

[[[01040.htm|prev]]][[[01042.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

18-24

[[[01041.htm|prev]]][[[01043.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

18/6

[[[01042.htm|prev]]][[[01044.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

180

[[[01043.htm|prev]]][[[01045.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

180-186

[[[01044.htm|prev]]][[[01046.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

180/185

[[[01045.htm|prev]]][[[01047.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

183

[[[01046.htm|prev]]][[[01048.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

18;pm:20

[[[01047.htm|prev]]][[[01049.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

19

[[[01048.htm|prev]]][[[01050.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

19+TS

[[[01049.htm|prev]]][[[01051.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

19-32

[[[01050.htm|prev]]][[[01052.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

19/20

[[[01051.htm|prev]]][[[01053.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

19/5

[[[01052.htm|prev]]][[[01054.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

191-497

[[[01053.htm|prev]]][[[01055.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

193-203

[[[01054.htm|prev]]][[[01056.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

194-204

[[[01055.htm|prev]]][[[01057.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

194-809

[[[01056.htm|prev]]][[[01058.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

196-329

[[[01057.htm|prev]]][[[01059.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

197-207

[[[01058.htm|prev]]][[[01060.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

198-208

[[[01059.htm|prev]]][[[01061.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2

[[[01060.htm|prev]]][[[01062.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2+EA

[[[01061.htm|prev]]][[[01063.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2+fw

[[[01062.htm|prev]]][[[01064.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2-8

[[[01063.htm|prev]]][[[01065.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/15+EA

[[[01064.htm|prev]]][[[01066.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/2

[[[01065.htm|prev]]][[[01067.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/3

[[[01066.htm|prev]]][[[01068.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/3,pm:2

[[[01067.htm|prev]]][[[01069.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/4

[[[01068.htm|prev]]][[[01070.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/5

[[[01069.htm|prev]]][[[01071.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/5,pm:17/19

[[[01070.htm|prev]]][[[01072.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/5,pm:18/19

[[[01071.htm|prev]]][[[01073.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/6

[[[01072.htm|prev]]][[[01074.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/7

[[[01073.htm|prev]]][[[01075.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/8+EA

[[[01074.htm|prev]]][[[01076.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2/9+EA

[[[01075.htm|prev]]][[[01077.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

20

[[[01076.htm|prev]]][[[01078.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

20+TS

[[[01077.htm|prev]]][[[01079.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

20-24

[[[01078.htm|prev]]][[[01080.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

20-31

[[[01079.htm|prev]]][[[01081.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

20-35

[[[01080.htm|prev]]][[[01082.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

20-55

[[[01081.htm|prev]]][[[01083.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

20-70

[[[01082.htm|prev]]][[[01084.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

20/21

[[[01083.htm|prev]]][[[01085.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

200-273

[[[01084.htm|prev]]][[[01086.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

2000+

[[[01085.htm|prev]]][[[01087.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

205-215

[[[01086.htm|prev]]][[[01088.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

21

[[[01087.htm|prev]]][[[01089.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

21-30

[[[01088.htm|prev]]][[[01090.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

21-303

[[[01089.htm|prev]]][[[01091.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

21/24

[[[01090.htm|prev]]][[[01092.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

21/46

[[[01091.htm|prev]]][[[01093.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

211-476

[[[01092.htm|prev]]][[[01094.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

215-225

[[[01093.htm|prev]]][[[01095.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

216-226

[[[01094.htm|prev]]][[[01096.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

22

[[[01095.htm|prev]]][[[01097.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

22+m; pm:38+m

[[[01096.htm|prev]]][[[01098.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

22,pm:38

[[[01097.htm|prev]]][[[01099.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

22-103

[[[01098.htm|prev]]][[[01100.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

22-111

[[[01099.htm|prev]]][[[01101.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

22-24

[[[01100.htm|prev]]][[[01102.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

22/25

[[[01101.htm|prev]]][[[01103.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

220-230

[[[01102.htm|prev]]][[[01104.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

221-231

[[[01103.htm|prev]]][[[01105.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

224-238

[[[01104.htm|prev]]][[[01106.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

225-239

[[[01105.htm|prev]]][[[01107.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

23

[[[01106.htm|prev]]][[[01108.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

23-27

[[[01107.htm|prev]]][[[01109.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

23-31

[[[01108.htm|prev]]][[[01110.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

23/27

[[[01109.htm|prev]]][[[01111.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

230-243

[[[01110.htm|prev]]][[[01112.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

231-245

[[[01111.htm|prev]]][[[01113.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

24

[[[01112.htm|prev]]][[[01114.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

24+EA

[[[01113.htm|prev]]][[[01115.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

24-25

[[[01114.htm|prev]]][[[01116.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

24-32

[[[01115.htm|prev]]][[[01117.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

24/24

[[[01116.htm|prev]]][[[01118.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

25

[[[01117.htm|prev]]][[[01119.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

25-33

[[[01118.htm|prev]]][[[01120.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

25/26

[[[01119.htm|prev]]][[[01121.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

25/28

[[[01120.htm|prev]]][[[01122.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

250-800

[[[01121.htm|prev]]][[[01123.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

257-354

[[[01122.htm|prev]]][[[01124.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

257-547

[[[01123.htm|prev]]][[[01125.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

26

[[[01124.htm|prev]]][[[01126.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

26-34

[[[01125.htm|prev]]][[[01127.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

266-275

[[[01126.htm|prev]]][[[01128.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

27

[[[01127.htm|prev]]][[[01129.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

27-35

[[[01128.htm|prev]]][[[01130.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

27-55

[[[01129.htm|prev]]][[[01131.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

27/28

[[[01130.htm|prev]]][[[01132.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

28

[[[01131.htm|prev]]][[[01133.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

28-34

[[[01132.htm|prev]]][[[01134.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

29-34

[[[01133.htm|prev]]][[[01135.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

29-37

[[[01134.htm|prev]]][[[01136.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

29-57

[[[01135.htm|prev]]][[[01137.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

290-310

[[[01136.htm|prev]]][[[01138.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

292-365

[[[01137.htm|prev]]][[[01139.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3

[[[01138.htm|prev]]][[[01140.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3+fw

[[[01139.htm|prev]]][[[01141.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/1

[[[01140.htm|prev]]][[[01142.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/12

[[[01141.htm|prev]]][[[01143.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/15+EA

[[[01142.htm|prev]]][[[01144.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/16+EA

[[[01143.htm|prev]]][[[01145.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/3

[[[01144.htm|prev]]][[[01146.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/4

[[[01145.htm|prev]]][[[01147.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/5

[[[01146.htm|prev]]][[[01148.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/6

[[[01147.htm|prev]]][[[01149.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/7

[[[01148.htm|prev]]][[[01150.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/8

[[[01149.htm|prev]]][[[01151.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/9

[[[01150.htm|prev]]][[[01152.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3/9+EA

[[[01151.htm|prev]]][[[01153.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

30

[[[01152.htm|prev]]][[[01154.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

30-32

[[[01153.htm|prev]]][[[01155.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

30-38

[[[01154.htm|prev]]][[[01156.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

30-45

[[[01155.htm|prev]]][[[01157.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

30-540

[[[01156.htm|prev]]][[[01158.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

308

[[[01157.htm|prev]]][[[01159.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

31

[[[01158.htm|prev]]][[[01160.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

310-630

[[[01159.htm|prev]]][[[01161.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

314-487

[[[01160.htm|prev]]][[[01162.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

32

[[[01161.htm|prev]]][[[01163.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

32-38

[[[01162.htm|prev]]][[[01164.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

32-57

[[[01163.htm|prev]]][[[01165.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

33

[[[01164.htm|prev]]][[[01166.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

33+fw

[[[01165.htm|prev]]][[[01167.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

35-45

[[[01166.htm|prev]]][[[01168.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

36

[[[01167.htm|prev]]][[[01169.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

37+EA

[[[01168.htm|prev]]][[[01170.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

37, pm16:32, pm32:33

[[[01169.htm|prev]]][[[01171.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

38

[[[01170.htm|prev]]][[[01172.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

38-36

[[[01171.htm|prev]]][[[01173.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

38-48

[[[01172.htm|prev]]][[[01174.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

38-56

[[[01173.htm|prev]]][[[01175.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

38/41

[[[01174.htm|prev]]][[[01176.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

39

[[[01175.htm|prev]]][[[01177.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

4

[[[01176.htm|prev]]][[[01178.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

4+5n

[[[01177.htm|prev]]][[[01179.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

4/1

[[[01178.htm|prev]]][[[01180.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

4/10+EA

[[[01179.htm|prev]]][[[01181.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

4/17+EA

[[[01180.htm|prev]]][[[01182.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

4/3

[[[01181.htm|prev]]][[[01183.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

4/5

[[[01182.htm|prev]]][[[01184.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

4/9

[[[01183.htm|prev]]][[[01185.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

4/pm:8

[[[01184.htm|prev]]][[[01186.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

40

[[[01185.htm|prev]]][[[01187.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

40-50

[[[01186.htm|prev]]][[[01188.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

40-60

[[[01187.htm|prev]]][[[01189.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

40/40

[[[01188.htm|prev]]][[[01190.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

41

[[[01189.htm|prev]]][[[01191.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

41+TS

[[[01190.htm|prev]]][[[01192.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

42

[[[01191.htm|prev]]][[[01193.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

42+TS

[[[01192.htm|prev]]][[[01194.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

42-52

[[[01193.htm|prev]]][[[01195.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

43

[[[01194.htm|prev]]][[[01196.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

43+TS

[[[01195.htm|prev]]][[[01197.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

43+m, pm:31+m

[[[01196.htm|prev]]][[[01198.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

43/44

[[[01197.htm|prev]]][[[01199.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

44

[[[01198.htm|prev]]][[[01200.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

44, pm:34

[[[01199.htm|prev]]][[[01201.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

[[[01200.htm|prev]]][[[01202.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

45

[[[01201.htm|prev]]][[[01203.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

45+m

[[[01202.htm|prev]]][[[01204.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

45-52

[[[01203.htm|prev]]][[[01205.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

45-55

[[[01204.htm|prev]]][[[01206.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

46

[[[01205.htm|prev]]][[[01207.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

46-54

[[[01206.htm|prev]]][[[01208.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

48-58

[[[01207.htm|prev]]][[[01209.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

49+m

[[[01208.htm|prev]]][[[01210.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5

[[[01209.htm|prev]]][[[01211.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5+TS

[[[01210.htm|prev]]][[[01212.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5+ts

[[[01211.htm|prev]]][[[01213.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5,pm:20

[[[01212.htm|prev]]][[[01214.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5/11+EA

[[[01213.htm|prev]]][[[01215.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5/3

[[[01214.htm|prev]]][[[01216.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5/5

[[[01215.htm|prev]]][[[01217.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5/6

[[[01216.htm|prev]]][[[01218.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5/8

[[[01217.htm|prev]]][[[01219.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

512-534

[[[01218.htm|prev]]][[[01220.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

52-58

[[[01219.htm|prev]]][[[01221.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

52-60

[[[01220.htm|prev]]][[[01222.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

520-540

[[[01221.htm|prev]]][[[01223.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

53

[[[01222.htm|prev]]][[[01224.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

53-65

[[[01223.htm|prev]]][[[01225.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

55

[[[01224.htm|prev]]][[[01226.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

56-63

[[[01225.htm|prev]]][[[01227.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

56-67

[[[01226.htm|prev]]][[[01228.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

57-72

[[[01227.htm|prev]]][[[01229.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

57-82

[[[01228.htm|prev]]][[[01230.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

58-83

[[[01229.htm|prev]]][[[01231.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6

[[[01230.htm|prev]]][[[01232.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6,5

[[[01231.htm|prev]]][[[01233.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6,pm:4

[[[01232.htm|prev]]][[[01234.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6-103/7-104

[[[01233.htm|prev]]][[[01235.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6-12

[[[01234.htm|prev]]][[[01236.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6-34/6-35

[[[01235.htm|prev]]][[[01237.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6-42/6-43

[[[01236.htm|prev]]][[[01238.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6-42/7-43

[[[01237.htm|prev]]][[[01239.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6/12

[[[01238.htm|prev]]][[[01240.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6/13

[[[01239.htm|prev]]][[[01241.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6/7(=); 6/10(!=)

[[[01240.htm|prev]]][[[01242.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6/8

[[[01241.htm|prev]]][[[01243.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

60

[[[01242.htm|prev]]][[[01244.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

60-68

[[[01243.htm|prev]]][[[01245.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

60-70

[[[01244.htm|prev]]][[[01246.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

61-65

[[[01245.htm|prev]]][[[01247.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

61-82

[[[01246.htm|prev]]][[[01248.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

63-73

[[[01247.htm|prev]]][[[01249.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

65-75

[[[01248.htm|prev]]][[[01250.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

66-80

[[[01249.htm|prev]]][[[01251.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

67-77

[[[01250.htm|prev]]][[[01252.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

67-86

[[[01251.htm|prev]]][[[01253.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

68

[[[01252.htm|prev]]][[[01254.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7

[[[01253.htm|prev]]][[[01255.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7+fw

[[[01254.htm|prev]]][[[01256.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7+m

[[[01255.htm|prev]]][[[01257.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7+m,10+m

[[[01256.htm|prev]]][[[01258.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7+m/10+m

[[[01257.htm|prev]]][[[01259.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7+m/3

[[[01258.htm|prev]]][[[01260.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7, pm:4*/21**, vm:19

[[[01259.htm|prev]]][[[01261.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7,pm:21

[[[01260.htm|prev]]][[[01262.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7,pm:22

[[[01261.htm|prev]]][[[01263.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7,pm:25

[[[01262.htm|prev]]][[[01264.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7-14

[[[01263.htm|prev]]][[[01265.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7-24/9-26

[[[01264.htm|prev]]][[[01266.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7-39/7-40

[[[01265.htm|prev]]][[[01267.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7-71/7-72

[[[01266.htm|prev]]][[[01268.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7/11

[[[01267.htm|prev]]][[[01269.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7/13

[[[01268.htm|prev]]][[[01270.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7/3

[[[01269.htm|prev]]][[[01271.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7/4

[[[01270.htm|prev]]][[[01272.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7/5

[[[01271.htm|prev]]][[[01273.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7/8

[[[01272.htm|prev]]][[[01274.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

70

[[[01273.htm|prev]]][[[01275.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

70-100

[[[01274.htm|prev]]][[[01276.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

70-103

[[[01275.htm|prev]]][[[01277.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

70-138

[[[01276.htm|prev]]][[[01278.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

70-76

[[[01277.htm|prev]]][[[01279.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

70-77/(76-83)+EA

[[[01278.htm|prev]]][[[01280.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

700-1000

[[[01279.htm|prev]]][[[01281.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

71

[[[01280.htm|prev]]][[[01282.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

71-75

[[[01281.htm|prev]]][[[01283.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

71-83

[[[01282.htm|prev]]][[[01284.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

72-167

[[[01283.htm|prev]]][[[01285.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

72-84

[[[01284.htm|prev]]][[[01286.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

72-86

[[[01285.htm|prev]]][[[01287.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

73

[[[01286.htm|prev]]][[[01288.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

74-155

[[[01287.htm|prev]]][[[01289.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

74-88

[[[01288.htm|prev]]][[[01290.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

75-105

[[[01289.htm|prev]]][[[01291.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

75-85

[[[01290.htm|prev]]][[[01292.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

76-87

[[[01291.htm|prev]]][[[01293.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

78-91

[[[01292.htm|prev]]][[[01294.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

79-93

[[[01293.htm|prev]]][[[01295.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

8

[[[01294.htm|prev]]][[[01296.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

8+4 per bit/(20+4 per bit)+EA

[[[01295.htm|prev]]][[[01297.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

8,4

[[[01296.htm|prev]]][[[01298.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

8-20

[[[01297.htm|prev]]][[[01299.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

8-25/10-27

[[[01298.htm|prev]]][[[01300.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

8-30/9-31

[[[01299.htm|prev]]][[[01301.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

8/4

[[[01300.htm|prev]]][[[01302.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

8/int+32

[[[01301.htm|prev]]][[[01303.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

80-90

[[[01302.htm|prev]]][[[01304.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

80-90/(86-96)+EA

[[[01303.htm|prev]]][[[01305.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

80-93

[[[01304.htm|prev]]][[[01306.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

80-97

[[[01305.htm|prev]]][[[01307.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

80-98/(86-104)+EA

[[[01306.htm|prev]]][[[01308.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

82

[[[01307.htm|prev]]][[[01309.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

82-92

[[[01308.htm|prev]]][[[01310.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

82-95

[[[01309.htm|prev]]][[[01311.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

83

[[[01310.htm|prev]]][[[01312.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

83-87

[[[01311.htm|prev]]][[[01313.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

84-86

[[[01312.htm|prev]]][[[01314.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

84-90

[[[01313.htm|prev]]][[[01315.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

84-94

[[[01314.htm|prev]]][[[01316.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

85-89

[[[01315.htm|prev]]][[[01317.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

86+4x

[[[01316.htm|prev]]][[[01318.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

86-92

[[[01317.htm|prev]]][[[01319.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

88

[[[01318.htm|prev]]][[[01320.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

89

[[[01319.htm|prev]]][[[01321.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9

[[[01320.htm|prev]]][[[01322.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9+fw

[[[01321.htm|prev]]][[[01323.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9+m/5

[[[01322.htm|prev]]][[[01324.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9, pm:6*/24**, vm:22

[[[01323.htm|prev]]][[[01325.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9,pm:6

[[[01324.htm|prev]]][[[01326.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9-12

[[[01325.htm|prev]]][[[01327.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9-14

[[[01326.htm|prev]]][[[01328.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9-14/12-17

[[[01327.htm|prev]]][[[01329.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9-16

[[[01328.htm|prev]]][[[01330.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9-20

[[[01329.htm|prev]]][[[01331.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9-22

[[[01330.htm|prev]]][[[01332.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9-22/12-25

[[[01331.htm|prev]]][[[01333.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9-38

[[[01332.htm|prev]]][[[01334.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9-38/12-41

[[[01333.htm|prev]]][[[01335.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9/10

[[[01334.htm|prev]]][[[01336.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9/6

[[[01335.htm|prev]]][[[01337.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9/9

[[[01336.htm|prev]]][[[01338.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

90+4x+m

[[[01337.htm|prev]]][[[01339.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

90-120

[[[01338.htm|prev]]][[[01340.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

900-1100

[[[01339.htm|prev]]][[[01341.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

91

[[[01340.htm|prev]]][[[01342.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

94

[[[01341.htm|prev]]][[[01343.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

94-105

[[[01342.htm|prev]]][[[01344.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

95-125

[[[01343.htm|prev]]][[[01345.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

95-185

[[[01344.htm|prev]]][[[01346.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

96-104

[[[01345.htm|prev]]][[[01347.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

98-106

[[[01346.htm|prev]]][[[01348.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

TS

[[[01347.htm|prev]]][[[01349.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

TS+10

[[[01348.htm|prev]]][[[01350.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

TS+32

[[[01349.htm|prev]]][[[01351.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

hit=12, nohit=11

[[[01350.htm|prev]]][[[01352.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:10/11

[[[01351.htm|prev]]][[[01353.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:20/21

[[[01352.htm|prev]]][[[01354.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:21+ts

[[[01353.htm|prev]]][[[01355.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:22

[[[01354.htm|prev]]][[[01356.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:35

[[[01355.htm|prev]]][[[01357.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:37+ts

[[[01356.htm|prev]]][[[01358.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:37+tx

[[[01357.htm|prev]]][[[01359.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:44

[[[01358.htm|prev]]][[[01360.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:45+2x

[[[01359.htm|prev]]][[[01361.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:52+m

[[[01360.htm|prev]]][[[01362.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:56+m

[[[01361.htm|prev]]][[[01363.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:69

[[[01362.htm|prev]]][[[01364.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:7

[[[01363.htm|prev]]][[[01365.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:77+4x

[[[01364.htm|prev]]][[[01366.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:86+m

[[[01365.htm|prev]]][[[01367.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:90+m

[[[01366.htm|prev]]][[[01368.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:94+ 4x+m

[[[01367.htm|prev]]][[[01369.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

pm:98+ 4x+m

[[[01368.htm|prev]]][[[01370.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

ts

[[[01369.htm|prev]]][[[01371.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

xm16:75, xm32:95; pm:70

[[[01370.htm|prev]]][[[01372.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(197-207)+EA+fw

[[[01371.htm|prev]]][[[01373.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(40-50)+EA+fw

[[[01372.htm|prev]]][[[01374.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

22+16(n-1)

[[[01373.htm|prev]]][[[01375.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

22-25

[[[01374.htm|prev]]][[[01376.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

22-25/29-32

[[[01375.htm|prev]]][[[01377.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

3+5n

[[[01376.htm|prev]]][[[01378.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

33-35

[[[01377.htm|prev]]][[[01379.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5+n/17+n

[[[01378.htm|prev]]][[[01380.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

8+9n

[[[01379.htm|prev]]][[[01381.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(10-16)+fw

[[[01380.htm|prev]]][[[01382.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(103-104)+fw

[[[01381.htm|prev]]][[[01383.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(154,pm=143)+fw

[[[01382.htm|prev]]][[[01384.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(205-215)+fw

[[[01383.htm|prev]]][[[01385.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(375-376)+fw

[[[01384.htm|prev]]][[[01386.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(40-50)+EA

[[[01385.htm|prev]]][[[01387.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(40-50)+fw

[[[01386.htm|prev]]][[[01388.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(67,pm=56)+fw

[[[01387.htm|prev]]][[[01389.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(xm16/32=127/151,pm=124)+fw

[[[01388.htm|prev]]][[[01390.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

(xm16/32=50/48,pm16/32=49/50)+fw

[[[01389.htm|prev]]][[[01391.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

10/11

[[[01390.htm|prev]]][[[01392.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

103-104

[[[01391.htm|prev]]][[[01393.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

13+fw

[[[01392.htm|prev]]][[[01394.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

154,pm=143

[[[01393.htm|prev]]][[[01395.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

375-376

[[[01394.htm|prev]]][[[01396.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

4,pm=3

[[[01395.htm|prev]]][[[01397.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

67,pm=56

[[[01396.htm|prev]]][[[01398.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

??

[[[01397.htm|prev]]][[[01399.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

xm16/32=127/151,pm=124

[[[01398.htm|prev]]][[[01400.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

xm16/32=50/48,pm16/32=49/50

[[[01399.htm|prev]]][[[01401.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

119

[[[01400.htm|prev]]][[[01402.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

167

[[[01401.htm|prev]]][[[01403.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:119,0:3

[[[01402.htm|prev]]][[[01404.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:13,0:4

[[[01403.htm|prev]]][[[01405.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:168,0:3

[[[01404.htm|prev]]][[[01406.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:19+TS,0:4

[[[01405.htm|prev]]][[[01407.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:24,0:3

[[[01406.htm|prev]]][[[01408.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:27,0:4

[[[01407.htm|prev]]][[[01409.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:28,0:3

[[[01408.htm|prev]]][[[01410.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:35,0:3

[[[01409.htm|prev]]][[[01411.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:39+TS,0:3

[[[01410.htm|prev]]][[[01412.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:41,0:3

[[[01411.htm|prev]]][[[01413.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:44,0:4

[[[01412.htm|prev]]][[[01414.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:46,0:3

[[[01413.htm|prev]]][[[01415.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:53,0:4

[[[01414.htm|prev]]][[[01416.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:56,0:4

[[[01415.htm|prev]]][[[01417.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:59,0:3

[[[01416.htm|prev]]][[[01418.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:73,0:3

[[[01417.htm|prev]]][[[01419.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:79,0:3

[[[01418.htm|prev]]][[[01420.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:84,0:3

[[[01419.htm|prev]]][[[01421.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:99,0:3

[[[01420.htm|prev]]][[[01422.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

1:TS,0:3

[[[01421.htm|prev]]][[[01423.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

23+TS

[[[01422.htm|prev]]][[[01424.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

37

[[[01423.htm|prev]]][[[01425.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

37+TS

[[[01424.htm|prev]]][[[01426.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

48

[[[01425.htm|prev]]][[[01427.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

51

[[[01426.htm|prev]]][[[01428.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

52

[[[01427.htm|prev]]][[[01429.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

56

[[[01428.htm|prev]]][[[01430.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

59

[[[01429.htm|prev]]][[[01431.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

78

[[[01430.htm|prev]]][[[01432.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

86

[[[01431.htm|prev]]][[[01433.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

99

[[[01432.htm|prev]]][[[01434.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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]]]

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]]]

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]]]

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]]]

Instruction Timing

4+3*CX

[[[01438.htm|prev]]][[[01440.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5*3,13*4,12+3(E)CX*5

[[[01439.htm|prev]]][[[01441.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5*3,7+4(E)CX*6

[[[01440.htm|prev]]][[[01442.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5*3,7+5(E)CX*6

[[[01441.htm|prev]]][[[01443.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5*3,7+7(E)CX*6

[[[01442.htm|prev]]][[[01444.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Instruction Timing

5+15*15

[[[01444.htm|prev]]][[[01446.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5+15*N

[[[01445.htm|prev]]][[[01447.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5+22*N

[[[01446.htm|prev]]][[[01448.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5+4(E)CX

[[[01447.htm|prev]]][[[01449.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5+4*CX

[[[01448.htm|prev]]][[[01450.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5+5(E)CX

[[[01449.htm|prev]]][[[01451.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5+8*N

[[[01450.htm|prev]]][[[01452.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

5+9*N

[[[01451.htm|prev]]][[[01453.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6*3,13*4

[[[01452.htm|prev]]][[[01454.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6*3,13*4,13(E)CX*5

[[[01453.htm|prev]]][[[01455.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6*3,9(E)CX*6

[[[01454.htm|prev]]][[[01456.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6+11*N

[[[01455.htm|prev]]][[[01457.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

6+9*N

[[[01456.htm|prev]]][[[01458.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7*3,7+3(E)CX*6

[[[01457.htm|prev]]][[[01459.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7*3,8+4(E)CX*6

[[[01458.htm|prev]]][[[01460.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

7*3,9+4(E)CX*6

[[[01459.htm|prev]]][[[01461.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

8+8*N

[[[01460.htm|prev]]][[[01462.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9+10*CX

[[[01461.htm|prev]]][[[01463.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9+15*N

[[[01462.htm|prev]]][[[01464.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9+17*CX

[[[01463.htm|prev]]][[[01465.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

9+22*N

[[[01464.htm|prev]]][[[01466.htm|next]]][[[00860.htm|parent]]][[[toc.htm|TOC]]]

Instruction Timing

N/A

[[[01465.htm|prev]]][[[01467.htm|next]]][[[00795.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Protected Mode Exceptions

None

[[[01467.htm|prev]]][[[01469.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

Real Address Mode Exceptions

None

[[[01468.htm|prev]]][[[01470.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

Virtual 8086 Mode Exceptions

None

[[[01469.htm|prev]]][[[01471.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |  |  |  |  |  |  |
\-----------------------/

None

[[[01470.htm|prev]]][[[01472.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

FPU Flags Affected


/-----------\
|C0|C1|C2|C3|
|--+--+--+--|
|? |* |? |? |
\-----------/

C1 as described in FPU Flags Affected; C0, C2, C3 undefined.

[[[01471.htm|prev]]][[[01473.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

FPU Flags Affected


/-----------\
|C0|C1|C2|C3|
|--+--+--+--|
|? |? |? |? |
\-----------/

C0, C1, C2, C3 undefined.

[[[01472.htm|prev]]][[[01474.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

FPU Flags Affected


/-----------\
|C0|C1|C2|C3|
|--+--+--+--|
|* |* |* |* |
\-----------/

C0, C1, C2, C3 as described in FPU Flags Affected.

[[[01473.htm|prev]]][[[01475.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

FPU Flags Affected


/-----------\
|C0|C1|C2|C3|
|--+--+--+--|
|* |* |* |* |
\-----------/

C0, C1, C2, C3 as loaded.

[[[01474.htm|prev]]][[[01476.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

AAA-ASCII Adjust after Addition



/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|37        |AAA                 |X|X|X|X|X|X|ASCII adjust AL after addition    |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01475.htm|prev]]][[[01477.htm|next]]][[[01475.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|37        |AAA                 |X|X|X|X|X|X|ASCII adjust AL after addition    |
\------------------------------------------------------------------------------/

[[[01476.htm|prev]]][[[01478.htm|next]]][[[01475.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


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;

[[[01478.htm|prev]]][[[01480.htm|next]]][[[01475.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|? |  |  |? |? |* |? |* |
\-----------------------/

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01480.htm|prev]]][[[01482.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

AAD-ASCII Adjust AX before Division



/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|D5 0A     |AAD                 |X|X|X|X|X|X|ASCII adjust before division      |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01481.htm|prev]]][[[01483.htm|next]]][[[01481.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|D5 0A     |AAD                 |X|X|X|X|X|X|ASCII adjust before division      |
\------------------------------------------------------------------------------/

[[[01482.htm|prev]]][[[01484.htm|next]]][[[01481.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


regAL = AL;
regAH = AH;
AL � (regAH * imm8 + regAL) AND OFFH;
AH � 0;

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]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|? |  |  |* |* |? |* |? |
\-----------------------/

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01486.htm|prev]]][[[01488.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

AAM-ASCII Adjust AX after Multiply



/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|D4 0A     |AAM                 |X|X|X|X|X|X|ASCII adjust AX after             |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01487.htm|prev]]][[[01489.htm|next]]][[[01487.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|D4 0A     |AAM                 |X|X|X|X|X|X|ASCII adjust AX after             |
\------------------------------------------------------------------------------/

[[[01488.htm|prev]]][[[01490.htm|next]]][[[01487.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


regAL � AL;
AH� regAL / imm8;
AL� regAL MOD imm8;

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]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|? |  |  |* |* |? |* |? |
\-----------------------/

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01492.htm|prev]]][[[01494.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

AAS-ASCII Adjust AL after Subtraction



/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|3F        |AAS                 |X|X|X|X|X|X|ASCII adjust AL after subtraction |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01493.htm|prev]]][[[01495.htm|next]]][[[01493.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|3F        |AAS                 |X|X|X|X|X|X|ASCII adjust AL after subtraction |
\------------------------------------------------------------------------------/

[[[01494.htm|prev]]][[[01496.htm|next]]][[[01493.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


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;

[[[01496.htm|prev]]][[[01498.htm|next]]][[[01493.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|? |  |  |? |? |* |? |* |
\-----------------------/

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01498.htm|prev]]][[[01500.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

ADC-Add with Carry



/------------------------------------------------------------------------------\
|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                          |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01499.htm|prev]]][[[01501.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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                          |
\------------------------------------------------------------------------------/

[[[01500.htm|prev]]][[[01502.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


DEST � DEST + SRC + CF;

[[[01502.htm|prev]]][[[01504.htm|next]]][[[01499.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|* |  |  |* |* |* |* |* |
\-----------------------/

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]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01507.htm|prev]]][[[01509.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

ADD-Add



/------------------------------------------------------------------------------\
|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   |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01508.htm|prev]]][[[01510.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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   |
\------------------------------------------------------------------------------/

[[[01509.htm|prev]]][[[01511.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


DEST � DEST + SRC;

[[[01511.htm|prev]]][[[01513.htm|next]]][[[01508.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|* |  |  |* |* |* |* |* |
\-----------------------/

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]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01516.htm|prev]]][[[01518.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

AND-Logical AND



/------------------------------------------------------------------------------\
|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   |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01517.htm|prev]]][[[01519.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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   |
\------------------------------------------------------------------------------/

[[[01518.htm|prev]]][[[01520.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


DEST � DEST AND SRC;
CF � 0;
OF � 0;

[[[01520.htm|prev]]][[[01522.htm|next]]][[[01517.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|0 |  |  |* |* |? |* |0 |
\-----------------------/

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]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01525.htm|prev]]][[[01527.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

ARPL-Adjust RPL Field of Selector



/------------------------------------------------------------------------------\
|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                   |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01526.htm|prev]]][[[01528.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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                   |
\------------------------------------------------------------------------------/

[[[01527.htm|prev]]][[[01529.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


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;

[[[01529.htm|prev]]][[[01531.htm|next]]][[[01526.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |  |  |* |  |  |  |
\-----------------------/

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]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01534.htm|prev]]][[[01536.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

BOUND-Check Array Index Against Bounds



/------------------------------------------------------------------------------\
|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)              |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01535.htm|prev]]][[[01537.htm|next]]][[[01535.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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)              |
\------------------------------------------------------------------------------/

[[[01536.htm|prev]]][[[01538.htm|next]]][[[01535.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


IF (LeftSRC < [RightSRC] OR LeftSRC > [RightSRC + 
OperandSize/8])
   (* Under lower bound or over upper bound *)
THEN Interrupt 5;
FI;

[[[01538.htm|prev]]][[[01540.htm|next]]][[[01535.htm|parent]]][[[toc.htm|TOC]]]

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]]]

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]]]

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01542.htm|prev]]][[[01544.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

BSF-Bit Scan Forward



/------------------------------------------------------------------------------\
|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     |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01543.htm|prev]]][[[01545.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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     |
\------------------------------------------------------------------------------/

[[[01544.htm|prev]]][[[01546.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


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;

[[[01546.htm|prev]]][[[01548.htm|next]]][[[01543.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|? |  |  |? |* |? |? |? |
\-----------------------/

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]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01551.htm|prev]]][[[01553.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

BSR-Bit Scan Reverse



/------------------------------------------------------------------------------\
|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     |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01552.htm|prev]]][[[01554.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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     |
\------------------------------------------------------------------------------/

[[[01553.htm|prev]]][[[01555.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


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;

[[[01555.htm|prev]]][[[01557.htm|next]]][[[01552.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|? |  |  |? |* |? |? |? |
\-----------------------/

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]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

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]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01560.htm|prev]]][[[01562.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

BSWAP-Byte Swap



/------------------------------------------------------------------------------\
|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         |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01561.htm|prev]]][[[01563.htm|next]]][[[01561.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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         |
\------------------------------------------------------------------------------/

[[[01562.htm|prev]]][[[01564.htm|next]]][[[01561.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


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)

[[[01564.htm|prev]]][[[01566.htm|next]]][[[01561.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Related Information

Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01566.htm|prev]]][[[01568.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

BT-Bit Test



/------------------------------------------------------------------------------\
|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        |                    | | | | | | |                                  |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01567.htm|prev]]][[[01569.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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        |                    | | | | | | |                                  |
\------------------------------------------------------------------------------/

[[[01568.htm|prev]]][[[01570.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


CF � BIT [LeftSRC, RightSRC];

[[[01570.htm|prev]]][[[01572.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |  |  |  |  |  |* |
\-----------------------/

The CF flag contains the value of the selected bit.

[[[01571.htm|prev]]][[[01573.htm|next]]][[[01567.htm|parent]]][[[toc.htm|TOC]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

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]]]

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:

    Effective Address + (4* (BitOffset DIV 32))

for a 32-bit operand size, or two bytes starting from the memory address given by:

    Effective Address + (2 * (BitOffset DIV 16))

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]]]

Related Information

Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01576.htm|prev]]][[[01578.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

BTC-Bit Test and Complement



/------------------------------------------------------------------------------\
|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                        |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01577.htm|prev]]][[[01579.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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                        |
\------------------------------------------------------------------------------/

[[[01578.htm|prev]]][[[01580.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


CF � BIT[LeftSRC, RightSRC];
BIT[LeftSRC, RightSRC] � NOT BIT[LeftSrc, RightSRC];

[[[01580.htm|prev]]][[[01582.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |  |  |  |  |  |* |
\-----------------------/

The CF flag contains the complement of the selected bit.

[[[01581.htm|prev]]][[[01583.htm|next]]][[[01577.htm|parent]]][[[toc.htm|TOC]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

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]]]

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:

    Effective Address + (4 * (BitOffset DIV 32))

for a 32-bit operand size, or two bytes starting from the memory address given by:

    Effective Address + (2 * (BitOffset DIV 16))

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]]]

Related Information

Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01586.htm|prev]]][[[01588.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

BTR-Bit Test and Reset



/------------------------------------------------------------------------------\
|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        |                    | | | | | | |                                  |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01587.htm|prev]]][[[01589.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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        |                    | | | | | | |                                  |
\------------------------------------------------------------------------------/

[[[01588.htm|prev]]][[[01590.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


CF � BIT[LeftSRC, RightSRC];
BIT[LeftSRC, RightSRC] � 0;

[[[01590.htm|prev]]][[[01592.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |  |  |  |  |  |* |
\-----------------------/

The CF flag contains the value of the selected bit.

[[[01591.htm|prev]]][[[01593.htm|next]]][[[01587.htm|parent]]][[[toc.htm|TOC]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

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]]]

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:

    Effective Address + 4 * (BitOffset DIV 32)

for a 32-bit operand size, or two bytes starting from the memory address given by:

    Effective Address + 2 * (BitOffset DIV 16)

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]]]

Related Information

Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01596.htm|prev]]][[[01598.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

BTS-Bit Test and Set



/------------------------------------------------------------------------------\
|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        |                    | | | | | | |                                  |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01597.htm|prev]]][[[01599.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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        |                    | | | | | | |                                  |
\------------------------------------------------------------------------------/

[[[01598.htm|prev]]][[[01600.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


CF � BIT[LeftSRC, RightSRC];
BIT[LeftSRC, RightSRC] � 1;

[[[01600.htm|prev]]][[[01602.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |  |  |  |  |  |* |
\-----------------------/

The CF flag contains the value of the selected bit.

[[[01601.htm|prev]]][[[01603.htm|next]]][[[01597.htm|parent]]][[[toc.htm|TOC]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

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]]]

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:

    Effective Address + (4 * (BitOffset DIV 32))

for a 32-bit operand size, or two bytes starting from the memory address given by:

    Effective Address + (2 * (BitOffset DIV 16))

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]]]

Related Information

Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01606.htm|prev]]][[[01608.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

CALL-Call Procedure



/------------------------------------------------------------------------------\
|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                      |
\------------------------------------------------------------------------------/

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 rel16and CALL rel32forms add a signed offset to the address of the instruction following the CALL instruction to determine the destination. The rel16form is used when the instruction's operand-size attribute is 16- bits; rel32is 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/m16and CALL r/m32specify a register or memory location from which the absolute segment offset is fetched. The offset fetched from r/mis 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:16and CALL ptr16:32, use a four-byte or six-byte operand as a long pointer to the procedure called. The CALL m16:16and m16: 32forms 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

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.



Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01607.htm|prev]]][[[01609.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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                      |
\------------------------------------------------------------------------------/

[[[01608.htm|prev]]][[[01610.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]

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 rel16and CALL rel32forms add a signed offset to the address of the instruction following the CALL instruction to determine the destination. The rel16form is used when the instruction's operand-size attribute is 16- bits; rel32is 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/m16and CALL r/m32specify a register or memory location from which the absolute segment offset is fetched. The offset fetched from r/mis 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:16and CALL ptr16:32, use a four-byte or six-byte operand as a long pointer to the procedure called. The CALL m16:16and m16: 32forms 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

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]]]

Operation


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)

[[[01610.htm|prev]]][[[01612.htm|next]]][[[01607.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |  |  |  |  |  |  |
\-----------------------/

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]]]

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]]]

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]]]

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]]]

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]]]

Related Information

Description

Flags Affected

Notes

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01616.htm|prev]]][[[01618.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

CBW/CWDE-Convert Byte to Word/Convert Word to Doubleword



/------------------------------------------------------------------------------\
|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           |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01617.htm|prev]]][[[01619.htm|next]]][[[01617.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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           |
\------------------------------------------------------------------------------/

[[[01618.htm|prev]]][[[01620.htm|next]]][[[01617.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


IF OperandSize = 16 (* instruction = CBW *)
THEN AX � Sign Extend(AL);
ELSE (* OperandSize = 32, instruction = CWDE *)
   EAX � Sign Extend(AX);
FI;

[[[01620.htm|prev]]][[[01622.htm|next]]][[[01617.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01621.htm|prev]]][[[01623.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

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]]]

CLC-Clear Carry Flag



/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|F8        |CLC                 |X|X|X|X|X|X|Clear carry flag                  |
\------------------------------------------------------------------------------/

The CLC instruction clears the CF flag. It does not affect other flags or registers.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01623.htm|prev]]][[[01625.htm|next]]][[[01623.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|F8        |CLC                 |X|X|X|X|X|X|Clear carry flag                  |
\------------------------------------------------------------------------------/

[[[01624.htm|prev]]][[[01626.htm|next]]][[[01623.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


CF � 0;

[[[01626.htm|prev]]][[[01628.htm|next]]][[[01623.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |  |  |  |  |  |0 |
\-----------------------/

The CF flag is cleared.

[[[01627.htm|prev]]][[[01629.htm|next]]][[[01623.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01628.htm|prev]]][[[01630.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

CLD-Clear Direction Flag



/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|FC        |CLD                 |X|X|X|X|X|X|Clear direction flag              |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01629.htm|prev]]][[[01631.htm|next]]][[[01629.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|FC        |CLD                 |X|X|X|X|X|X|Clear direction flag              |
\------------------------------------------------------------------------------/

[[[01630.htm|prev]]][[[01632.htm|next]]][[[01629.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


DF � 0;

[[[01632.htm|prev]]][[[01634.htm|next]]][[[01629.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |0 |  |  |  |  |  |  |
\-----------------------/

The DF flag is cleared.

[[[01633.htm|prev]]][[[01635.htm|next]]][[[01629.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01634.htm|prev]]][[[01636.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

CLI-Clear Interrupt Flag



/------------------------------------------------------------------------------\
|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                           |
\------------------------------------------------------------------------------/

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.



Decision Table

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01635.htm|prev]]][[[01637.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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                           |
\------------------------------------------------------------------------------/

[[[01636.htm|prev]]][[[01638.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


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;

[[[01638.htm|prev]]][[[01640.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]

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.

/--------------------------------------------------\
|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   |
\--------------------------------------------------/

Notes:

- Don't care

Blank Action Not Taken

Y Action in Column 1 taken

[[[01639.htm|prev]]][[[01641.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |0 |  |  |  |  |  |
\-----------------------/

IF cleared.

[[[01640.htm|prev]]][[[01642.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]

Protected Mode Exceptions

  1. 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]]]

Virtual 8086 Mode Exceptions

  1. GP(0) as for protected mode.

[[[01642.htm|prev]]][[[01644.htm|next]]][[[01635.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Decision Table

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01643.htm|prev]]][[[01645.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

CLTS-Clear Task-Switched Flag in CR0



/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|0F 06     |CLTS                | | |X|X|X|X|Clear task-switched flag          |
\------------------------------------------------------------------------------/

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.

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01644.htm|prev]]][[[01646.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|0F 06     |CLTS                | | |X|X|X|X|Clear task-switched flag          |
\------------------------------------------------------------------------------/

[[[01645.htm|prev]]][[[01647.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]

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.

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]]]

Operation


TS Flag in CR0 � 0;

[[[01647.htm|prev]]][[[01649.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |  |  |  |  |  |  |
\-----------------------/

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]]]

Protected Mode Exceptions

  1. 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]]]

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]]]

Virtual 8086 Mode Exceptions

Same exceptions as in Protected Mode.

[[[01651.htm|prev]]][[[01653.htm|next]]][[[01644.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01652.htm|prev]]][[[01654.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

CMC-Complement Carry Flag



/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|F5        |CMC                 |X|X|X|X|X|X|Complement carry flag             |
\------------------------------------------------------------------------------/

The CMC instruction reverses the setting of the CF flag. No other flags are affected.



Description

Flags Affected

Operation

Protected Mode Exceptions

Protected Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01653.htm|prev]]][[[01655.htm|next]]][[[01653.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|Encoding  |Instruction         |0|1|2|3|4|5|Description                       |
|----------+--------------------+-+-+-+-+-+-+----------------------------------|
|F5        |CMC                 |X|X|X|X|X|X|Complement carry flag             |
\------------------------------------------------------------------------------/

[[[01654.htm|prev]]][[[01656.htm|next]]][[[01653.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


CF � NOT CF;

[[[01656.htm|prev]]][[[01658.htm|next]]][[[01653.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|  |  |  |  |  |  |  |* |
\-----------------------/

The CF flag contains the complement of its original value.

[[[01657.htm|prev]]][[[01659.htm|next]]][[[01653.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Flags Affected

Operation

Protected Mode Exceptions

Protected Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01658.htm|prev]]][[[01660.htm|next]]][[[01466.htm|parent]]][[[toc.htm|TOC]]]

CMP-Compare Two Operands



/------------------------------------------------------------------------------\
|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                          |
\------------------------------------------------------------------------------/

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.



Description

Flags Affected

Operation

Protected Mode Exceptions

Real Address Mode Exceptions

Virtual 8086 Mode Exceptions

[[[01659.htm|prev]]][[[01661.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]

Details Table


/------------------------------------------------------------------------------\
|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                          |
\------------------------------------------------------------------------------/

[[[01660.htm|prev]]][[[01662.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]

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]]]

Operation


LeftSRC - SignExtend(RightSRC);
(* CMP does not store a result; its purpose is to set the flags *)

[[[01662.htm|prev]]][[[01664.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]

Flags Affected


/-----------------------\
|OF|DF|IF|SF|ZF|AF|PF|CF|
|--+--+--+--+--+--+--+--|
|* |  |  |* |* |* |* |* |
\-----------------------/

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]]]

Protected Mode Exceptions

  1. 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.

[[[01664.htm|prev]]][[[01666.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]

Real Address Mode Exceptions

Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH.

[[[01665.htm|prev]]][[[01667.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]

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.

[[[01666.htm|prev]]][[[01668.htm|next]]][[[01659.htm|parent]]][[[toc.htm|TOC]]]

Related Information

Description

Flags Affected

Operation

[[01664.htm|Protect