home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft_Programmers_Library.7z / MPL / masm / masmref.txt < prev    next >
Encoding:
Text File  |  2013-11-08  |  185.9 KB  |  5,701 lines

  1.  Microsoft(R) Macro Assembler Reference
  2.  
  3.  
  4.  for the MS-DOS(R) and OS/2 Operating Systems
  5.  
  6.  
  7.  Microsoft Corporation
  8.  Information in this document is subject to change without notice and does
  9.  not represent a commitment on the part of Microsoft Corporation.  The
  10.  software described in this document is furnished under a license agreement
  11.  or nondisclosure agreement.  The software may be used or copied only in
  12.  accordance with the terms of the agreement.  The purchaser may make one copy
  13.  for backup purposes.  No part of this manual may be reproduced or
  14.  transmitted in any form or by any means, electronic or mechanical, including
  15.  photocopying and recording, for any purpose other than the purchaser's
  16.  personal use without the written permission of Microsoft Corporation.
  17.  
  18.  
  19.  (C) Copyright Microsoft Corporation, 1987, 1988.  All rights reserved.
  20.  Simultaneously published in the U.S. and Canada.
  21.  
  22.  Printed and bound in the United States of America.
  23.  
  24.  Timings and encodings in this manual are used with permission of Intel and
  25.  come from the following publications:
  26.  
  27.  Intel Corporation. iAPX 86, 88, 186 and 188 User's Manual, Programmer's
  28.  Reference. Santa Clara, Calif. 1986.
  29.  Intel Corporation. iAPX 286 Programmer's Reference Manual including the iAPX
  30.  286 Numeric Supplement, Santa Clara, Calif. 1985.
  31.  
  32.  Intel Corporation. 80386 Programmer's Reference Manual. Santa Clara, Calif.
  33.  1986
  34.  Intel Corporation. 80387 80-bit CHMOS III Numeric Processor Extension. Santa
  35.  Clara, Calif. 1987.
  36.  Intel Corporation.  i486 Microprocessor, Santa Clara, Calif. 1989.
  37.  
  38.  Document No. 410610002-500-R01-1287
  39.  10   9   8   7   6   5   4   3   2   1
  40.  
  41.  Part No. 04696
  42.  
  43.  
  44.  
  45.  Document Conventions
  46.  
  47.  
  48.  KEY TERMS
  49.  Bold type indicates text that must be typed exactly as shown. This includes
  50.  assembly-language instructions, directives, symbols, and operators, as well
  51.  as keywords in other languages.
  52.  
  53.  
  54.  placeholders
  55.  Italics indicate variable information supplied by the user.
  56.  
  57.  Examples
  58.  This typeface indicates example programs, user input, and screen output.
  59.  
  60.  
  61.  [optional items]
  62.  Double brackets indicate that the enclosed item is optional.
  63.  
  64.  
  65.  {choice1 |  choice2}
  66.  Braces and a vertical bar indicate a choice between two or more items. You
  67.  must choose one of the items unless double square brackets surround the
  68.  braces.
  69.  
  70.  
  71.  Repeating elements...
  72.  Three dots following an item indicate that more items having the same form
  73.  may be typed.
  74.  
  75.  SHIFT+F1
  76.  Small capital letters indicate key names.
  77.  
  78.  
  79.  
  80.  Tools
  81.  
  82.  
  83.  
  84.  BIND
  85.  
  86.  The BIND utility converts an OS/2 program to run under both DOS and OS/2.
  87.  
  88.  Command-Line Syntax
  89.  BIND infile [libraries] [options]
  90.  
  91.  
  92.  Options
  93. ╓┌───────────────────────────────────┌───────────────────────────────────────╖
  94.  Option                              Action
  95.  ────────────────────────────────────────────────────────────────────────────
  96.  /HELP                               Option name: /HELP. Calls QuickHelp
  97.                                      for help on BIND.
  98.  
  99.  /MAP [ mapfile]                     Option name: /M[AP]. Generates a map
  100.                                      of the DOS part of the executable file.
  101.  
  102.  /NAMES  functions/NAMES  @filename  Option name: /N[AMES]. Specifies
  103.                                      functions supported under OS/2 only.
  104.                                      Use with a list of functions separated
  105.                                      by spaces or a file specification
  106.                                      preceded by  @.
  107.  Option                              Action
  108.  ────────────────────────────────────────────────────────────────────────────
  109.                                     preceded by  @.
  110.  
  111.  /NOLOGO                             Option name: /NOLOGO. Suppresses the
  112.                                      BIND copyright message.
  113.  
  114.  /O  outfile                         Option name: /O[UTFILE]. Specifies the
  115.                                      name for the bound application.
  116.  
  117.  /?                                  Option name: /?. Displays a brief
  118.                                      summary of BIND command-line syntax.
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  Environment Variables
  127. ╓┌───────────┌───────────────────────────────────────────────────────────────╖
  128.  Variable    Description
  129.  ────────────────────────────────────────────────────────────────────────────
  130.  LIB         Specifies search path for library files.
  131.  LINK        Specifies default command-line options for the linker.
  132.  TMPf        Specifies path for the VM.TMP file.
  133.  
  134.  
  135.  
  136.  
  137.  Microsoft(R) CodeView(R) Debugger
  138.  
  139.  The Microsoft(R) CodeView(R) debugger runs the assembled or compiled program
  140.  while simultaneously displaying the program source code, program variables,
  141.  memory locations, processor registers, and other pertinent information.
  142.  
  143.  Command-Line Syntax
  144.  CV [options] executablefile [arguments]
  145.  CVP [options] executablefile [arguments]
  146.  
  147.  
  148.  
  149.  Options
  150. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  151.  Option                            Action
  152.  ────────────────────────────────────────────────────────────────────────────
  153.  /2                                Permits the use of two monitors.
  154.  
  155.  /25                               Starts in 25-line mode.
  156.  
  157.  /43                               Starts in 43-line mode.
  158.  
  159.  /50                               Starts in 50-line mode.
  160.  
  161.  /B                                Starts in black-and-white mode.
  162.  
  163.  /C commands                       Executes  commands on start-up.
  164.  
  165.  /D[ buffersize]                   Enables disk overlays (CV only).
  166.  
  167.  /E                                Enables use of expanded memory (CV only).
  168.  
  169.  /F                                Exchanges screens by flipping between
  170.  Option                            Action
  171.  ────────────────────────────────────────────────────────────────────────────
  172. /F                                Exchanges screens by flipping between
  173.                                    video pages (CV only).
  174.  
  175.  /G                                Eliminates refresh snow on CGA monitors
  176.                                    (CV only).
  177.  
  178.  /I[0 | 1]                         Turns nonmaskable-interrupt and
  179.                                    8259-interrupt trapping on (/I1) or off
  180.                                    (/I0) (CV only).
  181.  
  182.  /K                                Disables installation of keyboard
  183.                                    monitors for the program being debugged.
  184.  
  185.  /L dll                            Loads symbolic information for the
  186.                                    specified dynamic-link library (CVP
  187.                                    only).
  188.  
  189.  /M                                Disables CodeView use of the mouse (use
  190.                                    this option when debugging an
  191.  Option                            Action
  192.  ────────────────────────────────────────────────────────────────────────────
  193.                                   this option when debugging an
  194.                                    application that supports the mouse).
  195.  
  196.  /N[0 | 1]                         /N0 tells CodeView to trap nonmaskable
  197.                                    interrupts; /N1 tells it not to trap (CV
  198.                                    only).
  199.  
  200.  /O                                Enables debugging of multiple processes
  201.                                    (CVP only).
  202.  
  203.  /R                                Enables 80386/486 debug registers (CV
  204.                                    only).
  205.  
  206.  /S                                Exchanges screens by changing buffers
  207.                                    (primarily for use with graphics
  208.                                    programs) (CV only).
  209.  
  210.  /TSF                              Toggles TOOLS.INI entry to read/not read
  211.                                    the CURRENT.STS file.
  212.  Option                            Action
  213.  ────────────────────────────────────────────────────────────────────────────
  214.                                   the CURRENT.STS file.
  215.  
  216.  /X                                Enables use of extended memory (CV only).
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  Environment Variables
  225.  
  226.  variable     Description
  227.  ────────────────────────────────────────────────────────────────────────────
  228.  HELPFILES    Specifies path of help files or list of help filenames.
  229.  INIT         Specifies path for TOOLS.INI and CURRENT.STS files.
  230.  
  231.  
  232.  
  233.  
  234.  CVPACK
  235.  
  236.  The CVPACK utility reduces the size of an executable file that contains
  237.  CodeView debugging information.
  238.  
  239.  Command-Line Syntax
  240.  CVPACK [options] exefile
  241.  
  242.  
  243.  Options
  244.  
  245.  Option     Action
  246.  ────────────────────────────────────────────────────────────────────────────
  247.  /HELP      Calls QuickHelp for help on CVPACK.
  248.  /P         Packs the file to the smallest possible size.
  249.  /?         Displays a brief summary of CVPACK command-line syntax.
  250.  
  251.  
  252.  
  253.  
  254.  EXEHDR
  255.  
  256.  The EXEHDR utility displays and modifies the contents of an executable-file
  257.  header.
  258.  
  259.  Command-Line Syntax
  260.  EXEHDR [options]  filenames
  261.  
  262.  
  263.  Options
  264. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  265.  Option                            action
  266.  ────────────────────────────────────────────────────────────────────────────
  267.  /HEAP: number                     Option name: /HEA[P]. Sets the heap
  268.                                    allocation field to  number bytes for
  269.                                    segmented executable files.
  270.  
  271.  /HELP                             Option name: /HEL[P]. Calls QuickHelp
  272.                                    for help on EXEHDR.
  273.  
  274.  /MAX: number                      Option name: /MA[X]. Sets the maximum
  275.  Option                            action
  276.  ────────────────────────────────────────────────────────────────────────────
  277. /MAX: number                      Option name: /MA[X]. Sets the maximum
  278.                                    memory allocation to  number paragraphs
  279.                                    for DOS executable files.
  280.  
  281.  
  282.  
  283.  /MIN: number                      Option name: /MI[N]. Sets the minimum
  284.                                    memory allocation to  number paragraphs
  285.                                    for DOS executable files.
  286.  
  287.  /NEW                              Option name: /NE[WFILES]. Enables
  288.                                    support for HPFS.
  289.  
  290.  /NOLOGO                           Option name: /NO[LOGO]. Suppresses the
  291.                                    EXEHDR copyright message.
  292.  
  293.  /PM: type                         Option name: /P[MTYPE]. Sets the
  294.                                    application type for OS/2 or Microsoft
  295.                                    Windows[tm], where  type is one of the
  296.  Option                            action
  297.  ────────────────────────────────────────────────────────────────────────────
  298.                                   Windows[tm], where  type is one of the
  299.                                    following:  PM (or  WINDOWAPI),  VIO (or
  300.                                    WINDOWCOMPAT), or  NOVIO (or
  301.                                    NOTWINDOWCOMPAT).
  302.  
  303.  /RESET                            Option name: /R[ESETERROR]. Clears the
  304.                                    error bit in the header of an OS/2 or
  305.                                    Windows executable file.
  306.  
  307.  /STACK: number                    Option name: /S[TACK]. Sets the stack
  308.                                    allocation to  number bytes.
  309.  
  310.  /V                                Option name: /V[ERBOSE]. Provides more
  311.                                    information about segmented executable
  312.                                    files, including the default flags in
  313.                                    the segment table, all run-time
  314.                                    relocations, and additional fields from
  315.                                    the header.
  316.  
  317.  Option                            action
  318.  ────────────────────────────────────────────────────────────────────────────
  319. 
  320.  /?                                Option name: /?. Displays a brief
  321.                                    summary of EXEHDR command-line syntax.
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  EXP
  329.  
  330.  The EXP utility deletes all files in the hidden DELETED subdirectory of the
  331.  current or specified directory. EXP is used along with RM and UNDEL to
  332.  manage backup files.
  333.  
  334.  Command-Line Syntax
  335.  EXP [options] [directories]
  336.  
  337.  
  338.  Options
  339. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  340.  Option                            Action
  341.  ────────────────────────────────────────────────────────────────────────────
  342.  /HELP                             Calls QuickHelp for help on EXP.
  343.  
  344.  /Q                                Suppresses display of deleted files.
  345.  
  346.  /R                                Recurses into subdirectories of the
  347.                                    current or specified directory.
  348.  
  349.  /?                                Displays a brief summary of EXP
  350.                                    command-line syntax.
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  HELPMAKE
  358.  
  359.  The HELPMAKE utility creates help files and customizes the help files
  360.  supplied with Microsoft language products.
  361.  
  362.  Command-Line Syntax
  363.  HELPMAKE {/E[n] | /D[c] | /H | /?} [options] sourcefiles
  364.  
  365.  
  366.  Options
  367. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  368.  Option                            Action
  369.  ────────────────────────────────────────────────────────────────────────────
  370.  /A c                              Specifies  c as an application-specific
  371.                                    control character for the help database,
  372.                                    marking a line that contains special
  373.                                    information for internal use by the
  374.                                    application.
  375.  
  376.  /C                                Indicates that the context strings are
  377.                                    case sensitive so that at run time all
  378.                                    searches for help topics will be case
  379.                                    sensitive.
  380.  Option                            Action
  381.  ────────────────────────────────────────────────────────────────────────────
  382.                                   sensitive.
  383.  
  384.  /D                                Fully decodes the help database.
  385.  
  386.  /DS                               Splits the concatenated, compressed help
  387.                                    database into its components, using
  388.                                    their original names. No decompression
  389.                                    occurs.
  390.  
  391.  /DU                               Decompresses the database and removes
  392.                                    all screen formatting and
  393.                                    cross-references.
  394.  
  395.  /E[ n]                            Creates ("encodes") a help database from
  396.                                    a specified text file (or files). The
  397.                                    optional  n indicates the amount of
  398.                                    compression to take place. The value of
  399.                                    n can range from 0 to 15.
  400.  
  401.  Option                            Action
  402.  ────────────────────────────────────────────────────────────────────────────
  403. 
  404.  /H[ELP]                           Calls the QuickHelp utility. If HELPMAKE
  405.                                    cannot find QuickHelp or the help file,
  406.                                    it displays a brief summary of HELPMAKE
  407.                                    command-line syntax.
  408.  
  409.  /K filename                       Specifies a file containing
  410.                                    word-separator characters. This file
  411.                                    must contain a single line of characters
  412.                                    that separate words. ASCII characters
  413.                                    from 0 to 32 (including the space) and
  414.                                    character 127 are always separators. If
  415.                                    the /K option is not specified, the
  416.                                    following characters are also considered
  417.                                    separators:
  418.  
  419.  
  420.  /L                                Locks the generated file so that it
  421.                                    cannot be decoded by HELPMAKE at a later
  422.  Option                            Action
  423.  ────────────────────────────────────────────────────────────────────────────
  424.                                   cannot be decoded by HELPMAKE at a later
  425.                                    time.
  426.  
  427.  /NOLOGO                           Suppresses the HELPMAKE copyright
  428.                                    message.
  429.  
  430.  /O outfile                        Specifies  outfile as the name of the
  431.                                    help database. The name  outfile is
  432.                                    optional with the /D option.
  433.  
  434.  
  435.  
  436.  /S n                              Specifies the type of input file,
  437.                                    according to the following  n values:
  438.  
  439.  /T                                During encoding, translates dot commands
  440.                                    to application-specific commands. During
  441.                                    decoding, translates application
  442.                                    commands to dot commands. The /T option
  443.  Option                            Action
  444.  ────────────────────────────────────────────────────────────────────────────
  445.                                   commands to dot commands. The /T option
  446.                                    forces /A:.
  447.  
  448.  /V[ n]                            Sets the verbosity of the diagnostic and
  449.                                    informational output, depending on the
  450.                                    value of  n. The value of  n can range
  451.                                    from 0 to 6.
  452.  
  453.  /W width                          Sets the fixed width of the resulting
  454.                                    help text in number of characters. The
  455.                                    value of  width can range from 11 to 255.
  456.  
  457.  /?                                Displays a brief summary of HELPMAKE
  458.                                    command-line syntax.
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  H2INC
  465.  
  466.  The H2INC utility converts C header (.H) files into MASM- compatible include
  467.  (.INC) files. It translates declarations and prototypes, but does not
  468.  translate code.
  469.  
  470.  Command-Line SyntaxH2INC [options]  filename.H
  471.  
  472.  
  473.  Options
  474. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  475.  Option                            Action
  476.  ────────────────────────────────────────────────────────────────────────────
  477.  /C                                Passes comments in the .H file to the
  478.                                    .INC file.
  479.  
  480.  /Fa [ filename]                   Specifies that the output file contain
  481.                                    only equivalent MASM statements. This is
  482.                                    the default.
  483.  
  484.  /Fc [ filename]                   Specifies that the output file contain
  485.  Option                            Action
  486.  ────────────────────────────────────────────────────────────────────────────
  487. /Fc [ filename]                   Specifies that the output file contain
  488.                                    equivalent MASM statements plus original
  489.                                    C statements converted to comment lines.
  490.  
  491.  /HELP                             Calls QuickHelp for help on H2INC.
  492.  
  493.  /Ht                               Enables generation of text equates. By
  494.                                    default, text items are not translated.
  495.  
  496.  /Mn                               Instructs H2INC to explicitly declare
  497.                                    the distances for all pointers and
  498.                                    functions.
  499.  
  500.  /Ni                               Suppresses the expansion of nested
  501.                                    include files.
  502.  
  503.  /Zn  string                       Adds  string to all names generated by
  504.                                    H2INC. Used to eliminate name conflicts
  505.                                    with other H2INC-generated include files.
  506.  Option                            Action
  507.  ────────────────────────────────────────────────────────────────────────────
  508.                                   with other H2INC-generated include files.
  509.  
  510.  
  511.  
  512.  /Zu                               Makes all structure and union tag names
  513.                                    unique.
  514.  
  515.  /?                                Displays a brief summary of H2INC
  516.                                    command-line syntax.
  517.  
  518.  
  519.  
  520.  
  521.  Note: H2INC also supports the following options from Microsoft C, version
  522.  6.0: /AC, /AH, /AL, /AM, /AS, /AT, /D, /F, /Fi, /G0, /G1, /G2, /G3, /G4,
  523.  /Gc, /Gd, /Gr, /I, /J, /Tc, /U, /u, /W0, /W1, /W2, /W3, /W4, /X, /Za, /Zc,
  524.  /Ze, /Zp1, /Zp2, /Zp4.
  525.  
  526.  Environment Variables
  527. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  528.  Variable                          Description
  529.  ────────────────────────────────────────────────────────────────────────────
  530.  CL                                Specifies default command-line options.
  531.  
  532.  H2INC                             Specifies default command-line options.
  533.                                    Appended after the CL environment
  534.                                    variable.
  535.  
  536.  INCLUDE                           Specifies search path for include files.
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  IMPLIB
  544.  
  545.  The IMPLIB utility creates import libraries used by LINK to link
  546.  dynamic-link libraries with applications.
  547.  
  548.  Command-Line Syntax
  549.  IMPLIB [options] implibname {dllfile... | deffile...}
  550.  
  551.  
  552.  Options
  553. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  554.  Option                            action
  555.  ────────────────────────────────────────────────────────────────────────────
  556.  /HELP                             Option name: /H[ELP]. Calls QuickHelp
  557.                                    for help on IMPLIB.
  558.  
  559.  /NOI                              Option name: /NOI[GNORECASE]. Preserves
  560.                                    case for entry names in DLLs.
  561.  
  562.  /NOLOGO                           Option name: /NOL[OGO]. Suppresses the
  563.                                    IMPLIB copyright message.
  564.  
  565.  /?                                Option name: /?. Displays a brief
  566.                                    summary of IMPLIB command-line syntax.
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  LIB
  573.  
  574.  The LIB utility helps create, organize, and maintain run-time libraries.
  575.  Command-Line SyntaxLIB inlibrary [options] [commands] [, [listfile] [,
  576.  [outlibrary] ] ] [;]
  577.  
  578.  
  579.  Options
  580. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  581.  Option                            Action
  582.  ────────────────────────────────────────────────────────────────────────────
  583.  /HELP
  584.  
  585.  /IGN                              Option name: /I[GNORECASE]. Tells LIB to
  586.                                    ignore case when comparing symbols (the
  587.                                    default). Use to combine a library
  588.                                    marked /NOI with an unmarked library to
  589.                                    create a new case-insensitive library.
  590.  Option                            Action
  591.  ────────────────────────────────────────────────────────────────────────────
  592.                                   create a new case-insensitive library.
  593.  
  594.  /NOE                              Option name: NOE[XTDICTIONARY]. Prevents
  595.                                    LIB from creating an extended dictionary.
  596.  
  597.  /NOI                              Option name: /NOI[GNORECASE]. Tells LIB
  598.                                    to preserve case when comparing symbols.
  599.                                    When combining libraries, if any library
  600.                                    is marked /NOI, the output library is
  601.                                    case sensitive, unless /IGN is specified.
  602.  
  603.  /NOLOGO                           Option name: /NOL[OGO]. Suppresses the
  604.                                    LIB copyright message.
  605.  
  606.  /PAGE: number                     Option name: /P[AGESIZE]. Specifies the
  607.                                    page size (in bytes) of a new library or
  608.                                    changes the page size of an existing
  609.                                    library. The default for a new library
  610.                                    is 16.
  611.  Option                            Action
  612.  ────────────────────────────────────────────────────────────────────────────
  613.                                   is 16.
  614.  
  615.  /?                                Option name: /?. Displays a brief
  616.                                    summary of LIB command-line syntax.
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  Commands
  624. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  625.  Operator                          Action
  626.  ────────────────────────────────────────────────────────────────────────────
  627.  + name                            Appends an object file or library file.
  628.  
  629.   - name                           Deletes a module.
  630.  
  631.   -+ name                          Replaces a module by deleting it and
  632.  Operator                          Action
  633.  ────────────────────────────────────────────────────────────────────────────
  634.  -+ name                          Replaces a module by deleting it and
  635.                                    appending an object file with the same
  636.                                    name.
  637.  
  638.   * name                           Copies a module to a new object file.
  639.  
  640.   -* name                          Moves a module out of the library by
  641.                                    copying it to a new object file and then
  642.                                    deleting it.
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  LINK
  650.  
  651.  The LINK utility combines object files into a single executable file or
  652.  dynamic-link library.
  653.  
  654.  Command-Line Syntax
  655.  LINK objfiles [, [exefile] [, [mapfile] [, [libraries] [, [deffile] ] ] ] ]
  656.  [;]
  657.  
  658.  
  659.  Options
  660. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  661.  Option                            Action
  662.  ────────────────────────────────────────────────────────────────────────────
  663.  /ALIGN: size                      Option name: /A[LIGNMENT]. Directs LINK
  664.                                    to align segment data in a segmented
  665.                                    executable file along the boundaries
  666.                                    specified by  size bytes, where  size
  667.                                    must be a power of two.
  668.  
  669.  /BATCH                            Option name: /B[ATCH]. Suppresses
  670.                                    prompts for library or object files not
  671.                                    found.
  672.  
  673.  /CO                               Option name: /CO[DEVIEW]. Adds symbolic
  674.  Option                            Action
  675.  ────────────────────────────────────────────────────────────────────────────
  676. /CO                               Option name: /CO[DEVIEW]. Adds symbolic
  677.                                    data and line numbers needed by the
  678.                                    Microsoft CodeView debugger. This option
  679.                                    is incompatible with the /EXEPACK option.
  680.  
  681.  /CPARM: number                    Option name: /CP[ARMAXALLOC]. Sets the
  682.                                    program's maximum memory allocation to
  683.                                    number of 16-byte paragraphs.
  684.  
  685.  /DOSSEG                           Option name: /DO[SSEG]. Orders segments
  686.                                    in the default order used by Microsoft
  687.                                    high-level languages.
  688.  
  689.  /DSALLOC                          Option name: /DS[ALLOCATE]. Directs LINK
  690.                                    to load all data starting at the high
  691.                                    end of the data segment. The /DSALLOC
  692.                                    option is for assembly-language programs
  693.                                    that create DOS .EXE files.
  694.  
  695.  Option                            Action
  696.  ────────────────────────────────────────────────────────────────────────────
  697. 
  698.  /EXEPACK                          Option name: /E[XEPACK]. Packs the
  699.                                    executable file. The /EXEPACK option is
  700.                                    incompatible with either /INCR or /CO.
  701.                                    Do not use /EXEPACK on a Windows program.
  702.  
  703.  /FARCALL                          Option name: /F[ARCALLTRANSLATION].
  704.                                    Optimizes far calls. The /FARCALL option
  705.                                    is on automatically when using /TINY.
  706.                                    Use the /PACKC option with /FARCALL when
  707.                                    linking for OS/2; /PACKC is not
  708.                                    recommended with /FARCALL when linking
  709.                                    for Windows.
  710.  
  711.  /HELP                             Option name: /HE[LP]. Calls QuickHelp
  712.                                    for help on LINK.
  713.  
  714.  /HIGH                             Option name: /HI[GH]. Places the
  715.                                    executable file as high in memory as
  716.  Option                            Action
  717.  ────────────────────────────────────────────────────────────────────────────
  718.                                   executable file as high in memory as
  719.                                    possible. Use /HIGH with the /DSALLOC
  720.                                    option. This option is for
  721.                                    assembly-language programs that create
  722.                                    DOS .EXE files.
  723.  
  724.  /INCR                             Option name: /INC[REMENTAL]. Prepares
  725.                                    for incremental linking with ILINK. This
  726.                                    option is incompatible with /EXEPACK and
  727.                                    /TINY.
  728.  
  729.  /INFO                             Option name: /INF[ORMATION]. Displays to
  730.                                    the standard output the phase of linking
  731.                                    and names of object files being linked.
  732.  
  733.  /LINE                             Option name: /LI[NENUMBERS]. Adds
  734.                                    source-file line numbers and associated
  735.                                    addresses to the map file. The object
  736.                                    file must be created with line numbers.
  737.  Option                            Action
  738.  ────────────────────────────────────────────────────────────────────────────
  739.                                   file must be created with line numbers.
  740.                                    This option creates a map file even if
  741.                                    mapfile is not specified.
  742.  
  743.  /MAP                              Option name: /M[AP]. Adds public symbols
  744.                                    to the map file.
  745.  
  746.  /NOD[: libraryname]               Option name: /NOD[EFAULTLIBRARYSEARCH].
  747.                                    Ignores the specified default library.
  748.                                    Specify without  libraryname to ignore
  749.                                    all default libraries.
  750.  
  751.  /NOE                              Option name: /NOE[XTDICTIONARY].
  752.                                    Prevents LINK from searching extended
  753.                                    dictionaries in libraries. Use /NOE when
  754.                                    redefinition of a symbol causes error
  755.                                    L2044.
  756.  
  757.  /NOFARCALL                        Option name: /NOF[ARCALLTRANSLATION].
  758.  Option                            Action
  759.  ────────────────────────────────────────────────────────────────────────────
  760. /NOFARCALL                        Option name: /NOF[ARCALLTRANSLATION].
  761.                                    Turns off far-call optimization.
  762.  
  763.  /NOI                              Option name: /NOI[GNORECASE]. Preserves
  764.                                    case in identifiers.
  765.  
  766.  /NOLOGO                           Option name: /NOL[OGO]. Suppresses the
  767.                                    LINK copyright message
  768.  
  769.  /NONULLS                          Option name: /NON[ULLSDOSSEG]. Orders
  770.                                    segments as with the /DOSSEG option, but
  771.                                    with no additional bytes at the
  772.                                    beginning of the _TEXT segment (if
  773.                                    defined). This option overrides /DOSSEG.
  774.  
  775.  /NOPACKC                          Option name: /NOP[ACKCODE]. Turns off
  776.                                    code segment packing.
  777.  
  778.  /PACKC[: number]                  Option name: /PACKC[ODE]. Packs
  779.  Option                            Action
  780.  ────────────────────────────────────────────────────────────────────────────
  781. /PACKC[: number]                  Option name: /PACKC[ODE]. Packs
  782.                                    neighboring code segments together.
  783.                                    Specify  number bytes to set the maximum
  784.                                    size for physical segments formed by
  785.                                    /PACKC.
  786.  
  787.  /PACKD[: number]                  Option name: /PACKD[ATA]. Packs
  788.                                    neighboring data segments together.
  789.                                    Specify  number bytes to set the maximum
  790.                                    size for physical segments formed by
  791.                                    /PACKD. This option is for OS/2 and
  792.                                    Windows only.
  793.  
  794.  /PAUSE                            Option name: /PAU[SE]. Pauses during the
  795.                                    link session for disk changes.
  796.  
  797.  /PM: type                         Option name: /PM[TYPE]. Specifies the
  798.                                    type of Windows or OS/2 application
  799.                                    where  type is one of the following:  PM
  800.  Option                            Action
  801.  ────────────────────────────────────────────────────────────────────────────
  802.                                   where  type is one of the following:  PM
  803.                                    (or  WINDOWAPI),  VIO (or  WINDOWCOMPAT),
  804.                                    or  NOVIO (or  NOTWINDOWCOMPAT).
  805.  
  806.  /STACK: number                    Option name: /ST[ACK]. Sets the stack
  807.                                    size to  number bytes, from 1 byte to
  808.                                    64K.
  809.  
  810.  /TINY                             Option name: /T[INY]. Creates a
  811.                                    tiny-model DOS program with a .COM
  812.                                    extension instead of .EXE. Incompatible
  813.                                    with /INCR.
  814.  
  815.  /?                                Option name: /?. Displays a brief
  816.                                    summary of LINK command-line syntax.
  817.  
  818.  
  819.  
  820.  Note: Several rarely used options not listed above are described in online
  821.  help.
  822.  
  823.  Environment Variables
  824. ╓┌────────────────┌──────────────────────────────────────────────────────────╖
  825.  Variable         Description
  826.  ────────────────────────────────────────────────────────────────────────────
  827.  INIT             Specifies path for the TOOLS.INI file.
  828.  LIB              Specifies search path for library files.
  829.  LINK             Specifies default command-line options.
  830.  TMP              Specifies path for the VM.TMP file.
  831.  
  832.  
  833.  
  834.  
  835.  MASM
  836.  
  837.  The MASM program converts command-line options from MASM style to ML style,
  838.  adds options to maximize compatibility, and calls ML.EXE.
  839.  
  840.  Command-Line Syntax
  841.  MASM [options] sourcefile [, [objectfile] [, [listingfile]
  842.  [, [crossreferencefile] ] ] ] [;]
  843.  
  844.  
  845.  Options
  846. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  847.  Option                            Action
  848.  ────────────────────────────────────────────────────────────────────────────
  849.  /A                                Orders segments alphabetically. Results
  850.                                    in a warning. Ignored.
  851.  
  852.  /B                                Sets internal buffer size. Ignored.
  853.  
  854.  /C                                Creates a cross-reference file.
  855.                                    Translated to /FR.
  856.  
  857.  /D                                Creates a Pass 1 listing. Ignored.
  858.  
  859.  /D symbol[ = value]               Defines a symbol. Unchanged.
  860.  
  861.  /E                                Emulates floating-point instructions.
  862.                                    Translated to /FPi.
  863.  Option                            Action
  864.  ────────────────────────────────────────────────────────────────────────────
  865.                                   Translated to /FPi.
  866.  
  867.  /H                                Lists command-line arguments. Translated
  868.                                    to /help.
  869.  
  870.  /HELP                             Calls QuickHelp for help on the MASM
  871.                                    driver.
  872.  
  873.  /I  pathname                      Specifies an include path. Unchanged.
  874.  
  875.  /L                                Creates a normal listing. Translated to
  876.                                    /Fl.
  877.  
  878.  /LA                               Lists all. Translated to /Fl and /Sa.
  879.  
  880.  /ML                               Treats names as case sensitive.
  881.                                    Translated to /Cp.
  882.  
  883.  /MU                               Converts names to uppercase. Translated
  884.  Option                            Action
  885.  ────────────────────────────────────────────────────────────────────────────
  886. /MU                               Converts names to uppercase. Translated
  887.                                    to /Cu.
  888.  
  889.  /MX                               Preserves case on nonlocal names.
  890.                                    Translated to /Cx.
  891.  
  892.  /N                                Suppresses table in listing file.
  893.                                    Translated to /Sn.
  894.  
  895.  /P                                Checks for impure code. Use  OPTION
  896.                                    READONLY. Ignored.
  897.  
  898.  /S                                Orders segments sequentially. Results in
  899.                                    a warning. Ignored.
  900.  
  901.  /T                                Enables terse assembly. Translated to
  902.                                    /nologo.
  903.  
  904.  /V                                Enables verbose assembly. Ignored.
  905.  Option                            Action
  906.  ────────────────────────────────────────────────────────────────────────────
  907. /V                                Enables verbose assembly. Ignored.
  908.  
  909.  /W0                               Enables warning level 0. Unchanged.
  910.  
  911.  /W1                               Enables warning level 1. Unchanged.
  912.  
  913.  /W2                               Enables warning level 2. Unchanged.
  914.  
  915.  /X                                Lists false conditionals. Translated to
  916.                                    /Sx.
  917.  
  918.  /Z                                Displays error lines on screen. Ignored.
  919.  
  920.  /ZD                               Generates line numbers for CodeView.
  921.                                    Translated to /Zd.
  922.  
  923.  /ZI                               Generates symbols for CodeView.
  924.                                    Translated to /Zi.
  925.  
  926.  Option                            Action
  927.  ────────────────────────────────────────────────────────────────────────────
  928. 
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  Environment Variables
  935. ╓┌────────────────┌──────────────────────────────────────────────────────────╖
  936.  Variable         Description
  937.  ────────────────────────────────────────────────────────────────────────────
  938.  INCLUDE          Specifies default path for .INC files.
  939.  MASM             Specifies default command-line options.
  940.  TMP              Specifies path for temporary files.
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  ML
  947.  
  948.  The ML program assembles and links one or more assembly-language source
  949.  files. The command-line options are case sensitive.
  950.  
  951.  Command-Line Syntax
  952.  ML [options]  filename [ [options]  filename]... [/link linkoptions]
  953.  
  954.  
  955.  Options
  956. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  957.  Option                            Action
  958.  ────────────────────────────────────────────────────────────────────────────
  959.  /AT                               Enables tiny-memory-model support.
  960.                                    Enables error messages for code
  961.                                    constructs that violate the requirements
  962.                                    for .COM format files. Note that this is
  963.                                    not equivalent to the  .MODEL  TINY
  964.                                    directive.
  965.  
  966.  /Bl  filename                     Selects an alternate linker.
  967.  
  968.  Option                            Action
  969.  ────────────────────────────────────────────────────────────────────────────
  970. 
  971.  /c
  972.  
  973.  /Cp                               Preserves case of all user identifiers.
  974.  
  975.  /Cu                               Maps all identifiers to uppercase
  976.                                    (default).
  977.  
  978.  /Cx                               Preserves case in public and extern
  979.                                    symbols.
  980.  
  981.  /D symbol[ = value]               Defines a text macro with the given name.
  982.                                    If  value is missing, it is blank.
  983.                                    Multiple tokens separated by spaces must
  984.                                    be enclosed in quotation marks.
  985.  
  986.  /EP                               Generates a preprocessed source listing
  987.                                    (sent to STDOUT). See /Sf.
  988.  
  989.  Option                            Action
  990.  ────────────────────────────────────────────────────────────────────────────
  991. 
  992.  
  993.  
  994.  /F  hexnum                        Sets stack size to  hexnum bytes (this
  995.                                    is the same as /link /STACK: number).
  996.                                    The value must be expressed in
  997.                                    hexadecimal notation. There must be a
  998.                                    space between /F and  hexnum.
  999.  
  1000.  /Fb [ filename]                   Creates a bound executable file.
  1001.  
  1002.  /Fe  filename                     Names the executable file.
  1003.  
  1004.  /Fl [ filename]                   Generates an assembled code listing. See
  1005.                                    /Sf.
  1006.  
  1007.  /Fm [ filename]                   Creates a linker map file.
  1008.  
  1009.  /Fo  filename                     Names an object file.
  1010.  Option                            Action
  1011.  ────────────────────────────────────────────────────────────────────────────
  1012. /Fo  filename                     Names an object file.
  1013.  
  1014.  /FPi                              Generates emulator fixups for
  1015.                                    floating-point arithmetic
  1016.                                    (mixed-language only).
  1017.  
  1018.  /Fr [ filename]                   Generates a source browser .SBR file.
  1019.  
  1020.  /FR [ filename]                   Generates an extended form of a source
  1021.                                    browser .SBR file.
  1022.  
  1023.  /Gc                               Specifies use of FORTRAN- or
  1024.                                    Pascal-style function calling and naming
  1025.                                    conventions. Same as  OPTION
  1026.                                    LANGUAGE:PASCAL.
  1027.  
  1028.  /Gd                               Specifies use of C-style function
  1029.                                    calling and naming conventions. Same as
  1030.                                    OPTION  LANGUAGE:C.
  1031.  Option                            Action
  1032.  ────────────────────────────────────────────────────────────────────────────
  1033.                                   OPTION  LANGUAGE:C.
  1034.  
  1035.  /H  number                        Restricts external names to  number
  1036.                                    significant characters. The default is
  1037.                                    31 characters.
  1038.  
  1039.  /help                             Calls QuickHelp for help on ML.
  1040.  
  1041.  /I  pathname                      Sets path for include file. A maximum of
  1042.                                    10 /I options is allowed.
  1043.  
  1044.  /nologo                           Suppresses messages for successful
  1045.                                    assembly.
  1046.  
  1047.  /Sa                               Turns on listing of all available
  1048.                                    information.
  1049.  
  1050.  /Sf                               Adds first-pass listing to listing file.
  1051.  
  1052.  Option                            Action
  1053.  ────────────────────────────────────────────────────────────────────────────
  1054. 
  1055.  /Sg                               Turns on listing of assembly-generated
  1056.                                    code.
  1057.  
  1058.  /Sl  width                        Sets the line width of source listing in
  1059.                                    characters per line. Range is 60 to 255
  1060.                                    or 0. Default is 0. Same as  PAGE  ,
  1061.                                    width.
  1062.  
  1063.  /Sn                               Turns off symbol table when producing a
  1064.                                    listing.
  1065.  
  1066.  /Sp  length                       Sets the page length of source listing
  1067.                                    in lines per page. Range is 10 to 255 or
  1068.                                    0. Default is 0. Same as  PAGE  length.
  1069.  
  1070.  /Ss  text                         Specifies  text for source listing. Same
  1071.                                    as  SUBTITLE  text.
  1072.  
  1073.  Option                            Action
  1074.  ────────────────────────────────────────────────────────────────────────────
  1075. 
  1076.  /St  text                         Specifies title for source listing. Same
  1077.                                    as  TITLE  text.
  1078.  
  1079.  /Sx                               Turns on false conditionals in listing.
  1080.  
  1081.  /Ta  filename                     Assembles source file whose name does
  1082.                                    not end with the .ASM extension.
  1083.  
  1084.  /w                                Same as /W0.
  1085.  
  1086.  /W level                          Sets the warning level: level 0, 1, 2,
  1087.                                    or 3.
  1088.  
  1089.  
  1090.  
  1091.  /WX                               Returns an error code if warnings are
  1092.                                    generated.
  1093.  
  1094.  Option                            Action
  1095.  ────────────────────────────────────────────────────────────────────────────
  1096. 
  1097.  /Zd                               Generates line-number information in
  1098.                                    object file.
  1099.  
  1100.  /Zf                               Makes all symbols public.
  1101.  
  1102.  /Zi                               Generates CodeView information in object
  1103.                                    file.
  1104.  
  1105.  /Zm                               Enables  M510 option for maximum
  1106.                                    compatibility with MASM 5.1.
  1107.  
  1108.  /Zp [ alignment]                  Packs structures on the specified byte
  1109.                                    boundary. The  alignment may be 1, 2, or
  1110.                                    4.
  1111.  
  1112.  /Zs                               Performs a syntax check only.
  1113.  
  1114.  /?                                Displays a brief summary of ML
  1115.  Option                            Action
  1116.  ────────────────────────────────────────────────────────────────────────────
  1117. /?                                Displays a brief summary of ML
  1118.                                    command-line syntax.
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  QuickAssembler Support
  1127.  
  1128.  For compatibility with QuickAssembler makefiles, ML recognizes the following
  1129.  options:
  1130. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  1131.  Option                            Action
  1132.  ────────────────────────────────────────────────────────────────────────────
  1133.  /a                                Orders segments alphabetically. In MASM
  1134.                                    6.0, the  .ALPHA directive must be used.
  1135.                                    Ignored.
  1136.  Option                            Action
  1137.  ────────────────────────────────────────────────────────────────────────────
  1138.                                   Ignored.
  1139.  
  1140.  /Cl                               Equivalent to /Cp.
  1141.  
  1142.  /Ez                               Prints the source for error lines to the
  1143.                                    screen. This option is no longer
  1144.                                    supported and is ignored by MASM 6.0.
  1145.  
  1146.  /P1                               Performs one-pass assembly. MASM 6.0
  1147.                                    always performs a single pass through
  1148.                                    the source file. This option is ignored
  1149.                                    by MASM 6.0.
  1150.  
  1151.  /P2                               Performs two-pass assembly. MASM 6.0
  1152.                                    always performs a single pass through
  1153.                                    the source file. This option is ignored
  1154.                                    by MASM 6.0.
  1155.  
  1156.  /s                                Orders segments sequentially. In MASM
  1157.  Option                            Action
  1158.  ────────────────────────────────────────────────────────────────────────────
  1159. /s                                Orders segments sequentially. In MASM
  1160.                                    6.0, the  .SEQ directive must be used.
  1161.                                    Ignored.
  1162.  
  1163.  /Sq                               Equivalent to /Sl0 /Sp0.
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  Environment Variables
  1171. ╓┌────────────────┌──────────────────────────────────────────────────────────╖
  1172.  Variable         Description
  1173.  ────────────────────────────────────────────────────────────────────────────
  1174.  INCLUDE          Specifies search path for include files.
  1175.  ML               Specifies default command-line options.
  1176.  TMP              Specifies path for temporary files.
  1177.  
  1178.  
  1179.  
  1180.  NMAKE
  1181.  
  1182.  The NMAKE utility automates the process of compiling and linking project
  1183.  files.
  1184.  
  1185.  Command-Line Syntax
  1186.  NMAKE [options] [macros] [targets]
  1187.  
  1188.  
  1189.  Options
  1190. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  1191.  Option                            Action
  1192.  ────────────────────────────────────────────────────────────────────────────
  1193.  /A                                Executes all commands even if targets
  1194.                                    are not out-of-date.
  1195.  
  1196.  /C                                Suppresses the NMAKE copyright message
  1197.                                    and prevents nonfatal error or warning
  1198.                                    messages from being displayed.
  1199.  Option                            Action
  1200.  ────────────────────────────────────────────────────────────────────────────
  1201.                                   messages from being displayed.
  1202.  
  1203.  /D                                Displays the modification time of each
  1204.                                    file when the times of targets and
  1205.                                    dependents are checked.
  1206.  
  1207.  /E                                Causes environment variables to override
  1208.                                    macro definitions within description
  1209.                                    files.
  1210.  
  1211.  /F  filename                      Specifies  filename as the name of the
  1212.                                    description file to use. If a dash (-)
  1213.                                    is entered instead of a filename, NMAKE
  1214.                                    reads the description file from the
  1215.                                    standard input device.If /F is not
  1216.                                    specified, NMAKE uses MAKEFILE as the
  1217.                                    description file. If MAKEFILE does not
  1218.                                    exist, NMAKE builds command-line targets
  1219.                                    using inference rules.
  1220.  Option                            Action
  1221.  ────────────────────────────────────────────────────────────────────────────
  1222.                                   using inference rules.
  1223.  
  1224.  /HELP                             Calls QuickHelp for help on NMAKE.
  1225.  
  1226.  /I                                Ignores exit codes from commands in the
  1227.                                    description file. NMAKE continues
  1228.                                    executing the rest of the description
  1229.                                    file despite the errors.
  1230.  
  1231.  /N                                Displays but does not execute commands
  1232.                                    from the description file.
  1233.  
  1234.  /NOLOGO                           Suppresses the NMAKE copyright message.
  1235.  
  1236.  /P                                Displays all macro definitions,
  1237.                                    inference rules, target descriptions,
  1238.                                    and the . SUFFIXES list.
  1239.  
  1240.  /Q                                Checks modification times of
  1241.  Option                            Action
  1242.  ────────────────────────────────────────────────────────────────────────────
  1243. /Q                                Checks modification times of
  1244.                                    command-line targets (or first target in
  1245.                                    the description file if no command-line
  1246.                                    targets are specified). NMAKE returns a
  1247.                                    zero exit code if all such targets are
  1248.                                    up-to-date and a nonzero exit code if
  1249.                                    any target is out-of-date. Only
  1250.                                    preprocessing commands in the
  1251.                                    description file are executed.
  1252.  
  1253.  /R                                Ignores inference rules and macros that
  1254.                                    are defined in the TOOLS.INI file or are
  1255.                                    predefined.
  1256.  
  1257.  /S                                Suppresses display of commands as they
  1258.                                    are executed.
  1259.  
  1260.  /T                                Changes modification times of
  1261.                                    command-line targets (or first target in
  1262.  Option                            Action
  1263.  ────────────────────────────────────────────────────────────────────────────
  1264.                                   command-line targets (or first target in
  1265.                                    the description file if no command-line
  1266.                                    targets are specified) to the current
  1267.                                    time. Only preprocessing commands in the
  1268.                                    description file are executed. The
  1269.                                    contents of target files are not
  1270.                                    modified.
  1271.  
  1272.  /X  filename                      Sends all error output to  filename,
  1273.                                    which can be either a file or a device.
  1274.                                    If a dash (-) is entered instead of a
  1275.                                    filename, the error output is sent to
  1276.                                    the standard output device.
  1277.  
  1278.  /Z                                Internal option for use by the Microsoft
  1279.                                    Programmer's WorkBench (PWB).
  1280.  
  1281.  /?                                Displays a brief summary of NMAKE
  1282.                                    command-line syntax.
  1283.  Option                            Action
  1284.  ────────────────────────────────────────────────────────────────────────────
  1285.                                   command-line syntax.
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  Environment Variable
  1293. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  1294.  Variable                          Description
  1295.  ────────────────────────────────────────────────────────────────────────────
  1296.  INIT                              Specifies path for TOOLS.INI file, which
  1297.                                    may contain macros, inference rules, and
  1298.                                    description blocks.
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  PWB (Programmer's WorkBench)
  1305.  
  1306.  The Microsoft Programmer's WorkBench (PWB) provides an integrated
  1307.  environment for developing programs in assembly language. The command-line
  1308.  options are case sensitive.
  1309.  
  1310.  Command-Line Syntax
  1311.  PWB [options] [files]
  1312.  
  1313.  
  1314.  Options
  1315. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  1316.  Option                            Action
  1317.  ────────────────────────────────────────────────────────────────────────────
  1318.  /D[ init]                         Prevents PWB from examining
  1319.                                    initialization files, where  init is one
  1320.                                    or more of the following characters:
  1321.  
  1322.                                    A    Disable autoload extensions
  1323.                                    (including language-specific extensions
  1324.                                    and online help)
  1325.  Option                            Action
  1326.  ────────────────────────────────────────────────────────────────────────────
  1327.                                   and online help)
  1328.  
  1329.                                    S    Ignore CURRENT.STS
  1330.  
  1331.                                    T    Ignore TOOLS.INI
  1332.  
  1333.                                    If the /D option does not include an
  1334.                                    init character, it is equivalent to
  1335.                                    specifying /DAST (all files
  1336.  
  1337.  
  1338.  /e  cmdstr                        Executes the command or sequence of
  1339.                                    commands at start-up. The entire  cmdstr
  1340.                                    argument must be placed in double
  1341.                                    quotation marks if it contains a space.
  1342.                                    If  cmdstr contains literal double
  1343.                                    quotation marks, place a backslash (\)
  1344.                                    in front of each double quotation mark.
  1345.                                    To include a literal backslash in the
  1346.  Option                            Action
  1347.  ────────────────────────────────────────────────────────────────────────────
  1348.                                   To include a literal backslash in the
  1349.                                    command string, use double backslashes
  1350.                                    (\\).
  1351.  
  1352.  /m  mark                          Moves the cursor to the specified  mark
  1353.                                    instead of moving it to the last known
  1354.                                    position. The mark can be a line number.
  1355.  
  1356.  /P[ init]                         Specifies a program list for PWB to read,
  1357.                                    where  init can be
  1358.  
  1359.                                    F file    Read a foreign program list
  1360.                                    (one not created using PWB).
  1361.  
  1362.                                    L         Read the last program list.
  1363.                                    Use this option to start PWB in the same
  1364.                                    state you left it.
  1365.  
  1366.                                    P file    Read a PWB program list.
  1367.  Option                            Action
  1368.  ────────────────────────────────────────────────────────────────────────────
  1369.                                   P file    Read a PWB program list.
  1370.  
  1371.  /r                                Starts PWB in no-edit mode. Functions
  1372.                                    that modify files are disallowed.
  1373.  
  1374.  [ [/t]  file...]                  Loads the specified file at start-up.
  1375.                                    The  file specification can contain
  1376.                                    wildcards. If multiple  files are
  1377.                                    specified, PWB loads only the first file.
  1378.                                    When the  Exit function is invoked, PWB
  1379.                                    saves the current file and loads the
  1380.                                    next file in the list. Files specified
  1381.                                    with /t are temporary; PWB does not add
  1382.                                    them to the file history on the File
  1383.                                    menu.
  1384.  
  1385.                                    No other options can follow /t on the
  1386.                                    command line. Each temporary file must
  1387.                                    be specified in a separate /t option.
  1388.  Option                            Action
  1389.  ────────────────────────────────────────────────────────────────────────────
  1390.                                   be specified in a separate /t option.
  1391.  
  1392.  /?                                Displays a brief summary of PWB
  1393.                                    command-line syntax.
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  Environment Variables
  1400. ╓┌────────────┌──────────────────────────────────────────────────────────────╖
  1401.  Variable     Description
  1402.  ────────────────────────────────────────────────────────────────────────────
  1403.  HELPFILES    Specifies path of help files or list of help filenames.
  1404.  INIT         Specifies path for TOOLS.INI and CURRENT.STS files.
  1405.  TMP          Specifies path for temporary files.
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  PWBRMAKE
  1411.  
  1412.  PWBRMAKE converts the .SBR files created by the assembler into database .BSC
  1413.  files that can be read by the Microsoft Programmer's WorkBench (PWB) Source
  1414.  Browser. The command-line options are case sensitive.
  1415.  
  1416.  Command-Line Syntax
  1417.  PWBRMAKE [options] sbrfiles
  1418.  
  1419.  
  1420.  Options
  1421. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  1422.  Option                            Action
  1423.  ────────────────────────────────────────────────────────────────────────────
  1424.  /Ei  filename/Ei ( filename...)   Excludes the contents of the specified
  1425.                                    include files from the database. To
  1426.                                    specify multiple filenames, separate
  1427.                                    them with spaces and enclose the list in
  1428.                                    parentheses.
  1429.  
  1430.  Option                            Action
  1431.  ────────────────────────────────────────────────────────────────────────────
  1432. 
  1433.  /Em                               Excludes symbols in the body of macros.
  1434.                                    Use /Em to include only macro names.
  1435.  
  1436.  /Es                               Excludes from the database every include
  1437.                                    file specified with an absolute pathname
  1438.                                    or found in an absolute path specified
  1439.                                    in the INCLUDE environment variable.
  1440.  
  1441.  
  1442.  
  1443.  /HELP                             Calls QuickHelp for help on PWBRMAKE.
  1444.  
  1445.  /Iu                               Includes unreferenced symbols.
  1446.  
  1447.  /n                                Forces a nonincremental build and
  1448.                                    prevents truncation of .SBR files.
  1449.  
  1450.  /o  filename                      Specifies a name for the database file.
  1451.  Option                            Action
  1452.  ────────────────────────────────────────────────────────────────────────────
  1453. /o  filename                      Specifies a name for the database file.
  1454.  
  1455.  /v                                Displays verbose output.
  1456.  
  1457.  /?                                Displays a brief summary of PWBRMAKE
  1458.                                    command-line syntax.
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  QuickHelp
  1465.  
  1466.  The QuickHelp utility displays online help files. All MASM reserved words
  1467.  and error messages can be used for topic.
  1468.  
  1469.  Command-Line Syntax
  1470.  QH [options] [topic]
  1471.  
  1472.  
  1473.  Options
  1474. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  1475.  Option                            Action
  1476.  ────────────────────────────────────────────────────────────────────────────
  1477.  /d  filename                      Specifies either a specific database
  1478.                                    name or a path where the databases are
  1479.                                    found.
  1480.  
  1481.  /l number                         Specifies the number of lines the
  1482.                                    QuickHelp window should occupy.
  1483.  
  1484.  /m number                         Changes the screen mode to display the
  1485.                                    specified number of lines, where  number
  1486.                                    is in the range 25 to 60.
  1487.  
  1488.  /p  filename                      Sets the name of the paste file.
  1489.  
  1490.  /pa [ filename]                   Specifies that pasting operations are
  1491.                                    appended to the current paste file
  1492.                                    (rather than overwriting the file).
  1493.  Option                            Action
  1494.  ────────────────────────────────────────────────────────────────────────────
  1495.                                   (rather than overwriting the file).
  1496.  
  1497.  /q                                Prevents the version box from being
  1498.                                    displayed when QuickHelp is installed as
  1499.                                    a keyboard monitor.
  1500.  
  1501.  /r  command                       Specifies the command that QuickHelp
  1502.                                    should execute when the right mouse
  1503.                                    button is pressed. The  command can be
  1504.                                    one of the following letters:
  1505.  
  1506.                                    l    Display last topic
  1507.  
  1508.                                    i    Display history of help topics
  1509.  
  1510.                                    w    Hide window
  1511.  
  1512.                                    b    Display previous topic
  1513.  
  1514.  Option                            Action
  1515.  ────────────────────────────────────────────────────────────────────────────
  1516. 
  1517.                                    e    Find next topic
  1518.  
  1519.                                    t    Display contents
  1520.  
  1521.  /s                                Specifies that clicking the mouse above
  1522.                                    or below the scroll box causes QuickHelp
  1523.                                    to scroll by lines rather than by pages.
  1524.  
  1525.  /sg number                        Specifies the number of screen groups
  1526.                                    that QuickHelp should monitor, where
  1527.                                    number is in the range 1 to 12. This
  1528.                                    option is valid only when QuickHelp is
  1529.                                    detached from an OS/2 protected-mode
  1530.                                    screen group.
  1531.  
  1532.  /t  name                          Directs QuickHelp to copy the specified
  1533.                                    section of the given topic to the
  1534.                                    current paste file and exit. The  name
  1535.  Option                            Action
  1536.  ────────────────────────────────────────────────────────────────────────────
  1537.                                   current paste file and exit. The  name
  1538.                                    may be
  1539.  
  1540.                                    All      Paste the entire topic
  1541.  
  1542.                                    Syntax   Paste the syntax only
  1543.  
  1544.                                    Example  Paste the example only
  1545.  
  1546.                                    If the topic is not found, QuickHelp
  1547.                                    returns an exit code of 1.
  1548.  
  1549.  /u                                Specifies that QuickHelp is being run by
  1550.                                    a utility. If the topic specified on the
  1551.                                    command line is not found, QuickHelp
  1552.                                    immediately exits with an exit code of 3.
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  Environment Variables
  1560. ╓┌────────────┌──────────────────────────────────────────────────────────────╖
  1561.  Variable     Description
  1562.  ────────────────────────────────────────────────────────────────────────────
  1563.  HELPFILES    Specifies path of help files or list of help filenames.
  1564.  QH           Specifies default command-line options.
  1565.  TMP          Specifies directory of default paste file.
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  RM
  1571.  
  1572.  The RM utility moves a file to a hidden DELETED subdirectory of the
  1573.  directory containing the file. Use the UNDEL utility to recover the file and
  1574.  the EXP utility to expunge the hidden file.
  1575.  
  1576.  Command-Line Syntax
  1577.  RM [options] [files]
  1578.  
  1579.  
  1580.  Options
  1581. ╓┌──────────────┌────────────────────────────────────────────────────────────╖
  1582.  Option         Action
  1583.  ────────────────────────────────────────────────────────────────────────────
  1584.  /F             Deletes read-only files without prompting.
  1585.  /HELP          Calls QuickHelp for help on RM.
  1586.  /I             Inquires for permission before removing each file.
  1587.  /K             Keeps read-only files without prompting.
  1588.  /R  directory  Recurses into subdirectories of the specified directory.
  1589.  /?             Displays a brief summary of RM command-line syntax.
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  UNDEL
  1595.  
  1596.  The UNDEL utility moves a file from a hidden DELETED subdirectory to the
  1597.  parent directory. UNDEL is used along with EXP and RM to manage backup
  1598.  files.
  1599.  
  1600.  Command-Line Syntax
  1601.  UNDEL [{option | files}]
  1602.  
  1603.  
  1604.  Options
  1605. ╓┌──────────┌────────────────────────────────────────────────────────────────╖
  1606.  Option     Action
  1607.  ────────────────────────────────────────────────────────────────────────────
  1608.  /HELP      Calls QuickHelp for help on UNDEL.
  1609.  /?         Displays a brief summary of UNDEL command-line syntax.
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  Cross-References
  1616.  
  1617.  
  1618.  
  1619.  Topical Cross-Reference for Directives
  1620.  
  1621.  
  1622.  Simplified Segment
  1623.  .MODEL
  1624.  .STARTUP
  1625.  .EXIT
  1626.  .CODE
  1627.  .STACK
  1628.  .DATA
  1629.  .DATA?
  1630.  .FARDATA
  1631.  .FARDATA?
  1632.  .CONST
  1633.  .DOSSEG
  1634.  
  1635.  
  1636.  Segment
  1637.  SEGMENT
  1638.  ENDS
  1639.  GROUP
  1640.  ASSUME
  1641.  END
  1642.  .ALPHA
  1643.  .DOSSEG
  1644.  .SEQ
  1645.  
  1646.  
  1647.  Conditional Assembly
  1648.  IF
  1649.  IFE
  1650.  IFB/IFNB
  1651.  IFDEF/IFNDEF
  1652.  IFDIF/IFDIFI
  1653.  IFIDN/IFIDNI
  1654.  ELSE
  1655.  ENDIF
  1656.  
  1657.  
  1658.  Macros
  1659.  MACRO
  1660.  LOCAL
  1661.  PURGE
  1662.  GOTO
  1663.  ENDM
  1664.  EXITM
  1665.  
  1666.  
  1667.  Data Allocation
  1668.  BYTE/SBYTE
  1669.  WORD/SWORD
  1670.  DWORD/SDWORD
  1671.  FWORD
  1672.  QWORD
  1673.  TBYTE
  1674.  LABEL
  1675.  ALIGN
  1676.  EVEN
  1677.  ORG
  1678.  REAL4
  1679.  REAL8
  1680.  REAL10
  1681.  
  1682.  
  1683.  Code Labels
  1684.  LABEL
  1685.  ALIGN
  1686.  EVEN
  1687.  ORG
  1688.  
  1689.  
  1690.  Scope
  1691.  PUBLIC
  1692.  EXTERNDEF
  1693.  EXTERN
  1694.  COMM
  1695.  INCLUDELIB
  1696.  
  1697.  
  1698.  Structure and Record
  1699.  RECORD
  1700.  STRUCT
  1701.  UNION
  1702.  ENDS
  1703.  TYPEDEF
  1704.  
  1705.  
  1706.  String
  1707.  CATSTR
  1708.  SIZESTR
  1709.  SUBSTR
  1710.  INSTR
  1711.  
  1712.  
  1713.  Equates
  1714.  EQU
  1715.  =
  1716.  TEXTEQU
  1717.  
  1718.  
  1719.  Repeat Blocks
  1720.  REPEAT
  1721.  WHILE
  1722.  FOR
  1723.  FORC
  1724.  ENDM
  1725.  GOTO
  1726.  
  1727.  
  1728.  Conditional Control Flow
  1729.  .IF
  1730.  .ELSE
  1731.  .ELSEIF
  1732.  .ENDIF
  1733.  .WHILE
  1734.  .ENDW
  1735.  .REPEAT
  1736.  .UNTIL/
  1737.  .UNTILCXZ
  1738.  .BREAK
  1739.  .CONTINUE
  1740.  
  1741.  
  1742.  Listing Control
  1743.  TITLE
  1744.  SUBTITLE
  1745.  PAGE
  1746.  .LIST
  1747.  .NOLIST
  1748.  .LISTIF
  1749.  .NOLISTIF
  1750.  .TFCOND
  1751.  .LISTMACROALL
  1752.  .NOLISTMACRO
  1753.  .LISTMACRO
  1754.  .CREF
  1755.  .NOCREF
  1756.  .LISTALL
  1757.  
  1758.  
  1759.  Conditional Error
  1760.  .ERR
  1761.  .ERRE
  1762.  .ERRNZ
  1763.  .ERRB
  1764.  .ERRNB
  1765.  .ERRDEF
  1766.  .ERRNDEF
  1767.  .ERRDIF/.ERRDIFI
  1768.  .ERRIDN/.ERRIDNI
  1769.  
  1770.  
  1771.  Processor
  1772.  .8086    .486
  1773.  .186    .486P
  1774.  .286    .8087
  1775.  .286P    .287
  1776.  .386    .387
  1777.  .386P    .NO87
  1778.  
  1779.  
  1780.  Procedures
  1781.  PROC
  1782.  ENDP
  1783.  PROTO
  1784.  INVOKE
  1785.  USES
  1786.  
  1787.  
  1788.  Miscellaneous
  1789.  OPTION
  1790.  COMMENT
  1791.  ECHO
  1792.  .RADIX
  1793.  END
  1794.  PUSHCONTEXT
  1795.  POPCONTEXT
  1796.  INCLUDE
  1797.  INCLUDELIB
  1798.  ASSUME
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  Topical Cross-Reference for Symbols
  1804.  
  1805.  
  1806.  Segment Information
  1807.  @code
  1808.  @CodeSize
  1809.  @CurSeg
  1810.  @data
  1811.  @DataSize
  1812.  @fardata
  1813.  @fardata?
  1814.  @Model
  1815.  @stack
  1816.  @WordSize
  1817.  
  1818.  
  1819.  Macro Functions
  1820.  @CatStr
  1821.  @InStr
  1822.  @SizeStr
  1823.  @SubStr
  1824.  
  1825.  
  1826.  Environment Information
  1827.  @Cpu
  1828.  @Environ
  1829.  @Interface
  1830.  @Version
  1831.  
  1832.  
  1833.  Date and Time Information
  1834.  @Date
  1835.  @Time
  1836.  
  1837.  
  1838.  File Information
  1839.  @FileCur
  1840.  @FileName
  1841.  @Line
  1842.  
  1843.  
  1844.  Miscellaneous
  1845.  $
  1846.  ?
  1847.  @@:
  1848.  @B
  1849.  @F
  1850.  
  1851.  
  1852.  Topical Cross-Reference for Operators
  1853.  
  1854.  
  1855.  Arithmetic
  1856.  +    MOD
  1857.  -    .
  1858.  *    []
  1859.  /
  1860.  
  1861.  
  1862.  Macro
  1863.  <>    %
  1864.  !    &
  1865.  ;;
  1866.  
  1867.  
  1868.  Relational
  1869.  EQ    GE
  1870.  NE    LT
  1871.  GT    LE
  1872.  
  1873.  
  1874.  Logical
  1875.  and ShiftAND
  1876.  OR
  1877.  XOR
  1878.  NOT
  1879.  SHL
  1880.  SHR
  1881.  
  1882.  
  1883.  Record
  1884.  MASK
  1885.  WIDTH
  1886.  
  1887.  
  1888.  Segment
  1889.  :
  1890.  SEG
  1891.  OFFSET
  1892.  LROFFSET
  1893.  
  1894.  
  1895.  Type
  1896.  HIGH
  1897.  HIGHWORD
  1898.  LOW
  1899.  LOWWORD
  1900.  PTR
  1901.  SHORT
  1902.  SIZE
  1903.  SIZEOF
  1904.  LENGTH
  1905.  LENGTHOF
  1906.  THIS
  1907.  TYPE
  1908.  OPATTR
  1909.  
  1910.  
  1911.  Control Flow
  1912.  !    = =
  1913.  !=    >=
  1914.  &&    <=
  1915.  ||    >
  1916.  &    <
  1917.  
  1918.  
  1919.  Miscellaneous
  1920.  ;    :
  1921.  DUP    ::
  1922.  "  "    ' '
  1923.  CARRY?
  1924.  OVERFLOW?
  1925.  PARITY?
  1926.  SIGN?
  1927.  ZERO?
  1928.  
  1929.  
  1930.  
  1931.  Directives
  1932.  
  1933.   name =  expression
  1934.  Assigns the numeric value of  expression to  name. The symbol may be
  1935.  redefined later.
  1936.  
  1937.  
  1938.  .186
  1939.  Enables assembly of instructions for the 80186 processor; disables assembly
  1940.  of instructions introduced with later processors. Also enables 8087
  1941.  instructions.
  1942.  
  1943.  
  1944.  .286
  1945.  Enables assembly of nonprivileged instructions for the 80286 processor;
  1946.  disables assembly of instructions introduced with later processors. Also
  1947.  enables 80287 instructions.
  1948.  
  1949.  
  1950.  .286P
  1951.  Enables assembly of all instructions (including privileged) for the 80286
  1952.  processor; disables assembly of instructions introduced with later
  1953.  processors. Also enables 80287 instructions.
  1954.  
  1955.  
  1956.  .287
  1957.  Enables assembly of instructions for the 80287 coprocessor; disables
  1958.  assembly of instructions introduced with later coprocessors.
  1959.  
  1960.  .386
  1961.  Enables assembly of nonprivileged instructions for the 80386 processor;
  1962.  disables assembly of instructions introduced with later processors. Also
  1963.  enables 80387 instructions.
  1964.  
  1965.  .386P
  1966.  Enables assembly of all instructions (including privileged) for the 80386
  1967.  processor; disables assembly of instructions introduced with later
  1968.  processors. Also enables 80387 instructions.
  1969.  
  1970.  .387
  1971.  Enables assembly of instructions for the 80387 coprocessor.
  1972.  
  1973.  .486
  1974.  Enables assembly of nonprivileged instructions for the 80486 processor.
  1975.  
  1976.  .486P
  1977.  Enables assembly of all instructions (including privileged) for the 80486
  1978.  processor.
  1979.  
  1980.  .8086
  1981.  Enables assembly of 8086 instructions (and the identical 8088 instructions);
  1982.  disables assembly of instructions introduced with later processors. Also
  1983.  enables 8087 instructions. This is the default mode for processors.
  1984.  
  1985.  .8087
  1986.  Enables assembly of 8087 instructions; disables assembly of instructions
  1987.  introduced with later coprocessors. This is the default mode for
  1988.  coprocessors.
  1989.  
  1990.  ALIGN [ number]
  1991.  Aligns the next variable or instruction on a byte that is a multiple of
  1992.  number.
  1993.  
  1994.  .ALPHA
  1995.  Orders segments alphabetically.
  1996.  
  1997.  ASSUME  segregister : name [ ,  segregister : name]...
  1998.   ASSUME  dataregister : type [ ,  dataregister : type]...
  1999.  
  2000.  
  2001.  ASSUME  register :ERROR [ ,  register :ERROR]...
  2002.  
  2003.  
  2004.  ASSUME [ register :]  NOTHING [ ,  register :NOTHING]...
  2005.  Enables error-checking for register values. After an  ASSUME is put into
  2006.  effect, the assembler watches for changes to the values of the given
  2007.  registers.  ERROR generates an error if the register is used at all. NOTHING
  2008.  assumptions in one statement.
  2009.  
  2010.  .BREAK [ .IF  condition]
  2011.  Generates code to terminate a  .WHILE or  .REPEAT block if  condition is
  2012.  true.
  2013.  
  2014.  [ name]  BYTE  initializer [ ,  initializer]...
  2015.  Allocates and optionally initializes a byte of storage for each
  2016.  initializer. Can also be used as a type specifier anywhere a type is legal.
  2017.  
  2018.   name  CATSTR [ textitem1  [ ,  textitem2]...]
  2019.  Concatenates text items. Each text item can be a literal string, a constant
  2020.  preceded by a  %, or the string returned by a macro function.
  2021.  
  2022.  .CODE [ name]
  2023.  When used with  .MODEL, indicates the start of a code segment called  name
  2024.  (the default segment name is _TEXT for tiny, small, compact, and flat
  2025.  models, or  module_TEXT for other models).
  2026.  
  2027.  COMM  definition [ ,  definition]...
  2028.  Creates a communal variable with the attributes specified in  definition.
  2029.  Each  definition has the following form:
  2030.  
  2031.  [ langtype]  [ NEAR |  FAR]  label : type[ : count]
  2032.  
  2033.  The  label is the name of the variable. The  type can be any type specifier
  2034.  ( BYTE,  WORD, etc.) or an integer specifying the number of bytes. The
  2035.  count specifies the number of data objects (one is the default).
  2036.  
  2037.  COMMENT  delimiter [ text]
  2038.       [ text]
  2039.  [ text]  delimiter [ text]
  2040.  Treats all  text between or on the same line as the delimiters as a comment.
  2041.  
  2042.  .CONST
  2043.  When used with  .MODEL, starts a constant data segment (with segment name
  2044.  CONST). This segment has the read-only attribute.
  2045.  
  2046.  .CONTINUE [ .IF  condition]
  2047.  
  2048.  Generates code to jump to the top of a  .WHILE or  .REPEAT block if
  2049.  condition is true.
  2050.  
  2051.  .CREF
  2052.  Enables listing of symbols in the symbol portion of the symbol table and
  2053.  browser file.
  2054.  
  2055.  .DATA
  2056.  When used with  .MODEL, starts a near data segment for initialized data
  2057.  (segment name _DATA).
  2058.  
  2059.  .DATA?
  2060.  When used with  .MODEL, starts a near data segment for uninitialized data
  2061.  (segment name _BSS).
  2062.  
  2063.  .DOSSEG
  2064.  Orders the segments according to the DOS segment convention: CODE first,
  2065.  then segments not in DGROUP, and then segments in DGROUP. The segments in
  2066.  DGROUP follow this order: segments not in BSS or STACK, then BSS segments,
  2067.  and finally STACK segments. Primarily used for ensuring CodeView support in
  2068.  MASM stand-alone programs. Same as  DOSSEG.
  2069.  
  2070.  DOSSEG
  2071.  Identical to . DOSSEG, which is the preferred form.
  2072.  
  2073.  DB
  2074.  Can be used to define data like  BYTE.
  2075.  
  2076.  DD
  2077.  Can be used to define data like  DWORD.
  2078.  
  2079.  DF
  2080.  Can be used to define data like  FWORD.
  2081.  
  2082.  DQ
  2083.  Can be used to define data like  QWORD.
  2084.  
  2085.  DT
  2086.  Can be used to define data like  TBYTE.
  2087.  
  2088.  DW
  2089.  Can be used to define data like  WORD.
  2090.  
  2091.  [ name]  DWORD  initializer [ ,  initializer]...
  2092.  Allocates and optionally initializes a doubleword (4 bytes) of storage for
  2093.  each  initializer. Can also be used as a type specifier anywhere a type is
  2094.  legal.
  2095.  
  2096.  ECHO  message
  2097.  Displays  message to the standard output device (by default, the screen).
  2098.  Same as  %OUT.
  2099.  
  2100.  .ELSE
  2101.  See  .IF.
  2102.  
  2103.  ELSE
  2104.  Marks the beginning of an alternate block within a conditional block. See IF.
  2105.  
  2106.  END [ address]
  2107.  Marks the end of a module and, optionally, sets the program entry point to
  2108.  address.
  2109.  
  2110.  .ENDIF
  2111.  See  .IF.
  2112.  
  2113.  ENDIF
  2114.  See  IF.
  2115.  
  2116.  ENDM
  2117.  Terminates a macro or repeat block. See  MACRO,  FOR,  FORC,  REPEAT, or WHIL
  2118.   name  ENDP
  2119.  Marks the end of procedure  name previously begun with  PROC. See  PROC.
  2120.  
  2121.   name  ENDS
  2122.  Marks the end of segment, structure, or union  name previously begun with SEG
  2123.  
  2124.  .ENDW
  2125.  See  .WHILE.
  2126.  
  2127.   name  EQU  expression
  2128.  Assigns numeric value of  expression to  name. The  name cannot be redefined
  2129.  later.
  2130.  
  2131.   name  EQU  < text >
  2132.  Assigns specified  text to  name. The  name can be assigned a different text
  2133.  
  2134.  .ERR [ message]
  2135.  Generates an error.
  2136.  
  2137.  .ERRB  < textitem > [ ,  message]
  2138.  Generates an error if  textitem is blank.
  2139.  
  2140.  .ERRDEF  name [ ,  message]
  2141.  Generates an error if  name is a previously defined label, variable, or
  2142.  symbol.
  2143.  
  2144.  .ERRDIF[ I]  < textitem1 >, < textitem2 > [ ,  message]
  2145.  Generates an error if the text items are different. If  I is given, the
  2146.  comparison is case insensitive.
  2147.  
  2148.  .ERRE  expression [ ,  message]
  2149.  Generates an error if  expression is false (0).
  2150.  
  2151.  .ERRIDN[ I]  < textitem1 >, < textitem2 > [ ,  message]
  2152.  Generates an error if the text items are identical. If  I is given, the
  2153.  comparison is case insensitive.
  2154.  
  2155.  .ERRNB  < textitem > [ ,  message]
  2156.  Generates an error if  textitem is not blank.
  2157.  
  2158.  .ERRNDEF  name [ ,  message]
  2159.  Generates an error if  name has not been defined.
  2160.  
  2161.  .ERRNZ  expression [ ,  message]
  2162.  Generates an error if  expression is true (nonzero).
  2163.  
  2164.  EVEN
  2165.  Aligns the next variable or instruction on an even byte.
  2166.  
  2167.  .EXIT [ expression]
  2168.  Generates termination code. Returns optional  expression to shell.
  2169.  
  2170.  EXITM [ expression]
  2171.  Terminates expansion of the current repeat or macro block and begins
  2172.  assembly of the next statement outside the block. In a macro function,
  2173.  expression is the value returned.
  2174.  
  2175.  EXTERN [ langtype]  name [ ( altid )]  : type
  2176.  [ , [ langtype]  name [ ( altid )]  : type]...
  2177.  Defines one or more external variables, labels, or symbols called  name
  2178.  whose type is  type. The  type can be  ABS, which imports  name as a
  2179.  constant. Same as  EXTRN.
  2180.  
  2181.  EXTERNDEF [ langtype]  name : type [ , [ langtype]  name : type]...
  2182.  Defines one or more external variables, labels, or symbols called  name
  2183.  whose type is  type. If  name is defined in the module, it is treated as
  2184.  
  2185.  PUBLIC. If  name is referenced in the module, it is treated as  EXTERN. If
  2186.  name is not referenced, it is ignored. The  type can be  ABS, which imports
  2187.  name as a constant. Normally used in include files.
  2188.  
  2189.  EXTRN
  2190.  See  EXTERN.
  2191.  
  2192.  .FARDATA [ name]
  2193.  When used with  .MODEL, starts a far data segment for initialized data
  2194.  (segment name FAR_DATA or  name).
  2195.  
  2196.  .FARDATA? [ name]
  2197.  When used with  .MODEL, starts a far data segment for uninitialized data
  2198.  (segment name FAR_BSS or  name).
  2199.  
  2200.  FOR  parameter [ :REQ |  := default]  ,  < argument [ ,  argument]... >
  2201.        statements
  2202.  
  2203.   ENDM
  2204.  Marks a block that will be repeated once for each  argument, with the
  2205.  current  argument replacing  parameter on each repetition. Same as  IRP.
  2206.  
  2207.  FORC  parameter ,  < string >
  2208.       statements
  2209.  
  2210.   ENDM
  2211.  Marks a block that will be repeated once for each character in  string, with
  2212.  the current character replacing  parameter on each repetition. Same as
  2213.  
  2214.  IRPC.
  2215.  [ name]  FWORD  initializer [ ,  initializer]...
  2216.  Allocates and optionally initializes 6 bytes of storage for each
  2217.  initializer. Can also be used as a type specifier anywhere a type is legal.
  2218.  
  2219.  GOTO  macrolabel
  2220.  Transfers assembly to the line marked  : macrolabel.  GOTO is permitted only
  2221.  inside  MACRO,  FOR,  FORC,  REPEAT, and  WHILE blocks. The label must be
  2222.  the only directive on the line and must be preceded by a leading colon.
  2223.  
  2224.   name  GROUP  segment [ ,  segment]...
  2225.  Add the specified  segments to the group called  name.
  2226.  
  2227.  .IF  condition1
  2228.       statements
  2229.  [ .ELSEIF  condition2
  2230.        statements]
  2231.  [ .ELSE
  2232.        statements]
  2233.  .ENDIF
  2234.  Generates code that tests  condition1 (for example, AX > 7) and executes the
  2235.   statements if that condition is true. If an  .ELSE follows, its statements
  2236.  are executed if the original condition was false. Note: The conditions are
  2237.  evaluated at run time.
  2238.  
  2239.  IF  expression1
  2240.       ifstatements
  2241.  [ ELSEIF  expression2
  2242.        elseifstatements]
  2243.  [ ELSE
  2244.        elsestatements]
  2245.  ENDIF
  2246.  Grants assembly of  ifstatements if  expression1 is true (nonzero) or
  2247.  elseifstatements if  expression1 is false (0) and  expression2 is true. The
  2248.  following directives may be substituted for  ELSEIF:  ELSEIFB,  ELSEIFDEF,
  2249.  
  2250.  ELSEIFDIF,  ELSEIFDIFI,  ELSEIFE,  ELSEIFIDN,  ELSEIFIDNI,  ELSEIFNB, and ELS
  2251.  is false. Note: The expressions are evaluated at assembly time.
  2252.  
  2253.  IFB  textitem
  2254.  Grants assembly if  textitem is blank. See  IF for complete syntax.
  2255.  
  2256.  IFDEF  name
  2257.  Grants assembly if  name is a previously defined label, variable, or symbol.
  2258.  See  IF for complete syntax.
  2259.  
  2260.  IFDIF[ I]  textitem1 ,  textitem2
  2261.  Grants assembly if the text items are different. If  I is given, the
  2262.  comparison is case insensitive. See  IF for complete syntax.
  2263.  
  2264.  IFE  expression
  2265.  Grants assembly if  expression is false (0). See  IF for complete syntax.
  2266.  
  2267.  IFIDN[ I]  textitem1 ,  textitem2
  2268.  Grants assembly if the text items are identical. If  I is given, the
  2269.  comparison is case insensitive. See  IF for complete syntax.
  2270.  
  2271.  IFNB  textitem
  2272.  Grants assembly if  textitem is not blank. See  IF for complete syntax.
  2273.  
  2274.  IFNDEF  name
  2275.  Grants assembly if  name has not been defined. See  IF for complete syntax.
  2276.  
  2277.  INCLUDE  filename
  2278.  Inserts source code from the source file given by  filename into the current
  2279.  source file during assembly. The  filename must be enclosed in angle
  2280.  brackets if it includes a backslash, semicolon, greater-than symbol,
  2281.  less-than symbol, single quotation mark, or double quotation mark.
  2282.  
  2283.  INCLUDELIB  libraryname
  2284.  Informs the linker that the current module should be linked with
  2285.  libraryname. The  libraryname must be enclosed in angle brackets if it
  2286.  includes a backslash, semicolon, greater-than symbol, less-than symbol,
  2287.  single quotation mark, or double quotation mark.
  2288.   name  INSTR [ position ,]  textitem1 ,  textitem2
  2289.  Finds the first occurrence of  textitem2 in  textitem1. The starting
  2290.  position is optional. Each text item can be a literal string, a constant
  2291.  preceded by a  %, or the string returned by a macro function.
  2292.  
  2293.  INVOKE  expression [ ,  arguments]
  2294.  
  2295.  Calls the procedure at the address given by  expression, passing the
  2296.  arguments on the stack or in registers according to the standard calling
  2297.  conventions of the language type. Each argument passed to the procedure may
  2298.  be an expression, a register pair, or an address expression (an expression
  2299.  preceded by  ADDR).
  2300.  
  2301.  IRP
  2302.  See  FOR.
  2303.  
  2304.  IRPC
  2305.  See  FORC.
  2306.   name  LABEL  type
  2307.  Creates a new label by assigning the current location-counter value and the
  2308.  given  type to  name.
  2309.   name  LABEL [ NEAR |  FAR |  PROC]  PTR [ type]
  2310.  
  2311.  Creates a new label by assigning the current location-counter value and the
  2312.  given  type to  name.
  2313.  
  2314.  .LALL
  2315.  See  .LISTMACROALL.
  2316.  
  2317.  .LFCOND
  2318.  See  .LISTIF.
  2319.  
  2320.  .LIST
  2321.  Starts listing of statements. This is the default.
  2322.  
  2323.  .LISTALL
  2324.  Starts listing of all statements. Equivalent to the combination of  .LIST,
  2325.  
  2326.  .LISTIF, and  .LISTMACROALL.
  2327.  .LISTIF
  2328.  Starts listing of statements in false conditional blocks. Same as  .LFCOND.
  2329.  
  2330.  .LISTMACRO
  2331.  Starts listing of macro expansion statements that generate code or data.
  2332.  This is the default. Same as  .XALL.
  2333.  
  2334.  .LISTMACROALL
  2335.  Starts listing of all statements in macros. Same as  .LALL.
  2336.  
  2337.  LOCAL  localname [ ,  localname]...
  2338.  Within a macro,  LOCAL defines labels that are unique to each instance of
  2339.  the macro.
  2340.  
  2341.  LOCAL  label [  [ count ] ] [ : type] [ ,  label [  [ count ] ] [ type]
  2342.  ]...
  2343.  Within a procedure definition ( PROC),  LOCAL creates stack-based variables
  2344.  that exist for the duration of the procedure. The  label may be a simple
  2345.  variable or an array containing  count elements.
  2346.   name  MACRO [ parameter [ :REQ |  := default |  :VARARG] ]...
  2347.        statements
  2348.  
  2349.  
  2350.  ENDM [ value]
  2351.  Marks a macro block called  name and establishes  parameter placeholders for
  2352.  arguments passed when the macro is called. A macro function returns  value
  2353.  to the calling statement.
  2354.  
  2355.  .MODEL  memorymodel  [ ,  langtype] [ ,  ostype] [ ,  stackoption]
  2356.  Initializes the program memory model. The  memorymodel may be  TINY,  SMALL,
  2357.  
  2358.  COMPACT,  MEDIUM,  LARGE,  HUGE, or  FLAT. The  langtype may be  C,  BASIC,
  2359.  
  2360.  FORTRAN,  PASCAL,  SYSCALL, or  STDCALL. The  ostype may be  OS_DOS or
  2361.  
  2362.  OS_OS2. The  stackoption may be  NEARSTACK or  FARSTACK.
  2363.  
  2364.  NAME  modulename
  2365.  Ignored in version 6.0.
  2366.  
  2367.  .NO87
  2368.  Disallows assembly of all floating-point instructions.
  2369.  
  2370.  .NOCREF [ name[ ,  name]...]
  2371.  Suppresses listing of symbols in the symbol table and browser file. If names
  2372.  are specified, only the given names are suppressed. Same as  .XCREF.
  2373.  
  2374.  .NOLIST
  2375.  Suppresses program listing. Same as  .XLIST.
  2376.  
  2377.  .NOLISTIF
  2378.  Suppresses listing of conditional blocks whose condition evaluates to false
  2379.  (0). This is the default. Same as  .SFCOND.
  2380.  
  2381.  .NOLISTMACRO
  2382.  Suppresses listing of macro expansions. Same as  .SALL.
  2383.  
  2384.  OPTION  optionlist
  2385.  Enables and disables features of the assembler. Available options include
  2386.  
  2387.  CASEMAP, DODD DOTNAME,  NODOTNAME, EPILOGUEEE EMULATOR,  NOEMULATOR,
  2388.  EPILOGUE,  EXPR16,  EXPR32,  LANGUAGE,  LJMP,  NOLJMP,  M510,  NOM510,
  2389.  NOKEYWORD,  NOSIGNEXTEND,  OFFSET,  OLDMACROS,  NOOLDMACROS,  OLDSTRUCTS,
  2390.  NOOLDSTRUCTS,  PROC,  PROLOGUE,  READONLY,  NOREADONLY,  SCOPED,  NOSCOPED,
  2391.  and  SEGMENT.
  2392.  
  2393.  ORG  expression
  2394.  Sets the location counter to  expression.
  2395.  
  2396.  %OUT
  2397.  See  ECHO.
  2398.  
  2399.  PAGE [ [ length] ,  width]
  2400.  Sets line  length and character  width of the program listing. If no
  2401.  arguments are given, generates a page break.
  2402.  
  2403.  PAGE +
  2404.  Increments the section number and resets the page number to 1.
  2405.  
  2406.  POPCONTEXT  context
  2407.  Restores part or all of the current  context (saved by the  PUSHCONTEXT
  2408.  directive). The  context can be  ASSUMES,  RADIX,  LISTING,  CPU, or  ALL.
  2409.  
  2410.   label  PROC [ distance] [ langtype] [ visibility] [ < prologuearg >]
  2411.  [ USES  reglist] [ ,  parameter [ : tag] ]...
  2412.       statements
  2413.   label  ENDP
  2414.  Marks start and end of a procedure block called  label. The statements in
  2415.  the block can be called with the  CALL instruction or  INVOKE directive.
  2416.  
  2417.   label  PROTO [ distance] [ langtype] [ ,  [ parameter] : tag]...
  2418.  Prototypes a function.
  2419.  
  2420.  PUBLIC [ langtype]  name [ , [ langtype]  name]...
  2421.  Makes each variable, label, or absolute symbol specified as  name available
  2422.  to all other modules in the program.
  2423.  
  2424.  PURGE  macroname [ ,  macroname]...
  2425.  Deletes the specified macros from memory.
  2426.  
  2427.  PUSHCONTEXT  context
  2428.  Saves part or all of the current  context: segment register assumes, radix
  2429.  value, listing and cref flags, or processor/coprocessor values. The  context
  2430.  can be  ASSUMES,  RADIX,  LISTING,  CPU, or  ALL.
  2431.  
  2432.  [ name]  QWORD  initializer [ ,  initializer]...
  2433.  Allocates and optionally initializes 8 bytes of storage for each
  2434.  initializer. Can also be used as a type specifier anywhere a type is legal.
  2435.  
  2436.  .RADIX  expression
  2437.  Sets the default radix, in the range 2 to 16, to the value of  expression.
  2438.  
  2439.   name  REAL4  initializer [ ,  initializer]...
  2440.  Allocates and optionally initializes a single-precision (4-byte)
  2441.  floating-point number for each  initializer.
  2442.  
  2443.   name  REAL8  initializer [ ,  initializer]...
  2444.  Allocates and optionally initializes a double-precision (8-byte)
  2445.  floating-point number for each  initializer.
  2446.  
  2447.   name  REAL10  initializer [ ,  initializer]...
  2448.  Allocates and optionally initializes a 10-byte floating-point number for
  2449.  each  initializer.
  2450.  
  2451.   recordname  RECORD  fieldname : width [ =  expression]
  2452.  [ ,  fieldname : width [ =  expression] ]...
  2453.  Declares a record type consisting of the specified fields. The  fieldname
  2454.  names the field,  width specifies the number of bits, and  expression gives
  2455.  its initial value.
  2456.  
  2457.  .REPEAT
  2458.        statements
  2459.  .UNTIL  condition
  2460.  Generates code that repeats execution of the block of  statements until
  2461.  condition becomes true.  .UNTILCXZ, which becomes true when CX is zero, may
  2462.  be substituted for  .UNTIL. The  condition is optional with  .UNTILCXZ.
  2463.  
  2464.  REPEAT  expression
  2465.   statements
  2466.   ENDM
  2467.  Marks a block that is to be repeated  expression times. Same as  REPT.
  2468.  
  2469.  REPT
  2470.  See  REPEAT.
  2471.  
  2472.  .SALL
  2473.  See  .NOLISTMACRO.
  2474.   name  SBYTE  initializer [ ,  initializer]...
  2475.  Allocates and optionally initializes a signed byte of storage for each
  2476.  initializer. Can also be used as a type specifier anywhere a type is legal.
  2477.  
  2478.   name  SDWORD  initializer [ ,  initializer]...
  2479.  Allocates and optionally initializes a signed doubleword
  2480.  (4 bytes) of storage for each  initializer. Can also be used as a type
  2481.  specifier anywhere a type is legal.
  2482.  
  2483.   name  SEGMENT [ READONLY] [ align] [ combine] [ use] [ ' class ']
  2484.        statements
  2485.  name  ENDS
  2486.  Defines a program segment called  name having segment attributes  align (BYTE
  2487.  AT  address,  PRIVATE),  use ( USE16,  USE32,  FLAT),  and  class.
  2488.  
  2489.  .SEQ
  2490.  Orders segments sequentially (the default order).
  2491.  
  2492.  .SFCOND
  2493.  See  .NOLISTIF.
  2494.  
  2495.   name  SIZESTR  textitem
  2496.  Finds the size of a text item.
  2497.  
  2498.  .STACK [ size]
  2499.  When used with  .MODEL, defines a stack segment (with segment name STACK).
  2500.  The optional  size specifies the number of bytes for the stack (default
  2501.  1,024). The  .STACK directive automatically closes the stack statement.
  2502.  
  2503.  .STARTUP
  2504.  Generates program start-up code.
  2505.  
  2506.  STRUC
  2507.  See  STRUCT.
  2508.  
  2509.   name  STRUCT [ alignment] [ ,  NONUNIQUE]
  2510.        fielddeclarations
  2511.  name  ENDS
  2512.  Declares a structure type having the specified  fielddeclarations. Each
  2513.  field must be a valid data definition. Same as  STRUC.
  2514.  
  2515.  
  2516.  STRUC
  2517.  STRUCT
  2518.  
  2519.   name  SUBSTR  textitem ,  position  [ ,  length]
  2520.  Returns a substring of  textitem, starting at  position. The  textitem can
  2521.  be a literal string, a constant preceded by a  %, or the string returned by
  2522.  a macro function.
  2523.  
  2524.  SUBTITLE  text
  2525.  Defines the listing subtitle. Same as  SUBTTL.
  2526.  
  2527.  SUBTTL
  2528.  See  SUBTITLE.
  2529.   name  SWORD  initializer [ ,  initializer]...
  2530.  
  2531.  Allocates and optionally initializes a signed word (2 bytes) of storage for
  2532.  each  initializer. Can also be used as a type specifier anywhere a type is
  2533.  legal.
  2534.  [ name]  TBYTE  initializer [ ,  initializer]...
  2535.  Allocates and optionally initializes 10 bytes of storage for each
  2536.  initializer. Can also be used as a type specifier anywhere a type is legal.
  2537.   name  TEXTEQU [ textitem]
  2538.  
  2539.  Assigns  textitem to  name. The  textitem can be a literal string, a
  2540.  constant preceded by a  %, or the string returned by a macro function.
  2541.  
  2542.  .TFCOND
  2543.  Toggles listing of false conditional blocks.
  2544.  
  2545.  TITLE  text
  2546.  Defines the program listing title.
  2547.  
  2548.   name  TYPEDEF  type
  2549.  Defines a new type called  name, which is equivalent to  type.
  2550.  
  2551.   name  UNION [ alignment] [ , NONUNIQUE]
  2552.   fielddeclarations
  2553.  [ name]   ENDS
  2554.  Declares a union of one or more data types. The  fielddeclarations must be
  2555.  valid data definitions. Omit the  ENDS  name label on nested  UNION
  2556.  definitions.
  2557.  
  2558.  .UNTIL
  2559.  See  .REPEAT.
  2560.  
  2561.  .UNTILCXZ
  2562.  See  .REPEAT.
  2563.  
  2564.  .WHILE  condition
  2565.        statements
  2566.  .ENDW
  2567.  Generates code that executes the block of  statements while  condition
  2568.  remains true.
  2569.  
  2570.  WHILE  expression
  2571.        statements
  2572.  ENDM
  2573.  Repeats assembly of block  statements as long as  expression remains true.
  2574.  
  2575.  [ name]  WORD  initializer [ ,  initializer]...
  2576.  Allocates and optionally initializes a word (2 bytes) of storage for each
  2577.  
  2578.  initializer. Can also be used as a type specifier anywhere a type is legal.
  2579.  
  2580.  .XALL
  2581.  See  .LISTMACRO.
  2582.  
  2583.  .XCREF
  2584.  See  .NOCREF.
  2585.  
  2586.  .XLIST
  2587.  See  .NOLIST.
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  Predefined Symbols
  2593.  
  2594.  $
  2595.  The current value of the location counter.
  2596.  
  2597.  ?
  2598.  In data declarations, a value that the assembler allocates but does not
  2599.  initialize.
  2600.  
  2601.  @@:
  2602.  Defines a local code label. Overrides any previous  @@: labels. See  @B and
  2603.  
  2604.  @F.
  2605.  The location of the previous  @@: label.
  2606.  @CatStr(  string1 [ ,  string2...]  )
  2607.  
  2608.  Macro function that concatenates one or more strings. Returns a string.
  2609.  
  2610.  
  2611.  @code
  2612.  The name of the code segment (text macro).
  2613.  
  2614.  @CodeSize
  2615.  0 for  TINY,  SMALL,  COMPACT, and  FLAT models, and 1 for  MEDIUM,  LARGE,
  2616.  and  HUGE models (numeric equate).
  2617.  
  2618.  @Cpu
  2619.  A bit mask specifying the processor mode (numeric equate).
  2620.  
  2621.  @CurSeg
  2622.  The name of the current segment (text macro).
  2623.  
  2624.  @data
  2625.  The name of the default data group. Evaluates to DGROUP for all models
  2626.  except  FLAT. Evaluates to  FLAT under the  FLAT memory model (text macro).
  2627.  
  2628.  
  2629.  @DataSize
  2630.  0 for  TINY,  SMALL,  MEDIUM, and  FLAT models, 1 for  COMPACT and  LARGE
  2631.  models, and 2 for  HUGE model (numeric equate).
  2632.  
  2633.  @Date
  2634.  The system date in the format mm/dd/yy (text macro).
  2635.  
  2636.  @Environ(  envvar  )
  2637.  Value of environment variable  envvar (macro function).
  2638.  
  2639.  
  2640.  @F
  2641.  The location of the next  @@: label.
  2642.  
  2643.  @fardata
  2644.  The name of the segment defined by the  .FARDATA directive (text macro).
  2645.  
  2646.  @fardata?
  2647.  The name of the segment defined by the  .FARDATA? directive (text macro).
  2648.  
  2649.  @FileCur
  2650.  The name of the current file (text macro).
  2651.  
  2652.  @FileName
  2653.  The base name of the main file being assembled (text macro).
  2654.  
  2655.  @InStr( [ position] ,  string1 ,  string2  )
  2656.  
  2657.  Macro function that finds the first occurrence of  string2 in  string1. The
  2658.  starting position within  string1 is optional. Returns an integer (0 if
  2659.  string2 is not found).
  2660.  
  2661.  
  2662.  @Interface
  2663.  Information about the language parameters (numeric equate).
  2664.  
  2665.  @Line
  2666.  The source line number in the current file (numeric equate).
  2667.  
  2668.  @Model
  2669.  1 for  TINY model, 2 for  SMALL model, 3 for  COMPACT model, 4 for  MEDIUM
  2670.  model, 5 for  LARGE model, 6 for  HUGE model, and 7 for  FLAT model (numeric
  2671.  equate).
  2672.  
  2673.  @SizeStr(  string  )
  2674.  Macro function that returns the length of the given string. Returns an
  2675.  integer.
  2676.  
  2677.  @SubStr(  string ,  position [ ,  length]  )
  2678.  Macro function that returns a substring starting at  position.
  2679.  
  2680.  @stack
  2681.  DGROUP for near stacks or STACK for far stacks (text macro).
  2682.  
  2683.  @Time
  2684.  The system time in 24-hour hh:mm:ss format (text macro).
  2685.  
  2686.  @Version
  2687.  600 in MASM 6.0 (text macro).
  2688.  
  2689.  @WordSize
  2690.  2 for a 16-bit segment or 4 for a 32-bit segment (numeric equate).
  2691.  
  2692.  
  2693.  
  2694.  Operators
  2695.  
  2696.  
  2697.  expression1  + expression2
  2698.  Returns expression1 plus expression2.
  2699.  
  2700.  expression1 - expression2
  2701.  Returns expression1 minus expression2.
  2702.  
  2703.  expression1 * expression2
  2704.  Returns expression1 times expression2.
  2705.  
  2706.  expression1  / expression2
  2707.  Returns expression1 divided by expression2.
  2708.  
  2709.  -expression
  2710.  Reverses the sign of expression.
  2711.  
  2712.  [expression1]  [expression2 ]
  2713.  Returns expression1 plus  [expression2 ].
  2714.  
  2715.  segment : expression
  2716.  Overrides the default segment of expression with segment. The segment can
  2717.  be a segment register, group name, segment name, or segment expression. The e
  2718.  
  2719.  expression . field [ . field]...
  2720.  Returns expression plus the offset of field within its structure or union.
  2721.  
  2722.   [register ]. field [ . field]...
  2723.  Returns value at the location pointed to by register plus the offset of
  2724.  field within its structure or union.
  2725.  
  2726.   <text >
  2727.  Treats text as a single literal element.
  2728.  
  2729.  "text"
  2730.  Treats "text" as a string.
  2731.  
  2732.  'text'
  2733.  Treats 'text' as a string.
  2734.  
  2735.   !character
  2736.  Treats character as a literal character rather than as an operator or
  2737.  symbol.
  2738.  
  2739.   ;text
  2740.  Treats text as a comment.
  2741.  
  2742.   ;;text
  2743.  Treats text as a comment that will not be listed in expanded macros.
  2744.  
  2745.   %expression
  2746.  Treats the value of expression in a macro argument as text.
  2747.  
  2748.   ¶meter &
  2749.  Replaces parameter with its corresponding argument value.
  2750.  
  2751.   ABS
  2752.  See the  EXTERNDEF directive.
  2753.  
  2754.   ADDR
  2755.  See the  INVOKE directive.
  2756.  
  2757.  expression1  AND expression2
  2758.  Returns the result of a bitwise Boolean AND done on expression1 and expressio
  2759.  
  2760.  count  DUP (initialvalue [ , initialvalue]...)
  2761.  Specifies count number of declarations of initialvalue.
  2762.  
  2763.  expression1  EQ expression2
  2764.  Returns true (-1) if expression1 equals expression2, or returns false (0)
  2765.  if it does not.
  2766.  
  2767.  expression1  GE expression2
  2768.  Returns true (-1) if expression1 is greater than or equal to expression2,
  2769.  or returns false (0) if it is not.
  2770.  
  2771.  expression1  GT expression2
  2772.  Returns true (-1) if expression1 is greater than expression2, or returns
  2773.  false (0) if it is not.
  2774.  
  2775.   HIGH expression
  2776.  Returns the high byte of expression.
  2777.  
  2778.   HIGHWORD expression
  2779.  Returns the high word of expression.
  2780.  
  2781.  expression1  LE expression2
  2782.  Returns true (-1) if expression1 is less than or equal to expression2, or
  2783.  returns false (0) if it is not.
  2784.  
  2785.   LENGTH variable
  2786.  Returns the number of data items in variable created by the first
  2787.  initializer.
  2788.  
  2789.   LENGTHOF variable
  2790.  Returns the number of data objects in variable.
  2791.  
  2792.   LOW expression
  2793.  Returns the low byte of expression.
  2794.  
  2795.   LOWWORD expression
  2796.  Returns the low word of expression.
  2797.  
  2798.   LROFFSET expression
  2799.  Returns the offset of expression. Same as  OFFSET, but it generates a
  2800.  loader resolved offset, which allows Windows to relocate code segments.
  2801.  
  2802.  expression1  LT expression2
  2803.  Returns true (-1) if expression1 is less than expression2, or returns
  2804.  false (0) if it is not.
  2805.  
  2806.   MASK {recordfieldname | record}
  2807.  Returns a bit mask in which the bits in recordfieldname or record are set
  2808.  and all other bits are cleared.
  2809.  
  2810.  expression1  MOD expression2
  2811.  Returns the remainder of dividing expression1 by expression2.
  2812.  
  2813.  expression1  NE expression2
  2814.  Returns true (-1) if expression1 does not equal expression2, or returns
  2815.  false (0) if it does.
  2816.  
  2817.   NOT expression
  2818.  Returns expression with all bits reversed.
  2819.  
  2820.   OFFSET expression
  2821.  Returns the offset of expression.
  2822.  
  2823.   OPATTR expression
  2824.  
  2825.  Returns a word defining the mode and scope of expression. The low byte is
  2826.  identical to the byte returned by  .TYPE. The high byte contains additional
  2827.  information.
  2828.  
  2829.  expression1  OR expression2
  2830.  Returns the result of a bitwise OR done on expression1 and expression2.
  2831.  
  2832.  type  PTR expression
  2833.  Forces the expression to be treated as having the specified type.
  2834.  
  2835.  [distance]  PTR type
  2836.  
  2837.  Specifies a pointer to type.
  2838.  
  2839.   SEG expression
  2840.  Returns the segment of expression.
  2841.  
  2842.  expression  SHL count
  2843.  Returns the result of shifting the bits of expression left count number of
  2844.  bits.
  2845.  
  2846.   SHORT label
  2847.  Sets the type of label to short. All jumps to
  2848.  label must be short (within
  2849.  the range -128 to +127 bytes from the jump instruction to label).
  2850.  
  2851.  expression  SHR count
  2852.  Returns the result of shifting the bits of expression right count number
  2853.  of bits.
  2854.  
  2855.   SIZE variable
  2856.  Returns the number of bytes in variable allocated by the first initializer.
  2857.  
  2858.   SIZEOF {variable | type}
  2859.  Returns the number of bytes in variable or type.
  2860.  
  2861.   THIS type
  2862.  Returns an operand of specified type whose offset and segment values are
  2863.  equal to the current location-counter value.
  2864.  
  2865.   .TYPE expression
  2866.  See  OPATTR.
  2867.  
  2868.   TYPE expression
  2869.  Returns the type of expression.
  2870.  
  2871.   WIDTH {recordfieldname | record}
  2872.  Returns the width in bits of the current recordfieldname or record.
  2873.  
  2874.  expression1  XOR expression2
  2875.  Returns the result of a bitwise Boolean XOR done on expression1 and
  2876.  expression2.
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  Run-Time Operators
  2883.  
  2884.  The following operators are used only within  .IF,  .WHILE, or  .REPEAT
  2885.  blocks and are evaluated at run time, not at assembly time:
  2886.  
  2887.  expression1  ==  expression2
  2888.  Is equal to.
  2889.  
  2890.  expression1  !=  expression2
  2891.  Is not equal to.
  2892.  
  2893.  expression1  >  expression2
  2894.  Is greater than.
  2895.  
  2896.  expression1  >=  expression2
  2897.  Is greater than or equal to.
  2898.  
  2899.  expression1  <  expression2
  2900.  Is less than.
  2901.  
  2902.  expression1  <=  expression2
  2903.  Is less than or equal to.
  2904.  
  2905.  expression1  ||  expression2
  2906.  Logical OR.
  2907.  
  2908.  expression1  &&  expression2
  2909.  Logical AND.
  2910.  
  2911.  expression1  &  expression2
  2912.  Bitwise AND.
  2913.  
  2914.  ! expression
  2915.  Logical negation.
  2916.  
  2917.  CARRY?
  2918.  Carry (C) processor flag.
  2919.  
  2920.  OVERFLOW?
  2921.  Overflow (O) processor flag.
  2922.  
  2923.  PARITY?
  2924.  Parity (P) processor flag.
  2925.  
  2926.  SIGN?
  2927.  Sign (S) processor flag.
  2928.  
  2929.  ZERO?
  2930.  Zero (Z) processor flag.
  2931.  
  2932.  
  2933.  Processor
  2934.  
  2935.  
  2936.  
  2937.  Topical Cross-Reference for Processor
  2938.  
  2939.  
  2940.  Data Transfer
  2941.  MOV
  2942.  MOVS
  2943.  MOVSX
  2944.  MOVZX
  2945.  XCHG
  2946.  LODS
  2947.  STOS
  2948.  LEA
  2949.  LDS/LES
  2950.  LFS/LGS/LSS
  2951.  XLAT/XLATB
  2952.  BSWAP#
  2953.  CMPXCHG#
  2954.  XADD#
  2955.  
  2956.  
  2957.  Stack
  2958.  PUSH
  2959.  PUSHF
  2960.  PUSHA*
  2961.  POP
  2962.  POPF
  2963.  POPA*
  2964.  ENTER*
  2965.  LEAVE*
  2966.  
  2967.  
  2968.  Input/Output
  2969.  IN
  2970.  INS*
  2971.  OUT
  2972.  OUTS*
  2973.  
  2974.  
  2975.  Type Conversion
  2976.  CBW
  2977.  CWD
  2978.  CWDE
  2979.  CDQ
  2980.  BSWAP#
  2981.  
  2982.  
  2983.  Flag
  2984.  CLC
  2985.  CLD
  2986.  CLI
  2987.  CMC
  2988.  STC
  2989.  STD
  2990.  STI
  2991.  POPF
  2992.  PUSHF
  2993.  LAHF
  2994.  SAHF
  2995.  
  2996.  
  2997.  String
  2998.  MOVS
  2999.  LODS
  3000.  STOS
  3001.  SCAS
  3002.  CMPS
  3003.  INS*
  3004.  OUTS*
  3005.  REP
  3006.  REPE/REPZ
  3007.  REPNE/REPNZ
  3008.  
  3009.  
  3010.  Arithmetic
  3011.  ADD
  3012.  ADC
  3013.  INC
  3014.  SUB
  3015.  SBB
  3016.  DEC
  3017.  NEG
  3018.  IMUL
  3019.  MUL
  3020.  DIV
  3021.  IDIV
  3022.  XADD#
  3023.  
  3024.  
  3025.  Bit Operations
  3026.  AND
  3027.  OR
  3028.  XOR
  3029.  NOT
  3030.  ROL
  3031.  ROR
  3032.  RCL
  3033.  RCR
  3034.  SHL/SAL
  3035.  SHR
  3036.  SAR
  3037.  SHLD
  3038.  SHRD
  3039.  BSF
  3040.  BSR
  3041.  BT
  3042.  BTC
  3043.  BTR
  3044.  BTS
  3045.  
  3046.  
  3047.  Compare
  3048.  CMP
  3049.  CMPS
  3050.  TEST
  3051.  BT
  3052.  BTC
  3053.  BTR
  3054.  BTS
  3055.  CMPXCHG#
  3056.  
  3057.  
  3058.  Unconditional Transfer
  3059.  CALL
  3060.  INT
  3061.  IRET
  3062.  RET
  3063.  RETN/RETF
  3064.  JMP
  3065.  
  3066.  
  3067.  Loop
  3068.  LOOP
  3069.  LOOPE/LOOPZ
  3070.  LOOPNE/LOOPNZ
  3071.  JCXZ/JECXZ
  3072.  
  3073.  
  3074.  Conditional Transfer
  3075.  JB/JNAE
  3076.  JAE/JNB
  3077.  JBE/JNA
  3078.  JA/JNBE
  3079.  JE/JZ
  3080.  JNE/JNZ
  3081.  JL/JNGE
  3082.  JGE/JNL
  3083.  JLE/JNG
  3084.  JG/JNLE
  3085.  JS
  3086.  JNS
  3087.  JC
  3088.  JNC
  3089.  JO
  3090.  JNO
  3091.  JP/JPE
  3092.  JNP/JPO
  3093.  JCXZ/JECXZ
  3094.  INTO
  3095.  BOUND*
  3096.  
  3097.  
  3098.  Conditional Set
  3099.  SETB/SETNAE
  3100.  SETAE/SETNB
  3101.  SETBE/SETNA
  3102.  SETA/SETNBE
  3103.  SETE/SETZ
  3104.  SETNE/SETNZ
  3105.  SETL/SETNGE
  3106.  SETGE/SETNL
  3107.  SETLE/SETNG
  3108.  SETG/SETNLE
  3109.  SETS
  3110.  SETNS
  3111.  SETC
  3112.  SETNC
  3113.  SETO
  3114.  SETNO
  3115.  SETP/SETPE
  3116.  SETNP/SETPO
  3117.  
  3118.  
  3119.  BCD Conversion
  3120.  AAA
  3121.  AAS
  3122.  AAM
  3123.  AAD
  3124.  DAA
  3125.  DAS
  3126.  
  3127.  
  3128.  Processor Control
  3129.  NOP
  3130.  WAIT
  3131.  LOCK
  3132.  HLT
  3133.  
  3134.  
  3135.  Process Control
  3136.  ARPL
  3137.  CLTS
  3138.  LAR
  3139.  LGDT/LIDT/LLDT
  3140.  LMSW
  3141.  LSL
  3142.  LTR
  3143.  SGDT/SIDT/SLDT
  3144.  SMSW
  3145.  STR
  3146.  VERR
  3147.  VERW
  3148.  MOV special
  3149.  INVD#
  3150.  INVLPG#
  3151.  WBINVD#
  3152.  
  3153.  
  3154.  
  3155.  Interpreting Processor Instructions
  3156.  
  3157.  This section provides an alphabetical reference to the instructions for the
  3158.  8086, 8088, 80286, 80386, and 80486 processors. Figure 1 gives a key to each
  3159.  element of the reference.
  3160.  
  3161.  
  3162.  Flags
  3163.  The first row of the display has a one-character abbreviation for the flag
  3164.  name. Only the flags common to all processors are shown.
  3165.  
  3166.  O  Overflow       T  Trap       A  Auxiliary carry
  3167.  D  Direction      S  Sign       P  Parity
  3168.  I  Interrupt      Z  Zero       C  Carry
  3169.  
  3170.  
  3171.  The second line has codes indicating how the flag can be affected.
  3172.  1    Sets the flag
  3173.  0    Clears the flag
  3174.  ?    May change the flag, but the value is not predictable
  3175.  blank    No effect on the flag
  3176.  +-   Modifies according to the rules associated with the flag
  3177.  
  3178.  Syntax
  3179.  Each encoding variation may have different syntaxes corresponding to
  3180.  different addressing modes. The following abbreviations are used:
  3181.  reg
  3182.  A general-purpose register of any size
  3183.  segreg
  3184.  One of the segment registers: DS, ES, SS, or CS (also FS or GS on the
  3185.  80386/486)
  3186.  accum
  3187.  An accumulator register of any size: AL or AX (also EAX on the 80386/486)
  3188.  mem
  3189.  A direct or indirect memory operand of any size
  3190.  label
  3191.  A labeled memory location in the code segment
  3192.  src,dest
  3193.  A source or destination memory operand used in a string operation
  3194.  immed
  3195.  A constant operand
  3196.  In some cases abbreviations have numeric suffixes to specify that the
  3197.  operand must be a particular size. For example, reg16 means that only a
  3198.  16-bit (word) register is accepted.
  3199.  
  3200.  
  3201.  Examples
  3202.  One or more examples are shown for each syntax. Their position is not
  3203.  related to the clock speeds in the right column.
  3204.  
  3205.  Clock Speeds
  3206.  Column 3 shows the clock speeds for each processor. Sometimes an instruction
  3207.  may have more than one clock speed. Multiple speeds are separated by commas.
  3208.  If several speeds are part of an expression, they are enclosed in
  3209.  parentheses. The following abbreviations are used to specify variations:
  3210.  EA      Effective address. This applies only to the 8088 and 8086 processors,
  3211.  described in the next section.
  3212.  b,w,d   Byte, word, or doubleword operands.
  3213.  pm      Protected mode.
  3214.  n       Iterations. Repeated instructions may have a base number of clocks pl
  3215.  number of clocks for each iteration. For example, 8+4n means eight clocks
  3216.  plus four clocks for each iteration.
  3217.  noj     No jump. For conditional jump instructions, noj indicates the speed i
  3218.  condition is false and the jump is not taken.
  3219.  m       Next instruction components. Some control transfer instructions take
  3220.  different times depending on the length of the next instruction executed. On
  3221.  the 8088 and 8086, m is never a factor. On the 80286, m is the number of
  3222.  bytes in the instruction. On the 80386/486, m is the number of components.
  3223.  Each byte of encoding is a component, and the displacement and data are
  3224.  separate components.
  3225.  W88,88  8088 exceptions. See "Timings on the 8088 and 8086 Processors."
  3226.  
  3227.  Clocks can be converted to nanoseconds by dividing one microsecond by the
  3228.  number of megahertz (MHz) at which the processor is running. For example, on
  3229.  a processor running at 8 MHz, one clock takes 125 nanoseconds (1000 MHz per
  3230.  nanosecond / 8 MHz).
  3231.  
  3232.  The clock counts are for best-case timings. Actual timings vary depending on
  3233.  wait states, alignment of the instruction, the status of the prefetch queue,
  3234.  and other factors.
  3235.  
  3236.  
  3237.  Timings on the 8088 and 8086 Processors
  3238.  Because of its 8-bit data bus, the 8088 always requires two fetches to get a
  3239.  16-bit operand. Instructions that work on 16-bit memory operands therefore
  3240.  take longer on the 8088 than on the 8086. Separate 8088 timings are shown in
  3241.  parentheses following the main timing. For example, 9 (W88=13) means that
  3242.  the 8086 with any operands or the 8088 with byte operands take 9 clocks, but
  3243.  the 8088 with word operands takes 13 clocks. Similarly, 16 (88=24) means
  3244.  that the 8086 takes 16 clocks, but the 8088 takes 24 clocks.
  3245.  On the 8088 and 8086, the effective address (EA) value must be added for
  3246.  instructions that operate on memory operands. A displacement is any direct
  3247.  memory or constant operand, or any combination of the two. Below are the
  3248.  number of clocks to add for the effective address.
  3249. ╓┌───────────────────────────────┌──────────┌────────────────────────────────╖
  3250.  ────────────────────────────────────────────────────────────────────────────
  3251.  Components                      EA Clocks  Examples
  3252.  
  3253.  Displacement                    6          mov   ax,stuffmov   ax,stuff+2
  3254.  
  3255.  Base or index                   5          mov   ax,[bx]mov   ax,[di]
  3256.  
  3257.  ────────────────────────────────────────────────────────────────────────────
  3258. 
  3259.  Displacementplus base or index  9          mov   ax,[bp+8]mov
  3260.                                             ax,stuff[di]
  3261.  
  3262.  Base plus index (BP+DI,BX+SI)   7          mov   ax,[bx+si]mov   ax,[bp+di]
  3263.  
  3264.  Base plus index (BP+SI,BX+DI)   8          mov   ax,[bx+di]mov   ax,[bp+si]
  3265.  
  3266.  Base plus indexplus             11         mov   ax,stuff[bx+si]mov
  3267.  displacement (BP+DI+disp                   ax,[bp+di+8]
  3268.  ,BX+SI+disp)
  3269.  
  3270.  Base plus indexplus             12         mov   ax,stuff[bx+di]mov
  3271.  displacement  (BP+SI+disp                  ax,[bp+si+20]
  3272.  ,BX+DI+disp)
  3273.  
  3274.  Segment override                EA+2       mov   ax,es:stuffmov
  3275.                                             ax,ds:[bp+10]
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  Timings on the 80286-80486 Processors
  3282.  On the 80286-80486 processors, the effective address calculation is handled
  3283.  by hardware and is therefore not a factor in clock calculations except in
  3284.  one case. If a memory operand includes all three possible elements--a
  3285.  displacement, a base register, and an index register--then add one clock. On
  3286.  the 80486, the extra clock is not always used. Examples are shown below.
  3287.  
  3288.  mov    ax,[bx+di]         ;No extra
  3289.  mov    ax,array[bx+di]    ;One extra
  3290.  mov    ax,[bx+di+6]       ;One extra
  3291.  
  3292.  
  3293.  Note: 80186 and 80188 timings are different from 8088, 8086, and 80286
  3294.  timings. They are not shown in this manual. Timings are also not shown for
  3295.  protected-mode transfers through gates or for the virtual 8086 mode
  3296.  available on the 80386/486 processors.
  3297.  
  3298.  Interpreting Encodings
  3299.  Encodings are shown for each variation of the instruction. This section
  3300.  describes encoding for all processors except the 80386/486. The encodings
  3301.  take the form of boxes filled with 0s and 1s for bits that are constant for
  3302.  the instruction variation, and abbreviations (in italics) for the following
  3303.  variable bits or bitfields:
  3304.  d
  3305.  Direction bit. If set, do memory to register or register to register; the
  3306.  reg field is the destination. If cleared, do register to memory; the reg
  3307.  field is the source.
  3308.  
  3309.  w
  3310.  Word/byte bit. If set, use 16-bit or 32-bit operands. If cleared, use 8-bit
  3311.  operands.
  3312.  
  3313.  s
  3314.  Sign bit. If set, sign-extend 8-bit immediate data to 16 bits.
  3315.  
  3316.  mod
  3317.  Mode. This two-bit field gives the register/memory mode with displacement.
  3318.  The possible values are shown below.
  3319.  
  3320.  mod    Meaning
  3321.  00    This value can have two meanings:
  3322.      If r/m is 110, a direct memory operand is used.
  3323.  If r/m is not 110, the displacement is 0 and an indirect memory operand is
  3324.  used. The operand must be based, indexed, or based indexed.
  3325.  01    An indirect memory operand is used with an 8-bit displacement.
  3326.  10    An indirect memory operand is used with a 16-bit displacement.
  3327.  11    A two-register instruction is used; the reg field specifies the
  3328.  destination and the r/m field specifies the source.
  3329.  
  3330.  
  3331.  reg
  3332.  Register. This three-bit field specifies one of the general-purpose
  3333.  registers:
  3334.  
  3335.  reg    16/32 biut if w=1   8-bit if w=0
  3336.  000       AX/EAX              AL
  3337.  001       CX/ECX              CL
  3338.  010       DX/EDX              DL
  3339.  011       BX/EBX              BL
  3340.  100       SP/ESP              AH
  3341.  101       BP/EBP              CH
  3342.  110       SI/ESI              DH
  3343.  111       DI/EDI              BH
  3344.  
  3345.  The reg field is sometimes used to specify encoding information rather than
  3346.  a register.
  3347.  sreg
  3348.  Segment register. This field specifies one of the segment registers.
  3349.  sreg    Register
  3350.  000    ES
  3351.  001    CS
  3352.  010    SS
  3353.  011    DS
  3354.  100    FS
  3355.  101    GS
  3356.  
  3357.  
  3358.  r/m
  3359.  Register/memory. This three-bit field specifies a register or memory r/m
  3360.  operand.
  3361.  If the mod field is 11, r/m specifies the source register using the reg
  3362.  field codes. Otherwise, the field has one of the following values:
  3363.  
  3364.  r/m    Operand Address
  3365.  
  3366.  000    DS:[BX+SI+disp]
  3367.  001    DS:[BX+DI+disp]
  3368.  010    SS:[BP+SI+disp]
  3369.  011    SS:[BP+DI+disp]
  3370.  100    DS:[SI+disp]
  3371.  101    DS:[DI+disp]
  3372.  110    SS:[BP+disp]*
  3373.  
  3374.  * If mod is 00 and r/m is 110, then the operand is treated as a direct
  3375.  memory operand. This means that the operand [BP] is encoded as [BP+0] rather
  3376.  than having a short-form like other register indirect operands. Encoding
  3377.  [BX] takes one byte, but encoding [BP] takes two.
  3378.  111    DS:[BX+disp]
  3379.  
  3380.  
  3381.  disp
  3382.  Displacement. These bytes give the offset for memory operands. The possible
  3383.  lengths (in bytes) are shown in parentheses.
  3384.  
  3385.  data
  3386.  Data. These bytes gives the actual value for constant values. The possible
  3387.  lengths (in bytes) are shown in parentheses.
  3388.  
  3389.  If a memory operand has a segment override, the entire instruction has one
  3390.  of the following bytes as a prefix:
  3391.  
  3392.  Prefix                 Segment
  3393.  00101110    (2Eh)        CS
  3394.  00111110    (3Eh)        DS
  3395.  00100110    (26h)        ES
  3396.  00110110    (36h)        SS
  3397.  01100100    (64h)        FS
  3398.  01100101    (65h)        GS
  3399.  
  3400.  Example
  3401.  As an example, assume you want to calculate the encoding for the following
  3402.  statement (where  warray  is a 16-bit variable):
  3403.  add    warray[bx+di],-3
  3404.  
  3405.  First look up the encoding for the immediate to memory syntax of the ADD
  3406.  instruction:
  3407.  100000sw
  3408.  mod,000,r/m
  3409.  
  3410.  data (0, 1, or 2)
  3411.  
  3412.  
  3413.  Since the destination is a word operand, the w bit is set. The 8-bit
  3414.  immediate data must be sign-extended to 16 bits in order to fit into the
  3415.  operand, so the s bit is also set. The first byte of the instruction is
  3416.  therefore 10000011 (83h).
  3417.  Since the memory operand can be anywhere in the segment, it must have a
  3418.  16-bit offset (displacement). Therefore the mod field is 10. The reg field
  3419.  is 000, as shown in the encoding. The r/m coding for [bx+di+disp] is 001.
  3420.  The second byte is 10000001 (81h).
  3421.  The next two bytes are the offset of  warray. The low byte of the offset is
  3422.  stored first and the high byte second. For this example, assume that  warray
  3423.  is located at offset 10EFh.
  3424.  The last byte of the instruction is used to store the 8-bit immediate value
  3425.  -3 (FDh). This value is encoded as 8 bits (but sign-extended to 16 bits by
  3426.  the processor).
  3427.  
  3428.  83 81 EF 10 FD
  3429.  
  3430.  You can confirm this by assembling the instruction and looking at the
  3431.  resulting assembly listing.
  3432.  
  3433.  Interpreting 80386/486 Encoding Extensions
  3434.  This book shows 80386/486 encodings for instructions that are available only
  3435.  on the 80386/486 processors. For other instructions, encodings are shown
  3436.  only for the 16-bit subset available on all processors. This section tells
  3437.  how to convert the 80286 encodings shown in the book to 80386/486 encodings
  3438.  that use extensions such as 32-bit registers and memory operands.
  3439.  The extended 80386/486 encodings differ in that they can have additional
  3440.  prefix bytes, a Scaled Index Base (SIB) byte, and 32-bit displacement and
  3441.  immediate bytes. Use of these elements is closely tied to the segment word
  3442.  size. The use type of the code segment determines whether the instructions
  3443.  are processed in 32-bit mode (USE32) or
  3444.  16-bit mode (USE16). Current versions of MS-DOS(R) and Microsoft Windows and
  3445.  version 1.x of OS/2 use 16-bit mode only. Version 2.0 of OS/2 uses 32-bit
  3446.  mode.
  3447.  
  3448.  Additional bytes may be added for a segment prefix, a repeat prefix, or the
  3449.  LOCK prefix.
  3450.  
  3451.  
  3452.  
  3453.  Address-Size Prefix
  3454.  The address-size prefix determines the segment word size of the operation.
  3455.  It can override the default size for calculating the displacement of memory
  3456.  addresses. The address prefix byte is 67h. The assembler automatically
  3457.  inserts this byte where appropriate.
  3458.  In 32-bit mode (USE32 or FLAT code segment), displacements are calculated as
  3459.  32-bit addresses. The effective address-size prefix must be used for any
  3460.  instructions that must calculate addresses as 16-bit displacements. In
  3461.  16-bit mode the defaults are reversed. The prefix must be used to specify
  3462.  calculation of 32-bit displacements.
  3463.  
  3464.  
  3465.  Operand-Size Prefix
  3466.  The operand-size prefix determines the size of operands. It can override the
  3467.  default size of registers or memory operands. The operand-size prefix byte
  3468.  is 66h. The assembler automatically inserts this byte where appropriate.
  3469.  In 32-bit mode, the default sizes for operands are 8 bits and 32 bits
  3470.  (depending on the w bit). For most instructions, the operand-size prefix
  3471.  must be used for any instructions that use 16-bit operands. In 16-bit mode,
  3472.  the default sizes are 8 bits and 16 bits. The prefix must be used for any
  3473.  instructions that use 32-bit  operands. Some instructions use 16-bit
  3474.  operands, regardless of mode.
  3475.  
  3476.  
  3477.  Encoding Differences for 32-Bit Operations
  3478.  When 32-bit operations are performed, the meaning of certain bits or fields
  3479.  are different than for 16-bit operations. The changes may affect default
  3480.  operations in 32-bit mode, or 16-bit mode operations in which the
  3481.  address-size prefix or the operand-size prefix is used. The following fields
  3482.  may have a different meaning for 32-bit operations than the meaning
  3483.  described in the "Interpreting Encodings" section:
  3484.  
  3485.  w
  3486.  Word/byte bit.  If set, use 32-bit operands. If cleared, use
  3487.  8-bit operands.
  3488.  
  3489.  s
  3490.  Sign bit.  If set, sign-extend 8-bit or 16-bit immediate data to 32 bits.
  3491.  
  3492.  mod
  3493.  Mode. This field indicates the register/memory mode. The value 11 still
  3494.  indicates a register-to-register operation with r/m containing the code for
  3495.  a 32-bit source register. However, other codes have different meanings as
  3496.  shown in the tables in the next section.
  3497.  
  3498.  reg
  3499.  Register. The codes for 16-bit registers are extended to
  3500.  32-bit registers. For example, if the reg field is 000, EAX
  3501.  is used instead of AX. Use of 8-bit registers is unchanged.
  3502.  
  3503.  sreg
  3504.  Segment register. The 80386 has the following additional segment registers:
  3505.               sreg     Register
  3506.               100         FS
  3507.               101         GS
  3508.  
  3509.  r/m
  3510.  Register/memory. If the r/m field is used for the source register, 32-bit
  3511.  registers are used as for the reg field. If the field is used for memory
  3512.  operands, the meaning is completely different than for 16-bit operations, as
  3513.  shown in the tables in the next section.
  3514.  
  3515.  disp
  3516.  Displacement. This field is four bytes for 32-bit addresses.
  3517.  
  3518.  data
  3519.  Data. Immediate data can be up to four bytes.
  3520.  
  3521.  
  3522.  Scaled Index Base Byte
  3523.  Many 80386/486 extended memory operands are too complex to be represented by
  3524.  a single mod-reg-r/m byte. For these operands, a value of 100 in the r/m
  3525.  field signals the presence of a second encoding byte called the Scaled Index
  3526.  Base (SIB) byte. The SIB byte is made up of the following fields:
  3527.  
  3528.  ss
  3529.  Scaling Field. This two-bit field specifies one of the following scaling
  3530.  factors:
  3531.        ss   Scale
  3532.        00    1
  3533.        01    2
  3534.        10    4
  3535.        11    8
  3536.  
  3537.  index
  3538.  Index Register. This three-bit field specifies one of the following index
  3539.  registers:
  3540.       index    Register
  3541.         000    EAX
  3542.         001    ECX
  3543.         010    EDX
  3544.         011    EBX
  3545.         100    no index
  3546.         101    EBP
  3547.         110    ESI
  3548.         111    EDI
  3549.  
  3550.  Note that ESP cannot be an index register. If the index field is 100, then
  3551.  the ss field must be 00.
  3552.  
  3553.  base
  3554.  Base Register. This three-bit field combines with the mod field to specify
  3555.  the base register and the displacement. Note that the base field only
  3556.  specifies the base when the r/m field is 100. Otherwise, the r/m field
  3557.  specifies the base.
  3558.  
  3559.  If a memory operand has a segment override, the entire instruction has one
  3560.  of the prefixes discussed earlier in the "Interpreting Encodings" section or
  3561.  one of the following prefixes for the segment registers available only on
  3562.  the 80386/486:
  3563.       Prefix                 Segment
  3564.       01100100    (64h)        FS
  3565.       01100101    (65h)        GS
  3566.  
  3567.  
  3568.  Example
  3569.  Assume you want to calculate the encoding for the following statement (where
  3570.  warray  is a 16-bit variable). Assume also that the instruction is used in
  3571.  16-bit mode.
  3572.  add   warray[eax+ecx*2],-3
  3573.  
  3574.  First look up the encoding for the immediate to memory syntax of the ADD
  3575.  instruction:
  3576.  100000sw
  3577.  mod,000,r/m
  3578.  
  3579.  This encoding must be expanded to account for 80386/486 extensions. Note
  3580.  that the instruction operates on 16-bit data in a 16-bit mode program.
  3581.  Therefore, the operand-size prefix is not needed. However, the instruction
  3582.  does use 32-bit registers to calculate a 32-bit effective address. Thus the
  3583.  first byte of the encoding must be the effective address-size prefix,
  3584.  01100111 (67h).
  3585.  
  3586.  The opcode byte is the same (83h) as for the 80286 example described in the
  3587.  "Interpreting Encodings" section.
  3588.  
  3589.  The mod-reg-r/m byte must specify a based indexed operand with a scaling
  3590.  factor of two. This operand cannot be specified with a single byte, so the
  3591.  encoding must also use the SIB byte. The value 100 in the r/m field
  3592.  specifies an SIB byte. The reg field is 000, as shown in the encoding. The
  3593.  mod field is 10 for operands that have base and scaled index registers and a
  3594.  32-bit displacement. The combined mod, reg, and r/m fields for the second
  3595.  byte are 10000100 (84h).
  3596.  
  3597.  The SIB byte is next. The scaling factor is 2, so the ss field is 01. The
  3598.  index register is ECX, so the index field is 001. The base register is EAX,
  3599.  so the base field is 000. The SIB byte is 01001000 (48h).
  3600.  
  3601.  The next four bytes are the offset of  warray. The low bytes are stored
  3602.  first. For this example, assume that  warray  is located at offset 10EFh.
  3603.  This offset only requires two bytes, but four must be supplied because of
  3604.  the addressing mode. A 32-bit address can be safely used in 16-bit mode as
  3605.  long as the upper word is 0.
  3606.  
  3607.  The last byte of the instruction is used to store the 8-bit immediate value
  3608.  -3 (FDh).
  3609.  
  3610.  The encoding is shown below in hexadecimal:
  3611.  67 83 84 48 00 00 EF 10 FD
  3612.  
  3613.  
  3614.  
  3615.  Processor Instructions
  3616.  
  3617.  
  3618.  
  3619.  AAA
  3620.  ASCII Adjust after Addition
  3621.  
  3622.  Adjusts the result of an addition to a decimal digit (0-9). The previous
  3623.  addition instruction should place its 8-bit sum in AL. If the sum is greater
  3624.  than 9h, AH is incremented and the carry and auxiliary carry flags are set.
  3625.  Otherwise, the carry and auxiliary carry flags are cleared.
  3626.  
  3627.  
  3628.  
  3629.  AAD
  3630.  ASCII Adjust before Division
  3631.  
  3632.  Converts unpacked BCD digits in AH (most significant digit) and AL (least
  3633.  significant digit) to a binary number in AX. This instruction is often used
  3634.  to prepare an unpacked BCD number in AX for division by an unpacked BCD
  3635.  digit in an 8-bit register.
  3636.  
  3637.  
  3638.  
  3639.  AAM
  3640.  ASCII Adjust after Multiply
  3641.  
  3642.  Converts an 8-bit binary number less than 100 decimal in AL to an unpacked
  3643.  BCD number in AX. The most significant digit goes in AH and the least
  3644.  significant in AL. This instruction is often used to adjust the product
  3645.  after a MUL instruction that multiplies unpacked BCD digits in AH and AL. It
  3646.  is also used to adjust the quotient after a DIV instruction that divides a
  3647.  binary number less than 100 decimal in AX by an unpacked BCD number.
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  AAS
  3653.  ASCII Adjust after Subtraction
  3654.  
  3655.  Adjusts the result of a subtraction to a decimal digit (0-9). The previous
  3656.  subtraction instruction should place its 8-bit result in AL. If the result
  3657.  is greater than 9h, AH is decremented and the carry and auxiliary carry
  3658.  flags are set. Otherwise, the carry and auxiliary carry flags are cleared.
  3659.  
  3660.  
  3661.  
  3662.  ADC
  3663.  Add with Carry
  3664.  
  3665.  Adds the source operand, the destination operand, and the value of the carry
  3666.  flag. The result is assigned to the destination operand. This instruction is
  3667.  used to add the more significant portions of numbers that must be added in
  3668.  multiple registers.
  3669.  
  3670.  
  3671.  
  3672.  ADD
  3673.  Add
  3674.  
  3675.  Adds the source and destination operands and puts the sum in the destination
  3676.  operand.
  3677.  
  3678.  
  3679.  
  3680.  AND
  3681.  Logical AND
  3682.  
  3683.  Performs a bitwise AND operation on the source and destination operands and
  3684.  stores the result in the destination operand. For each bit position in the
  3685.  operands, if both bits are set, the corresponding bit of the result is set.
  3686.  Otherwise, the corresponding bit of the result is cleared.
  3687.  
  3688.  
  3689.  
  3690.  ARPL
  3691.  Adjust Requested Privilege Level
  3692.  80286-80486 Protected Only
  3693.  
  3694.  Verifies that the destination Requested Privilege Level (RPL) field (bits 0
  3695.  and 1 of a selector value) is less than the source RPL field. If it is not,
  3696.  ARPL adjusts the destination RPL up to match the source RPL. The destination
  3697.  operand should be a 16-bit memory or register operand containing the value
  3698.  of a selector. The source operand should be a
  3699.  16-bit register containing the test value. The zero flag is set if the
  3700.  destination is adjusted; otherwise, the flag is cleared. ARPL is useful only
  3701.  in 80286-80486 protected mode. See Intel documentation for details on
  3702.  selectors and privilege levels.
  3703.  
  3704.  
  3705.  
  3706.  BOUND
  3707.  Check Array Bounds
  3708.  80186-80486 Only
  3709.  
  3710.  Verifies that a signed index value is within the bounds of an array. The
  3711.  destination operand can be any 16-bit register containing the index to be
  3712.  checked. The source operand must then be a 32-bit memory operand in which
  3713.  the low and high words contain the starting and ending values, respectively,
  3714.  of the array. (On the 80386/486 processors, the destination operand can be a
  3715.  32-bit register; in this case, the source operand must be a 64-bit operand
  3716.  made up of 32-bit bounds.) If the source operand is less than the first
  3717.  bound or greater than the last bound, an interrupt 5 is generated. The
  3718.  instruction pointer pushed by the interrupt (and returned by IRET) points to
  3719.  the BOUND instruction rather than to the next instruction.
  3720.  
  3721.  
  3722.  
  3723.  BSF/BSR
  3724.  Bit Scan
  3725.  80386/486 Only
  3726.  
  3727.  Scans an operand to find the first set bit. If a set bit is found, the zero
  3728.  flag is set and the destination operand is loaded with the bit index of the
  3729.  first set bit encountered. If no set bit is found, the zero flag is cleared.
  3730.  BSF (Bit Scan Forward) scans from bit 0 to the most significant bit. BSR
  3731.  (Bit Scan Reverse) scans from the most significant bit of an operand to bit
  3732.  0.
  3733.  
  3734.  
  3735.  
  3736.  BSWAP
  3737.  Byte Swap
  3738.  80486 Only
  3739.  
  3740.  Takes a single 32-bit register as operand and exchanges the first byte with
  3741.  the fourth and the second byte with the third. This instruction does not
  3742.  alter any bit values within the bytes and is useful for quickly translating
  3743.  between 8086-family byte storage and storage schemes in which the high byte
  3744.  is stored first.
  3745.  
  3746.  
  3747.  
  3748.  BT/BTC/BTR/BTS
  3749.  Bit Tests
  3750.  80386/486 Only
  3751.  
  3752.  Copies the value of a specified bit into the carry flag, where it can be
  3753.  tested by a JC or JNC instruction. The destination operand specifies the
  3754.  value in which the bit is located; the source operand specifies the bit
  3755.  position. BT simply copies the bit to the flag. BTC copies the bit and
  3756.  complements (toggles) it in the destination. BTR copies the bit and resets
  3757.  (clears) it in the destination. BTS copies the bit and sets it in the
  3758.  destination.
  3759.  
  3760.  
  3761.  
  3762.  CALL
  3763.  Call Procedure
  3764.  
  3765.  Calls a procedure. The instruction pushes the address of the next
  3766.  instruction onto the stack and jumps to the address specified by the
  3767.  operand. For NEAR calls, SP is decreased by 2, the offset (IP) is pushed,
  3768.  and the new offset is loaded into IP.
  3769.  For FAR calls, SP is decreased by 2, the segment (CS) is pushed, and the new
  3770.  segment is loaded into CS. Then SP is decreased by 2 again, the offset (IP)
  3771.  is pushed, and the new offset is loaded into IP. A subsequent RET
  3772.  instruction can pop the address so that execution continues with the
  3773.  instruction following the call.
  3774.  
  3775.  
  3776.  
  3777.  CBW
  3778.  Convert Byte to Word
  3779.  
  3780.  Converts a signed byte in AL to a signed word in AX by extending the sign
  3781.  bit of AL into all bits of AH.
  3782.  
  3783.  
  3784.  
  3785.  CDQ
  3786.  Convert Double to Quad
  3787.  80386/486 Only
  3788.  
  3789.  Converts the signed doubleword in EAX to a signed quadword in the EDX:EAX
  3790.  register pair by extending the sign bit of EAX into all bits of EDX.
  3791.  
  3792.  
  3793.  
  3794.  CLC
  3795.  Clear Carry Flag
  3796.  
  3797.  Clears the carry flag.
  3798.  
  3799.  
  3800.  
  3801.  CLD
  3802.  Clear Direction Flag
  3803.  
  3804.  Clears the direction flag. All subsequent string instructions will process
  3805.  up (from low addresses to high addresses) by increasing the appropriate
  3806.  index registers.
  3807.  
  3808.  
  3809.  
  3810.  CLI
  3811.  Clear Interrupt Flag
  3812.  
  3813.  Clears the interrupt flag. When the interrupt flag is cleared, maskable
  3814.  interrupts are not recognized until the flag is set again with the STI
  3815.  instruction. In protected mode, CLI only clears the flag if the current
  3816.  task's privilege level is less than or equal to the value of the IOPL flag.
  3817.  Otherwise, a general-protection fault occurs.
  3818.  
  3819.  
  3820.  
  3821.  CLTS
  3822.  Clear Task Switched Flag
  3823.  80286-80486 Privileged Only
  3824.  
  3825.  Clears the task switched flag in the Machine Status Word (MSW) of the 80286
  3826.  or the CR0 register of the 80386/486. This instruction can be used only in
  3827.  systems software executing at privilege level 0. See Intel documentation for
  3828.  details on the task-switched flag and other privileged-mode concepts.
  3829.  
  3830.  
  3831.  
  3832.  CMC
  3833.  Complement Carry Flag
  3834.  
  3835.  Complements (toggles) the carry flag.
  3836.  
  3837.  
  3838.  
  3839.  CMP
  3840.  Compare Two Operands
  3841.  
  3842.  Compares two operands as a test for a subsequent conditional-jump or set
  3843.  instruction. CMP does this by subtracting the source operand from the
  3844.  destination operand and setting the flags according to the result. CMP is
  3845.  the same as the SUB instruction, except that the result is not stored.
  3846.  
  3847.  
  3848.  
  3849.  CMPS/CMPSB/
  3850.  CMPSW/CMPSD
  3851.  Compare String
  3852.  
  3853.  Compares two strings. DS:SI must point to the source string and ES:DI must
  3854.  point to the destination string (even if operands are given). For each
  3855.  comparison, the destination element is subtracted from the source element
  3856.  and the flags are updated to reflect the result (although the result is not
  3857.  stored). DI and SI are adjusted according to the size of the operands and
  3858.  the status of the direction flag. They are increased if the direction flag
  3859.  has been cleared with CLD or decreased if the direction flag has been set
  3860.  with STD.
  3861.  If the CMPS form of the instruction is used, operands must be provided to
  3862.  indicate the size of the data elements to be processed. A segment override
  3863.  can be given for the source (but not for the destination). If CMPSB (bytes),
  3864.  CMPSW (words), or CMPSD (doublewords on the 80386/486 only) is used, the
  3865.  instruction determines the size of the data elements to be processed.
  3866.  
  3867.  CMPS and its variations are normally used with repeat prefixes. REPNE (or
  3868.  REPNZ) is used to find the first match between two strings. REPE (or REPZ)
  3869.  is used to find the first nonmatch. Before the comparison, CX should contain
  3870.  the maximum number of elements to compare. After a REPNE CMPS, the zero flag
  3871.  will be cleared if no match was found. After a REPE CMPS, the zero flag will
  3872.  be set if no nonmatch was found. Otherwise, SI and DI will point to the
  3873.  element after the first match or nonmatch.
  3874.  
  3875.  
  3876.  
  3877.  CMPXCHG
  3878.  Compare and Exchange
  3879.  80486 Only
  3880.  
  3881.  Compares the destination operand to the accumulator (AL, AX, or EAX). If
  3882.  equal, the source operand is copied to the destination. Otherwise, the
  3883.  destination is copied to the accumulator. The instruction sets flags
  3884.  according to the result of the comparison.
  3885.  
  3886.  
  3887.  
  3888.  CWD
  3889.  Convert Word to Double
  3890.  
  3891.  Converts the signed word in AX to a signed doubleword in the DX:AX register
  3892.  pair by extending the sign bit of AX into all bits of DX.
  3893.  
  3894.  
  3895.  
  3896.  CWDE
  3897.  Convert Word to  Extended Double
  3898.  80386/486 Only
  3899.  
  3900.  Converts a signed word in AX to a signed doubleword in EAX by extending the
  3901.  sign bit of AX into all bits of EAX.
  3902.  
  3903.  
  3904.  
  3905.  DAA
  3906.  Decimal Adjust after Addition
  3907.  
  3908.  Adjusts the result of an addition to a packed BCD number (less than 100
  3909.  decimal). The previous addition instruction should place its 8-bit binary
  3910.  sum in AL. DAA converts this binary sum to packed BCD format with the least
  3911.  significant decimal digit in the lower four bits and the most significant
  3912.  digit in the upper four bits. If the sum is greater than 99h after
  3913.  adjustment, the carry and auxiliary carry flags are set. Otherwise, the
  3914.  carry and auxiliary carry flags are cleared.
  3915.  
  3916.  
  3917.  
  3918.  DAS
  3919.  Decimal Adjust after Subtraction
  3920.  
  3921.  Adjusts the result of a subtraction to a packed BCD number (less than 100
  3922.  decimal). The previous subtraction instruction should place its
  3923.  8-bit binary result in AL. DAS converts this binary sum to packed BCD format
  3924.  with the least significant decimal digit in the lower four bits and the most
  3925.  significant digit in the upper four bits. If the sum is greater than 99h
  3926.  after adjustment, the carry and auxiliary carry flags are set. Otherwise,
  3927.  the carry and auxiliary carry flags are cleared.
  3928.  
  3929.  
  3930.  
  3931.  DEC
  3932.  Decrement
  3933.  
  3934.  Subtracts 1 from the destination operand. Because the operand is treated as
  3935.  an unsigned integer, the DEC instruction does not affect the carry flag. To
  3936.  detect any effects on the carry flag, use the SUB instruction.
  3937.  
  3938.  
  3939.  
  3940.  DIV
  3941.  Unsigned Divide
  3942.  
  3943.  Divides an implied destination operand by a specified source operand. Both
  3944.  operands are treated as unsigned numbers. If the source (divisor) is 16 bits
  3945.  wide, the implied destination (dividend) is the DX:AX register pair. The
  3946.  quotient goes into AX and the remainder into DX. If the source is 8 bits
  3947.  wide, the implied destination operand is AX. The quotient goes into AL and
  3948.  the remainder into AH. On the 80386/486, if the source is EAX, the quotient
  3949.  goes into EAX and the divisor into EDX.
  3950.  
  3951.  
  3952.  
  3953.  ENTER
  3954.  Make Stack Frame
  3955.  80186-80486 Only
  3956.  
  3957.  Creates a stack frame for a procedure that receives parameters passed on the
  3958.  stack. When immed16 is 0, ENTER is equivalent to push bp, followed by mov
  3959.  bp,sp. The first operand of the ENTER instruction specifies the number of
  3960.  bytes to reserve for local variables. The second operand specifies the
  3961.  nesting level for the procedure. The nesting level should be 0 for languages
  3962.  that do not allow access to local variables of higher-level procedures (such
  3963.  as C, Basic, and FORTRAN). See the complementary instruction LEAVE for a
  3964.  method of exiting from a procedure.
  3965.  
  3966.  
  3967.  
  3968.  HLT@EH@%
  3969.  Halt
  3970.  
  3971.  Stops CPU execution until an interrupt restarts execution at the instruction
  3972.  following HLT. In protected mode, this instruction works only in privileged
  3973.  mode.
  3974.  
  3975.  
  3976.  
  3977.  IDIV
  3978.  Signed Divide
  3979.  
  3980.  Divides an implied destination operand by a specified source operand. Both
  3981.  operands are treated as signed numbers. If the source (divisor) is 16 bits
  3982.  wide, the implied destination (dividend) is the DX:AX register pair. The
  3983.  quotient goes into AX and the remainder into DX. If the source is 8 bits
  3984.  wide, the implied destination is AX. The quotient goes into AL and the
  3985.  remainder into AH. On the 80386/486, if the source is EAX, the quotient goes
  3986.  into EAX and the divisor into EDX.
  3987.  
  3988.  
  3989.  
  3990.  IMUL
  3991.  Signed Multiply
  3992.  
  3993.  Multiplies an implied destination operand by a specified source operand.
  3994.  Both operands are treated as signed numbers. If a single 16-bit operand is
  3995.  given, the implied destination is AX and the product goes into the DX:AX
  3996.  register pair. If a single 8-bit operand is given, the implied destination
  3997.  is AL and the product goes into AX. On the 80386/486, if the operand is EAX,
  3998.  the product goes into the EDX:EAX register pair. The carry and overflow
  3999.  flags are set if the product is sign-extended into DX for 16-bit operands,
  4000.  into AH for 8-bit operands, or into EDX for 32-bit operands.
  4001.  
  4002.  Two additional syntaxes are available on the 80186-80486 processors. In the
  4003.  two-operand form, a 16-bit register gives one of the factors and serves as
  4004.  the destination for the result; a source constant specifies the other
  4005.  factor. In the three-operand form, the first operand is a 16-bit register
  4006.  where the result will be stored, the second is a 16-bit register or memory
  4007.  operand containing one of the factors, and the third is a constant
  4008.  representing the other factor. With both variations, the overflow and carry
  4009.  flags are set if the result is too large to fit into the 16-bit destination
  4010.  register. Since the low 16 bits of the product are the same for both signed
  4011.  and unsigned multiplication, these syntaxes can be used for either signed or
  4012.  unsigned numbers. On the 80386/486, the operands can be either 16 or 32 bits
  4013.  wide.
  4014.  
  4015.  A fourth syntax is available on the 80386/486. Both the source and
  4016.  destination operands can be given specifically. The source can be any 16- or
  4017.  32-bit memory operand or general-purpose register. The destination can be
  4018.  any general-purpose register of the same size. The overflow and carry flags
  4019.  are set if the product does not fit in the destination.
  4020.  
  4021.  
  4022.  
  4023.  IN
  4024.  Input from Port
  4025.  
  4026.  Transfers a byte or word (or doubleword on the 80386/486) from a port to the
  4027.  accumulator register. The port address is specified by the source operand,
  4028.  which can be DX or an 8-bit constant. Constants can only be used for port
  4029.  numbers less than 255; use DX for higher port numbers. In protected mode, a
  4030.  general-protection fault occurs if IN is used when the current privilege
  4031.  level is greater than the value of the IOPL flag.
  4032.  
  4033.  
  4034.  
  4035.  INC
  4036.  Increment
  4037.  
  4038.  Adds 1 to the destination operand. Because the operand is treated as an
  4039.  unsigned integer, the INC instruction does not affect the carry flag. If a
  4040.  signed carry requires detection, use the ADD instruction.
  4041.  
  4042.  
  4043.  
  4044.  INS/INSB/INSW/INSD
  4045.  Input from Port to String
  4046.  80186-80486 Only
  4047.  
  4048.  Receives a string from a port. The string is considered the destination and
  4049.  must be pointed to by ES:DI (even if an operand is given). The input port is
  4050.  specified in DX. For each element received, DI is adjusted according to the
  4051.  size of the operand and the status of the direction flag. DI is increased if
  4052.  the direction flag has been cleared with CLD or decreased if the direction
  4053.  flag has been set with STD.
  4054.  
  4055.  If the INS form of the instruction is used, a destination operand must be
  4056.  provided to indicate the size of the data elements to be processed and DX
  4057.  must be specified as the source operand containing the port number. A
  4058.  segment override is not allowed. If INSB (bytes), INSW (words), or INSD
  4059.  (doublewords on the 80386/486 only) is used, the instruction determines the
  4060.  size of the data elements to be received.
  4061.  
  4062.  INS and its variations are normally used with the REP prefix. Before the
  4063.  repeated instruction is executed, CX should contain the number of elements
  4064.  to be received. In protected mode, a general-protection fault occurs if INS
  4065.  is used when the current privilege level is greater than the value of the
  4066.  IOPL flag.
  4067.  
  4068.  
  4069.  
  4070.  INT
  4071.  Interrupt
  4072.  
  4073.  Generates a software interrupt. An 8-bit constant operand (0 to 255)
  4074.  specifies the interrupt procedure to be called. The call is made by indexing
  4075.  the interrupt number into the Interrupt Descriptor Table (IDT) starting at
  4076.  segment 0, offset 0. In real mode, the IDT contains 4-byte pointers to
  4077.  interrupt procedures. In privileged mode, the IDT contains 8-byte pointers.
  4078.  
  4079.  When an interrupt is called in real mode, the flags, CS, and IP are pushed
  4080.  onto the stack (in that order) and the trap and interrupt flags are cleared.
  4081.  STI can be used to restore interrupts. See Intel documentation and the
  4082.  documentation for your operating system for details on using and defining
  4083.  interrupts in privileged mode. To return from an interrupt, use the IRET
  4084.  instruction.
  4085.  
  4086.  
  4087.  
  4088.  INTO
  4089.  Interrupt on Overflow
  4090.  
  4091.  Generates interrupt 4 if the overflow flag is set. The default DOS behavior
  4092.  for interrupt 4 is to return without taking any action. You must define an
  4093.  interrupt procedure for interrupt 4 in order for INTO to have any effect.
  4094.  
  4095.  
  4096.  
  4097.  INVD
  4098.  Invalidate Data Cache
  4099.  80486 Only
  4100.  
  4101.  Empties contents of the current data cache without writing changes to
  4102.  memory. Proper use of this instruction requires knowledge of how contents
  4103.  are placed in the cache. INVD is intended primarily for systems programming.
  4104.  See Intel documentation for details.
  4105.  
  4106.  
  4107.  
  4108.  INVLPG
  4109.  Invalidate TLB Entry
  4110.  80486 Only
  4111.  
  4112.  Invalidates an entry in the Translation Lookaside Buffer (TLB), used by the
  4113.  demand-paging mechanism for OS/2 and other virtual-memory systems. The
  4114.  instruction takes a single memory operand and calculates the effective
  4115.  address of the operand, including the segment address. If the resulting
  4116.  address is mapped by any entry in the TLB, this entry is removed. Proper use
  4117.  of INVLPG requires understanding the hardware-supported demand-paging
  4118.  mechanism. INVLPG is intended primarily for systems programming. See Intel
  4119.  documentation for details.
  4120.  
  4121.  
  4122.  
  4123.  IRET/IRETD
  4124.  Interrupt Return
  4125.  
  4126.  Returns control from an interrupt procedure to the interrupted code. In real
  4127.  mode, the IRET instruction pops IP, CS, and the flags (in that order) and
  4128.  resumes execution. See Intel documentation for details on IRET operation in
  4129.  privileged mode. On the 80386/486, the IRETD instruction should be used to
  4130.  pop a 32-bit instruction pointer when returning from an interrupt called
  4131.  from a 32-bit segment. The F suffix prevents epilogue code from being
  4132.  generated when ending a PROC block. Use it to terminate interrupt service
  4133.  procedures.
  4134.  
  4135.  
  4136.  
  4137.  Jcondition
  4138.  Jump Conditionally
  4139.  
  4140.  Transfers execution to the specified label if the flags condition is true.
  4141.  The condition is tested by checking the flags shown in the table on the
  4142.  following page. If the condition is false, no jump is taken and program
  4143.  execution continues at the next instruction. On the 8086-80286 processors,
  4144.  the label given as the operand must be short (between -128 and +127 bytes
  4145.  from the instruction following the jump).* The 80386/486 processors allow
  4146.  near jumps (-32,768 to +32,767 bytes). On the 80386/486, the assembler
  4147.  generates the shortest jump possible, unless the jump size is explicitly
  4148.  specified.
  4149.  
  4150.  When the 80386/486 processors are in FLAT memory model, short jumps range
  4151.  from -128 to +127 bytes and near jumps range from -2 to +2 gigabytes. There
  4152.  are no far jumps.
  4153.  
  4154.  
  4155.  
  4156.  JMP
  4157.  Jump Unconditionally
  4158.  
  4159.  Transfers program execution to the address specified by the destination
  4160.  operand. Jumps are near (between -32,768 and +32,767 bytes from the
  4161.  instruction following the jump), or short (between -128 and +127 bytes), or
  4162.  far (in a different code segment). Unless a distance is explicitly
  4163.  specified, the assembler selects the shortest possible jump. With near and
  4164.  short jumps, the operand specifies a new IP address. With far jumps, the
  4165.  operand specifies new IP and CS addresses.
  4166.  
  4167.  When the 80386/486 processors are in FLAT memory model, short jumps range
  4168.  from -128 to +127 bytes and near jumps range from -2 to +2 gigabytes.
  4169.  
  4170.  
  4171.  
  4172.  LAHF
  4173.  Load Flags into AH Register
  4174.  
  4175.  Transfers bits 0 to 7 of the flags register to AH. This includes the carry,
  4176.  parity, auxiliary carry, zero, and sign flags, but not the trap, interrupt,
  4177.  direction, or overflow flags.
  4178.  
  4179.  
  4180.  
  4181.  LAR
  4182.  Load Access Rights
  4183.  80286-80486 Protected Only
  4184.  
  4185.  Loads the access rights of a selector into a specified register. The source
  4186.  operand must be a register or memory operand containing a selector. The
  4187.  destination operand must be a register that will receive the access rights
  4188.  if the selector is valid and visible at the current privilege level. The
  4189.  zero flag is set if the access rights are transferred, or cleared if they
  4190.  are not. See Intel documentation for details on selectors, access rights,
  4191.  and other privileged-mode concepts.
  4192.  
  4193.  
  4194.  
  4195.  LDS/LES/LFS/LGS/LSS
  4196.  Load Far Pointer
  4197.  
  4198.  Reads and stores the far pointer specified by the source memory operand. The
  4199.  instruction moves the pointer's segment value into DS, ES, FS, GS, or SS
  4200.  (depending on the instruction). Then it moves the pointer's offset value
  4201.  into the destination operand. The LDS and LES instructions are available on
  4202.  all processors. The LFS, LGS, and LSS instructions are available only on the
  4203.  80386/486.
  4204.  
  4205.  
  4206.  
  4207.  LEA
  4208.  Load Effective Address
  4209.  
  4210.  Calculates the effective address (offset) of the source memory operand and
  4211.  stores the result in the destination register.
  4212.  
  4213.  If the source operand is a direct memory address, the assembler encodes the
  4214.  instruction in the more efficient  MOV reg,immediate  form (equivalent to
  4215.  MOV reg, OFFSET mem).
  4216.  
  4217.  
  4218.  
  4219.  LEAVE
  4220.  High Level Procedure Exit
  4221.  80186-80486 Only
  4222.  
  4223.  Terminates the stack frame of a procedure. LEAVE reverses the action of a
  4224.  previous ENTER instruction by restoring SP and BP to the values they had
  4225.  before the procedure stack frame was initialized. LEAVE is equivalent to mov
  4226.  sp,bp, followed by pop bp.
  4227.  
  4228.  
  4229.  
  4230.  LES/LFS/LGS
  4231.  Load Far Pointer to Extra Segment
  4232.  See LDS.
  4233.  
  4234.  
  4235.  
  4236.  LGDT/LIDT/LLDT
  4237.  Load Descriptor Table
  4238.  80286-80486 Privileged Only
  4239.  
  4240.  Loads a value from an operand into a descriptor table register. LGDT loads
  4241.  into the Global Descriptor Table, LIDT into the Interrupt Descriptor Table,
  4242.  and LLDT into the Local Descriptor Table. These instructions are available
  4243.  only in privileged mode. See Intel documentation for details on descriptor
  4244.  tables and other protected-mode concepts.
  4245.  
  4246.  
  4247.  
  4248.  LMSW
  4249.  Load Machine Status Word
  4250.  80286-80486 Privileged Only
  4251.  
  4252.  Loads a value from a memory operand into the Machine Status Word (MSW). This
  4253.  instruction is available only in privileged mode. See Intel documentation
  4254.  for details on the MSW and other protected-mode concepts.
  4255.  
  4256.  
  4257.  
  4258.  LOCK
  4259.  Lock the Bus
  4260.  
  4261.  Locks out other processors during execution of the next instruction. This
  4262.  instruction is a prefix. It must precede an instruction that accesses a
  4263.  memory location that another processor might attempt to access at the same
  4264.  time. See Intel documentation for details on multiprocessor environments.
  4265.  
  4266.  
  4267.  
  4268.  LODS/LODSB/
  4269.  LODSW/LODSD
  4270.  Load String Operand
  4271.  
  4272.  Loads a string from memory into the accumulator register. The string to be
  4273.  loaded is the source and must be pointed to by DS:SI (even if an operand is
  4274.  given). For each source element loaded, SI is adjusted according to the size
  4275.  of the operands and the status of the direction flag. SI is increased if the
  4276.  direction flag has been cleared with CLD or decreased if the direction flag
  4277.  has been set with STD.
  4278.  
  4279.  If the LODS form of the instruction is used, an operand must be provided to
  4280.  indicate the size of the data elements to be processed. A segment override
  4281.  can be given. If LODSB (bytes), LODSW (words), or LODSD (doublewords on the
  4282.  80386/486 only) is used, the instruction determines the size of the data
  4283.  elements to be processed and whether the element will be loaded to AL, AX,
  4284.  or EAX.
  4285.  
  4286.  LODS and its variations are not normally used with repeat prefixes, since
  4287.  there is no reason to repeatedly load memory values to a register.
  4288.  
  4289.  
  4290.  
  4291.  LOOP/LOOPW/LOOPD
  4292.  Loop
  4293.  
  4294.  Loops repeatedly to a specified label. LOOP decrements CX (without changing
  4295.  any flags) and, if the result is not 0, transfers execution to the address
  4296.  specified by the operand. On the 80386/486, LOOP uses the 16-bit CX in
  4297.  16-bit mode and the 32-bit ECX in 32-bit mode. The default can be overridden
  4298.  with LOOPW (CX) or LOOPD (ECX). If CX is 0 after being decremented,
  4299.  execution continues at the next instruction. The operand must specify a
  4300.  short label (between -128 and +127 bytes from the instruction following the
  4301.  LOOP instruction).
  4302.  
  4303.  
  4304.  
  4305.  LOOPcondition
  4306.  LOOPconditionW
  4307.  LOOPcondition
  4308.  Loop Conditionally
  4309.  
  4310.  Loops repeatedly to a specified label if condition is met and if CX is not
  4311.  0. On the 80386/486, these instructions use the 16-bit CX in
  4312.  16-bit mode and the 32-bit ECX in 32-bit mode. This default can be
  4313.  overridden with the W (CX) or D (ECX) forms of the instruction. The
  4314.  instruction decrements CX (without changing any flags) and tests whether the
  4315.  zero flag was set by a previous instruction (such as CMP). With LOOPE and
  4316.  LOOPZ (they are synonyms), execution is transferred to the label if the zero
  4317.  flag is set and CX is not 0. With LOOPNE and LOOPNZ (they are synonyms),
  4318.  execution is transferred to the label if the zero flag is cleared and CX is
  4319.  not 0. Execution continues at the next instruction if the condition is not
  4320.  met. Before entering the loop, CX should be set to the maximum number of
  4321.  repetitions desired.
  4322.  
  4323.  
  4324.  
  4325.  LSL
  4326.  Load Segment Limit
  4327.  80286-80486 Protected Only
  4328.  
  4329.  Loads the segment limit of a selector into a specified register. The source
  4330.  operand must be a register or memory operand containing a selector. The
  4331.  destination operand must be a register that will receive the segment limit
  4332.  if the selector is valid and visible at the current privilege level. The
  4333.  zero flag is set if the segment limit is transferred, or cleared if it is
  4334.  not. See Intel documentation for details on selectors, segment limits, and
  4335.  other protected-mode concepts.
  4336.  
  4337.  
  4338.  
  4339.  LSS
  4340.  Load Far Pointer to Stack Segment
  4341.  
  4342.  See LDS.
  4343.  
  4344.  
  4345.  
  4346.  LTR
  4347.  Load Task Register
  4348.  80286-80486 Privileged Only
  4349.  
  4350.  Loads a value from the specified operand to the current task register. LTR
  4351.  is available only in privileged mode. See Intel documentation for details on
  4352.  task registers and other protected-mode concepts.
  4353.  
  4354.  
  4355.  
  4356.  MOV
  4357.  Move Data
  4358.  
  4359.  Moves the value in the source operand to the destination operand. If the
  4360.  destination operand is SS, interrupts are disabled until the next
  4361.  instruction is executed (except on early versions of the 8088 and 8086).
  4362.  
  4363.  
  4364.  
  4365.  MOV
  4366.  Move to/from Special Registers
  4367.  80386/486 Only
  4368.  
  4369.  Moves a value from a special register to or from a 32-bit general-purpose
  4370.  register. The special registers include the control registers CR0, CR2, and
  4371.  CR3; the debug registers DR0, DR1, DR2, DR3, DR6, and DR7; and the test
  4372.  registers TR6 and TR7. On the 80486, the test registers TR4, TR5, and TR7
  4373.  are also available. See Intel documentation for details on special
  4374.  registers.
  4375.  
  4376.  
  4377.  
  4378.  MOVS/MOVSB/
  4379.  MOVSW/MOVSD
  4380.  Move String Data
  4381.  
  4382.  Moves a string from one area of memory to another. The source string must be
  4383.  pointed to by DS:SI, and the destination address must be pointed to by ES:DI
  4384.  (even if operands are given). For each element moved, DI and SI are adjusted
  4385.  according to the size of the operands and the status of the direction flag.
  4386.  They are increased if the direction flag has been cleared with CLD, or
  4387.  decreased if the direction flag has been set with STD.
  4388.  
  4389.  If the MOVS form of the instruction is used, operands must be provided to
  4390.  indicate the size of the data elements to be processed. A segment override
  4391.  can be given for the source operand (but not for the destination). If MOVSB
  4392.  (bytes), MOVSW (words), or MOVSD (doublewords on the 80386/486 only) is
  4393.  used, the instruction determines the size of the data elements to be
  4394.  processed.
  4395.  
  4396.  MOVS and its variations are normally used with the REP prefix.
  4397.  
  4398.  
  4399.  
  4400.  MOVSX
  4401.  Move with Sign-Extend
  4402.  80386/486 Only
  4403.  
  4404.  Moves and sign-extends the value of the source operand to the destination
  4405.  register. MOVSX is used to copy a signed 8-bit or 16-bit source operand to a
  4406.  larger 16-bit or 32-bit destination register.
  4407.  
  4408.  
  4409.  
  4410.  MOVZX
  4411.  Move with Zero-Extend
  4412.  80386/486 Only
  4413.  
  4414.  Moves and zero-extends the value of the source operand to the destination
  4415.  register. MOVZX is used to copy an unsigned 8-bit or
  4416.  16-bit source operand to a larger 16-bit or 32-bit destination register.
  4417.  
  4418.  
  4419.  
  4420.  MUL
  4421.  Unsigned Multiply
  4422.  
  4423.  Multiplies an implied destination operand by a specified source operand.
  4424.  Both operands are treated as unsigned numbers. If a single
  4425.  16-bit operand is given, the implied destination is AX and the product goes
  4426.  into the DX:AX register pair. If a single 8-bit operand is given, the
  4427.  implied destination is AL and the product goes into AX. On the 80386/486, if
  4428.  the operand is EAX, the product goes into the EDX:EAX register pair. The
  4429.  carry and overflow flags are set if DX is not 0 for 16-bit operands or if AH
  4430.  is not 0 for 8-bit operands.
  4431.  
  4432.  
  4433.  
  4434.  NEG
  4435.  Two's Complement Negation
  4436.  
  4437.  Replaces the operand with its two's complement. NEG does this by subtracting
  4438.  the operand from 0. If the operand is 0, the carry flag is cleared.
  4439.  Otherwise, the carry flag is set. If the operand contains the maximum
  4440.  possible negative value (-128 for 8-bit operands or -32,768 for 16-bit
  4441.  operands), the value does not change, but the overflow and carry flags are
  4442.  set.
  4443.  
  4444.  
  4445.  
  4446.  NOP
  4447.  No Operation
  4448.  
  4449.  Performs no operation. NOP can be used for timing delays or alignment.
  4450.  
  4451.  
  4452.  
  4453.  NOT
  4454.  One's Complement Negation
  4455.  
  4456.  Toggles each bit of the operand by clearing set bits and setting cleared
  4457.  bits.
  4458.  
  4459.  
  4460.  
  4461.  OR
  4462.  Inclusive OR
  4463.  
  4464.  Performs a bitwise OR operation on the source and destination operands and
  4465.  stores the result to the destination operand. For each
  4466.  bit position in the operands, if either or both bits are set, the
  4467.  corresponding bit of the result it set. Otherwise, the corresponding
  4468.  bit of the result is cleared.
  4469.  
  4470.  
  4471.  
  4472.  OUT
  4473.  Output to Port
  4474.  
  4475.  Transfers a byte or word (or a doubleword on the 80386/486) to a port from
  4476.  the accumulator register. The port address is specified by the destination
  4477.  operand, which can be DX or an 8-bit constant. In protected mode, a
  4478.  general-protection fault occurs if OUT is used when the current privilege
  4479.  level is greater than the value of the IOPL flag.
  4480.  
  4481.  
  4482.  
  4483.  OUTS/OUTSB/
  4484.  OUTSW/OUTSD
  4485.  Output String to Port
  4486.  80186-80486 Only
  4487.  
  4488.  Sends a string to a port. The string is considered the source and must be
  4489.  pointed to by DS:SI (even if an operand is given). The output port is
  4490.  specified in DX. For each element sent, SI is adjusted according to the size
  4491.  of the operand and the status of the direction flag. SI is increased if the
  4492.  direction flag has been cleared with CLD or decreased if the direction flag
  4493.  has been set with STD.
  4494.  
  4495.  If the OUTS form of the instruction is used, an operand must be provided to
  4496.  indicate the size of data elements to be sent. A segment override can be
  4497.  given. If OUTSB (bytes), OUTSW (words), or OUTSD (doublewords on the
  4498.  80386/486 only) is used, the instruction determines the size of the data
  4499.  elements to be sent.
  4500.  
  4501.  OUTS and its variations are normally used with the REP prefix. Before the
  4502.  instruction is executed, CX should contain the number of elements to send.
  4503.  In protected mode, a general-protection fault occurs if OUTS is used when
  4504.  the current privilege level is greater than the value of the IOPL flag.
  4505.  
  4506.  
  4507.  
  4508.  POP
  4509.  Pop
  4510.  
  4511.  Pops the top of the stack into the destination operand. The value at SS:SP
  4512.  is copied to the destination operand and SP is increased by 2. The
  4513.  destination operand can be a memory location, a general-purpose 16-bit
  4514.  register, or any segment register except CS. Use RET to pop CS. On the
  4515.  80386/486, 32-bit values can be popped by giving a 32-bit operand. ESP is
  4516.  increased by 4 for 32-bit pops.
  4517.  
  4518.  
  4519.  
  4520.  POPA/POPAD
  4521.  Pop All
  4522.  80186-80486 Only
  4523.  
  4524.  Pops the top 16 bytes on the stack into the 8 general-purpose registers. The
  4525.  registers are popped in the following order: DI, SI, BP, SP, BX, DX, CX, AX.
  4526.  The value for the SP register is actually discarded rather than copied to
  4527.  SP. POPA always pops into 16-bit registers. On the 80386/486, use POPAD to
  4528.  pop into 32-bit registers.
  4529.  
  4530.  
  4531.  
  4532.  POPF/POPFD
  4533.  Pop Flags
  4534.  
  4535.  Pops the value on the top of the stack into the flags register. POPF always
  4536.  pops into the 16-bit flags register. On the 80386/486, use POPFD to pop into
  4537.  the 32-bit flags register.
  4538.  
  4539.  
  4540.  
  4541.  PUSH/PUSHW/PUSHD
  4542.  Push
  4543.  
  4544.  Pushes the source operand onto the stack. SP is decreased by 2 and the
  4545.  source value is copied to SS:SP. The operand can be a memory location, a
  4546.  general-purpose 16-bit register, or a segment register. On the 80186-80486
  4547.  processors, the operand can also be a constant. On the 80386/486, 32-bit
  4548.  values can be pushed by specifying a 32-bit operand. ESP is decreased by 4
  4549.  for 32-bit pushes. On the 8088 and 8086, PUSH SP saves the value of SP after
  4550.  the push. On the 80186-80486 processors, PUSH SP saves the value of SP
  4551.  before the push. The PUSHW and PUSHD instructions push a word (2 bytes) and
  4552.  a doubleword (4 bytes), respectively.
  4553.  
  4554.  
  4555.  
  4556.  PUSHA/PUSHAD
  4557.  Push All
  4558.  80186-80486 Only
  4559.  
  4560.  Pushes the eight general-purpose registers onto the stack. The registers are
  4561.  pushed in the following order: AX, CX, DX, BX, SP, BP, SI, DI. The value
  4562.  pushed for SP is the value before the instruction. PUSHA always pushes
  4563.  16-bit registers. On the 80386/486, use PUSHAD to push 32-bit registers.
  4564.  
  4565.  
  4566.  
  4567.  PUSHF/PUSHFD
  4568.  Push Flags
  4569.  
  4570.  Pushes the flags register onto the stack. PUSHF always pushes the 16-bit
  4571.  flags register. On the 80386/486, use PUSHFD to push the 32-bit flags
  4572.  register.
  4573.  
  4574.  
  4575.  
  4576.  RCL/RCR/ROL/ROR
  4577.  Rotate
  4578.  
  4579.  Rotates the bits in the destination operand the number of times specified in
  4580.  the source operand. RCL and ROL rotate the bits left; RCR and ROR rotate
  4581.  right.
  4582.  
  4583.  ROL and ROR rotate the number of bits in the operand. For each rotation, the
  4584.  leftmost or rightmost bit is copied to the carry flag as well as rotated.
  4585.  RCL and RCR rotate through the carry flag. The carry flag becomes an
  4586.  extension of the operand so that a 9-bit rotation is done for 8-bit
  4587.  operands, or a 17-bit rotation for 16-bit operands.
  4588.  
  4589.  On the 8088 and 8086, the source operand can be either CL or 1. On the
  4590.  80186-80486, the source operand can be CL or an 8-bit constant. On the
  4591.  80186-80486, rotate counts larger than 31 are masked off, but on the 8088
  4592.  and 8086, larger rotate counts are performed despite the inefficiency
  4593.  involved. The overflow flag is only modified by single-bit variations of the
  4594.  instruction; for multiple-bit variations, it is undefined.
  4595.  
  4596.  
  4597.  
  4598.  REP
  4599.  Repeat String
  4600.  
  4601.  Repeats a string instruction the number of times indicated by CX. First, CX
  4602.  is compared to zero; if it equals zero, execution proceeds to the next
  4603.  instruction. Otherwise, CX is decremented, the string instruction is
  4604.  performed, and the loop continues with CX being compared to zero. REP is
  4605.  used with MOVS and STOS. REP can also be used with INS and OUTS on the
  4606.  80186-80486 processors. On all processors except the 80386/486, combining a
  4607.  repeat prefix with a segment override can cause errors if an interrupt
  4608.  occurs.
  4609.  
  4610.  
  4611.  
  4612.  REPcondition
  4613.  Repeat String Conditionally
  4614.  
  4615.  Repeats a string instruction as long as condition is true and the maximum
  4616.  count has not been reached. REPE and REPZ (they are synonyms) repeat while
  4617.  the zero flag is set. REPNE and REPNZ (they are synonyms) repeat while the
  4618.  zero flag is cleared. The conditional-repeat prefixes should only be used
  4619.  with SCAS and CMPS, since these are the only string instructions that modify
  4620.  the zero flag. Before executing the instruction, CX should be set to the
  4621.  maximum allowable number of repetitions. First, CX is compared to zero; if
  4622.  it equals zero, execution proceeds to the next instruction. Otherwise, CX is
  4623.  decremented, the string instruction is performed, and the loop continues
  4624.  with CX being compared to zero. On all processors except the 80386/486,
  4625.  combining a repeat prefix with a segment override may cause errors if an
  4626.  interrupt occurs during a string operation.
  4627.  
  4628.  
  4629.  
  4630.  RET/RETN/RETF
  4631.  Return from Procedure
  4632.  
  4633.  Returns from a procedure by transferring control to an address popped from
  4634.  the top of the stack. A constant operand can be given indicating the number
  4635.  of additional bytes to release. The constant is normally used to adjust the
  4636.  stack for arguments pushed before the procedure was called. The size of a
  4637.  return (near or far) is the size of the procedure in which the RET is
  4638.  defined with the PROC directive. RETN can be used to specify a near return;
  4639.  RETF can specify a far return. A near return pops a word into IP. A far
  4640.  return pops a word into IP and then pops a word into CS. After the return,
  4641.  the number of bytes given in the operand (if any) is added to SP.
  4642.  
  4643.  
  4644.  
  4645.  ROL/ROR
  4646.  Rotate
  4647.  
  4648.  See RCL/RCR.
  4649.  
  4650.  
  4651.  
  4652.  SAHF
  4653.  Store AH into Flags
  4654.  
  4655.  Transfers AH into bits 0 to 7 of the flags register. This includes the
  4656.  carry, parity, auxiliary carry, zero, and sign flags, but not the trap,
  4657.  interrupt, direction, or overflow flags.
  4658.  
  4659.  
  4660.  
  4661.  SAL/SAR
  4662.  Shift
  4663.  
  4664.  See SHL/SHR/SAL/SAR.
  4665.  
  4666.  
  4667.  
  4668.  SBB
  4669.  Subtract with Borrow
  4670.  
  4671.  Adds the carry flag to the second operand, then subtracts that value from
  4672.  the first operand. This result is assigned to the first operand. SBB is used
  4673.  to subtract the least significant portions of numbers that must be processed
  4674.  in multiple registers.
  4675.  
  4676.  
  4677.  
  4678.  SCAS/SCASB/
  4679.  SCASW/SCASD
  4680.  Scan String Flags
  4681.  
  4682.  Scans a string to find a value specified in the accumulator register. The
  4683.  string to be scanned is considered the destination and must be pointed to by
  4684.  ES:DI (even if an operand is specified). For each element, the destination
  4685.  element is subtracted from the accumulator value and the flags are updated
  4686.  to reflect the result (although the result is not stored). DI is adjusted
  4687.  according to the size of the operands and the status of the direction flag.
  4688.  DI is increased if the direction flag has been cleared with CLD or decreased
  4689.  if the direction flag has been set with STD.
  4690.  
  4691.  If the SCAS form of the instruction is used, an operand must be provided to
  4692.  indicate the size of the data elements to be processed. No segment override
  4693.  is allowed. If SCASB (bytes), SCASW (words), or SCASD (doublewords on the
  4694.  80386/486 only) is used, the instruction determines the size of the data
  4695.  elements to be processed and whether the element scanned for is in AL, AX,
  4696.  or EAX.
  4697.  
  4698.  SCAS and its variations are normally used with repeat prefixes. REPNE (or
  4699.  REPNZ) is used to find the first match of the accumulator value. REPE (or
  4700.  REPZ) is used to find the first nonmatch. Before the comparison, CX should
  4701.  contain the maximum number of elements to compare. After a REPNE SCAS, the
  4702.  zero flag will be cleared if no match was found. After a REPE SCAS, the zero
  4703.  flag will be set if no nonmatch was found. Otherwise, ES:DI will point to
  4704.  the element past the first match or nonmatch.
  4705.  
  4706.  
  4707.  
  4708.  SETcondition
  4709.  Set Conditionally
  4710.  80386/486 Only
  4711.  
  4712.  Sets the byte specified in the operand to 1 if condition is true or to 0 if
  4713.  condition is false. The condition is tested by checking the flags shown in
  4714.  the table on the following page. The instruction is used to set Boolean
  4715.  flags conditionally.
  4716.  
  4717.  
  4718.  
  4719.  SGDT/SIDT/SLDT
  4720.  Store Descriptor Table
  4721.  80286-80486 Only
  4722.  
  4723.  Stores a descriptor table register into a specified operand. SGDT stores the
  4724.  Global Descriptor Table; SIDT, the Interrupt Descriptor Table; and SLDT, the
  4725.  Local Descriptor Table. These instructions are generally useful only in
  4726.  privileged mode. See Intel documentation for details on descriptor tables
  4727.  and other protected-mode concepts.
  4728.  
  4729.  
  4730.  SHL/SHR/SAL/SAR
  4731.  Shift
  4732.  
  4733.  Shifts the bits in the destination operand the number of times specified by
  4734.  the source operand. SAL and SHL shift the bits left; SAR and SHR shift
  4735.  right.
  4736.  
  4737.  With SHL, SAL, and SHR, the bit shifted off the end of the operand is copied
  4738.  into the carry flag and the leftmost or rightmost bit opened by the shift is
  4739.  set to 0. With SAR, the bit shifted off the end of the operand is copied
  4740.  into the carry flag and the leftmost bit opened by
  4741.  the shift retains its previous value (thus preserving the sign of the
  4742.  operand). SAL and SHL are synonyms.
  4743.  
  4744.  On the 8088 and 8086, the source operand can be either CL or 1. On the
  4745.  80186-80486 processors, the source operand can be CL or an 8-bit constant.
  4746.  On the 80186-80486 processors, shift counts larger than 31 are masked off,
  4747.  but on the 8088 and 8086, larger shift counts are performed despite the
  4748.  inefficiency involved. The overflow flag is only modified by single-bit
  4749.  variations of the instruction; for multiple-bit variations, it is undefined.
  4750.  
  4751.  
  4752.  
  4753.  SHLD/SHRD
  4754.  Double Precision Shift
  4755.  80386/486 Only
  4756.  
  4757.  Shifts the bits of the second operand into the first operand. The number of
  4758.  bits shifted is specified by the third operand. SHLD shifts the first
  4759.  operand to the left by the number of positions specified in the count. The
  4760.  positions opened by the shift are filled by the most significant bits of the
  4761.  second operand. SHRD shifts the first operand to the right by the number of
  4762.  positions specified in the count. The positions opened by the shift are
  4763.  filled by the least significant bits of the second operand. The count
  4764.  operand can be either CL or an 8-bit constant. If a shift count larger than
  4765.  31 is given, it is adjusted by using the remainder (modulus) of a division
  4766.  by 32.
  4767.  
  4768.  
  4769.  
  4770.  SMSW
  4771.  Store Machine Status Word
  4772.  80286-80486 Only
  4773.  
  4774.  Stores the Machine Status Word (MSW) into a specified memory operand. SMSW
  4775.  is generally useful only in protected mode. See Intel documentation for
  4776.  details on the MSW and other protected-mode concepts.
  4777.  
  4778.  
  4779.  
  4780.  STC
  4781.  Set Carry Flag
  4782.  
  4783.  Sets the carry flag.
  4784.  
  4785.  
  4786.  
  4787.  STD
  4788.  Set Direction Flag
  4789.  
  4790.  Sets the direction flag. All subsequent string instructions will process
  4791.  down (from high addresses to low addresses).
  4792.  
  4793.  
  4794.  
  4795.  STI
  4796.  Set Interrupt Flag
  4797.  
  4798.  Sets the interrupt flag. When the interrupt flag is set, maskable interrupts
  4799.  are recognized. If interrupts were disabled by a previous CLI instruction,
  4800.  pending interrupts will not be executed immediately; they will be executed
  4801.  after the instruction following STI.
  4802.  
  4803.  
  4804.  
  4805.  STOS/STOSB/
  4806.  STOSW/STOSD
  4807.  Store String Data
  4808.  
  4809.  Stores the value in the accumulator in a string. The string to be filled is
  4810.  the destination and must be pointed to by ES:DI (even if an operand is
  4811.  given). For each source element loaded, DI is adjusted according to the size
  4812.  of the operands and the status of the direction flag. DI is increased if the
  4813.  direction flag has been cleared with CLD or decreased if the direction flag
  4814.  has been set with STD.
  4815.  
  4816.  If the STOS form of the instruction is used, an operand must be provided to
  4817.  indicate the size of the data elements to be processed. No segment override
  4818.  is allowed. If STOSB (bytes), STOSW (words), or STOSD (doublewords on the
  4819.  80386/486 only) is used, the instruction determines the size of the data
  4820.  elements to be processed and whether the element comes from AL, AX, or EAX.
  4821.  
  4822.  STOS and its variations are often used with the REP prefix. Before the
  4823.  repeated instruction is executed, CX should contain the number of elements
  4824.  to store.
  4825.  
  4826.  
  4827.  
  4828.  STR
  4829.  Store Task Register
  4830.  80286-80486 Only
  4831.  
  4832.  Stores the current task register to the specified operand. This instruction
  4833.  is generally useful only in privileged mode. See Intel documentation for
  4834.  details on task registers and other protected-mode concepts.
  4835.  
  4836.  
  4837.  SUB
  4838.  Subtract
  4839.  
  4840.  Subtracts the source operand from the destination operand and stores the
  4841.  result in the destination operand.
  4842.  
  4843.  
  4844.  
  4845.  TEST
  4846.  Logical Compare
  4847.  
  4848.  Tests specified bits of an operand and sets the flags for a subsequent
  4849.  conditional jump or set instruction. One of the operands contains the value
  4850.  to be tested. The other contains a bit mask indicating the bits to be
  4851.  tested. TEST works by doing a bitwise AND operation on the source and
  4852.  destination operands. The flags are modified according to the result, but
  4853.  the destination operand is not changed. This instruction is the same as the
  4854.  AND instruction, except the result is not stored.
  4855.  
  4856.  
  4857.  
  4858.  VERR/VERW
  4859.  Verify Read or Write
  4860.  80286-80486 Protected Only
  4861.  
  4862.  Verifies that a specified segment selector is valid and can be read or
  4863.  written to at the current privilege level. VERR verifies that the selector
  4864.  is readable. VERW verifies that the selector can be written to. If the
  4865.  segment is verified, the zero flag is set. Otherwise, the zero flag is
  4866.  cleared.
  4867.  
  4868.  
  4869.  
  4870.  WAIT
  4871.  Wait
  4872.  
  4873.  Suspends processor execution until the processor receives a signal that a
  4874.  coprocessor has finished a simultaneous operation. It should be used to
  4875.  prevent a coprocessor instruction from modifying a memory location that is
  4876.  being modified simultaneously by a processor instruction. WAIT is the same
  4877.  as the coprocessor FWAIT instruction.
  4878.  
  4879.  
  4880.  
  4881.  WBINVD
  4882.  Write Back and Invalidate Data Cache
  4883.  80486 Only
  4884.  
  4885.  Empties the contents of the current data cache but first writes changes to
  4886.  memory. Proper use of this instruction requires knowledge of how contents
  4887.  are placed in the cache. WBINVD is intended primarily for systems
  4888.  programming. See Intel documentation for details.
  4889.  
  4890.  
  4891.  
  4892.  XADD
  4893.  Exchange and Add
  4894.  80486 Only
  4895.  
  4896.  Adds the source and destination operands and stores the sum in the
  4897.  destination; simultaneously, the original value of the destination is moved
  4898.  to the source. The instruction sets flags according to the result of the
  4899.  addition.
  4900.  
  4901.  
  4902.  
  4903.  XCHG
  4904.  Exchange
  4905.  
  4906.  Exchanges the values of the source and destination operands.
  4907.  
  4908.  
  4909.  
  4910.  XLAT/XLATB
  4911.  Translate
  4912.  
  4913.  Translates a value from one coding system to another by looking up the value
  4914.  to be translated in a table stored in memory. Before the instruction is
  4915.  executed, BX should point to a table in memory and AL should contain the
  4916.  unsigned position of the value to be translated from the table. After the
  4917.  instruction, AL contains the table value with the specified position. No
  4918.  operand is required, but one can be given in order to specify a segment
  4919.  override. DS is assumed unless a segment override is given. XLATB is a
  4920.  synonym for XLAT. Either version allows an operand, but neither requires
  4921.  one.
  4922.  
  4923.  
  4924.  
  4925.  XOR
  4926.  Exclusive OR
  4927.  
  4928.  Performs a bitwise exclusive OR operation on the source and destination
  4929.  operands and stores the result in the destination. For each bit position in
  4930.  the operands, if both bits are set or if both bits are cleared, the
  4931.  corresponding bit of the result is cleared. Otherwise, the corresponding bit
  4932.  of the result is set.
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  Coprocessor
  4938.  
  4939.  
  4940.  Topical Cross-Reference for Coprocessor
  4941.  
  4942.  
  4943.  Load
  4944.  FLD/FILD/FBLD
  4945.  FXCH
  4946.  FLDCW
  4947.  FLDENV
  4948.  FRSTOR
  4949.  
  4950.  
  4951.  Store Data
  4952.  FST/FIST
  4953.  FSTP/FISTP/FBSTP
  4954.  FSTCW/FNSTCW
  4955.  FSTSW/FNSTSW
  4956.  FSAVE/FNSAVE
  4957.  FSTENV/FNSTENV
  4958.  
  4959.  
  4960.  Load Constant
  4961.  FLD1
  4962.  FLDL2E
  4963.  FLDL2T
  4964.  FLDLG2
  4965.  FLDLN2
  4966.  FLDPI
  4967.  FLDZ
  4968.  
  4969.  
  4970.  Arithmetic
  4971.  FADD/FIADD
  4972.  FADDP
  4973.  FSUB/FISUB
  4974.  FSUBP
  4975.  FSUBR/FISUBR
  4976.  FSUBRP
  4977.  FMUL/FIMUL
  4978.  FMULP
  4979.  FSCALE
  4980.  FDIV/FIDIV
  4981.  FDIVP
  4982.  FDIVR/FIDIVR
  4983.  FDIVRP
  4984.  FABS
  4985.  FCHS
  4986.  FRNDINT
  4987.  FSQRT
  4988.  FPREM
  4989.  FPREM1
  4990.  FXTRACT
  4991.  
  4992.  
  4993.  Transcendental
  4994.  FPTAN
  4995.  FPATAN
  4996.  FSIN
  4997.  FCOS
  4998.  FSINCOS
  4999.  F2XM1
  5000.  FYL2X
  5001.  FYL2P1
  5002.  FPREM
  5003.  FPREM1
  5004.  
  5005.  
  5006.  Compare
  5007.  FCOM/FICOM
  5008.  FCOMP/FICOMP
  5009.  FCOMPP
  5010.  FUCOM
  5011.  FUCOMP
  5012.  FUCOMPP
  5013.  FTST
  5014.  FXAM
  5015.  FSTSW/FNSTSW
  5016.  
  5017.  
  5018.  Processor Control
  5019.  FINIT/FNINIT
  5020.  FFREE
  5021.  FNOP
  5022.  FWAIT
  5023.  FDECSTP
  5024.  FINCSTP
  5025.  FCLEX/FNCLEX
  5026.  FSETPM
  5027.  FDISI/FNDISI*
  5028.  FENI/FNENI*
  5029.  FSAVE/FNSAVE
  5030.  FLDCW
  5031.  FRSTOR
  5032.  FSTCW/FNSTCW
  5033.  FSTSW/FNSTSW
  5034.  FSTENV/FNSTENV
  5035.  
  5036.  
  5037.  
  5038.  Interpreting  Coprocessor Instructions
  5039.  
  5040.  This section provides an alphabetical reference to instructions of the 8087,
  5041.  80287, and 80387 coprocessors. The format is the same as the processor
  5042.  instructions except that encodings are not provided. Differences are noted
  5043.  below.
  5044.  The 80486 has the coprocessor built in. This one chip executes all the
  5045.  instructions listed in the previous section and this section.
  5046.  
  5047.  
  5048.  Syntax
  5049.  Syntaxes in Column 1 use the following abbreviations for operand types:
  5050.  
  5051.  reg
  5052.  A coprocessor stack register
  5053.  
  5054.  memreal
  5055.  A direct or indirect memory operand storing a real number
  5056.  
  5057.  memint
  5058.  A direct or indirect memory operand storing a binary integer
  5059.  
  5060.  membcd
  5061.  A direct or indirect memory operand storing a BCD number
  5062.  
  5063.  
  5064.  Examples
  5065.  The position of the examples in Column 2 is not related to the clock speeds
  5066.  in Column 3.
  5067.  
  5068.  
  5069.  Clock Speeds
  5070.  Column 3 shows the clock speeds for each processor. Sometimes an instruction
  5071.  may have more than one possible clock speed. The following abbreviations are
  5072.  used to specify variations:
  5073.  
  5074.  EA
  5075.  Effective address. This applies only to the 8087. See the Processor Section,
  5076.  "Timings on the 8088 and 8086 Processors," for an explanation of effective
  5077.  address timings.
  5078.  
  5079.  s,l,t
  5080.  Short real, long real, and 10-byte temporary real.
  5081.  
  5082.  w,d,q
  5083.  Word, doubleword, and quadword binary integer.
  5084.  
  5085.  to,fr
  5086.  To or from stack top. On the 80387 and 80486, the to clocks represent
  5087.  timings when ST is the destination. The fr clocks represent timings when ST
  5088.  is the source.
  5089.  
  5090.  
  5091.  
  5092.  Instruction Size
  5093.  The instruction size is always two bytes for instructions that do not access
  5094.  memory. For instructions that do access memory, the size is four bytes on
  5095.  the 8087 and 80287. On the 80387 and 80486, the size for instructions that
  5096.  access memory is four bytes in 16-bit mode or six bytes in 32-bit mode.
  5097.  On the 8087, each instruction must be preceded by the WAIT (also called
  5098.  FWAIT) instruction, thereby increasing the instruction's size by one byte.
  5099.  The assembler inserts WAIT automatically by default, or with the .8087
  5100.  directive.
  5101.  
  5102.  
  5103.  Architecture
  5104.  The 8087, 80287, and 80387 coprocessors, along with the 80486, have several
  5105.  elements of architecture in common. All have a register stack made up of
  5106.  eight 80-bit data registers. These can contain floating-point numbers in the
  5107.  temporary real format. The coprocessors also have 14 bytes of control
  5108.  registers. Figure 2 shows the format of registers.
  5109.  
  5110.  The most important control registers are the control word and the status
  5111.  word. Figure 3 shows the format of these registers.
  5112.  
  5113.  
  5114.  
  5115.  Coprocessor Instructions
  5116.  
  5117.  
  5118.  
  5119.  F2XM1
  5120.  2X-1
  5121.  
  5122.  Calculates Y = 2X - 1. X is taken from ST. The result, Y, is returned in ST.
  5123.  X must be in the range 0  X  0.5 on the 8087/287, or in the range -1.0  X
  5124.  +1.0 on the 80387/486.
  5125.  
  5126.  
  5127.  
  5128.  FABS
  5129.  Absolute Value
  5130.  
  5131.  Converts the element in ST to its absolute value.
  5132.  
  5133.  
  5134.  
  5135.  FADD/FADDP/FIADD
  5136.  Add
  5137.  
  5138.  Adds the source to the destination and returns the sum in the destination.
  5139.  If two register operands are specified, one must be ST. If a memory operand
  5140.  is specified, the sum replaces the value in ST. Memory operands can be 32-
  5141.  or 64-bit real numbers or 16- or 32-bit integers. If no operand is
  5142.  specified, ST is added to ST(1) and the stack is popped, returning the sum
  5143.  in ST. For FADDP, the source must be ST; the sum is returned in the
  5144.  destination and ST is popped.
  5145.  
  5146.  
  5147.  
  5148.  FBLD
  5149.  Load BCD
  5150.  
  5151.  See FLD.
  5152.  
  5153.  
  5154.  
  5155.  FBSTP
  5156.  Store BCD and Pop
  5157.  
  5158.  See FST.
  5159.  
  5160.  
  5161.  
  5162.  FCHS
  5163.  Change Sign
  5164.  
  5165.  Reverses the sign of the value in ST.
  5166.  
  5167.  
  5168.  
  5169.  FCLEX/FNCLEX
  5170.  Clear Exceptions
  5171.  
  5172.  Clears all exception flags, the busy flag, and bit 7 in the status word. Bit
  5173.  7 is the interrupt-request flag on the 8087 and the error-status flag on the
  5174.  80287, 80387, and 80486. The instruction has wait and no-wait versions.
  5175.  
  5176.  
  5177.  
  5178.  FCOM/FCOMP/FCOMPP/
  5179.  FICOM/FICOMPCompare
  5180.  
  5181.  Compares the specified source operand to ST and sets the condition codes of
  5182.  the status word according to the result. The instruction subtracts the
  5183.  source operand from ST without changing either operand. Memory operands can
  5184.  be 32- or 64-bit real numbers or 16- or 32-bit integers. If no operand is
  5185.  specified or if two pops are specified, ST is compared to ST(1) and the
  5186.  stack is popped. If one pop is specified with an operand, the operand is
  5187.  compared to ST. If one of the operands is a NAN, an invalid-operation
  5188.  exception occurs (see FUCOM for an alternative method of comparing on the
  5189.  80387/486).
  5190.  
  5191.  
  5192.  
  5193.  FCOS
  5194.  Cosine
  5195.  
  5196.  80387/486 Only
  5197.  Replaces a value in radians in ST with its cosine. If |ST| < 263, the C2 bit
  5198.  of the status word is cleared and the cosine is calculated. Otherwise, C2 is
  5199.  set and no calculation is performed. ST can be reduced to the required range
  5200.  with FPREM or FPREM1.
  5201.  * For operands with an absolute value greater than /4, up to 76 additional
  5202.  clocks may be required.
  5203.   For operands with an absolute value greater than /4, add n clocks where  n
  5204.  = operand/(/4).
  5205.  
  5206.  
  5207.  
  5208.  FDECSTP
  5209.  Decrement Stack Pointer
  5210.  
  5211.  Decrements the stack-top pointer in the status word. No tags or registers
  5212.  are changed, and no data is transferred. If the stack pointer is 0, FDECSTP
  5213.  changes it to 7.
  5214.  
  5215.  
  5216.  
  5217.  FDISI/FNDISI
  5218.  Disable Interrupts
  5219.  8087 Only
  5220.  
  5221.  Disables interrupts by setting the interrupt-enable mask in the control
  5222.  word. This instruction has wait and no-wait versions. Since the 80287,
  5223.  80387, and 80486 do not have an interrupt-enable mask, the instruction is
  5224.  recognized but ignored on these coprocessors.
  5225.  
  5226.  
  5227.  
  5228.  FDIV/FDIVP/FIDIV
  5229.  Divide
  5230.  
  5231.  Divides the destination by the source and returns the quotient in the
  5232.  destination. If two register operands are specified, one must be ST. If a
  5233.  memory operand is specified, the quotient replaces the value in ST. Memory
  5234.  operands can be 32- or 64-bit real numbers or 16- or 32-bit
  5235.  integers. If no operand is specified, ST(1) is divided by ST and the stack
  5236.  is popped, returning the result in ST. For FDIVP, the source must be ST; the
  5237.  quotient is returned in the destination register and ST is popped.
  5238.  
  5239.  
  5240.  
  5241.  FDIVR/FDIVRP/FIDIVR
  5242.  Divide Reversed
  5243.  
  5244.  Divides the source by the destination and returns the quotient in the
  5245.  destination. If two register operands are specified, one must be ST. If a
  5246.  memory operand is specified, the quotient replaces the value in ST. Memory
  5247.  operands can be 32- or 64-bit real numbers or 16- or 32-bit
  5248.  integers. If no operand is specified, ST is divided by ST(1) and the stack
  5249.  is popped, returning the result in ST. For FDIVRP, the source must be ST;
  5250.  the quotient is returned in the destination register and ST is popped.
  5251.  
  5252.  
  5253.  
  5254.  FENI/FNENI
  5255.  Enable Interrupts
  5256.  8087 Only
  5257.  
  5258.  Enables interrupts by clearing the interrupt-enable mask in the control
  5259.  word. This instruction has wait and no-wait versions. Since the 80287,
  5260.  80387, and 80486 do not have an interrupt-enable mask, the instruction is
  5261.  recognized but ignored on these coprocessors.
  5262.  
  5263.  
  5264.  
  5265.  FFREE
  5266.  Free Register
  5267.  
  5268.  Changes the specified register's tag to empty without changing the contents
  5269.  of the register.
  5270.  
  5271.  
  5272.  
  5273.  FIADD/FISUB/FISUBR/
  5274.  FIMUL/FIDIV/FIDIVR
  5275.  Integer Arithmetic
  5276.  
  5277.  See FADD, FSUB, FSUBR, FMUL, FDIV, and FDIVR.
  5278.  
  5279.  
  5280.  
  5281.  FICOM/FICOMP
  5282.  Compare Integer
  5283.  
  5284.  See FCOM.
  5285.  
  5286.  
  5287.  
  5288.  FILD
  5289.  Load Integer
  5290.  
  5291.  See FLD.
  5292.  
  5293.  
  5294.  
  5295.  FINCSTP
  5296.  Increment Stack Pointer
  5297.  
  5298.  Increments the stack-top pointer in the status word. No tags or registers
  5299.  are changed, and no data is transferred. If the stack pointer is 7, FINCSTP
  5300.  changes it to 0.
  5301.  
  5302.  
  5303.  
  5304.  FINIT/FNINIT
  5305.  Initialize Coprocessor
  5306.  
  5307.  Initializes the coprocessor and resets all the registers and flags to their
  5308.  default values. The instruction has wait and no-wait versions. On the
  5309.  80387/486, the condition codes of the status word are cleared. On the
  5310.  8087/287, they are unchanged.
  5311.  
  5312.  
  5313.  
  5314.  FIST/FISTP
  5315.  Store Integer
  5316.  
  5317.  See FST.
  5318.  
  5319.  
  5320.  
  5321.  FLD/FILD/FBLD
  5322.  Load
  5323.  
  5324.  Pushes the specified operand onto the stack. All memory operands are
  5325.  automatically converted to temporary-real numbers before being loaded.
  5326.  Memory operands can be 32-, 64-, or 80-bit real numbers or 16-, 32-, or
  5327.  64-bit integers.
  5328.  
  5329.  
  5330.  
  5331.  FLD1/FLDZ/FLDPI/FLDL2E/
  5332.  FLDL2T/FLDLG2/FLDLN2
  5333.  Load Constant
  5334.  
  5335.  Pushes a constant onto the stack.
  5336.  
  5337.  
  5338.  FLDCW
  5339.  Load Control Word
  5340.  
  5341.  Loads the specified word into the coprocessor control word. The format of
  5342.  the control word is shown in the "Interpreting Coprocessor Instructions"
  5343.  section.
  5344.  
  5345.  
  5346.  
  5347.  FLDENV/FLDENVW/FLDENVD
  5348.  Load Environment State
  5349.  
  5350.  Loads the 14-byte coprocessor environment state from a specified memory
  5351.  location. The environment includes the control word, status word, tag word,
  5352.  instruction pointer, and operand pointer. On the 80387/486 in 32-bit mode,
  5353.  the environment state is 28 bytes.
  5354.  
  5355.  
  5356.  
  5357.  FMUL/FMULP/FIMUL
  5358.  Multiply
  5359.  
  5360.  Multiplies the source by the destination and returns the product in the
  5361.  destination. If two register operands are specified, one must be ST. If a
  5362.  memory operand is specified, the product replaces the value in ST. Memory
  5363.  operands can be 32- or 64-bit real numbers or 16- or 32-bit integers. If no
  5364.  operand is specified, ST(1) is multiplied by ST and the stack is popped,
  5365.  returning the product in ST. For FMULP, the source must be ST; the product
  5366.  is returned in the destination register and ST is popped.
  5367.  
  5368.  
  5369.  
  5370.  FNinstruction
  5371.  No-Wait Instructions
  5372.  
  5373.  Instructions that have no-wait versions include FCLEX, FDISI, FENI, FINIT,
  5374.  FSAVE, FSTCW, FSTENV, and FSTSW. Wait versions of instructions check for
  5375.  unmasked numeric errors; no-wait versions do not. When the .8087 directive
  5376.  is used, the assembler puts a WAIT instruction before the wait versions and
  5377.  a NOP instruction before the no-wait versions.
  5378.  
  5379.  
  5380.  
  5381.  
  5382.  FNOP
  5383.  No Operation
  5384.  
  5385.  Performs no operation. FNOP can be used for timing delays or alignment.
  5386.  
  5387.  
  5388.  
  5389.  FPATAN
  5390.  Partial Arctangent
  5391.  
  5392.  Finds the partial tangent by calculating Z = ARCTAN(Y / X). X is taken from
  5393.  ST and Y from ST(1). On the 8087/287, Y and X must be in the range 0  Y < X
  5394.  < . On the 80387/486, there is no restriction on X and Y. X is popped from
  5395.  the stack and Z replaces Y in ST.
  5396.  
  5397.  
  5398.  
  5399.  FPREM
  5400.  Partial Remainder
  5401.  
  5402.  Calculates the remainder of ST divided by ST(1), returning the result in ST.
  5403.  The remainder retains the same sign as the original dividend. The
  5404.  calculation uses the following formula:
  5405.  
  5406.  Condition Codes for FPREM and FPREM1
  5407.  
  5408.  C3    C2    C1    C0    Meaning
  5409.   ?     1     ?     ?    Incomplete reduction
  5410.   0     0     0     0    quotient MOD 8 = 0
  5411.   0     0     0     1    quotient MOD 8 = 4
  5412.   0     0     1     0    quotient MOD 8 = 1
  5413.   0     0     1     1    quotient MOD 8 = 5
  5414.   1     0     0     0    quotient MOD 8 = 2
  5415.   1     0     0     1    quotient MOD 8 = 6
  5416.   1     0     1     0    quotient MOD 8 = 3
  5417.   1     0     1     1    quotient MOD 8 = 7
  5418.  
  5419.  
  5420.  
  5421.  FPREM1
  5422.  Partial Remainder (IEEE Compatible)
  5423.  80387/486 Only
  5424.  
  5425.  Calculates the remainder of ST divided by ST(1), returning the result in ST.
  5426.  The remainder retains the same sign as the original dividend.
  5427.  
  5428.  
  5429.  
  5430.  FPTAN
  5431.  Partial Tangent
  5432.  
  5433.  Finds the partial tangent by calculating Y / X = TAN(Z). Z is taken from ST.
  5434.  Z must be in the range 0  Z   / 4 on the 8087/287. On the 80387/486, |Z|
  5435.  must be less than 263. The result is the ratio Y / X. Y replaces Z, and X is
  5436.  pushed into ST. Thus, Y is returned in ST(1) and X in ST.
  5437.  
  5438.  
  5439.  
  5440.  FRNDINT
  5441.  Round to Integer
  5442.  
  5443.  Rounds ST from a real number to an integer. The rounding control (RC) field
  5444.  of the control word specifies the rounding method, as shown in the
  5445.  introduction to this section.
  5446.  
  5447.  
  5448.  
  5449.  FRSTOR/FRSTORW/FRSTORD
  5450.  Restore Saved State
  5451.  
  5452.  Restores the 94-byte coprocessor state to the coprocessor from the specified
  5453.  memory location. In 32-bit mode on the 80387/486, the environment state
  5454.  takes 108 bytes.
  5455.  
  5456.  
  5457.  
  5458.  FSAVE/FSAVEW/FSAVED
  5459.  FNSAVE/FNSAVEW/FNSAVED
  5460.  Save Coprocessor State
  5461.  
  5462.  Stores the 94-byte coprocessor state to the specified memory location. In
  5463.  32-bit mode on the 80387/486, the environment state takes 108 bytes. This
  5464.  instruction has wait and no-wait versions. After the save, the coprocessor
  5465.  is initialized as if FINIT had been executed.
  5466.  
  5467.  
  5468.  
  5469.  FSCALE
  5470.  Scale
  5471.  
  5472.  Scales by powers of 2 by calculating the function Y = Y * 2X. X is the
  5473.  scaling factor taken from ST(1), and Y is the value to be scaled from ST.
  5474.  The scaled result replaces the value in ST. The scaling factor remains in
  5475.  ST(1). If the scaling factor is not an integer, it will be truncated toward
  5476.  zero before the scaling.
  5477.  
  5478.  
  5479.  
  5480.  FSETPM
  5481.  Set Protected Mode
  5482.  80287 Only
  5483.  
  5484.  Sets the 80287 to protected mode. The instruction and operand pointers are
  5485.  in the protected-mode format after this instruction. On the 80387/486,
  5486.  FSETPM is recognized but interpreted as FNOP, since the 80386/486 processors
  5487.  handle addressing identically in real and protected mode.
  5488.  
  5489.  
  5490.  
  5491.  FSIN
  5492.  Sine
  5493.  80387/486 Only
  5494.  
  5495.  Replaces a value in radians in ST with its sine. If |ST| < 263, the C2 bit
  5496.  of the status word is cleared and the sine is calculated. Otherwise, C2 is
  5497.  set and no calculation is performed. ST can be reduced to the required range
  5498.  with FPREM or FPREM1.
  5499.  
  5500.  
  5501.  
  5502.  FSINCOS
  5503.  Sine and Cosine
  5504.  80387/486 Only
  5505.  
  5506.  Computes the sine and cosine of a radian value in ST. The sine replaces the
  5507.  value in ST, and then the cosine is pushed onto the stack. If |ST| < 263,
  5508.  the C2 bit of the status word is cleared and the sine and cosine are
  5509.  calculated. Otherwise, C2 is set and no calculation is performed. ST can be
  5510.  reduced to the required range with FPREM or FPREM1.
  5511.  
  5512.  
  5513.  
  5514.  FSQRT
  5515.  Square Root
  5516.  
  5517.  Replaces the value of ST with its square root. (The square root of -0
  5518.  is -0.)
  5519.  
  5520.  
  5521.  
  5522.  FST/FSTP/FIST/FISTP/FBSTP
  5523.  Store
  5524.  
  5525.  Stores the value in ST to the specified memory location or register.
  5526.  Temporary-real values in registers are converted to the appropriate integer,
  5527.  BCD, or floating-point format as they are stored. With FSTP, FISTP, and
  5528.  FBSTP, the ST register value is popped off the stack. Memory operands can be
  5529.  32-, 64-, or 80-bit real numbers for FSTP or 16-, 32-, or 64-bit integers
  5530.  for FISTP.
  5531.  
  5532.  
  5533.  
  5534.  FSTCW/FNSTCW
  5535.  Store Control Word
  5536.  
  5537.  Stores the control word to a specified 16-bit memory operand. This
  5538.  instruction has wait and no-wait versions.
  5539.  
  5540.  
  5541.  
  5542.  FSTENV/FSTENVW/FSTENVD
  5543.  FNSTENV/FNSTENVW/FNSTENVD
  5544.  Store Environment State
  5545.  
  5546.  Stores the 14-byte coprocessor environment state to a specified memory
  5547.  location. The environment state includes the control word, status word, tag
  5548.  word, instruction pointer, and operand pointer. On the 80387/486 in 32-bit
  5549.  mode, the environment state is 28 bytes.
  5550.  
  5551.  
  5552.  
  5553.  FSTSW/FNSTSW
  5554.  Store Status Word
  5555.  
  5556.  Stores the status word to a specified 16-bit memory operand. On the 80287,
  5557.  80387, and 80486, the status word can also be stored to the processor's AX
  5558.  register. This instruction has wait and no-wait versions.
  5559.  
  5560.  
  5561.  
  5562.  FSUB/FSUBP/FISUB
  5563.  Subtract
  5564.  
  5565.  Subtracts the source operand from the destination operand and returns the
  5566.  difference in the destination operand. If two register operands are
  5567.  specified, one must be ST. If a memory operand is specified, the result
  5568.  replaces the value in ST. Memory operands can be 32- or 64-bit real numbers
  5569.  or 16- or 32-bit integers. If no operand is specified, ST is subtracted from
  5570.  ST(1) and the stack is popped, returning the difference in ST. For FSUBP,
  5571.  the source must be ST; the difference (destination minus source) is returned
  5572.  in the destination register and ST is popped.
  5573.  
  5574.  
  5575.  
  5576.  FSUBR/FSUBRP/FISUBR
  5577.  Subtract Reversed
  5578.  
  5579.  Subtracts the destination operand from the source operand and returns the
  5580.  result in the destination operand. If two register operands are specified,
  5581.  one must be ST. If a memory operand is specified, the result replaces the
  5582.  value in ST. Memory operands can be 32- or 64-bit real numbers or 16- or
  5583.  32-bit integers. If no operand is specified, ST(1) is subtracted from ST and
  5584.  the stack is popped, returning the difference in ST. For FSUBRP, the source
  5585.  must be ST; the difference (source minus destination) is returned in the
  5586.  destination register and ST is popped.
  5587.  
  5588.  
  5589.  
  5590.  FTST
  5591.  Test for Zero
  5592.  
  5593.  Compares ST with +0.0 and sets the condition of the status word according to
  5594.  the result.
  5595.  
  5596.  Condition Codes for FTST
  5597.  
  5598.  C3    C2    C1    C0    Meaning
  5599.   0     0     ?     0    ST is positive
  5600.   0     0     ?     1    ST is negative
  5601.   1     0     ?     0    ST is 0
  5602.   1     1     ?     1    ST is not comparable (NAN or projective
  5603.  infinity)
  5604.  
  5605.  
  5606.  
  5607.  FUCOM/FUCOMP/FUCOMPP
  5608.  Unordered Compare
  5609.  80387/486 Only
  5610.  
  5611.  Compares the specified source to ST and sets the condition codes of the
  5612.  status word according to the result. The instruction subtracts the source
  5613.  operand from ST without changing either operand. Memory operands are not
  5614.  allowed. If no operand is specified or if two pops are specified, ST is
  5615.  compared to ST(1). If one pop is specified with an operand, the given
  5616.  register is compared to ST.
  5617.  
  5618.  Condition Codes for FUCOM
  5619.  
  5620.  C3    C2    C1    C0    Meaning
  5621.   0     0     ?     0    ST > source
  5622.   0     0     ?     1    ST < source
  5623.   1     0     ?     0    ST = source
  5624.   1     1     ?     1    Unordered
  5625.  
  5626.  
  5627.  
  5628.  FWAIT
  5629.  Wait
  5630.  
  5631.  Suspends execution of the processor until the coprocessor is finished
  5632.  executing. This is an alternate mnemonic for the processor WAIT instruction.
  5633.  
  5634.  
  5635.  
  5636.  FXAM
  5637.  Examine
  5638.  
  5639.  Reports the contents of ST in the condition flags of the status word.
  5640.  
  5641.  Condition Codes for FXAM
  5642.  
  5643.  C3    C2    C1    C0    Meaning
  5644.   0     0     0     0    + Unnormal*
  5645.   0     0     0     1    + NAN
  5646.   0     0     1     0    - Unnormal*
  5647.   0     0     1     1    - NAN
  5648.   0     1     0     0    + Normal
  5649.   0     1     0     1    + Infinity
  5650.   0     1     1     0    - Normal
  5651.   0     1     1     1    - Infinity
  5652.   1     0     0     0    + 0
  5653.   1     0     0     1    Empty
  5654.   1     0     1     0    - 0
  5655.   1     0     1     1    Empty
  5656.   1     1     0     0    + Denormal
  5657.   1     1     0     1    Empty*
  5658.   1     1     1     0    - Denormal
  5659.   1     1     1     1    Empty*
  5660.  
  5661.  
  5662.  * Not used on the 80387/486. Unnormals are not supported by the 80387/486.
  5663.  Also, the 80387/486 use two codes instead of four to identify empty
  5664.  registers.
  5665.  
  5666.  
  5667.  
  5668.  FXCH
  5669.  Exchange Registers
  5670.  
  5671.  Exchanges the specified (destination) register and ST. If no operand is
  5672.  specified, ST and ST(1) are exchanged.
  5673.  
  5674.  
  5675.  
  5676.  FXTRACT
  5677.  Extract Exponent and Significand
  5678.  
  5679.  Extracts the exponent and significand (mantissa) fields of ST. The exponent
  5680.  replaces the value in ST, and then the significand is pushed onto the stack.
  5681.  
  5682.  
  5683.  
  5684.  FYL2X
  5685.  Y log2(X)
  5686.  
  5687.  Calculates Z = Y log2(X). X is taken from ST and Y from ST(1). The stack is
  5688.  popped, and the result, Z, replaces Y in ST. X must be in the range 0 < X <
  5689.  and Y in the range - < Y < .
  5690.  
  5691.  
  5692.  
  5693.  FYL2XP1
  5694.  Y log2(X+1)
  5695.  
  5696.  Calculates Z = Y log2(X + 1). X is taken from ST and Y from ST(1). The stack
  5697.  is popped once, and the result, Z, replaces Y in ST. X must be in the range
  5698.  0  |X| < (1 - (2 / 2)). Y must be in the range
  5699.  - < Y < .
  5700.  
  5701.