home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 3 / CDASC03.ISO / sorties / 314 / asm.txt next >
Text File  |  1993-04-01  |  102KB  |  4,141 lines

  1. @Assembler Programming Topics                    Copyright 1991 David Jurgens
  2. :8086 architecture
  3. ^Intel 8086 Family Architecture
  4.  
  5. %    General Purpose Registers        Segment Registers
  6.  
  7.     AH/AL  AX  (EAX)  Accumulator         CS    Code Segment
  8.     BH/BL  BX  (EBX)  Base             DS    Data Segment
  9.     CH/CL  CX  (ECX)  Counter         SS    Stack Segment
  10.     DH/DL  DX  (EDX)  Data             ES    Extra Segment
  11.                         (FS)    386 and newer
  12.     (Exx) indicates 386+ 32 bit register     (GS)    386 and newer
  13.  
  14.  
  15. %    Pointer Registers            Stack Registers
  16.  
  17.     SI (ESI)  Source Index            SP (ESP)  Stack Pointer
  18.     DI (EDI)  Destination Index        BP (EBP)  Base Pointer
  19.     IP      Instruction Pointer
  20.  
  21. %    Status Registers
  22.  
  23.     FLAGS Status Flags   (see ~FLAGS~)
  24.  
  25. %    Special Registers (386+ only)
  26.  
  27.     CR0    Control Register 0      DR0     Debug Register 0
  28.     CR2    Control Register 2      DR1     Debug Register 1
  29.     CR3    Control Register 3      DR2     Debug Register 2
  30.                       DR3     Debug Register 3
  31.     TR4    Test Register 4          DR6     Debug Register 6
  32.     TR5    Test Register 5          DR7     Debug Register 7
  33.     TR6    Test Register 6
  34.     TR7    Test Register 7
  35.     
  36. %    Register      Default Segment    Valid Overrides
  37.  
  38.     BP            SS        DS, ES, CS
  39.     SI or DI        DS        ES, SS, CS
  40.     DI strings        ES        None
  41.     SI strings        DS        ES, SS, CS
  42.  
  43.  
  44.     - see  ~CPU~   ~DETECTING~  ~Instruction Timing~
  45.  
  46. :Instruction Timing
  47. ^Instruction Clock Cycle Calculation
  48.  
  49.  
  50.     Some instructions require additional clock cycles due to a "Next
  51.     Instruction Component" identified by a "+m" in the instruction
  52.     clock cycle listings.  This is due to the prefetch queue being
  53.     purge on a control transfers.    Below is the general rule for
  54.     calculating "m":
  55.  
  56.  
  57.     88/86 not applicable
  58.     286  "m" is the number of bytes in the next instruction
  59.     386  "m" is the number of components in the next instruction
  60.         (the instruction coding (each byte), plus the data and
  61.         the displacement are all considered components)
  62.  
  63.  
  64. ^8088/8086  Effective Address (EA) Calculation
  65.  
  66. %           Description                  Clock Cycles
  67.  
  68.     Displacement                        6
  69.     Base or Index (BX,BP,SI,DI)                5
  70.     Displacement+(Base or Index)                9
  71.     Base+Index (BP+DI,BX+SI)                7
  72.     Base+Index (BP+SI,BX+DI)                8
  73.     Base+Index+Displacement (BP+DI,BX+SI)               11
  74.     Base+Index+Displacement (BP+SI+disp,BX+DI+disp)           12
  75.  
  76.  
  77.     - add 4 cycles for word operands at odd addresses
  78.     - add 2 cycles for segment override
  79.     - 80188/80186 timings differ from those of the 8088/8086/80286
  80.  
  81.  
  82. %    Task State Calculation
  83.  
  84.     "TS" is defined as switching from VM/486 or 80286 TSS to one of
  85.     the following:
  86.  
  87.              ┌───────────────────────────────────────┐
  88.             │            New Task        │
  89.             ├───────┬───────┬───────┬───────┬───────┤
  90.     ┌───────────────┤486 TSS│486 TSS│386 TSS│386 TSS│286 TSS│
  91.     │   Old Task    │ (VM=0)│ (VM=1)│ (VM=0)│ (VM=1)│    │
  92.     └───────────────┼───────┼───────┼───────┼───────┼───────┤
  93.     386 TSS (VM=0)    │    │    │  309  │  226  │  282  │
  94.             ├───────┼───────┼───────┼───────┼───────┤
  95.     386 TSS (VM=1)    │    │    │  314  │  231  │  287  │
  96.             ├───────┼───────┼───────┼───────┼───────┤
  97.     386 CPU/286 TSS    │    │    │  307  │  224  │  280  │
  98.             ├───────┼───────┼───────┼───────┼───────┤
  99.     486 CPU/286 TSS    │  199    │  177    │    │    │  180    │
  100.             └───────┴───────┴───────┴───────┴───────┘
  101.  
  102.                         
  103. %    Miscellaneous
  104.  
  105.     - all timings are for best case and do not take into account wait
  106.       states, instruction alignment, the state of the prefetch queue,
  107.       DMA refresh cycles, cache hits/misses or exception processing.
  108.     - to convert clocks to nanoseconds divide one microsecond by the
  109.       processor speed in MegaHertz:
  110.    
  111. ^(1000MHz/(n MHz)) = X nanoseconds
  112.  
  113.  
  114.     - see    ~8086 Architecture~
  115.  
  116. :directives:asm directives
  117. ^Macro Assembler Directives
  118.  
  119. ^Processor Code Generation Directives
  120.  
  121.     .186    enables assembly of 80186 instructions
  122.     .286    enables assembly of non privileged 80286 instructions
  123.     .286C    same as .286
  124.     .286P    enables assembly of all 80286 instructions
  125.     .287    enabled assembly of 80287 instructions
  126.     .386    enabled assembly of non privileged 80386 instructions
  127.         If used before .MODEL segments are defined as 32bits.
  128.         Causes all segments to default to DWORD alignment.
  129.     .386P    enabled assembly of all 80386 instructions (see .386)
  130.     .387    enabled assembly of 80387 instructions
  131.     .8086    default, enables assembly of 8088/8086 instruction
  132.     .8087    default, enables assembly of 8087 instructions
  133.  
  134.  
  135.     These directives must precede the segment they are to effect.
  136.     they cannot occur within a segment.
  137.  
  138.  
  139. ^Memory Model Directives
  140.  
  141.     .CODE  [name]    starts code segment; must follow .MODEL directive
  142.     .CONST        starts a constant data segment with name CONST;
  143.             must follow .MODEL directive; placed in DGROUP
  144.     .DATA        starts a near data segment for initialized data
  145.             with name _DATA; must follow .MODEL directive;
  146.             placed in DGROUP
  147.     .DATA?        starts a near data segment for uninitialized
  148.             data with name _BSS; must follow .MODEL
  149.             directive; placed in DGROUP
  150.     .FARDATA [name]    not placed in any group
  151.     .FARDATA? [name] not placed in any group
  152.     .MODEL model    defines memory model to be one of the following:
  153.             SMALL, COMPACT, MEDIUM, LARGE or HUGE;    must be
  154.             used prior to any other segment directive
  155.     .STACK [size]    indicates start of stack segment named 'STACK'
  156.             with size indicating number of bytes to reserve,
  157.             default is 1k; placed in DGROUP
  158.  
  159.  
  160. ^Segment Definition, Segment Ordering and Linkage Directives
  161.  
  162.     .ALPHA        orders segments alphabetically
  163.     .SEQ        orders segments sequentially (default)
  164.     ASSUME sreg:name [,sreg:name...]   selects default segment
  165.             register to be used by the assembler, not the CPU,
  166.             for addressing all symbols in the segment or group.
  167.             Name must be associated with a SEGMENT or GROUP
  168.             or set to "NOTHING" to indicate no segment register
  169.             is to be associated.
  170.     COMM def [,def...]  defines variables that are both public and
  171.             external (communal).  Can be used in and include
  172.             file to identify it to each source file without
  173.             declaring it in each model as extern.  Actually
  174.             defines data once.  Communal variables cannot be
  175.             initialized, and are not guaranteed to be allocated
  176.             contiguously since these are allocated by the linker.
  177.     DOSSEG        orders segments the same as DOS.  This is Microsoft
  178.             languages default order; causes paragph alignment
  179.     END [name]    marks end of source module and sets program
  180.             start address (CS:IP) if 'name' is present
  181.    name ENDP        ends procedure 'name'
  182.    name ENDS        ends a segment or structure
  183.     EXTRN name:type [,name:type...]  defines one or more external symbols
  184.    name GROUP seg[,seg]
  185.    name LABEL [NEAR|FAR|PROC]  defines an entry point;    If PROC is specified,
  186.             its value depends on the current MODEL
  187.     NAME pgmName    ignored since MASM 5.0; used to set module name
  188.    name PROC [NEAR|FAR]    defines procedure; NEAR/FAR has .MODEL default
  189.     PUBLIC name[,name...]  makes symbol 'name' available to other modules
  190.    name SEGMENT [align][combine][use]['class']
  191.         align    = BYTE    align on byte address (no alignment)
  192.             = WORD    align on even address
  193.             = DWORD    align on DWORD address
  194.             = PARA    align on next 16 byte paragraph
  195.             = PAGE    align on next 256 byte boundary
  196.         combine = PUBLIC  similar named segments are concatenated (CS)
  197.             = STACK   similar named segments are concatenated (SS)
  198.             = COMMON  similar named segment are overlapped
  199.             = MEMORY  similar names segments are concatenated
  200.             = AT addr segment relative to absolute address
  201.             = nothing segment is private and loaded independent
  202.         use    = USE16   segments will be 16 bits (if .386)
  203.             = USE32   segments will be 32 bits (if .386)
  204.  
  205.  
  206. ^Data Allocation Directives
  207.  
  208.     ALIGN n        aligns next variable or instruction on a boundary
  209.             that is a multiple of "n".  This can speed memory
  210.             fetches on 16 and 32 bit CPU'S if aligned.  New to
  211.             ~MASM~ 5.0, previous versions used EVEN.  Can result
  212.             in NOP's added to code.
  213.  [name]    DB init[,init...]  define byte
  214.  [name]    DD init[,init...]  define double word (DWORD, 4 bytes)
  215.  [name]    DF init[,init...]  define far word (FWORD, 386, 6 bytes)
  216.  [name]    DQ init[,init...]  define quad word (QWORD, 8 bytes)
  217.  [name]    DT init[,init...]  define temp word (TBYTE, 10 bytes)
  218.  [name]    DW init[,init...]  define word (WORD, 2 bytes)
  219.   count    DUP (init[,init...]) duplicate 'init' 'count' times; DUP can be
  220.             nested to 17 levels; DUP'ed initial values
  221.             of (?) don't result in data in the object file
  222.             but instead increment the next data addr
  223.    name    ENDS        end of structure or segment
  224.     EVEN        same as align 2;  Aligns data on even boundary
  225.     ORG expr    sets location counter to 'expr';  If 'expr'
  226.             is '$' the code is ORG'ed at the current loc.
  227.    name    RECORD fld[,fld...]  defines a byte or word variable
  228.             consisting of bit fields;  fields have the format:
  229.             fieldname:width[=expr];  the sum of all widths
  230.             must be <= 0
  231.  [name]    STRUC <[init[,init]]>  defines beginning of a structure; Values
  232.              between <> are initializers;  The '<>' symbols
  233.             are required.
  234.  
  235.  
  236. ^Logical and Bit Oriented Directives
  237.  
  238.   expr1    AND  expr2    returns nonzero if any set bit matches
  239.   expr1    EQ   expr2    returns (-1) for true or (0) for false
  240.   expr1    GE   expr2    returns (-1) for true or (0) for false
  241.   expr1    LE   expr2    returns (-1) for true or (0) for false
  242.   expr1    LT   expr2    returns (-1) for true or (0) for false
  243.     MASK {fldname|record}  returns bit mask for bits in record
  244.   expr1    OR   expr2    returns bitwise OR on expr1 and expr2
  245.     NOT  expr    returns 'expr' with all bits reversed
  246.    expr    SHL  count    returns expr shifted left count times
  247.    expr    SHR  count    returns expr shifted right count times
  248.     WIDTH {fldname|record}    returns width of field in bit record
  249.   expr1 XOR expr2    returns bitwise XOR on expr1 and expr2
  250.  
  251.  
  252. ^Other Operators and Directives
  253.  
  254.     []        index operator, same as addition
  255.     .MSFLOAT    encode floats in Microsoft Real Format
  256.     .TYPE    expr    returns byte defining mode and scope of expr
  257.    name    EQU     expr    assigns expression to name. surround text with <>
  258.     HIGH    expr    returns high byte of 'expr'
  259.     INCLUDE filespec  inserts code from 'filespec' into file
  260.     INCLUDELIB filespec  stores link library info in .OBJ file
  261.     LENGTH    var    returns number of data objects in DUPed 'var'
  262.     LOW    expr    returns low byte of 'expr'
  263.   expr1    MOD    expr2    return remainder of expr1/expr2
  264.     OFFSET    expr    returns offset of expr;   When .MODEL is used
  265.             the offset of a group relative segment refers
  266.             to the end of the segment
  267.    type    PTR    expr    forces 'expr' to 'type'
  268.     SEG    expr    returns segment of expression
  269.     SHORT        sets type of label to short, less than 128
  270.             bytes from start of next instruction
  271.     SIZE    var    returns # of bytes allocated by DUP directive
  272.     THIS    type    returns an operand of specified type whose
  273.             offset and segment values are equal to the
  274.             current location
  275.     TYPE    expr    returns type of expression
  276.  
  277.  
  278. %    Program Listing and Documentation Directives
  279.  
  280.     .CREF        restores listing of cross reference symbols
  281.     .LALL        include macro expansion in listings
  282.     .LFCOND        include false conditional blocks in listings
  283.     .LIST        starts listing of statements
  284.     .SALL        suppress listing of all macro expansions
  285.     .SFCOND        suppress false conditional blocks in listings
  286.     .XALL        start listing of macro expansion
  287.     .XCREF [name[,name...]]  suppress symbols in cross reference
  288.     .XLIST        suppress program listing
  289.     COMMENT delimiter [text]
  290.     PAGE   [[len],wid]    sets page length&width or ejects if no parms
  291.     SUBTTL    text    defines program listing subtitle
  292.     TITLE    text    defines program listing title
  293.  
  294.  
  295. %    Condition Assembly Directives
  296.  
  297.     ELSE        else clause for conditional assembly block
  298.     ENDIF        terminates a conditional assembly block
  299.     IFDEF    name    conditional assembly if name is defined
  300.  
  301.  
  302. %    Macro Definition Directives
  303.  
  304.     ENDM        terminates a macro block
  305.     EXITM        exit macro expansion immediately
  306.     IRP  parm,<arg[,arg...]> parm in the statements enclosed by the
  307.             IRP and ENDM will be repeated and replaced with the
  308.             values of "arg" for each "arg" in the <>.
  309.     IRPC parm,<string>  parm in the statements enclosed by the IRPC
  310.             and ENDM will be repeated and replaced with the values
  311.             of each char in the "string" for each character
  312.             position in the string.  "string" should be enclosed
  313.             in <> if it contains spaces or other separators.
  314.     LOCAL name[,name...]  defines scope symbol as local to a macro
  315.    name    MACRO [parm[,parm...]]    defines a macro and its parameters
  316.     PURGE name[,name]  purges macros from memory
  317.     REPT    expr    repeats all statements through ENDM statement for
  318.             'expr' times
  319.  
  320.  
  321. %    User Message Directives
  322.  
  323.     .ERR        generates and error
  324.     .ERR1        generates an error on PASS 1
  325.     .ERR2        generates an error on PASS 2
  326.     .ERRB    <arg>    generates an error if 'arg' is blank
  327.     .ERRDEF name    generates an error if 'name' is previously defined
  328.     .ERRDIF[I] <arg1>,<arg2>
  329.     .ERRE    expr    generates and error is 'expr' is false
  330.     %OUT    text    displays 'text' to console
  331.  
  332.  
  333. %    Predefined Equates (available only if simplified segments are used)
  334.  
  335.     @curseg        contains the current segment
  336.     @filename    current file name without extension
  337.     @code        contains the current code segment
  338.     @codesize    0 for small & compact, 1 for large, medium & huge
  339.     @datasize    0 for small & medium, 1 for compact & large, 2=huge
  340.     @const        contains segment of define by .CONST
  341.     @data        contains segment of define by .DATA
  342.     @data?        contains segment of define by .DATA?
  343.     @fardata    contains segment of define by .FARDATA
  344.     @fardata?    contains segment of define by .FARDATA?
  345.     @stack        contains segment of define by .STACK
  346.  
  347.     Most of these are only available if the simplified segment system
  348.     is used.  @curseg and @filename are available regardless.
  349.  
  350.  
  351. %    Radix Specifiers
  352.  
  353.     .RADIX expr    sets radix [2..16] for numbers (dec. default)
  354.     B        binary data specifier
  355.     Q        octal data specifier
  356.     O        octal data specifier
  357.     D        decimal data specifier
  358.     H        hexadecimal data specifier
  359.  
  360.  
  361. :masm options:assembler options
  362. ^Microsoft Assembler Command Line Options
  363.  
  364. ^MASM [options] srcfile[,[objfile][,[lstfile][,[xreffile]]]][;]
  365.  
  366. %    Options         Definition
  367.     /A        generate segments in alphabetical order
  368.     /B[size]        sets I/O buffer size in K bytes (1..63, default 32)
  369.     /C        generate cross reference file with .CRF extension
  370.     /D        generate PASS 1 listing
  371.     /Dsym[=val]    define symbol for use during assembly
  372.     /E        emulate floating point instructions (for use with HLL)
  373.     /H        list options and command syntax
  374.     /Ipath        include-file search path
  375.     /L        generate listing file with .LST extension
  376.     /ML        case sensitive for all symbols
  377.     /MU        upper case all symbols (default)
  378.     /MX        case sensitive in external and public symbols
  379.     /N        suppress symbol tables in listings
  380.     /P        check for impure code in 286 and 386 protected
  381.             mode (invalid CS overrides)
  382.     /S        generate segments in the order they are found (default)
  383.     /T        terse message display; display errors only
  384.     /V        verbose message display; includes # lines and symbols
  385.     /W{0|1|2}    assembly warning level
  386.                 0 = no warnings
  387.                 1 = severe warnings only
  388.                 2 = all warnings enabled
  389.     /X        display complete conditional assembly blocks in
  390.             listing including false conditionals
  391.     /Z        display errors including line numbers to screen
  392.     /ZD        generate line numbers in .OBJ files
  393.     /ZI        generate both symbolic and line number information in
  394.             .OBJ files
  395.  
  396. %    Environment Variables
  397.  
  398.     INCLUDE        search path for include files
  399.     MASM        default command line options
  400. :flags register:8086 flags
  401. ^FLAGS - Intel 8086 Family Flags Register
  402.  
  403.       │11│10│F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│
  404.     │  │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └───  CF Carry Flag
  405.     │  │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └───  1
  406.     │  │ │ │ │ │ │ │ │ │ │ │ │ │ │ └───  PF Parity Flag
  407.     │  │ │ │ │ │ │ │ │ │ │ │ │ │ └───  0
  408.     │  │ │ │ │ │ │ │ │ │ │ │ │ └───  AF Auxiliary Flag
  409.     │  │ │ │ │ │ │ │ │ │ │ │ └───  0
  410.     │  │ │ │ │ │ │ │ │ │ │ └───  ZF Zero Flag
  411.     │  │ │ │ │ │ │ │ │ │ └───  SF Sign Flag
  412.     │  │ │ │ │ │ │ │ │ └───  TF Trap Flag  (Single Step)
  413.     │  │ │ │ │ │ │ │ └───  IF Interrupt Flag
  414.     │  │ │ │ │ │ │ └───  DF Direction Flag
  415.     │  │ │ │ │ │ └───  OF Overflow flag
  416.     │  │ │ │ └─┴───  IOPL I/O Privilege Level  (286+ only)
  417.     │  │ │ └─────  NT Nested Task Flag  (286+ only)
  418.     │  │ └─────  0
  419.     │  └─────  RF Resume Flag (386+ only)
  420.     └──────  VM  Virtual Mode Flag (386+ only)
  421.  
  422.     - see    ~PUSHF~  ~POPF~  ~STI~  ~CLI~  ~STD~  ~CLD~
  423. :models:segment names
  424. ^Memory Model Programming & Segment Information
  425.  
  426. %    Model
  427.     TINY    Data and code fit in one 64K segment.  All code and
  428.         data are accessed via near pointers.
  429.     SMALL    64k data segment max and 64k code segment max.    All
  430.         code and data are accessed via near pointers.
  431.     COMPACT    1Mb data segment max and 64K code segment max.    Code
  432.         is accessed via near pointers, data is accessed via
  433.         far pointers.  No array can be greater than 64K
  434.     MEDIUM    64K data segment max and 1Mb code segment max.    Code is
  435.         accessed via far pointers, data is accessed via    near pointers.
  436.     LARGE    1Mb data segment max and 1Mb code segment max.    All
  437.         code and data are accessed via far pointers.  No
  438.         single element can be greater than 64K.
  439.     HUGE    1Mb data segment max and 1Mb code segment max.    All
  440.         code and data are accessed via far pointers.  This is
  441.         the only model where arrays can be larger than 64K.
  442.         In this mode is C will normalize all data pointers
  443.         to avoid segment wrapping.
  444.  
  445. ^Small Memory Model
  446.  
  447. %    Directive  Segment    Alignment    Combine    Class
  448.     .CODE        _TEXT    WORD        PUBLIC    'CODE'
  449.     .DATA        _DATA    WORD        PUBLIC    'DATA'
  450.     .CONST        CONST    WORD        PUBLIC    'CONST'
  451.     .DATA?        _BSS    WORD        PUBLIC    'BSS'
  452.     .STACK        STACK    PARA        STACK    'STACK'
  453.  
  454.  
  455. ^Compact Memory Model
  456.  
  457. %    Directive   Segment    Alignment    Combine    Class
  458.     .CODE        _TEXT    WORD        PUBLIC    'CODE'
  459.     .FARDATA    FAR_DATA    PARA        private    'FAR_DATA'
  460.     .FARDATA?   FAR_BSS    PARA        private    'FAR_BSS'
  461.     .DATA        _DATA    WORD        PUBLIC    'DATA'
  462.     .CONST        CONST    WORD        PUBLIC    'CONST'
  463.     .DATA?        _BSS    WORD        PUBLIC    'BSS'
  464.     .STACK        STACK    PARA        STACK    'STACK'
  465.  
  466.  
  467. ^Medium Memory Model
  468.  
  469. %    Directive  Segment    Alignment        Combine    Class
  470.     .CODE      name_TEXT    WORD        PUBLIC    'CODE'
  471.     .DATA        _DATA    WORD        PUBLIC    'DATA'
  472.     .CONST        CONST    WORD        PUBLIC    'CONST'
  473.     .DATA?        _BSS    WORD        PUBLIC    'BSS'
  474.     .STACK        STACK    PARA        STACK    'STACK'
  475.  
  476.  
  477. ^Large or Huge Memory Models
  478.  
  479. %    Directive    Segment  Alignment        Combine    Class
  480.     .CODE        name_TEXT    WORD        PUBLIC    'CODE'
  481.     .FARDATA    FAR_DATA    PARA        private    'FAR_DATA'
  482.     .FARDATA?   FAR_BSS    PARA        private    'FAR_BSS'
  483.     .DATA         _DATA    WORD        PUBLIC    'DATA'
  484.     .CONST         CONST    WORD        PUBLIC    'CONST'
  485.     .DATA?         _BSS    WORD        PUBLIC    'BSS'
  486.     .STACK         STACK    PARA        STACK    'STACK'
  487.  
  488.  
  489.     - all segments fall into DGROUP except for ???_TEXT, FAR_DATA
  490.       and FAR_BSS
  491.     - see ~MASM DIRECTIVES~
  492. :msw:machine status word
  493. ^MSW - Machine Status Word (286+ only)
  494.  
  495.  
  496.       │31│30-5│4│3│2│1│0│  Machine Status Word
  497.     │   │  │ │ │ │ └──── Protection Enable (PE)
  498.     │   │  │ │ │ └───── Math Present (MP)
  499.     │   │  │ │ └────── Emulation (EM)
  500.     │   │  │ └─────── Task Switched (TS)
  501.     │   │  └──────── Extension Type (ET)
  502.     │   └────────── Reserved
  503.     └───────────── Paging (PG)
  504.  
  505.  
  506.     Bit 0    PE    Protection Enable, switches processor between
  507.             protected and real mode
  508.     Bit 1    MP    Math Present, controls function of the ~WAIT~
  509.             instruction
  510.     Bit 2    EM    Emulation, indicates whether coprocessor functions
  511.             are to be emulated
  512.     Bit 3    TS    Task Switched, set and interrogated by coprocessor
  513.             on task switches and when interpretting coprocessor
  514.             instructions
  515.     Bit 4    ET    Extension Type, indicates type of coprocessor in
  516.             system
  517.     Bits 5-30    Reserved
  518.     bit 31    PG    Paging, indicates whether the processor uses page
  519.             tables to translate linear addresses to physical
  520.             addresses
  521.  
  522.     - see    ~SMSW~  ~LMSW~
  523. :aaa
  524. ^AAA - Ascii Adjust for Addition
  525.  
  526.  
  527.     Usage:    AAA
  528.     Modifies flags: AF CF (OF,PF,SF,ZF undefined)
  529.  
  530.  
  531.     Changes contents of AL to valid unpacked decimal.  The high order
  532.     nibble is zeroed.
  533.  
  534.  
  535. %                 Clocks            Size
  536. %    Operands     808x  286   386   486        Bytes
  537.  
  538.     none          8    3     4        3          1
  539.  
  540.  
  541.     - see ~Instruction Timing~
  542.  
  543. :aad
  544. ^AAD - Ascii Adjust for Division
  545.  
  546.  
  547.     Usage:    AAD
  548.     Modifies flags: SF ZF PF (AF,CF,OF undefined)
  549.  
  550.  
  551.     Used before dividing unpacked decimal numbers.     Multiplies AH by
  552.     10 and the adds result into AL.  Sets AH to zero.  This instruction
  553.     is also known to have an undocumented behavior.
  554.  
  555.  
  556.  
  557. %                 Clocks            Size
  558. %    Operands     808x  286   386   486        Bytes
  559.  
  560.     none          60    14    19    14          2
  561.  
  562.     - see ~Instruction Timing~
  563.  
  564. :aam
  565. ^AAM - Ascii Adjust for Multiplication
  566.  
  567.  
  568.     Usage:    AAM
  569.     Modifies flags: PF SF ZF (AF,CF,OF undefined)
  570.  
  571.  
  572.     Used after multiplication of two unpacked decimal numbers, this
  573.     instruction adjusts an unpacked decimal number.  The high order
  574.     nibble of each byte must be zeroed before using this instruction.
  575.     This instruction is also known to have an undocumented behavior.
  576.  
  577.  
  578. %                 Clocks            Size
  579. %    Operands     808x  286   386   486        Bytes
  580.  
  581.     none          83    16    17    15          2
  582.  
  583.  
  584.     - see ~Instruction Timing~
  585.  
  586. :aas
  587. ^AAS - Ascii Adjust for Subtraction
  588.  
  589.  
  590.     Usage:    AAS
  591.     Modifies flags: AF CF (OF,PF,SF,ZF undefined)
  592.  
  593.  
  594.     Corrects result of a previous unpacked decimal subtraction in AL.
  595.     High order nibble is zeroed.
  596.  
  597.  
  598. %                 Clocks            Size
  599. %    Operands     808x  286   386   486        Bytes
  600.  
  601.     none          8    3     4        3          1
  602.  
  603.  
  604.     - see ~Instruction Timing~
  605.  
  606. :adc
  607. ^ADC - Add With Carry
  608.  
  609.     Usage:    ADC    dest,src
  610.     Modifies flags: AF CF OF SF PF ZF
  611.  
  612.  
  613.     Sums two binary operands placing the result in the destination.
  614.     If CF is set, a 1 is added to the destination.
  615.  
  616.  
  617. %                Clocks            Size
  618. %    Operands     808x  286   386   486        Bytes
  619.  
  620.     reg,reg       3    2     2        1          2
  621.     mem,reg     16+EA    7     7        3         2-4  (W88=24+EA)
  622.     reg,mem      9+EA    7     6        2         2-4  (W88=13+EA)
  623.     reg,immed      4    3     2        1         3-4
  624.     mem,immed    17+EA    7     7        3         3-6  (W88=23+EA)
  625.     accum,immed      4    3     2        1         2-3
  626.  
  627.  
  628.     - see ~Instruction Timing~
  629.  
  630. :add
  631. ^ADD - Arithmetic Addition
  632.  
  633.     Usage:    ADD    dest,src
  634.     Modifies flags: AF CF OF PF SF ZF
  635.  
  636.  
  637.     Adds "src" to "dest" and replacing the original contents of "dest".
  638.     Both operands are binary.
  639.  
  640.  
  641. %                 Clocks            Size
  642. %    Operands     808x  286   386   486        Bytes
  643.  
  644.     reg,reg       3    2     2        1          2
  645.     mem,reg     16+EA    7     7        3         2-4  (W88=24+EA)
  646.     reg,mem      9+EA    7     6        2         2-4  (W88=13+EA)
  647.     reg,immed      4    3     2        1         3-4
  648.     mem,immed    17+EA    7     7        3         3-6  (W88=23+EA)
  649.     accum,immed      4    3     2        1         2-3
  650.  
  651.  
  652.     - see ~Instruction Timing~
  653.  
  654. :and
  655. ^AND - Logical And
  656.  
  657.     Usage:    AND    dest,src
  658.     Modifies flags: CF OF PF SF ZF (AF undefined)
  659.  
  660.  
  661.     Performs a logical AND of the two operands replacing the destination
  662.     with the result.
  663.  
  664.  
  665. %                Clocks            Size
  666. %    Operands     808x  286   386   486        Bytes
  667.  
  668.     reg,reg       3    2     2        1          2
  669.     mem,reg     16+EA    7     7        3         2-4  (W88=24+EA)
  670.     reg,mem      9+EA    7     6        1         2-4  (W88=13+EA)
  671.     reg,immed      4    3     2        1         3-4
  672.     mem,immed    17+EA    7     7        3         3-6  (W88=23+EA)
  673.     accum,immed      4    3     2        1         2-3
  674.  
  675.  
  676.     - see ~Instruction Timing~
  677.  
  678. :arpl
  679. ^ARPL - Adjusted Requested Privilege Level of Selector
  680. ^(286+ protected mode)
  681.  
  682.  
  683.     Usage:    ARPL    dest,src
  684.     Modifies flags: ZF
  685.  
  686.  
  687.     Compares the RPL bits of "dest" against "src".    If the RPL bits
  688.     of "dest" are less than "src", the destination RPL bits are set
  689.     equal to the source RPL bits and the Zero Flag is set.    Otherwise
  690.     the Zero Flag is cleared.
  691.  
  692.  
  693. %                Clocks            Size
  694. %    Operands     808x  286   386   486        Bytes
  695.  
  696.     reg,reg       -    10    20    9          2
  697.     mem,reg       -    11    21    9          4
  698.  
  699.  
  700.     - see ~Instruction Timing~
  701.  
  702. :bound
  703. ^BOUND - Array Index Bound Check (80188+)
  704.  
  705.  
  706.     Usage:    BOUND    src,limit
  707.     Modifies flags: None
  708.  
  709.  
  710.     Array index in source register is checked against upper and lower
  711.     bounds in memory source.  The first word located at "limit" is
  712.     the lower boundary and the word at "limit+2" is the upper array bound.
  713.     Interrupt 5 occurs if the source value is less than or higher than
  714.     the source.
  715.  
  716.  
  717. %                 Clocks            Size
  718. %    Operands     808x  286   386   486        Bytes
  719.  
  720.     reg16,mem32      -   nj=13 nj=10   7          2
  721.     reg32,mem64      -   nj=13 nj=10   7          2
  722.  
  723.     - nj = no jump taken
  724.     - see ~Instruction Timing~
  725.  
  726. :bsf
  727. ^BSF - Bit Scan Forward (386+ only)
  728.  
  729.  
  730.     Usage:    BSF    dest,src
  731.     Modifies flags: ZF
  732.  
  733.  
  734.     Scans source operand for first bit set.  Sets ZF if a bit is found
  735.     set and loads the destination with an index to first set bit.  Clears
  736.     ZF is no bits are found set.  BSF scans forward across bit pattern
  737.     (0-n) while BSR scans in reverse (n-0).
  738.  
  739.  
  740. %                 Clocks            Size
  741. %    Operands     808x  286   386   486        Bytes
  742.  
  743.     reg,reg       -    -   10+3n  6-42          3
  744.     reg,mem       -    -   10+3n  7-43         3-7
  745.     reg32,reg32      -    -   10+3n  6-42         3-7
  746.     reg32,mem32      -    -   10+3n  7-43         3-7
  747.  
  748.  
  749.     - see ~Instruction Timing~
  750.  
  751. :bsr
  752. ^BSR - Bit Scan Reverse  (386+ only)
  753.  
  754.  
  755.     Usage:    BSR    dest,src
  756.     Modifies flags: ZF
  757.  
  758.  
  759.     Scans source operand for first bit set.  Sets ZF if a bit is found
  760.     set and loads the destination with an index to first set bit.  Clears
  761.     ZF is no bits are found set.  BSF scans forward across bit pattern
  762.     (0-n) while BSR scans in reverse (n-0).
  763.  
  764.  
  765. %                 Clocks            Size
  766. %    Operands     808x  286   386   486        Bytes
  767.  
  768.     reg,reg       -    -   10+3n  6-103      3
  769.     reg,mem       -    -   10+3n  7-104     3-7
  770.     reg32,reg32      -    -   10+3n  6-103     3-7
  771.     reg32,mem32      -    -   10+3n  7-104     3-7
  772.  
  773.  
  774.     - see ~Instruction Timing~
  775.  
  776. :bswap
  777. ^BSWAP - Byte Swap (486+ only)
  778.  
  779.  
  780.     Usage:    BSWAP    reg32
  781.     Modifies flags: none
  782.  
  783.  
  784.     Changes the byte order of a 32 bit register from big endian to
  785.     little endian or vice versa.   Result left in destination register
  786.     is undefined if the operand is a 16 bit register.
  787.  
  788.  
  789. %                 Clocks            Size
  790. %    Operands     808x  286   386   486        Bytes
  791.  
  792.     reg32           -    -     -     1            2
  793.  
  794.  
  795.     - see ~Instruction Timing~
  796.  
  797. :bt
  798. ^BT - Bit Test    (386+ only)
  799.  
  800.  
  801.     Usage:    BT    dest,src
  802.     Modifies flags: CF
  803.  
  804.  
  805.     The destination bit indexed by the source value is copied into the
  806.     Carry Flag.
  807.  
  808.  
  809. %                 Clocks            Size
  810. %    Operands     808x  286   386   486        Bytes
  811.  
  812.     reg16,immed8      -    -     3        3         4-8
  813.     mem16,immed8      -    -     6        6         4-8
  814.     reg16,reg16      -    -     3        3         3-7
  815.     mem16,reg16      -    -     12    12         3-7
  816.  
  817.  
  818.     - see ~Instruction Timing~
  819.  
  820. :btc
  821. ^BTC - Bit Test with Compliment  (386+ only)
  822.  
  823.  
  824.     Usage:    BTC    dest,src
  825.     Modifies flags: CF
  826.  
  827.  
  828.     The destination bit indexed by the source value is copied into the
  829.     Carry Flag after being complimented (inverted).
  830.  
  831.  
  832. %                 Clocks            Size
  833. %    Operands     808x  286   386   486        Bytes
  834.  
  835.     reg16,immed8      -    -     6        6         4-8
  836.     mem16,immed8      -    -     8        8         4-8
  837.     reg16,reg16      -    -     6        6         3-7
  838.     mem16,reg16      -    -     13    13         3-7
  839.  
  840.  
  841.     - see ~Instruction Timing~
  842.  
  843. :btr
  844. ^BTR - Bit Test with Reset  (386+ only)
  845.  
  846.  
  847.     Usage:    BTR    dest,src
  848.     Modifies flags: CF
  849.  
  850.  
  851.     The destination bit indexed by the source value is copied into the
  852.     Carry Flag and then cleared in the destination.
  853.  
  854.  
  855. %                 Clocks            Size
  856. %    Operands     808x  286   386   486        Bytes
  857.  
  858.     reg16,immed8      -    -     6        6         4-8
  859.     mem16,immed8      -    -     8        8         4-8
  860.     reg16,reg16      -    -     6        6         3-7
  861.     mem16,reg16      -    -     13    13         3-7
  862.  
  863.  
  864.     - see ~Instruction Timing~
  865.  
  866. :bts
  867. ^BTS - Bit Test and Set  (386+ only)
  868.  
  869.  
  870.     Usage:    BTS    dest,src
  871.     Modifies flags: CF
  872.  
  873.  
  874.     The destination bit indexed by the source value is copied into the
  875.     Carry Flag and then set in the destination.
  876.  
  877.  
  878. %                 Clocks            Size
  879. %    Operands     808x  286   386   486        Bytes
  880.  
  881.     reg16,immed8      -    -     6        6         4-8
  882.     mem16,immed8      -    -     8        8         4-8
  883.     reg16,reg16      -    -     6        6         3-7
  884.     mem16,reg16      -    -     13    13         3-7
  885.  
  886.  
  887.     - see ~Instruction Timing~
  888.  
  889. :call
  890. ^CALL - Procedure Call
  891.  
  892.     Usage:    CALL    destination
  893.     Modifies flags: None
  894.  
  895.     Pushes Instruction Pointer (and Code Segment for far calls) onto
  896.     stack and loads Instruction Pointer with the address of proc-name.
  897.     Code continues with execution at CS:IP.
  898.  
  899. %                                 Clocks
  900. %           Operands            808x   286     386     486
  901.  
  902.     rel16 (near, IP relative)         19     7      7+m      3
  903.     rel32 (near, IP relative)         -    -      7+m      3
  904.  
  905.     reg16 (near, register indirect)         16     7      7+m      5
  906.     reg32 (near, register indirect)         -    -      7+m      5
  907.  
  908.     mem16 (near, memory indirect)         -     21+EA    11    10+m      5
  909.     mem32 (near, memory indirect)         -       -     10+m      5
  910.  
  911.     ptr16:16 (far, full ptr supplied)     28     13    17+m      18
  912.     ptr16:32 (far, full ptr supplied)     -    -     17+m      18
  913.     ptr16:16 (far, ptr supplied, prot. mode) -    26    34+m      20
  914.     ptr16:32 (far, ptr supplied, prot. mode) -    -     34+m      20
  915.     m16:16 (far, indirect)               37+EA    16    22+m      17
  916.     m16:32 (far, indirect)             -    -     22+m      17
  917.     m16:16 (far, indirect, prot. mode)     -      29    38+m      20
  918.     m16:32 (far, indirect, prot. mode)     -    -     38+m      20
  919.  
  920.     ptr16:16 (task, via TSS or task gate)     -     177     TS     37+TS
  921.     m16:16 (task, via TSS or task gate)     -   180/185  5+TS    37+TS
  922.     m16:32 (task)                 -    -      TS     37+TS
  923.     m16:32 (task)                 -    -     5+TS    37+TS
  924.  
  925.     ptr16:16 (gate, same privilege)         -      41    52+m      35
  926.     ptr16:32 (gate, same privilege)         -    -     52+m      35
  927.     m16:16 (gate, same privilege)                -    44    56+m      35
  928.     m16:32 (gate, same privilege)         -    -     56+m      35
  929.  
  930.     ptr16:16 (gate, more priv, no parm)     -       82    86+m      69
  931.     ptr16:32 (gate, more priv, no parm)     -    -     86+m      69
  932.     m16:16 (gate, more priv, no parm)     -       83    90+m      69
  933.     m16:32 (gate, more priv, no parm)     -    -     90+m      69
  934.  
  935.     ptr16:16 (gate, more priv, x parms)     -    86+4x  94+4x+m  77+4x
  936.     ptr16:32 (gate, more priv, x parms)     -    -    94+4x+m  77+4x
  937.     m16:16 (gate, more priv, x parms)     -    90+4x  98+4x+m  77+4x
  938.     m16:32 (gate, more priv, x parms)     -    -    98+4x+m  77+4x
  939.  
  940.  
  941.     - see ~Instruction Timing~
  942.  
  943. :cbw
  944. ^CBW - Convert Byte to Word
  945.  
  946.  
  947.     Usage:    CBW
  948.     Modifies flags: None
  949.  
  950.  
  951.     Converts byte in AL to word Value in AX by extending sign of AL
  952.     throughout register AH.
  953.  
  954.  
  955. %                 Clocks            Size
  956. %    Operands     808x  286   386   486        Bytes
  957.  
  958.     none          2    2     3        3          1
  959.  
  960.  
  961.     - see ~Instruction Timing~
  962.  
  963. :cdq
  964. ^CDQ - Convert Double to Quad    (386+ only)
  965.  
  966.  
  967.     Usage:    CDQ
  968.     Modifies flags: None
  969.  
  970.  
  971.     Converts signed DWORD in EAX to a signed quad word in EDX:EAX by
  972.     extending the high order bit of EAX throughout EDX
  973.  
  974.  
  975. %                 Clocks            Size
  976. %    Operands     808x  286   386   486        Bytes
  977.  
  978.     none          -    -     2        3          1
  979.  
  980.  
  981.     - see ~Instruction Timing~
  982.  
  983. :clc
  984. ^CLC - Clear Carry
  985.  
  986.  
  987.     Usage:    CLC
  988.     Modifies flags: CF
  989.  
  990.  
  991.     Clears the Carry Flag.
  992.  
  993.  
  994. %                 Clocks            Size
  995. %    Operands     808x  286   386   486        Bytes
  996.  
  997.     none          2    2     2        2          1
  998.  
  999.  
  1000.     - see ~Instruction Timing~
  1001.  
  1002. :cld
  1003. ^CLD - Clear Direction Flag
  1004.  
  1005.  
  1006.     Usage:    CLD
  1007.     Modifies flags: DF
  1008.  
  1009.  
  1010.     Clears the Direction Flag causing string instructions to increment
  1011.     the SI and DI index registers.
  1012.  
  1013.  
  1014. %                 Clocks            Size
  1015. %    Operands     808x  286   386   486        Bytes
  1016.  
  1017.     none          2    2     2        2          1
  1018.  
  1019.  
  1020.     - see ~Instruction Timing~
  1021.  
  1022. :cli
  1023. ^CLI - Clear Interrupt Flag (disable)
  1024.  
  1025.  
  1026.     Usage:    CLI
  1027.     Modifies flags: IF
  1028.  
  1029.  
  1030.     Disables the maskable hardware interrupts by clearing the Interrupt
  1031.     flag.  NMI's and software interrupts are not inhibited.
  1032.  
  1033.  
  1034. %                 Clocks            Size
  1035. %    Operands     808x  286   386   486        Bytes
  1036.  
  1037.     none          2    2     3        5          1
  1038.  
  1039.  
  1040.     - see ~Instruction Timing~
  1041.  
  1042. :clts
  1043. ^CLTS - Clear Task Switched Flag  (286+ privileged)
  1044.  
  1045.  
  1046.     Usage:    CLTS
  1047.     Modifies flags: None
  1048.  
  1049.  
  1050.     Clears the Task Switched Flag in the Machine Status Register.  This
  1051.     is a privileged operation and is generally used only by operating
  1052.     system code.
  1053.  
  1054.  
  1055. %                 Clocks            Size
  1056. %    Operands     808x  286   386   486        Bytes
  1057.  
  1058.     none          -    2     5        7          2
  1059.  
  1060.  
  1061.     - see ~Instruction Timing~
  1062.  
  1063. :cmc
  1064. ^CMC - Complement Carry Flag
  1065.  
  1066.  
  1067.     Usage:    CMC
  1068.     Modifies flags: CF
  1069.  
  1070.  
  1071.     Toggles (inverts) the Carry Flag
  1072.  
  1073.  
  1074. %                 Clocks            Size
  1075. %    Operands     808x  286   386   486        Bytes
  1076.  
  1077.     none          2    2     2        2          1
  1078.  
  1079.  
  1080.     - see ~Instruction Timing~
  1081.  
  1082. :cmp
  1083. ^CMP - Compare
  1084.  
  1085.     Usage:    CMP    dest,src
  1086.     Modifies flags: AF CF OF PF SF ZF
  1087.  
  1088.  
  1089.     Subtracts source from destination and updates the flags but does
  1090.     not save result.  Flags can subsequently be checked for conditions.
  1091.  
  1092.  
  1093. %                 Clocks            Size
  1094. %    Operands     808x  286   386   486        Bytes
  1095.  
  1096.     reg,reg       3    2     2        1          2
  1097.     mem,reg      9+EA    7     5        2         2-4  (W88=13+EA)
  1098.     reg,mem      9+EA    6     6        2         2-4  (W88=13+EA)
  1099.     reg,immed      4    3     2        1         3-4
  1100.     mem,immed    10+EA    6     5        2         3-6  (W88=14+EA)
  1101.     accum,immed      4    3     2        1         2-3
  1102.  
  1103.  
  1104.     - see ~Instruction Timing~
  1105.  
  1106. :cmps:cmpsb:cmpsw:cmpsd
  1107. ^CMPS - Compare String (Byte, Word or Doubleword)
  1108.  
  1109.     Usage:    CMPS    dest,src
  1110.         CMPSB
  1111.         CMPSW
  1112.         CMPSD    (386+ only)
  1113.     Modifies flags: AF CF OF PF SF ZF
  1114.  
  1115.     Subtracts destination value from source without saving results.
  1116.     Updates flags based on the subtraction and  the index registers
  1117.     (E)SI and (E)DI are incremented or decremented depending on the
  1118.     state of the Direction Flag.  CMPSB inc/decrements the index
  1119.     registers by 1, CMPSW inc/decrements by 2, while CMPSD increments
  1120.     or decrements by 4.  The REP prefixes can be used to process
  1121.     entire data items.
  1122.  
  1123. %                 Clocks            Size
  1124. %    Operands     808x  286   386   486        Bytes
  1125.  
  1126.     dest,src      22    8     10    8          1  (W88=30)
  1127.  
  1128.  
  1129.     - see ~Instruction Timing~
  1130.  
  1131. :cmpxchg
  1132. ^CMPXCHG - Compare and Exchange
  1133.  
  1134.     Usage:    CMPXCHG    dest,src  (486+)
  1135.     Modifies flags: AF CF OF PF SF ZF
  1136.  
  1137.  
  1138.     Compares the accumulator (8-32 bits) with "dest".  If equal the
  1139.     "dest" is loaded with "src", otherwise the accumulator is loaded
  1140.     with "dest".
  1141.  
  1142.  
  1143. %                 Clocks            Size
  1144. %    Operands     808x  286   386   486        Bytes
  1145.  
  1146.     reg,reg          -    -     -     6          2
  1147.     mem,reg          -     -     -     7          2
  1148.  
  1149.  
  1150.     - add 3 clocks if the "mem,reg" comparison fails
  1151.     - see ~Instruction Timing~
  1152.  
  1153. :cwd
  1154. ^CWD - Convert Word to Doubleword
  1155.  
  1156.  
  1157.     Usage:    CWD
  1158.     Modifies flags: None
  1159.  
  1160.  
  1161.     Extends sign of word in register AX throughout register DX forming
  1162.     a doubleword quantity in DX:AX.
  1163.  
  1164.  
  1165. %                 Clocks            Size
  1166. %    Operands     808x  286   386   486        Bytes
  1167.  
  1168.     none          5    2     2        3          1
  1169.  
  1170.  
  1171.     - see ~Instruction Timing~
  1172.  
  1173. :cwde
  1174. ^CWDE - Convert Word to Extended Doubleword  (386+ only)
  1175.  
  1176.  
  1177.     Usage:    CWDE
  1178.     Modifies flags: None
  1179.  
  1180.  
  1181.     Converts a signed word in AX to a signed doubleword in EAX by
  1182.     extending the sign bit of AX throughout EAX.
  1183.  
  1184. %                 Clocks            Size
  1185. %    Operands     808x  286   386   486        Bytes
  1186.  
  1187.     none          -    -     3        3          1
  1188.  
  1189.  
  1190.     - see ~Instruction Timing~
  1191.  
  1192. :daa
  1193. ^DAA - Decimal Adjust for Addition
  1194.  
  1195.  
  1196.     Usage:    DAA
  1197.     Modifies flags: AF CF PF SF ZF (OF undefined)
  1198.  
  1199.  
  1200.     Corrects result (in AL) of a previous BCD addition operation.
  1201.     Contents of AL are changed to a pair of packed decimal digits.
  1202.  
  1203.  
  1204. %                 Clocks            Size
  1205. %    Operands     808x  286   386   486        Bytes
  1206.  
  1207.     none          4    3     4        2          1
  1208.  
  1209.  
  1210.     - see ~Instruction Timing~
  1211.  
  1212. :das
  1213. ^DAS - Decimal Adjust for Subtraction
  1214.  
  1215.  
  1216.     Usage:    DAS
  1217.     Modifies flags: AF CF PF SF ZF (OF undefined)
  1218.  
  1219.  
  1220.     Corrects result (in AL) of a previous BCD subtraction operation.
  1221.     Contents of AL are changed to a pair of packed decimal digits.
  1222.  
  1223.  
  1224. %                 Clocks            Size
  1225. %    Operands     808x  286   386   486        Bytes
  1226.  
  1227.     none          4    3     4        2          1
  1228.  
  1229.  
  1230.     - see ~Instruction Timing~
  1231.  
  1232. :dec
  1233. ^DEC - Decrement
  1234.  
  1235.  
  1236.     Usage:    DEC    dest
  1237.     Modifies flags: AF OF PF SF ZF
  1238.  
  1239.  
  1240.     Unsigned binary subtraction of one from the destination.
  1241.  
  1242.  
  1243. %                 Clocks            Size
  1244. %    Operands     808x  286   386   486        Bytes
  1245.  
  1246.     reg8          3    2     2        1          2
  1247.     mem        15+EA    7     6        3         2-4
  1248.     reg16/32      3    2     2        1          1
  1249.  
  1250.  
  1251.     - see ~Instruction Timing~
  1252.  
  1253. :div
  1254. ^DIV - Divide
  1255.  
  1256.     Usage:    DIV    src
  1257.     Modifies flags: (AF,CF,OF,PF,SF,ZF undefined)
  1258.  
  1259.     Unsigned binary division of accumulator by source.  If the source
  1260.     divisor is a byte value then AX is divided by "src" and the quotient
  1261.     is placed in AL and the remainder in AH.  If source operand is a word
  1262.     value, then DX:AX is divided by "src" and the quotient is stored in AX
  1263.     and the remainder in DX.
  1264.  
  1265. %                 Clocks            Size
  1266. %    Operands     808x  286   386   486        Bytes
  1267.  
  1268.     reg8         80-90    14    14    16          2
  1269.     reg16        144-162 22    22    24          2
  1270.     reg32           -    -     38    40          2
  1271.     mem8        (86-96)+EA    17    17    16         2-4
  1272.     mem16      (150-168)+EA    25    25    24         2-4  (W88=158-176+EA)
  1273.     mem32           -    -     41    40         2-4
  1274.  
  1275.  
  1276.     - see ~Instruction Timing~
  1277.  
  1278. :enter
  1279. ^ENTER - Make Stack Frame  (80188+)
  1280.  
  1281.  
  1282.     Usage:    ENTER    locals,level
  1283.     Modifies flags: None
  1284.  
  1285.  
  1286.     Modifies stack for entry to procedure for high level language.
  1287.     Operand "locals" specifies the amount of storage to be allocated
  1288.     on the stack.    "Level" specifies the nesting level of the routine.
  1289.     Paired with the ~LEAVE~ instruction, this is an efficient method of
  1290.     entry and exit to procedures.
  1291.  
  1292.  
  1293. %                     Clocks            Size
  1294. %    Operands     808x     286       386         486    Bytes
  1295.  
  1296.     immed16,0      -      11       10          14        4
  1297.     immed16,1      -      15       12          17        4
  1298.     immed16,immed8      -   12+4(n-1) 15+4(n-1)    17+3n      4
  1299.  
  1300.  
  1301.     - see ~Instruction Timing~
  1302.  
  1303. :esc
  1304. ^ESC - Escape
  1305.  
  1306.  
  1307.     Usage:    ESC    immed,src
  1308.     Modifies flags: None
  1309.  
  1310.  
  1311.     Provides access to the data bus for other resident processors.
  1312.     The CPU treats it as a ~NOP~ but places memory operand on bus.
  1313.  
  1314.  
  1315. %                 Clocks            Size
  1316. %    Operands     808x  286   386   486        Bytes
  1317.  
  1318.     immed,reg      2   9-20    ?              2
  1319.     immed,mem      2   9-20    ?             2-4
  1320.  
  1321.  
  1322.     - see ~Instruction Timing~
  1323.  
  1324. :hlt
  1325. ^HLT - Halt CPU
  1326.  
  1327.  
  1328.     Usage:     HLT
  1329.     Modifies flags: None
  1330.  
  1331.  
  1332.     Halts CPU until RESET line is activated, NMI or maskable interrupt
  1333.     received.  The CPU becomes dormant but retains the current CS:IP
  1334.     for later restart.
  1335.  
  1336.  
  1337. %                 Clocks            Size
  1338. %    Operands     808x  286   386   486        Bytes
  1339.  
  1340.     none          2    2     5        4          1
  1341.  
  1342.  
  1343.     - see ~Instruction Timing~
  1344.  
  1345. :idiv
  1346. ^IDIV - Signed Integer Division
  1347.  
  1348.     Usage:     IDIV    src
  1349.     Modifies flags: (AF,CF,OF,PF,SF,ZF undefined)
  1350.  
  1351.     Signed binary division of accumulator by source.  If source is a
  1352.     byte value, AX is divided by "src" and the quotient is stored in
  1353.     AL and the remainder in AH.  If source is a word value, DX:AX is
  1354.     divided by "src", and the quotient is stored in AL and the
  1355.     remainder in DX.
  1356. %                 Clocks            Size
  1357. %    Operands     808x  286   386   486        Bytes
  1358.  
  1359.     reg8          101-112    17    19    19          2
  1360.     reg16          165-184    25    27    27          2
  1361.     reg32         -    -     43    43          2
  1362.     mem8     (107-118)+EA    20    22    20         2-4
  1363.     mem16     (171-190)+EA    38    30    28         2-4  (W88=175-194)
  1364.     mem32         -    -     46    44         2-4
  1365.  
  1366.  
  1367.     - see ~Instruction Timing~
  1368.  
  1369. :imul
  1370. ^IMUL - Signed Multiply
  1371.  
  1372.     Usage:    IMUL    src
  1373.         IMUL    src,immed  (286+ only)
  1374.         IMUL    dest,src,immed8  (286+ only)
  1375.         IMUL    dest,src  (386+ only)
  1376.     Modifies flags: CF OF (AF,PF,SF,ZF undefined)
  1377.  
  1378.  
  1379.     Signed multiplication of accumulator by "src" with result placed
  1380.     in the accumulator.  If the source operand is a byte value, it
  1381.     is multiplied by AL and the result stored in AX.  If the source
  1382.     operand is a word value it is multiplied by AX and the result is
  1383.     stored in DX:AX.  Other variations of this instruction allow
  1384.     specification of source and destination registers as well as a
  1385.     third immediate factor.
  1386.  
  1387. %                  Clocks        Size
  1388. %    Operands     808x    286   386   486        Bytes
  1389.  
  1390.     reg8         80-98     13   9-14  13-18      2
  1391.     reg16        128-154     21   9-22  13-26      2
  1392.     reg32           -     -    9-38  12-42      2
  1393.     mem8         86-104     16  12-17  13-18     2-4
  1394.     mem16        134-160     24  12-25  13-26     2-4
  1395.     mem32           -     -   12-41  13-42     2-4
  1396.     reg16,reg16       -     -    9-22  13-26     3-5
  1397.     reg32,reg32       -     -    9-38  13-42     3-5
  1398.     reg16,mem16       -     -   12-25  13-26     3-5
  1399.     reg32,mem32       -     -   12-41  13-42     3-5
  1400.     reg16,immed       -     21   9-22  13-26      3
  1401.     reg32,immed       -     21   9-38  13-42     3-6
  1402.     reg16,reg16,immed  -     2    9-22  13-26      3-6
  1403.     reg32,reg32,immed  -     21   9-38  13-42     3-6
  1404.     reg16,mem16,immed  -     24  12-25  13-26     3-6
  1405.     reg32,mem32,immed  -     24  12-41  13-42     3-6
  1406.  
  1407.  
  1408.     - see ~Instruction Timing~
  1409.  
  1410. :in
  1411. ^IN - Input Byte or Word From Port
  1412.  
  1413.  
  1414.     Usage:    IN    accum,port
  1415.     Modifies flags: None
  1416.  
  1417.  
  1418.     A byte, word or dword is read from "port" and placed in AL, AX or
  1419.     EAX respectively.  If the port number is in the range of 0-255
  1420.     it can be specified as an immediate, otherwise the port number
  1421.     must be specified in DX.  Valid port ranges on the PC are 0-1024,
  1422.     though values through 65535 may be specified and recognized by
  1423.     third party vendors and PS/2's.
  1424.  
  1425.  
  1426. %                 Clocks            Size
  1427. %    Operands     808x  286   386    486        Bytes
  1428.  
  1429.     accum,immed8    10/14    5     12     14          2
  1430.     accum,immed8 (PM)         6/26  8/28/27        2
  1431.     accum,DX     8/12    5     13     14          1
  1432.     accum,DX (PM)             7/27  8/28/27        1
  1433.  
  1434.  
  1435.     - 386+ protected mode timings depend on privilege levels.
  1436.  
  1437.       first number is the timing if:    CPL ≤ IOPL
  1438.       second number is the timing if:   CPL > IOPL or in VM 86 mode (386)
  1439.                                CPL ≥ IOPL  (486)
  1440.       third number is the timing when:    virtual mode on 486 processor
  1441.     - 486 virtual mode always requires 27 cycles
  1442.  
  1443.     - see ~Instruction Timing~
  1444.  
  1445. :inc
  1446. ^INC - Increment
  1447.  
  1448.  
  1449.     Usage:    INC    dest
  1450.     Modifies flags: AF OF PF SF ZF
  1451.  
  1452.  
  1453.     Adds one to destination unsigned binary operand.
  1454.  
  1455.  
  1456. %                 Clocks            Size
  1457. %    Operands     808x  286   386   486        Bytes
  1458.  
  1459.     reg8          3    2     2        1          2
  1460.     reg16          3    2     2        1          1
  1461.     reg32          3    2     2        1          1
  1462.     mem        15+EA    7     6        3         2-4  (W88=23+EA)
  1463.  
  1464.  
  1465.     - see ~Instruction Timing~
  1466.  
  1467. :ins:insb:insw:insd
  1468. ^INS - Input String from Port  (80188+)
  1469.  
  1470.  
  1471.     Usage:    INS    dest,port
  1472.         INSB
  1473.         INSW
  1474.         INSD  (386+ only)
  1475.     Modifies flags: None
  1476.  
  1477.     Loads data from port to the destination ES:(E)DI  (even if a
  1478.     destination operand is supplied).  (E)DI is adjusted by the size
  1479.     of the operand and increased if the Direction Flag is cleared and
  1480.     decreased if the Direction Flag is set.  For INSB, INSW, INSD no
  1481.     operands are allowed and the size is determined by the mnemonic.
  1482.  
  1483.  
  1484. %                 Clocks            Size
  1485. %    Operands     808x  286   386    486        Bytes
  1486.  
  1487.     dest,port      -    5     15     17          1
  1488.     dest,port (PM)      -    5    9/29 10/32/30      1
  1489.     none          -    5     15     17          1
  1490.     none (PM)      -    5    9/29 10/32/30      1
  1491.  
  1492.  
  1493.     - 386+ protected mode timings depend on privilege levels.
  1494.  
  1495.       first number is the timing if:    CPL ≤ IOPL
  1496.       second number is the timing if:   CPL > IOPL
  1497.       third number is the timing if:    virtual mode on 486 processor
  1498.  
  1499.     - see ~Instruction Timing~
  1500.  
  1501. :int
  1502. ^INT - Interrupt
  1503.  
  1504.  
  1505.     Usage:    INT    num
  1506.     Modifies flags: TF IF
  1507.  
  1508.     Initiates a software interrupt by pushing the flags, clearing the
  1509.     Trap and Interrupt Flags, pushing CS followed by IP and loading
  1510.     CS:IP with the value found in the interrupt vector table.  Execution
  1511.     then begins at the location addressed by the new CS:IP
  1512.  
  1513.  
  1514. %                           Clocks        Size
  1515. %        Operands            808x  286   386   486    Bytes
  1516.  
  1517.  3 (constant)                          52/72  23+m   33    26      2
  1518.  3 (prot. mode, same priv.)         -    40+m   59       44      2      
  1519.  3 (prot. mode, more priv.)         -    78+m   99       71      2
  1520.  3 (from VM86 to PL 0)             -     -    119       82      2
  1521.  3 (prot. mode via task gate)         -   167+m   TS     37+TS      2
  1522.  immed8                       51/71  23+m   37    30       1
  1523.  immed8 (prot. mode, same priv.)     -    40+m   59       44      1
  1524.  immed8 (prot. mode, more priv.)     -    78+m   99       71      1
  1525.  immed8 (from VM86 to PL 0)         -     -    119       86      1
  1526.  immed8 (prot. mode, via task gate)     -   167+m   TS     37+TS      1
  1527.  
  1528.  
  1529.     - see ~Instruction Timing~
  1530.  
  1531. :into
  1532. ^INTO - Interrupt on Overflow
  1533.  
  1534.  
  1535.     Usage:    INTO
  1536.     Modifies flags: IF TF
  1537.  
  1538.  
  1539.     If the Overflow Flag is set this instruction generates an INT 4
  1540.     which causes the code addressed by 0000:0010 to be executed.
  1541.  
  1542.  
  1543. %                      Clocks       Size
  1544. %    Operands        808x    286   386   486       Bytes
  1545.  
  1546.     none: jump           53/73   24+m    35    28         1
  1547.           no jump         4     3     3     3
  1548.     (prot. mode, same priv.) -     -     59    46         1
  1549.     (prot. mode, more priv.) -     -     99    73         1
  1550.     (from VM86 to PL 0)     -     -    119    84         1
  1551.     (prot. mode, via task gate)     -     TS  39+TS     1
  1552.  
  1553.  
  1554.     - see ~Instruction Timing~
  1555.  
  1556. :invd
  1557. ^INVD - Invalidate Cache  (486+ only)
  1558.  
  1559.  
  1560.     Usage:    INVD
  1561.     Modifies flags: none
  1562.  
  1563.  
  1564.     Flushes CPU internal cache.  Issues special function bus cycle
  1565.     which indicates to flush external caches.   Data in write-back
  1566.     external caches is lost.
  1567.  
  1568.     
  1569. %                  Clocks        Size
  1570. %    Operands     808x    286   386   486        Bytes
  1571.  
  1572.     none          -     -     -     4          2
  1573.  
  1574.  
  1575.     - see ~Instruction Timing~
  1576.  
  1577. :invlpg
  1578. ^INVLPG - Invalidate Translation Look-Aside Buffer Entry  (486+ only)
  1579.  
  1580.  
  1581.     Usage:    INVLPG
  1582.     Modifies flags: none
  1583.  
  1584.  
  1585.     Invalidates a single page table entry in the Translation
  1586.     Look-Aside Buffer.  Intel warns that this instruction may be
  1587.     implemented differently on future processors.
  1588.  
  1589.     
  1590. %                  Clocks        Size
  1591. %    Operands     808x    286   386   486        Bytes
  1592.  
  1593.     none          -     -     -     12          2
  1594.  
  1595.  
  1596.     - timing is for TLB entry hit only.
  1597.     - see ~Instruction Timing~
  1598.  
  1599. :iret:iretd
  1600. ^IRET/IRETD - Interrupt Return
  1601.  
  1602.     Usage:    IRET
  1603.         IRETD  (386+ only)
  1604.     Modifies flags: AF CF DF IF PF SF TF ZF
  1605.  
  1606.     Returns control to point of interruption by popping IP, CS
  1607.     and then the Flags from the stack and continues execution at
  1608.     this location.    CPU exception interrupts will return to the
  1609.     instruction that cause the exception because the CS:IP placed
  1610.     on the stack during the interrupt is the address of the offending
  1611.     instruction.
  1612.  
  1613. %                     Clocks            Size
  1614. %        Operands        808x   286   386   486        Bytes
  1615.  
  1616.     iret               32/44  17+m    22    15          1
  1617.     iret  (prot. mode)             -    31+m    38    15          1
  1618.     iret  (to less privilege)     -    55+m    82    36          1
  1619.     iret  (different task, NT=1) -   169+m    TS  TS+32          1
  1620.     iretd             -    -   22/38   15          1
  1621.     iretd (to less privilege)     -    -     82    36          1
  1622.     iretd (to VM86 mode)     -    -     60    15          1
  1623.     iretd (different task, NT=1) -    -     TS  TS+32          1
  1624.  
  1625.  
  1626.     - 386 timings are listed as real-mode/protected-mode
  1627.     - see ~Instruction Timing~
  1628.  
  1629. :j...
  1630. ^Jump Instructions Table
  1631.  
  1632. %    Mnemonic          Meaning             Jump Condition
  1633.  
  1634.       ~JA~       Jump if Above             CF=0 and ZF=0
  1635.       ~JAE~       Jump if Above or Equal         CF=0
  1636.       ~JB~       Jump if Below             CF=1
  1637.       ~JBE~       Jump if Below or Equal         CF=1 or ZF=1
  1638.       ~JC~       Jump if Carry             CF=1
  1639.       ~JCXZ~   Jump if CX Zero             CX=0
  1640.       ~JE~       Jump if Equal             ZF=1
  1641.       ~JG~       Jump if Greater (signed)         ZF=0 and SF=OF
  1642.       ~JGE~       Jump if Greater or Equal (signed)     SF=OF
  1643.       ~JL~       Jump if Less (signed)         SF != OF
  1644.       ~JLE~       Jump if Less or Equal (signed)     ZF=1 or SF != OF
  1645.       ~JMP~       Unconditional Jump             unconditional
  1646.       ~JNA~       Jump if Not Above             CF=1 or ZF=1
  1647.       ~JNAE~   Jump if Not Above or Equal         CF=1
  1648.       ~JNB~       Jump if Not Below             CF=0
  1649.       ~JNBE~   Jump if Not Below or Equal         CF=0 and ZF=0
  1650.       ~JNC~       Jump if Not Carry             CF=0
  1651.       ~JNE~       Jump if Not Equal             ZF=0
  1652.       ~JNG~       Jump if Not Greater (signed)      ZF=1 or SF != OF
  1653.       ~JNGE~   Jump if Not Greater or Equal (signed) SF != OF
  1654.       ~JNL~       Jump if Not Less (signed)         SF=OF
  1655.       ~JNLE~   Jump if Not Less or Equal (signed)     ZF=0 and SF=OF
  1656.       ~JNO~       Jump if Not Overflow (signed)     OF=0
  1657.       ~JNP~       Jump if No Parity             PF=0
  1658.       ~JNS~       Jump if Not Signed (signed)         SF=0
  1659.       ~JNZ~       Jump if Not Zero             ZF=0
  1660.       ~JO~       Jump if Overflow (signed)         OF=1
  1661.       ~JP~       Jump if Parity             PF=1
  1662.       ~JPE~       Jump if Parity Even             PF=1
  1663.       ~JPO~       Jump if Parity Odd             PF=0
  1664.       ~JS~       Jump if Signed (signed)         SF=1
  1665.       ~JZ~       Jump if Zero              ZF=1
  1666.  
  1667. %                       Clocks            Size
  1668. %    Operands     808x  286   386   486        Bytes
  1669.  
  1670.     Jx: jump      16   7+m   7+m    3          2
  1671.         no jump       4    3     3        1
  1672.     Jx  near-label       -    -    7+m    3          4
  1673.         no jump       -    -     3        1
  1674.  
  1675.  
  1676.     - It's a good programming practice to organize code so the
  1677.       expected case is executed without a jump since the actual
  1678.       jump takes longer to execute than falling through the test.
  1679.     - see    ~JCXZ~  and  ~JMP~  for their respective timings
  1680.     - see   ~Instruction Timing~   ~FLAGS~
  1681.  
  1682. :ja:jnbe
  1683. ^JA/JNBE - Jump Above / Jump Not Below or Equal
  1684.  
  1685.  
  1686.     Usage:    JA    label
  1687.         JNBE    label
  1688.     Modifies flags: None
  1689.  
  1690.  
  1691.     Causes execution to branch to "label" if the Carry Flag and Zero Flag
  1692.     are both clear.  Unsigned comparision.
  1693.  
  1694.  
  1695. %                 Clocks            Size
  1696. %    Operands     808x  286   386   486        Bytes
  1697.  
  1698.     label:    jump      16   7+m   7+m    3         2-4
  1699.         no jump      4    3     3        1
  1700.  
  1701.  
  1702.     - see ~Instruction Timing~
  1703.  
  1704. :jae:jnb
  1705. ^JAE/JNB - Jump Above or Equal / Jump on Not Below
  1706.  
  1707.  
  1708.     Usage:    JAE    label
  1709.         JNB    label
  1710.     Modifies flags: None
  1711.  
  1712.  
  1713.     Causes execution to branch to "label" if the Carry Flag is clear.
  1714.     Functionally similar to ~JNC~.  Unsigned comparision.
  1715.  
  1716.  
  1717. %                 Clocks            Size
  1718. %    Operands     808x  286   386   486        Bytes
  1719.  
  1720.     label:    jump      16   7+m   7+m    3         2-4
  1721.         no jump      4    3     3        1
  1722.  
  1723.  
  1724.     - see ~Instruction Timing~
  1725.  
  1726. :jb:jnae
  1727. ^JB/JNAE - Jump Below / Jump Not Above or Equal
  1728.  
  1729.  
  1730.     Usage:    JB    label
  1731.         JNAE    label
  1732.     Modifies flags: None
  1733.  
  1734.  
  1735.     Causes execution to branch to "label" if the Carry Flag is set.
  1736.     Functionally similar to ~JC~.  Unsigned comparision.
  1737.  
  1738.  
  1739. %                 Clocks            Size
  1740. %    Operands     808x  286   386   486        Bytes
  1741.  
  1742.     label:    jump      16   7+m   7+m    3         2-4
  1743.         no jump      4    3     3        1
  1744.  
  1745.  
  1746.     - see ~Instruction Timing~
  1747.  
  1748. :jbe:jna
  1749. ^JBE/JNA - Jump Below or Equal / Jump Not Above
  1750.  
  1751.  
  1752.     Usage:    JBE    label
  1753.         JNA    label
  1754.     Modifies flags: None
  1755.  
  1756.  
  1757.     Causes execution to branch to "label" if the Carry Flag or
  1758.     the Zero Flag is set.    Unsigned comparision.
  1759.  
  1760.  
  1761. %                 Clocks            Size
  1762. %    Operands     808x  286   386   486        Bytes
  1763.  
  1764.     label:    jump      16   7+m   7+m    3         2-4
  1765.         no jump      4    3     3        1
  1766.  
  1767.  
  1768.     - see ~Instruction Timing~
  1769.  
  1770. :jc
  1771. ^JC - Jump on Carry
  1772.  
  1773.  
  1774.     Usage:    JC    label
  1775.     Modifies flags: None
  1776.  
  1777.  
  1778.     Causes execution to branch to "label" if the Carry Flag is set.
  1779.     Functionally similar to ~JB~ and ~JNAE~.  Unsigned comparision.
  1780.  
  1781.  
  1782. %                 Clocks            Size
  1783. %    Operands     808x  286   386   486        Bytes
  1784.  
  1785.     label:    jump      16   7+m   7+m    3         2-4
  1786.         no jump      4    3     3        1
  1787.  
  1788.  
  1789.     - see ~Instruction Timing~
  1790.  
  1791. :jcxz:jecxz
  1792. ^JCXZ/JECXZ - Jump if Register (E)CX is Zero
  1793.  
  1794.  
  1795.     Usage:    JCXZ    label
  1796.         JECXZ    label  (386+ only)
  1797.     Modifies flags: None
  1798.  
  1799.  
  1800.     Causes execution to branch to "label" if register CX is zero.  Uses
  1801.     unsigned comparision.
  1802.  
  1803. %                 Clocks            Size
  1804. %    Operands     808x  286   386   486        Bytes
  1805.  
  1806.     label:    jump      18   8+m   9+m    8          2
  1807.         no jump       6    4     5        5
  1808.  
  1809.  
  1810.     - see ~Instruction Timing~
  1811.  
  1812. :je:jz
  1813. ^JE/JZ - Jump Equal / Jump Zero
  1814.  
  1815.  
  1816.     Usage:    JE    label
  1817.         JZ    label
  1818.     Modifies flags: None
  1819.  
  1820.  
  1821.     Causes execution to branch to "label" if the Zero Flag is set.    Uses
  1822.     unsigned comparision.
  1823.  
  1824. %                 Clocks            Size
  1825. %    Operands     808x  286   386   486        Bytes
  1826.  
  1827.     label:    jump      16   7+m   7+m    3         2-4
  1828.         no jump      4    3     3        1
  1829.  
  1830.  
  1831.     - see ~Instruction Timing~
  1832.  
  1833. :jg:jnle
  1834. ^JG/JNLE - Jump Greater / Jump Not Less or Equal
  1835.  
  1836.  
  1837.     Usage:    JG    label
  1838.         JNLE    label
  1839.     Modifies flags: None
  1840.  
  1841.  
  1842.     Causes execution to branch to "label" if the Zero Flag is clear or
  1843.     the Sign Flag equals the Overflow Flag.  Signed comparision.
  1844.  
  1845.  
  1846. %                 Clocks            Size
  1847. %    Operands     808x  286   386   486        Bytes
  1848.  
  1849.     label:    jump      16   7+m   7+m    3         2-4
  1850.         no jump      4    3     3        1
  1851.  
  1852.  
  1853.     - see ~Instruction Timing~
  1854.  
  1855. :jge:jnl
  1856. ^JGE/JNL - Jump Greater or Equal / Jump Not Less
  1857.  
  1858.  
  1859.     Usage:    JGE    label
  1860.         JNL    label
  1861.     Modifies flags: None
  1862.  
  1863.  
  1864.     Causes execution to branch to "label" if the Sign Flag equals
  1865.     the Overflow Flag.  Signed comparision.
  1866.  
  1867.  
  1868. %                 Clocks            Size
  1869. %    Operands     808x  286   386   486        Bytes
  1870.  
  1871.     label:    jump      16   7+m   7+m    3         2-4
  1872.         no jump      4    3     3        1
  1873.  
  1874.  
  1875.     - see ~Instruction Timing~
  1876.  
  1877. :jl:jnge
  1878. ^JL/JNGE - Jump Less / Jump Not Greater or Equal
  1879.  
  1880.  
  1881.     Usage:    JL    label
  1882.         JNGE    label
  1883.     Modifies flags: None
  1884.  
  1885.  
  1886.     Causes execution to branch to "label" if the Sign Flag is not equal
  1887.     to Overflow Flag.  Unsigned comparision.
  1888.  
  1889.  
  1890. %                 Clocks            Size
  1891. %    Operands     808x  286   386   486        Bytes
  1892.  
  1893.     label:    jump      16   7+m   7+m    3         2-4
  1894.         no jump      4    3     3        1
  1895.  
  1896.  
  1897.     - see ~Instruction Timing~
  1898.  
  1899. :jle:jng
  1900. ^JLE/JNG - Jump Less or Equal / Jump Not Greater
  1901.  
  1902.  
  1903.     Usage:    JLE    label
  1904.         JNG    label
  1905.     Modifies flags: None
  1906.  
  1907.  
  1908.     Causes execution to branch to "label" if the Zero Flag is set or the
  1909.     Sign Flag is not equal to the Overflow Flag.  Signed comparision.
  1910.  
  1911.  
  1912. %                 Clocks            Size
  1913. %    Operands     808x  286   386   486        Bytes
  1914.  
  1915.     label:    jump      16   7+m   7+m    3         2-4
  1916.         no jump      4    3     3        1
  1917.  
  1918.  
  1919.     - see ~Instruction Timing~
  1920.  
  1921. :jmp
  1922. ^JMP - Unconditional Jump
  1923.  
  1924.     Usage:    JMP    target
  1925.     Modifies flags: None
  1926.  
  1927.     Unconditionally transfers control to "label".  Jumps by default
  1928.     are within -32768 to 32767 bytes from the instruction following
  1929.     the jump.  NEAR and SHORT jumps cause the IP to be updated while FAR
  1930.     jumps cause CS and IP to be updated.
  1931.  
  1932. %                            Clocks
  1933. %           Operands            808x  286    386   486
  1934.  
  1935.     rel8  (relative)             15    7+m    7+m    3
  1936.     rel16 (relative)             15    7+m    7+m    3
  1937.     rel32 (relative)              -     -     7+m    3
  1938.     reg16 (near, register indirect)        11    7+m    7+m    5
  1939.     reg32 (near, register indirect)         -     -     7+m    5
  1940.     mem16 (near, mem indirect)           18+EA  11+m  10+m    5
  1941.     mem32 (near, mem indirect)           24+EA  15+m  10+m    5
  1942.     ptr16:16 (far, dword immed)         -     -    12+m    17
  1943.     ptr16:16 (far, PM dword immed)         -     -    27+m    19
  1944.     ptr16:16 (call gate, same priv.)     -    38+m  45+m    32
  1945.     ptr16:16 (via TSS)                    -   175+m   TS      42+TS
  1946.     ptr16:16 (via task gate)         -   180+m   TS      43+TS
  1947.     mem16:16 (far, indirect)         -     -    43+m    13
  1948.     mem16:16 (far, PM indirect)         -     -    31+m    18
  1949.     mem16:16 (call gate, same priv.)     -    41+m  49+m    31
  1950.     mem16:16 (via TSS)                -   178+m  5+TS  41+TS
  1951.     mem16:16 (via task gate)            -   183+m  5+TS  42+TS
  1952.     ptr16:32 (far, 6 byte immed)         -     -    12+m    13
  1953.     ptr16:32 (far, PM 6 byte immed)         -     -    27+m    18
  1954.     ptr16:32 (call gate, same priv.)     -     -    45+m    31
  1955.     ptr16:32 (via TSS)             -     -     TS      42+TS
  1956.     ptr16:32 (via task state)          -     -     TS      43+TS
  1957.     m16:32 (far, address at dword)         -     -    43+m    13
  1958.     m16:32 (far, address at dword)         -     -    31+m    18
  1959.     m16:32 (call gate, same priv.)         -     -    49+m    31
  1960.     m16:32 (via TSS)             -     -    5+TS  41+TS
  1961.     m16:32 (via task state)             -     -    5+TS  42+TS
  1962.  
  1963.     - see ~Instruction Timing~
  1964.  
  1965. :jnc
  1966. ^JNC - Jump Not Carry
  1967.  
  1968.  
  1969.     Usage:    JNC    label
  1970.     Modifies flags: None
  1971.  
  1972.  
  1973.     Causes execution to branch to "label" if the Carry Flag is clear.
  1974.     Functionally similar to ~JAE~ or ~JNB~.  Unsigned comparision.
  1975.  
  1976.  
  1977. %                 Clocks            Size
  1978. %    Operands     808x  286   386   486        Bytes
  1979.  
  1980.     label:    jump      16   7+m   7+m    3         2-4
  1981.         no jump      4    3     3        1
  1982.  
  1983.  
  1984.     - see ~Instruction Timing~
  1985.  
  1986. :jne:jnz
  1987. ^JNE/JNZ - Jump Not Equal / Jump Not Zero
  1988.  
  1989.  
  1990.     Usage:    JNE    label
  1991.         JNZ    label
  1992.     Modifies flags: None
  1993.  
  1994.  
  1995.     Causes execution to branch to "label" if the Zero Flag is clear.
  1996.     Unsigned comparision.
  1997.  
  1998. %                 Clocks            Size
  1999. %    Operands     808x  286   386   486        Bytes
  2000.  
  2001.     label:    jump      16   7+m   7+m    3         2-4
  2002.         no jump      4    3     3        1
  2003.  
  2004.  
  2005.     - see ~Instruction Timing~
  2006.  
  2007. :jno
  2008. ^JNO - Jump Not Overflow
  2009.  
  2010.  
  2011.     Usage:    JNO    label
  2012.     Modifies flags: None
  2013.  
  2014.  
  2015.     Causes execution to branch to "label" if the Overflow Flag is clear.
  2016.     Signed comparision.
  2017.  
  2018. %                 Clocks            Size
  2019. %    Operands     808x  286   386   486        Bytes
  2020.  
  2021.     label:    jump      16   7+m   7+m    3         2-4
  2022.         no jump      4    3     3        1
  2023.  
  2024.  
  2025.     - see ~Instruction Timing~
  2026.  
  2027. :jns
  2028. ^JNS - Jump Not Signed
  2029.  
  2030.  
  2031.     Usage:    JNS    label
  2032.     Modifies flags: None
  2033.  
  2034.  
  2035.     Causes execution to branch to "label" if the Sign Flag is clear.
  2036.     Signed comparision.
  2037.  
  2038. %                 Clocks            Size
  2039. %    Operands     808x  286   386   486        Bytes
  2040.  
  2041.     label:    jump      16   7+m   7+m    3         2-4
  2042.         no jump      4    3     3        1
  2043.  
  2044.  
  2045.     - see ~Instruction Timing~
  2046.  
  2047. :jnp:jpo
  2048. ^JNP/JPO - Jump Not Parity / Jump Parity Odd
  2049.  
  2050.  
  2051.     Usage:    JNP    label
  2052.         JPO    label
  2053.     Modifies flags: None
  2054.  
  2055.  
  2056.     Causes execution to branch to "label" if the Parity Flag is clear.
  2057.     Unsigned comparision.
  2058.  
  2059. %                 Clocks            Size
  2060. %    Operands     808x  286   386   486        Bytes
  2061.  
  2062.     label:    jump      16   7+m   7+m    3         2-4
  2063.         no jump      4    3     3        1
  2064.  
  2065.  
  2066.     - see ~Instruction Timing~
  2067.  
  2068. :jo
  2069. ^JO - Jump on Overflow
  2070.  
  2071.  
  2072.     Usage:    JO  label
  2073.     Modifies flags: None
  2074.  
  2075.  
  2076.     Causes execution to branch to "label" if the Overflow Flag is set.
  2077.     Signed comparision.
  2078.  
  2079. %                 Clocks            Size
  2080. %    Operands     808x  286   386   486        Bytes
  2081.  
  2082.     label:    jump      16   7+m   7+m    3         2-4
  2083.         no jump      4    3     3        1
  2084.  
  2085.  
  2086.     - see ~Instruction Timing~
  2087.  
  2088. :jp:jpe
  2089. ^JP/JPE - Jump on Parity / Jump on Parity Even
  2090.  
  2091.  
  2092.     Usage:    JP    label
  2093.         JPE    label
  2094.     Modifies flags: None
  2095.  
  2096.  
  2097.     Causes execution to branch to "label" if the Parity Flag is set.
  2098.     Unsigned comparision.
  2099.  
  2100. %                 Clocks            Size
  2101. %    Operands     808x  286   386   486        Bytes
  2102.  
  2103.     label:    jump      16   7+m   7+m    3         2-4
  2104.         no jump      4    3     3        1
  2105.  
  2106.  
  2107.     - see ~Instruction Timing~
  2108.  
  2109. :js
  2110. ^JS - Jump Signed
  2111.  
  2112.  
  2113.     Usage:    JS    label
  2114.     Modifies flags: None
  2115.  
  2116.  
  2117.     Causes execution to branch to "label" if the Sign Flag is set.
  2118.     Signed comparision.
  2119.  
  2120. %                 Clocks            Size
  2121. %    Operands     808x  286   386   486        Bytes
  2122.  
  2123.     label:    jump      16   7+m   7+m    3         2-4
  2124.         no jump      4    3     3        1
  2125.  
  2126.  
  2127.     - see ~Instruction Timing~
  2128.  
  2129. :lahf
  2130. ^LAHF - Load Register AH From Flags
  2131.  
  2132.  
  2133.     Usage:    LAHF
  2134.     Modifies flags: None
  2135.  
  2136.     Copies bits 0-7 of the flags register into AH.    This includes flags
  2137.     AF, CF, PF, SF and ZF other bits are undefined.
  2138.  
  2139.  
  2140. %                 Clocks            Size
  2141. %    Operands     808x  286   386   486        Bytes
  2142.  
  2143.     none          4    2     2        3          1
  2144.  
  2145.  
  2146.     - see ~Instruction Timing~
  2147.  
  2148. :lar
  2149. ^LAR - Load Access Rights  (286+ protected)
  2150.  
  2151.  
  2152.     Usage:    LAR    dest,src
  2153.     Modifies flags: ZF
  2154.  
  2155.  
  2156.     The high byte of the of the destination register is overwritten by
  2157.     the value of the access rights byte and the low order byte is zeroed
  2158.     depending on the selection in the source operand.  The Zero Flag is
  2159.     set if the load operation is successful.
  2160.  
  2161.  
  2162. %                 Clocks            Size
  2163. %    Operands     808x  286   386   486        Bytes
  2164.  
  2165.     reg16,reg16      -    14    15    11          3
  2166.     reg32,reg32      -    -     15    11          3
  2167.     reg16,mem16      -    16    16    11         3-7
  2168.     reg32,mem32      -    -     16    11         3-7
  2169.  
  2170.  
  2171.     - see ~Instruction Timing~
  2172.  
  2173. :lds
  2174. ^LDS - Load Pointer Using DS
  2175.  
  2176.     Usage:    LDS    dest,src
  2177.     Modifies flags: None
  2178.  
  2179.  
  2180.     Loads 32-bit pointer from memory source to destination register
  2181.     and DS.  The offset is placed in the destination register and the
  2182.     segment is placed in DS.  To use this instruction the word at the
  2183.     lower memory address must contain the offset and the word at the
  2184.     higher address must contain the segment.  This simplifies the loading
  2185.     of far pointers from the stack and the interrupt vector table.
  2186.  
  2187.  
  2188. %                 Clocks            Size
  2189. %    Operands     808x  286   386   486        Bytes
  2190.  
  2191.     reg16,mem32    16+EA    7     7        6         2-4
  2192.     reg,mem (PM)      -    -     22    12         5-7
  2193.  
  2194.  
  2195.     - see ~Instruction Timing~
  2196.  
  2197. :lea
  2198. ^LEA - Load Effective Address
  2199.  
  2200.  
  2201.     Usage:    LEA    dest,src
  2202.     Modifies flags: None
  2203.  
  2204.  
  2205.     Transfers offset address of "src" to the destination register.
  2206.  
  2207.  
  2208. %                 Clocks            Size
  2209. %    Operands     808x  286   386   486        Bytes
  2210.  
  2211.     reg,mem      2+EA    3     2        1         2-4
  2212.  
  2213.  
  2214.     - the ~MOV~ instruction can often save clock cycles when used in
  2215.       place of LEA on 8088 processors
  2216.     - see ~Instruction Timing~
  2217.  
  2218. :leave
  2219. ^LEAVE - Restore Stack for Procedure Exit (80188+)
  2220.  
  2221.  
  2222.     Usage:    LEAVE
  2223.     Modifies flags: None
  2224.  
  2225.  
  2226.     Releases the local variables created by the previous ~ENTER~
  2227.     instruction by restoring SP and BP to their condition before
  2228.     the procedure stack frame was initialized.
  2229.  
  2230.  
  2231. %                 Clocks            Size
  2232. %    Operands     808x  286   386   486        Bytes
  2233.  
  2234.     none          -    5     4        5          1
  2235.  
  2236.  
  2237.     - see ~Instruction Timing~
  2238.  
  2239. :les
  2240. ^LES - Load Pointer Using ES
  2241.  
  2242.     Usage:    LES    dest,src
  2243.     Modifies flags: None
  2244.  
  2245.  
  2246.     Loads 32-bit pointer from memory source to destination register
  2247.     and ES.  The offset is placed in the destination register and the
  2248.     segment is placed in ES.  To use this instruction the word at the
  2249.     lower memory address must contain the offset and the word at the
  2250.     higher address must contain the segment.  This simplifies the loading
  2251.     of far pointers from the stack and the interrupt vector table.
  2252.  
  2253.  
  2254. %                 Clocks            Size
  2255. %    Operands     808x  286   386   486        Bytes
  2256.  
  2257.     reg,mem     16+EA    7     7        6         2-4  (W88=24+EA)
  2258.     reg,mem (PM)      -    -     22    12         5-7
  2259.  
  2260.  
  2261.     - see ~Instruction Timing~
  2262.  
  2263. :lfs
  2264. ^LFS - Load Pointer Using FS  (386+ only)
  2265.  
  2266.  
  2267.     Usage:    LFS    dest,src
  2268.     Modifies flags: None
  2269.  
  2270.  
  2271.     Loads 32-bit pointer from memory source to destination register
  2272.     and FS.  The offset is placed in the destination register and the
  2273.     segment is placed in FS.  To use this instruction the word at the
  2274.     lower memory address must contain the offset and the word at the
  2275.     higher address must contain the segment.  This simplifies the loading
  2276.     of far pointers from the stack and the interrupt vector table.
  2277.  
  2278.  
  2279. %                 Clocks            Size
  2280. %    Operands     808x  286   386   486        Bytes
  2281.  
  2282.     reg,mem       -    -     7        6         5-7
  2283.     reg,mem (PM)      -    -     22    12         5-7
  2284.  
  2285.  
  2286.     - see ~Instruction Timing~
  2287.  
  2288. :lgdt
  2289. ^LGDT - Load Global Descriptor Table  (286+ privileged)
  2290.  
  2291.  
  2292.     Usage:    LGDT    src
  2293.     Modifies flags: None
  2294.  
  2295.  
  2296.     Loads a value from an operand into the Global Descriptor Table
  2297.     (~GDT~) register.
  2298.  
  2299.  
  2300. %                 Clocks            Size
  2301. %    Operands     808x  286   386   486        Bytes
  2302.  
  2303.     mem64          -    11    11    11          5
  2304.  
  2305.  
  2306.     - see ~Instruction Timing~
  2307.  
  2308. :lidt
  2309. ^LIDT - Load Interrupt Descriptor Table  (286+ privileged)
  2310.  
  2311.  
  2312.     Usage:    LIDT    src
  2313.     Modifies flags: None
  2314.  
  2315.  
  2316.     Loads a value from an operand into the Interrupt Descriptor Table
  2317.     (IDT) register.
  2318.  
  2319.  
  2320. %                 Clocks            Size
  2321. %    Operands     808x  286   386   486        Bytes
  2322.  
  2323.     mem64          -    12    11    11          5
  2324.  
  2325.  
  2326.     - see ~Instruction Timing~
  2327.  
  2328. :lgs
  2329. ^LGS - Load Pointer Using GS  (386+ only)
  2330.  
  2331.  
  2332.     Usage:    LGS    dest,src
  2333.     Modifies flags: None
  2334.  
  2335.  
  2336.     Loads 32-bit pointer from memory source to destination register
  2337.     and GS.  The offset is placed in the destination register and the
  2338.     segment is placed in GS.  To use this instruction the word at the
  2339.     lower memory address must contain the offset and the word at the
  2340.     higher address must contain the segment.  This simplifies the loading
  2341.     of far pointers from the stack and the interrupt vector table.
  2342.  
  2343.  
  2344. %                 Clocks            Size
  2345. %    Operands     808x  286   386   486        Bytes
  2346.  
  2347.     reg,mem       -    -     7        6         5-7
  2348.     reg,mem (PM)      -    -     22    12         5-7
  2349.  
  2350.  
  2351.     - see ~Instruction Timing~
  2352.  
  2353. :lldt
  2354. ^LLDT - Load Local Descriptor Table  (286+ privileged)
  2355.  
  2356.  
  2357.     Usage:    LLDT    src
  2358.     Modifies flags: None
  2359.  
  2360.  
  2361.     Loads a value from an operand into the Local Descriptor Table 
  2362.     Register (LDTR).
  2363.  
  2364.  
  2365. %                 Clocks            Size
  2366. %    Operands     808x  286   386   486        Bytes
  2367.  
  2368.     reg16          -    17    20    11          3
  2369.     mem16          -    19    24    11          5
  2370.  
  2371.  
  2372.     - see ~Instruction Timing~
  2373.  
  2374. :lmsw
  2375. ^LMSW - Load Machine Status Word  (286+ privileged)
  2376.  
  2377.  
  2378.     Usage:    LMSW    src
  2379.     Modifies flags: None
  2380.  
  2381.  
  2382.     Loads the Machine Status Word (~MSW~) from data found at "src"
  2383.  
  2384.  
  2385. %                 Clocks            Size
  2386. %    Operands     808x  286   386   486        Bytes
  2387.  
  2388.     reg16          -    3     10    13          3
  2389.     mem16          -    6     13    13          5
  2390.  
  2391.  
  2392.     - see ~Instruction Timing~
  2393.  
  2394. :lock
  2395. ^LOCK - Lock Bus
  2396.  
  2397.  
  2398.     Usage:    LOCK
  2399.         LOCK: (386+ prefix)
  2400.     Modifies flags: None
  2401.  
  2402.  
  2403.     This instruction is a prefix that causes the CPU assert bus lock
  2404.     signal during the execution of the next instruction.  Used to
  2405.     avoid two processors from updating the same data location.  The
  2406.     286 always asserts lock during an XCHG with memory operands.  This
  2407.     should only be used to lock the bus prior to ~XCHG~, ~MOV~, ~IN~ and
  2408.     ~OUT~ instructions.
  2409.  
  2410.  
  2411. %                 Clocks            Size
  2412. %    Operands     808x  286   386   486        Bytes
  2413.  
  2414.     none          2    0     0        1          1
  2415.  
  2416.  
  2417.     - see ~Instruction Timing~
  2418.  
  2419. :lods:lodsb:lodsw:lodsd
  2420. ^LODS - Load String (Byte, Word or Double)
  2421.  
  2422.  
  2423.     Usage:    LODS    src
  2424.         LODSB
  2425.         LODSW
  2426.         LODSD  (386+ only)
  2427.     Modifies flags: None
  2428.  
  2429.     Transfers string element addressed by DS:SI (even if an operand is
  2430.     supplied) to the accumulator.    SI is incremented based on the size
  2431.     of the operand or based on the instruction used.  If the Direction
  2432.     Flag is set SI is decremented, if the Direction Flag is clear SI
  2433.     is incremented.  Use with REP prefixes.
  2434.  
  2435.  
  2436. %                 Clocks            Size
  2437. %    Operands     808x  286   386   486        Bytes
  2438.  
  2439.     src        12/16    5     5        5          1
  2440.  
  2441.  
  2442.     - see ~Instruction Timing~
  2443.  
  2444. :loop
  2445. ^LOOP - Decrement CX and Loop if CX Not Zero
  2446.  
  2447.  
  2448.     Usage:    LOOP    label
  2449.     Modifies flags: None
  2450.  
  2451.  
  2452.     Decrements CX by 1 and transfers control to "label" if CX is not
  2453.     Zero.  The "label" operand must be within -128 or 127 bytes of the
  2454.     instruction following the loop instruction
  2455.  
  2456.  
  2457. %                 Clocks            Size
  2458. %    Operands     808x  286   386   486        Bytes
  2459.  
  2460.     label:    jump      18   8+m  11+m    6          2
  2461.         no jump       5    4     ?        2
  2462.  
  2463.  
  2464.     - see ~Instruction Timing~
  2465.  
  2466. :loope:loopz
  2467. ^LOOPE/LOOPZ - Loop While Equal / Loop While Zero
  2468.  
  2469.  
  2470.     Usage:    LOOPE    label
  2471.         LOOPZ    label
  2472.     Modifies flags: None
  2473.  
  2474.     Decrements CX by 1 (without modifying the flags) and transfers
  2475.     control to "label" if CX != 0 and the Zero Flag is set.  The
  2476.     "label" operand must be within -128 or 127 bytes of the instruction
  2477.     following the loop instruction.
  2478.  
  2479.  
  2480. %                 Clocks            Size
  2481. %    Operands     808x  286   386   486        Bytes
  2482.  
  2483.     label:    jump      18   8+m  11+m    9          2
  2484.         no jump       5    4     ?        6
  2485.  
  2486.  
  2487.     - see ~Instruction Timing~
  2488.  
  2489. :loopnz:loopne
  2490. ^LOOPNZ/LOOPNE - Loop While Not Zero / Loop While Not Equal
  2491.  
  2492.  
  2493.     Usage:    LOOPNZ    label
  2494.         LOOPNE    label
  2495.     Modifies flags: None
  2496.  
  2497.     Decrements CX by 1 (without modifying the flags) and transfers
  2498.     control to "label" if CX != 0 and the Zero Flag is clear.  The
  2499.     "label" operand must be within -128 or 127 bytes of the instruction
  2500.     following the loop instruction.
  2501.  
  2502.  
  2503. %                 Clocks            Size
  2504. %    Operands     808x  286   386   486        Bytes
  2505.  
  2506.     label:    jump      19   8+m  11+m    9          2
  2507.         no jump       5    4     ?        6
  2508.  
  2509.  
  2510.     - see ~Instruction Timing~
  2511.  
  2512. :lsl
  2513. ^LSL - Load Segment Limit  (286+ protected)
  2514.  
  2515.  
  2516.     Usage:    LSL    dest,src
  2517.     Modifies flags: ZF
  2518.  
  2519.     Loads the segment limit of a selector into the destination register
  2520.     if the selector is valid and visible at the current privilege level.
  2521.     If loading is successful the Zero Flag is set, otherwise it is
  2522.     cleared.
  2523.  
  2524.  
  2525. %                 Clocks            Size
  2526. %    Operands     808x  286   386   486        Bytes
  2527.  
  2528.     reg16,reg16      -    14  20/25   10          3
  2529.     reg32,reg32      -    -   20/25   10          3
  2530.     reg16,mem16      -    16  21/26   10          5
  2531.     reg32,mem32      -    -   21/26   10          5
  2532.  
  2533.  
  2534.     - 386 times are listed "byte granular" / "page granular"
  2535.     - see ~Instruction Timing~
  2536. :lss
  2537. ^LSS - Load Pointer Using SS  (386+ only)
  2538.  
  2539.  
  2540.     Usage:    LSS    dest,src
  2541.     Modifies flags: None
  2542.  
  2543.  
  2544.     Loads 32-bit pointer from memory source to destination register
  2545.     and SS.  The offset is placed in the destination register and the
  2546.     segment is placed in SS.  To use this instruction the word at the
  2547.     lower memory address must contain the offset and the word at the
  2548.     higher address must contain the segment.  This simplifies the loading
  2549.     of far pointers from the stack and the interrupt vector table.
  2550.  
  2551.  
  2552. %                 Clocks            Size
  2553. %    Operands     808x  286   386   486        Bytes
  2554.  
  2555.     reg,mem       -    -     7        6         5-7
  2556.     reg,mem (PM)      -    -     22    12         5-7
  2557.  
  2558.  
  2559.     - see ~Instruction Timing~
  2560.  
  2561. :ltr
  2562. ^LTR - Load Task Register   (286+ privileged)
  2563.  
  2564.  
  2565.     Usage:    LTR    src
  2566.     Modifies flags: None
  2567.  
  2568.  
  2569.     Loads the current task register with the value specified in "src".
  2570.  
  2571.  
  2572. %                 Clocks            Size
  2573. %    Operands     808x  286   386   486        Bytes
  2574.  
  2575.     reg16          -    17    23    20          3
  2576.     mem16          -    19    27    20          5
  2577.  
  2578.  
  2579.     - see ~Instruction Timing~
  2580.  
  2581. :mov
  2582. ^MOV - Move Byte or Word
  2583.  
  2584.     Usage:    MOV    dest,src
  2585.     Modifies flags: None
  2586.  
  2587.     Copies byte or word from the source operand to the destination
  2588.     operand.  If the destination is SS interrupts are disabled except
  2589.     on early buggy 808x CPUs.  Some CPUs disable interrupts if the
  2590.     destination is any of the segment registers
  2591.  
  2592. %                 Clocks            Size
  2593. %    Operands     808x  286   386   486        Bytes
  2594.  
  2595.     reg,reg       2    2     2        1          2
  2596.     mem,reg      9+EA    3     2        1         2-4  (W88=13+EA)
  2597.     reg,mem      8+EA    5     4        1         2-4  (W88=12+EA)
  2598.     mem,immed    10+EA    3     2        1         3-6  (W88=14+EA)
  2599.     reg,immed      4    2     2        1         2-3
  2600.     mem,accum      10    3     2        1          3   (W88=14)
  2601.     accum,mem      10    5     4        1          3   (W88=14)
  2602.     segreg,reg16      2    2     2        3          2
  2603.     segreg,mem16     8+EA    5     5        9         2-4  (W88=12+EA)
  2604.     reg16,segreg      2    2     2        3          2
  2605.     mem16,segreg     9+EA    3     2        3         2-4  (W88=13+EA)
  2606.     reg32,CR0/CR2/CR3 -    -     6        4
  2607.     CR0,reg32      -    -     10    16
  2608.     CR2,reg32      -    -     4     4           3
  2609.     CR3,reg32      -    -     5     4           3
  2610.     reg32,DR0/DR1/DR2/DR3    -     22   10          3
  2611.     reg32,DR6/DR7      -     -     22   10          3
  2612.     DR0/DR1/DR2/DR3,reg32   -     22   11          3
  2613.     DR6/DR7,reg32      -    -     16   11          3
  2614.     reg32,TR6/TR7       -    -     12    4          3
  2615.     TR6/TR7,reg32       -    -     12    4          3
  2616.     reg32,TR3                3
  2617.     TR3,reg32                6
  2618.  
  2619.     - when the 386 special registers are used all operands are 32 bits
  2620.     - see ~Instruction Timing~
  2621.  
  2622. :movs:movsb:movsw:movsd
  2623. ^MOVS - Move String (Byte or Word)
  2624.  
  2625.     Usage:    MOVS    dest,src
  2626.         MOVSB
  2627.         MOVSW
  2628.         MOVSD  (386+ only)
  2629.     Modifies flags: None
  2630.  
  2631.  
  2632.     Copies data from addressed by DS:SI (even if operands are given) to
  2633.     the location ES:DI destination and updates SI and DI based on the
  2634.     size of the operand or instruction used.  SI and DI are incremented
  2635.     when the Direction Flag is cleared and decremented when the Direction
  2636.     Flag is Set.  Use with ~REP~ prefixes.
  2637.  
  2638.  
  2639. %                 Clocks            Size
  2640. %    Operands     808x  286   386   486        Bytes
  2641.  
  2642.     dest,src      18    5     7        7          1   (W88=26)
  2643.  
  2644.  
  2645.     - see ~Instruction Timing~
  2646.  
  2647. :movsx
  2648. ^MOVSX - Move with Sign Extend    (386+ only)
  2649.  
  2650.  
  2651.     Usage:    MOVSX    dest,src
  2652.     Modifies flags: None
  2653.  
  2654.  
  2655.     Copies the value of the source operand to the destination register
  2656.     with the sign extended.
  2657.  
  2658.  
  2659. %                 Clocks            Size
  2660. %    Operands     808x  286   386   486        Bytes
  2661.  
  2662.     reg,reg       -    -     3        3          3
  2663.     reg,mem       -    -     6        3         3-7
  2664.  
  2665.  
  2666.     - see ~Instruction Timing~
  2667.  
  2668. :movzx
  2669. ^MOVZX - Move with Zero Extend    (386+ only)
  2670.  
  2671.  
  2672.     Usage:    MOVZX    dest,src
  2673.     Modifies flags: None
  2674.  
  2675.  
  2676.     Copies the value of the source operand to the destination register
  2677.     with the zeroes extended.
  2678.  
  2679.  
  2680. %                 Clocks            Size
  2681. %    Operands     808x  286   386   486        Bytes
  2682.  
  2683.     reg,reg       -    -     3        3          3
  2684.     reg,mem       -    -     6        3         3-7
  2685.  
  2686.  
  2687.     - see ~Instruction Timing~
  2688.  
  2689. :mul
  2690. ^MUL - Unsigned Multiply
  2691.  
  2692.     Usage:    MUL    src
  2693.     Modifies flags: CF OF (AF,PF,SF,ZF undefined)
  2694.  
  2695.     Unsigned multiply of the accumulator by the source.  If "src" is
  2696.     a byte value, then AL is used as the other multiplicand and the
  2697.     result is placed in AX.  If "src" is a word value, then AX is
  2698.     multiplied by "src" and DX:AX receives the result.  If "src" is
  2699.     a double word value, then EAX is multiplied by "src" and EDX:EAX
  2700.     receives the result.  The 386+ uses an early out algorithm which
  2701.     makes multiplying any size value in EAX as fast as in the 8 or 16
  2702.     bit registers.
  2703.  
  2704. %                 Clocks            Size
  2705. %    Operands     808x  286   386   486        Bytes
  2706.  
  2707.     reg8        70-77    13   9-14  13-18      2
  2708.     reg16           118-113    21   9-22  13-26      2
  2709.     reg32          -    -    9-38  13-42     2-4
  2710.     mem8        (76-83)+EA    16  12-17  13-18     2-4
  2711.     mem16      (124-139)+EA    24  12-25  13-26     2-4
  2712.     mem32          -    -   12-21  13-42     2-4
  2713.  
  2714.  
  2715.     - see ~Instruction Timing~   ~IMUL~
  2716.  
  2717. :neg
  2718. ^NEG - Two's Complement Negation
  2719.  
  2720.  
  2721.     Usage:    NEG    dest
  2722.     Modifies flags: AF CF OF PF SF ZF
  2723.  
  2724.  
  2725.     Subtracts the destination from 0 and saves the 2s complement of
  2726.     "dest" back into "dest".
  2727.  
  2728.  
  2729. %                 Clocks            Size
  2730. %    Operands     808x  286   386   486        Bytes
  2731.  
  2732.     reg          3    2     2        1          2
  2733.     mem        16+EA    7     6        3         2-4  (W88=24+EA)
  2734.  
  2735.  
  2736.     - see ~Instruction Timing~
  2737.  
  2738. :nop
  2739. ^NOP - No Operation (90h)
  2740.  
  2741.  
  2742.     Usage:    NOP
  2743.     Modifies flags: None
  2744.  
  2745.  
  2746.     This is a do nothing instruction.  It results in occupation of both
  2747.     space and time and is most useful for patching code segments.
  2748.  
  2749.  
  2750. %                 Clocks            Size
  2751. %    Operands     808x  286   386   486        Bytes
  2752.  
  2753.     none          3    3     3        1          1
  2754.  
  2755.  
  2756.     - see ~Instruction Timing~
  2757.  
  2758. :not
  2759. ^NOT - One's Compliment Negation (Logical NOT)
  2760.  
  2761.  
  2762.     Usage:    NOT    dest
  2763.     Modifies flags: None
  2764.  
  2765.     Inverts the bits of the "dest" operand forming the 1s complement.
  2766.  
  2767.  
  2768. %                 Clocks            Size
  2769. %    Operands     808x  286   386   486        Bytes
  2770.  
  2771.     reg          3    2     2        1          2
  2772.     mem        16+EA    7     6        3         2-4  (W88=24+EA)
  2773.  
  2774.  
  2775.     - see ~Instruction Timing~
  2776.  
  2777. :or
  2778. ^OR - Inclusive Logical OR
  2779.  
  2780.     Usage:    OR    dest,src
  2781.     Modifies flags: CF OF PF SF ZF (AF undefined)
  2782.  
  2783.     Logical inclusive OR of the two operands returning the result in
  2784.     the destination.  Any bit set in either operand will be set in the
  2785.     destination.
  2786.  
  2787. %                 Clocks            Size
  2788. %    Operands     808x  286   386   486        Bytes
  2789.  
  2790.     reg,reg       3    2     2        1          2
  2791.     mem,reg     16+EA    7     7        3         2-4  (W88=24+EA)
  2792.     reg,mem      9+EA    7     6        2         2-4  (W88=13+EA)
  2793.     reg,immed      4    3     2        1         3-4
  2794.     mem8,immed8    17+EA    7     7        3         3-6
  2795.     mem16,immed16    25+EA    7     7        3         3-6
  2796.     accum,immed      4    3     2        1         2-3
  2797.  
  2798.  
  2799.     - see ~Instruction Timing~
  2800.  
  2801. :out
  2802. ^OUT - Output Data to Port
  2803.  
  2804.  
  2805.     Usage:    OUT    port,accum
  2806.     Modifies flags: None
  2807.  
  2808.     Transfers byte in AL,word in AX or dword in EAX to the specified
  2809.     hardware port address.  If the port number is in the range of 0-255
  2810.     it can be specified as an immediate.  If greater than 255 then the
  2811.     port number must be specified in DX.  Since the PC only decodes 10
  2812.     bits of the port address, values over 1023 can only be decoded by
  2813.     third party vendor equipment and also map to the port range 0-1023.
  2814.  
  2815.  
  2816. %                 Clocks            Size
  2817. %    Operands     808x  286   386    486        Bytes
  2818.  
  2819.     immed8,accum    10/14    3     10     16          2
  2820.     immed8,accum (PM) -        -    4/24 11/31/29      2
  2821.     DX,accum     8/12    3     11     16          1
  2822.     DX,accum (PM)      -        -    5/25 10/30/29      1
  2823.  
  2824.  
  2825.     - 386+ protected mode timings depend on privilege levels.
  2826.  
  2827.       first number is the timing when:    CPL ≤ IOPL
  2828.       second number is the timing when:   CPL > IOPL
  2829.       third number is the timing when:    virtual mode on 486 processor
  2830.  
  2831.     - see ~Instruction Timing~
  2832.  
  2833. :outs:outsb:outsw:outsd
  2834. ^OUTS - Output String to Port  (80188+ only)
  2835.  
  2836.  
  2837.     Usage:    OUTS    port,src
  2838.         OUTSB
  2839.         OUTSW
  2840.         OUTSD  (386+ only)
  2841.     Modifies flags: None
  2842.  
  2843.  
  2844.     Transfers a byte, word or doubleword from "src" to the hardware
  2845.     port specified in DX.  For instructions with no operands the "src"
  2846.     is located at DS:SI and SI is incremented or decremented by the
  2847.     size of the operand or the size dictated by the instruction format.
  2848.     When the Direction Flag is set SI is decremented, when clear, SI is
  2849.     incremented.  If the port number is in the range of 0-255 it can
  2850.     be specified as an immediate.  If greater than 255 then the port
  2851.     number must be specified in DX.  Since the PC only decodes 10 bits
  2852.     of the port address, values over 1023 can only be decoded by third
  2853.     party vendor equipment and also map to the port range 0-1023.
  2854.  
  2855.  
  2856. %                 Clocks            Size
  2857. %    Operands     808x  286   386    486        Bytes
  2858.  
  2859.     port,src      -    5     14     17          1
  2860.     port,src (PM)      -    -    8/28 10/32/30      1
  2861.  
  2862.  
  2863.     - 386+ protected mode timings depend on privilege levels.
  2864.  
  2865.       first number is the timing when:    CPL ≤ IOPL
  2866.       second number is the timing when:   CPL > IOPL
  2867.       third number is the timing when:    virtual mode on 486 processor
  2868.  
  2869.     - see ~Instruction Timing~
  2870.  
  2871. :pop
  2872. ^POP - Pop Word off Stack
  2873.  
  2874.  
  2875.     Usage:    POP    dest
  2876.     Modifies flags: None
  2877.  
  2878.  
  2879.     Transfers word at the current stack top (SS:SP) to the destination
  2880.     then increments SP by two to point to the new stack top.  CS is not
  2881.     a valid destination.
  2882.  
  2883.  
  2884. %                 Clocks            Size
  2885. %    Operands     808x  286   386   486        Bytes
  2886.  
  2887.     reg16          8    5     4     4          1
  2888.     reg32          4    -     -        4          1
  2889.     segreg          8    5     7        3          1
  2890.     mem16        17+EA    5     5     6         2-4
  2891.     mem32          5    -     -        6         2-4
  2892.  
  2893.  
  2894.     - see ~Instruction Timing~
  2895.  
  2896. :popa:popad
  2897. ^POPA/POPAD - Pop All Registers onto Stack  (80188+ only)
  2898.  
  2899.  
  2900.     Usage:    POPA
  2901.         POPAD  (386+ only)
  2902.     Modifies flags: None
  2903.  
  2904.  
  2905.     Pops the top 8 words off the stack into the 8 general purpose 16/32
  2906.     bit registers.     Registers are popped in the following order: (E)DI,
  2907.     (E)SI, (E)BP, (E)SP, (E)DX, (E)CX and (E)AX.  The (E)SP value popped
  2908.     from the stack is actually discarded.
  2909.  
  2910.  
  2911. %                 Clocks            Size
  2912. %    Operands     808x  286   386   486        Bytes
  2913.  
  2914.     none          -    19    24    9          1
  2915.  
  2916.  
  2917.     - see ~Instruction Timing~
  2918.  
  2919. :popf:popfd
  2920. ^POPF/POPFD - Pop Flags off Stack
  2921.  
  2922.  
  2923.     Usage:    POPF
  2924.         POPFD  (386+ only)
  2925.     Modifies flags: all flags
  2926.  
  2927.  
  2928.     Pops word/doubleword from stack into the Flags Register and then
  2929.     increments SP by 2 (for POPF) or 4 (for POPFD).
  2930.  
  2931.  
  2932. %                 Clocks            Size
  2933. %    Operands     808x  286   386   486        Bytes
  2934.  
  2935.     none         8/12    5     5        9          1  (W88=12)
  2936.     none  (PM)      -    -     5     6          1
  2937.  
  2938.  
  2939.     - see ~Instruction Timing~
  2940.  
  2941. :push
  2942. ^PUSH - Push Word onto Stack
  2943.  
  2944.     Usage:    PUSH    src
  2945.         PUSH    immed    (80188+ only)
  2946.     Modifies flags: None
  2947.  
  2948.  
  2949.     Decrements SP by the size of the operand (two or four, byte values
  2950.     are sign extended) and transfers one word from source to the stack
  2951.     top (SS:SP).
  2952.  
  2953. %                 Clocks            Size
  2954. %    Operands     808x  286   386   486        Bytes
  2955.  
  2956.     reg16         11/15    3     2     1          1
  2957.     reg32           -    -     2     1          1
  2958.     mem16        16+EA    5     5     4          2-4  (W88=24+EA)
  2959.     mem32             -    -     5     4         2-4
  2960.     segreg        10/14    3     2     3          1
  2961.     immed          -    3     2     1         2-3
  2962.  
  2963.  
  2964.     - see ~Instruction Timing~
  2965.  
  2966. :pusha:pushad
  2967. ^PUSHA/PUSHAD - Push All Registers onto Stack  (80188+ only)
  2968.  
  2969.  
  2970.     Usage:    PUSHA
  2971.         PUSHAD    (386+ only)
  2972.     Modifies flags: None
  2973.  
  2974.  
  2975.     Pushes all general purpose registers onto the stack in the following
  2976.     order: (E)AX, (E)CX, (E)DX, (E)BX, (E)SP, (E)BP, (E)SI, (E)DI.    The
  2977.     value of SP is the value before the actual push of SP.
  2978.  
  2979.  
  2980. %                 Clocks            Size
  2981. %    Operands     808x  286   386   486        Bytes
  2982.  
  2983.     none          -    19    24    11          1
  2984.  
  2985.  
  2986.     - see ~Instruction Timing~
  2987.  
  2988. :pushf:pushfd
  2989. ^PUSHF/PUSHFD - Push Flags onto Stack
  2990.  
  2991.  
  2992.     Usage:    PUSHF
  2993.         PUSHFD    (386+ only)
  2994.     Modifies flags: None
  2995.  
  2996.  
  2997.     Transfers the Flags Register onto the stack.  PUSHF saves a 16 bit
  2998.     value while PUSHFD saves a 32 bit value.
  2999.  
  3000.  
  3001. %                 Clocks            Size
  3002. %    Operands     808x  286   386   486        Bytes
  3003.  
  3004.     none        10/14    3     4        4          1
  3005.     none  (PM)      -    -     4        3          1
  3006.  
  3007.  
  3008.     - see ~Instruction Timing~
  3009.  
  3010. :rcl
  3011. ^RCL - Rotate Through Carry Left
  3012.  
  3013.     Usage:    RCL    dest,count
  3014.     Modifies flags: CF OF
  3015.  
  3016.  
  3017.     Rotates the bits in the destination to the left "count" times with
  3018.     all data pushed out the left side re-entering on the right.  The
  3019.     Carry Flag holds the last bit rotated out.
  3020.  
  3021. %                 Clocks            Size
  3022. %    Operands     808x  286   386   486        Bytes
  3023.  
  3024.     reg,1          2    2     9        3         2
  3025.     mem,1        15+EA    7     10    4        2-4  (W88=23+EA)
  3026.     reg,CL         8+4n  5+n    9       8-30         2
  3027.     mem,CL          20+EA+4n 8+n    10   9-31        2-4  (W88=28+EA+4n)
  3028.     reg,immed8      -    5+n     9   8-30         3
  3029.     mem,immed8      -    8+n    10   9-31        3-5
  3030.  
  3031.  
  3032.     - see ~Instruction Timing~
  3033.  
  3034. :rcr
  3035. ^RCR - Rotate Through Carry Right
  3036.  
  3037.     Usage:    RCR    dest,count
  3038.     Modifies flags: CF OF
  3039.  
  3040.  
  3041.     Rotates the bits in the destination to the right "count" times with
  3042.     all data pushed out the right side re-entering on the left.  The
  3043.     Carry Flag holds the last bit rotated out.
  3044.  
  3045. %                 Clocks            Size
  3046. %    Operands     808x  286   386   486        Bytes
  3047.  
  3048.     reg,1          2    2     9        3         2
  3049.     mem,1        15+EA    7     10    4        2-4   (W88=23+EA)
  3050.     reg,CL         8+4n  5+n    9       8-30         2
  3051.     mem,CL          20+EA+4n 8+n    10   9-31        2-4   (W88=28+EA+4n)
  3052.     reg,immed8      -    5+n    9       8-30         3
  3053.     mem,immed8      -    8+n    10   9-31        3-5
  3054.  
  3055.  
  3056.     - see ~Instruction Timing~
  3057.  
  3058. :rep
  3059. ^REP - Repeat String Operation
  3060.  
  3061.     Usage:    REP
  3062.     Modifies flags: None
  3063.  
  3064.     Repeats execution of string instructions while CX != 0.  After
  3065.     each string operation, CX is decremented and the Zero Flag is
  3066.     tested.  The combination of a repeat prefix and a segment override
  3067.     on CPU's before the 386 may result in errors if an interrupt occurs
  3068.     before CX=0.  The following code shows code that is susceptible to
  3069.     this and how to avoid it:
  3070.  
  3071.      again:  rep movs  byte ptr ES:[DI],ES:[SI]   ; vulnerable instr.
  3072.              jcxz  next          ; continue if REP successful
  3073.              loop  again         ; interrupt goofed count
  3074.      next:
  3075.  
  3076. %                 Clocks            Size
  3077. %    Operands     808x  286   386   486        Bytes
  3078.  
  3079.     none          2    2     2              1
  3080.  
  3081.  
  3082.     - see ~Instruction Timing~   ~REPE~   ~REPNE~
  3083. :repe:repz
  3084. ^REPE/REPZ - Repeat Equal / Repeat Zero
  3085.  
  3086.  
  3087.     Usage:    REPE
  3088.         REPZ
  3089.     Modifies flags: None
  3090.  
  3091.  
  3092.     Repeats execution of string instructions while CX != 0 and the Zero
  3093.     Flag is set.  CX is decremented and the Zero Flag tested after
  3094.     each string operation.     The combination of a repeat prefix and a
  3095.     segment override on processors other than the 386 may result in
  3096.     errors if an interrupt occurs before CX=0.
  3097.  
  3098.  
  3099. %                 Clocks            Size
  3100. %    Operands     808x  286   386   486        Bytes
  3101.  
  3102.     none          2    2     2              1
  3103.  
  3104.  
  3105.     - see ~Instruction Timing~
  3106.  
  3107. :repne:repnz
  3108. ^REPNE/REPNZ - Repeat Not Equal / Repeat Not Zero
  3109.  
  3110.  
  3111.     Usage:    REPNE
  3112.         REPNZ
  3113.     Modifies flags: None
  3114.  
  3115.  
  3116.     Repeats execution of string instructions while CX != 0 and the Zero
  3117.     Flag is clear.     CX is decremented and the Zero Flag tested after
  3118.     each string operation.     The combination of a repeat prefix and a
  3119.     segment override on processors other than the 386 may result in
  3120.     errors if an interrupt occurs before CX=0.
  3121.  
  3122.  
  3123. %                 Clocks            Size
  3124. %    Operands     808x  286   386   486        Bytes
  3125.  
  3126.     none          2    2     2              1
  3127.  
  3128.  
  3129.     - see ~Instruction Timing~
  3130.  
  3131. :ret:retf:retn
  3132. ^RET/RETF - Return From Procedure
  3133.  
  3134.     Usage:    RET    nBytes
  3135.         RETF    nBytes
  3136.         RETN    nBytes
  3137.     Modifies flags: None
  3138.  
  3139.     Transfers control from a procedure back to the instruction address
  3140.     saved on the stack.  "n bytes" is an optional number of bytes to
  3141.     release.  Far returns pop the IP followed by the CS, while near
  3142.     returns pop only the IP register.
  3143.  
  3144. %                 Clocks            Size
  3145. %    Operands     808x  286    386   486        Bytes
  3146.  
  3147.     retn        16/20  11+m  10+m    5          1
  3148.     retn immed    20/24  11+m  10+m    5          3
  3149.     retf        26/34  15+m  18+m    13          1
  3150.     retf (PM, same priv.)    -    32+m    18          1
  3151.     retf (PM, lesser priv.)    -      68    33          1
  3152.           retf immed    25/33  15+m  18+m    14          3
  3153.     retf immed (PM, same priv.)  32+m    17          1
  3154.     retf immed (PM, lesser priv.)  68    33          1
  3155.  
  3156.  
  3157.     - see ~Instruction Timing~
  3158.  
  3159. :rol
  3160. ^ROL - Rotate Left
  3161.  
  3162.     Usage:    ROL    dest,count
  3163.     Modifies flags: CF OF
  3164.  
  3165.  
  3166.     Rotates the bits in the destination to the left "count" times with
  3167.     all data pushed out the left side re-entering on the right.  The
  3168.     Carry Flag will contain the value of the last bit rotated out.
  3169.  
  3170. %                 Clocks            Size
  3171. %    Operands     808x  286   386   486        Bytes
  3172.  
  3173.     reg,1          2    2     3        3          2
  3174.     mem,1        15+EA    7     7        4         2-4  (W88=23+EA)
  3175.     reg,CL         8+4n  5+n    3        3          2
  3176.     mem,CL          20+EA+4n 8+n    7        4         2-4  (W88=28+EA+4n)
  3177.     reg,immed8      -    5+n    3        2          3
  3178.     mem,immed8      -    8+n    7        4         3-5
  3179.  
  3180.  
  3181.     - see ~Instruction Timing~
  3182.  
  3183. :ror
  3184. ^ROR - Rotate Right
  3185.  
  3186.     Usage:    ROR    dest,count
  3187.     Modifies flags: CF OF
  3188.  
  3189.  
  3190.     Rotates the bits in the destination to the right "count" times with
  3191.     all data pushed out the right side re-entering on the left.  The
  3192.     Carry Flag will contain the value of the last bit rotated out.
  3193.  
  3194. %                 Clocks            Size
  3195. %    Operands     808x  286   386   486        Bytes
  3196.  
  3197.     reg,1          2    2     3        3          2
  3198.     mem,1        15+EA    7     7        4         2-4  (W88=23+EA)
  3199.     reg,CL         8+4n  5+n    3        3          2
  3200.     mem,CL          20+EA+4n 8+n    7        4         2-4  (W88=28+EA+4n)
  3201.     reg,immed8      -    5+n    3        2          3
  3202.     mem,immed8      -    8+n    7        4         3-5
  3203.  
  3204.  
  3205.     - see ~Instruction Timing~
  3206.  
  3207. :sahf
  3208. ^SAHF - Store AH Register into FLAGS
  3209.  
  3210.  
  3211.     Usage:    SAHF
  3212.     Modifies flags: AF CF PF SF ZF
  3213.  
  3214.  
  3215.     Transfers bits 0-7 of AH into the Flags Register.  This includes
  3216.     AF, CF, PF, SF and ZF.
  3217.  
  3218.  
  3219. %                 Clocks            Size
  3220. %    Operands     808x  286   386   486        Bytes
  3221.  
  3222.     none          4    2     3        2          1
  3223.  
  3224.  
  3225.     - see ~Instruction Timing~
  3226.  
  3227. :sal:shl
  3228. ^SAL/SHL - Shift Arithmetic Left / Shift Logical Left
  3229.  
  3230.     Usage:    SAL    dest,count
  3231.         SHL    dest,count
  3232.     Modifies flags: CF OF PF SF ZF (AF undefined)
  3233.  
  3234.  
  3235.     Shifts the destination left by "count" bits with zeroes shifted
  3236.     in on right.  The Carry Flag contains the last bit shifted out.
  3237.  
  3238. %                 Clocks            Size
  3239. %    Operands     808x  286   386   486        Bytes
  3240.  
  3241.     reg,1          2    2     3        3         2
  3242.     mem,1        15+EA    7     7        4        2-4  (W88=23+EA)
  3243.     reg,CL         8+4n  5+n    3        3         2
  3244.     mem,CL          20+EA+4n 8+n    7        4        2-4  (W88=28+EA+4n)
  3245.     reg,immed8      -    5+n    3        2         3
  3246.     mem,immed8      -    8+n    7        4        3-5
  3247.  
  3248.  
  3249.     - see ~Instruction Timing~
  3250.  
  3251. :sar
  3252. ^SAR - Shift Arithmetic Right
  3253.  
  3254.     Usage:    SAR    dest,count
  3255.     Modifies flags: CF OF PF SF ZF (AF undefined)
  3256.  
  3257.  
  3258.     Shifts the destination right by "count" bits with the current sign
  3259.     bit replicated in the leftmost bit.  The Carry Flag contains the
  3260.     last bit shifted out.
  3261.  
  3262. %                 Clocks            Size
  3263. %    Operands     808x  286   386   486        Bytes
  3264.  
  3265.     reg,1          2    2     3        3          2
  3266.     mem,1        15+EA    7     7        4         2-4  (W88=23+EA)
  3267.     reg,CL         8+4n  5+n    3        3          2
  3268.     mem,CL          20+EA+4n 8+n    7        4         2-4  (W88=28+EA+4n)
  3269.     reg,immed8      -    5+n    3        2          3
  3270.     mem,immed8      -    8+n    7        4         3-5
  3271.  
  3272.  
  3273.     - see ~Instruction Timing~
  3274.  
  3275. :sbb
  3276. ^SBB - Subtract with Borrow
  3277.  
  3278.     Usage:    SBB    dest,src
  3279.     Modifies flags: AF CF OF PF SF ZF
  3280.  
  3281.  
  3282.     Subtracts the source from the destination, and subtracts 1 extra if
  3283.     the Carry Flag is set.     Results are returned in "dest".
  3284.  
  3285.  
  3286. %                 Clocks            Size
  3287. %    Operands     808x  286   386   486        Bytes
  3288.  
  3289.     reg,reg       3    2     2        1          2
  3290.     mem,reg     16+EA    7     6        3         2-4  (W88=24+EA)
  3291.     reg,mem      9+EA    7     7        2         2-4  (W88=13+EA)
  3292.     reg,immed      4    3     2        1         3-4
  3293.     mem,immed    17+EA    7     7        3         3-6  (W88=25+EA)
  3294.     accum,immed      4    3     2        1         2-3
  3295.  
  3296.  
  3297.     - see ~Instruction Timing~
  3298.  
  3299. :scas:scasb:scasw:scasd
  3300. ^SCAS - Scan String  (Byte, Word or Doubleword)
  3301.  
  3302.  
  3303.     Usage:    SCAS    string
  3304.         SCASB
  3305.         SCASW
  3306.         SCASD    (386+ only)
  3307.     Modifies flags: AF CF OF PF SF ZF
  3308.  
  3309.  
  3310.     Compares value at ES:DI (even if operand is specified) from the
  3311.     accumulator and sets the flags similar to a subtraction.  DI is
  3312.     incremented/decremented based on the instruction format (or
  3313.     operand size) and the state of the Direction Flag.  Use with REP
  3314.     prefixes.
  3315.  
  3316. %                 Clocks            Size
  3317. %    Operands     808x  286   386   486        Bytes
  3318.  
  3319.     string          15    7     7        6          1  (W88=19)
  3320.  
  3321.  
  3322.     - see ~Instruction Timing~
  3323.  
  3324. :setae:setnb
  3325. ^SETAE/SETNB - Set if Above or Equal / Set if Not Below
  3326. ^(unsigned, 386+ only)
  3327.  
  3328.  
  3329.     Usage:    SETAE    dest
  3330.         SETNB    dest
  3331.     Modifies flags: none
  3332.  
  3333.  
  3334.     Sets the byte in the operand to 1 if the Carry Flag is clear
  3335.     otherwise sets the operand to 0.
  3336.  
  3337.  
  3338. %                 Clocks            Size
  3339. %    Operands     808x  286   386   486        Bytes
  3340.  
  3341.     reg8          -    -     4        3          3
  3342.     mem8          -    -     5        4          3
  3343.  
  3344.  
  3345.     - see ~Instruction Timing~
  3346.  
  3347. :setb:setnae
  3348. ^SETB/SETNAE - Set if Below / Set if Not Above or Equal
  3349. ^(unsigned, 386+ only)
  3350.  
  3351.  
  3352.     Usage:    SETB    dest
  3353.         SETNAE    dest
  3354.     Modifies flags: none
  3355.  
  3356.  
  3357.     Sets the byte in the operand to 1 if the Carry Flag is set
  3358.     otherwise sets the operand to 0.
  3359.  
  3360.  
  3361. %                 Clocks            Size
  3362. %    Operands     808x  286   386   486        Bytes
  3363.  
  3364.     reg8          -    -     4        3          3
  3365.     mem8          -    -     5        4          3
  3366.  
  3367.  
  3368.     - see ~Instruction Timing~
  3369.  
  3370. :setbe:setna
  3371. ^SETBE/SETNA - Set if Below or Equal / Set if Not Above
  3372. ^(unsigned, 386+ only)
  3373.  
  3374.  
  3375.     Usage:    SETBE    dest
  3376.         SETNA    dest
  3377.     Modifies flags: none
  3378.  
  3379.  
  3380.     Sets the byte in the operand to 1 if the Carry Flag or the Zero
  3381.     Flag is set, otherwise sets the operand to 0.
  3382.  
  3383.  
  3384. %                 Clocks            Size
  3385. %    Operands     808x  286   386   486        Bytes
  3386.  
  3387.     reg8          -    -     4        3          3
  3388.     mem8          -    -     5        4          3
  3389.  
  3390.  
  3391.     - see ~Instruction Timing~
  3392.  
  3393. :sete:setz
  3394. ^SETE/SETZ - Set if Equal / Set if Zero (386+ only)
  3395.  
  3396.  
  3397.     Usage:    SETE    dest
  3398.         SETZ    dest
  3399.     Modifies flags: none
  3400.  
  3401.  
  3402.     Sets the byte in the operand to 1 if the Zero Flag is set,
  3403.     otherwise sets the operand to 0.
  3404.  
  3405.  
  3406. %                 Clocks            Size
  3407. %    Operands     808x  286   386   486        Bytes
  3408.  
  3409.     reg8          -    -     4        3          3
  3410.     mem8          -    -     5        4          3
  3411.  
  3412.  
  3413.     - see ~Instruction Timing~
  3414.  
  3415. :setne:setnz
  3416. ^SETNE/SETNZ - Set if Not Equal / Set if Not Zero (386+ only)
  3417.  
  3418.  
  3419.     Usage:    SETNE    dest
  3420.         SETNZ    dest
  3421.     Modifies flags: none
  3422.  
  3423.  
  3424.     Sets the byte in the operand to 1 if the Zero Flag is clear,
  3425.     otherwise sets the operand to 0.
  3426.  
  3427.  
  3428. %                 Clocks            Size
  3429. %    Operands     808x  286   386   486        Bytes
  3430.  
  3431.     reg8          -    -     4        3          3
  3432.     mem8          -    -     5        4          3
  3433.  
  3434.  
  3435.     - see ~Instruction Timing~
  3436.  
  3437. :setl:setnge
  3438. ^SETL/SETNGE - Set if Less / Set if Not Greater or Equal
  3439. ^(signed, 386+ only)
  3440.  
  3441.  
  3442.     Usage:    SETL    dest
  3443.         SETNGE    dest
  3444.     Modifies flags: none
  3445.  
  3446.  
  3447.     Sets the byte in the operand to 1 if the Sign Flag is not equal
  3448.     to the Overflow Flag, otherwise sets the operand to 0.
  3449.  
  3450.  
  3451. %                 Clocks            Size
  3452. %    Operands     808x  286   386   486        Bytes
  3453.  
  3454.     reg8          -    -     4        3          3
  3455.     mem8          -    -     5        4          3
  3456.  
  3457.  
  3458.     - see ~Instruction Timing~
  3459.  
  3460. :setge:setnl
  3461. ^SETGE/SETNL - Set if Greater or Equal / Set if Not Less
  3462. ^(signed, 386+ only)
  3463.  
  3464.  
  3465.     Usage:    SETGE    dest
  3466.         SETNL    dest
  3467.     Modifies flags: none
  3468.  
  3469.  
  3470.     Sets the byte in the operand to 1 if the Sign Flag equals the
  3471.     Overflow Flag, otherwise sets the operand to 0.
  3472.  
  3473.  
  3474. %                 Clocks            Size
  3475. %    Operands     808x  286   386   486        Bytes
  3476.  
  3477.     reg8          -    -     4        3          3
  3478.     mem8          -    -     5        4          3
  3479.  
  3480.  
  3481.     - see ~Instruction Timing~
  3482.  
  3483. :setle:setng
  3484. ^SETLE/SETNG - Set if Less or Equal / Set if Not greater or Equal
  3485. ^(signed, 386+ only)
  3486.  
  3487.  
  3488.     Usage:    SETLE    dest
  3489.         SETNG    dest
  3490.     Modifies flags: none
  3491.  
  3492.  
  3493.     Sets the byte in the operand to 1 if the Zero Flag is set or the
  3494.     Sign Flag is not equal to the Overflow Flag,  otherwise sets the
  3495.     operand to 0.
  3496.  
  3497.  
  3498. %                 Clocks            Size
  3499. %    Operands     808x  286   386   486        Bytes
  3500.  
  3501.     reg8          -    -     4        3          3
  3502.     mem8          -    -     5        4          3
  3503.  
  3504.  
  3505.     - see ~Instruction Timing~
  3506.  
  3507. :setg:setnle
  3508. ^SETG/SETNLE - Set if Greater / Set if Not Less or Equal
  3509. ^(signed, 386+ only)
  3510.  
  3511.  
  3512.     Usage:    SETG    dest
  3513.         SETNLE    dest
  3514.     Modifies flags: none
  3515.  
  3516.  
  3517.     Sets the byte in the operand to 1 if the Zero Flag is clear or the
  3518.     Sign Flag equals to the Overflow Flag,    otherwise sets the operand
  3519.     to 0.
  3520.  
  3521.  
  3522. %                 Clocks            Size
  3523. %    Operands     808x  286   386   486        Bytes
  3524.  
  3525.     reg8          -    -     4        3          3
  3526.     mem8          -    -     5        4          3
  3527.  
  3528.  
  3529.     - see ~Instruction Timing~
  3530.  
  3531. :sets
  3532. ^SETS - Set if Signed (386+ only)
  3533.  
  3534.  
  3535.     Usage:    SETS    dest
  3536.     Modifies flags: none
  3537.  
  3538.  
  3539.     Sets the byte in the operand to 1 if the Sign Flag is set, otherwise
  3540.     sets the operand to 0.
  3541.  
  3542.  
  3543. %                 Clocks            Size
  3544. %    Operands     808x  286   386   486        Bytes
  3545.  
  3546.     reg8          -    -     4        3          3
  3547.     mem8          -    -     5        4          3
  3548.  
  3549.  
  3550.     - see ~Instruction Timing~
  3551.  
  3552. :setns
  3553. ^SETNS - Set if Not Signed (386+ only)
  3554.  
  3555.  
  3556.     Usage:    SETNS    dest
  3557.     Modifies flags: none
  3558.  
  3559.  
  3560.     Sets the byte in the operand to 1 if the Sign Flag is clear,
  3561.     otherwise sets the operand to 0.
  3562.  
  3563.  
  3564. %                 Clocks            Size
  3565. %    Operands     808x  286   386   486        Bytes
  3566.  
  3567.     reg8          -    -     4        3          3
  3568.     mem8          -    -     5        4          3
  3569.  
  3570.  
  3571.     - see ~Instruction Timing~
  3572.  
  3573. :setc
  3574. ^SETC - Set if Carry (386+ only)
  3575.  
  3576.  
  3577.     Usage:    SETC    dest
  3578.     Modifies flags: none
  3579.  
  3580.  
  3581.     Sets the byte in the operand to 1 if the Carry Flag is set,
  3582.     otherwise sets the operand to 0.
  3583.  
  3584.  
  3585. %                 Clocks            Size
  3586. %    Operands     808x  286   386   486        Bytes
  3587.  
  3588.     reg8          -    -     4        3          3
  3589.     mem8          -    -     5        4          3
  3590.  
  3591.  
  3592.     - see ~Instruction Timing~
  3593.  
  3594. :setnc
  3595. ^SETNC - Set if Not Carry (386+ only)
  3596.  
  3597.  
  3598.     Usage:    SETNC    dest
  3599.     Modifies flags: none
  3600.  
  3601.  
  3602.     Sets the byte in the operand to 1 if the Carry Flag is clear,
  3603.     otherwise sets the operand to 0.
  3604.  
  3605.  
  3606. %                 Clocks            Size
  3607. %    Operands     808x  286   386   486        Bytes
  3608.  
  3609.     reg8          -    -     4        3          3
  3610.     mem8          -    -     5        4          3
  3611.  
  3612.  
  3613.     - see ~Instruction Timing~
  3614.  
  3615. :seto
  3616. ^SETO - Set if Overflow (386+ only)
  3617.  
  3618.  
  3619.     Usage:    SETO    dest
  3620.     Modifies flags: none
  3621.  
  3622.  
  3623.     Sets the byte in the operand to 1 if the Overflow Flag is set,
  3624.     otherwise sets the operand to 0.
  3625.  
  3626.  
  3627. %                 Clocks            Size
  3628. %    Operands     808x  286   386   486        Bytes
  3629.  
  3630.     reg8          -    -     4        3          3
  3631.     mem8          -    -     5        4          3
  3632.  
  3633.  
  3634.     - see ~Instruction Timing~
  3635.  
  3636. :setno
  3637. ^SETNO - Set if Not Overflow (386+ only)
  3638.  
  3639.  
  3640.     Usage:    SETNO    dest
  3641.     Modifies flags: none
  3642.  
  3643.  
  3644.     Sets the byte in the operand to 1 if the Overflow Flag is clear,
  3645.     otherwise sets the operand to 0.
  3646.  
  3647.  
  3648. %                 Clocks            Size
  3649. %    Operands     808x  286   386   486        Bytes
  3650.  
  3651.     reg8          -    -     4        3          3
  3652.     mem8          -    -     5        4          3
  3653.  
  3654.  
  3655.     - see ~Instruction Timing~
  3656.  
  3657. :setp:setpe
  3658. ^SETP/SETPE - Set if Parity / Set if Parity Even  (386+ only)
  3659.  
  3660.  
  3661.     Usage:    SETP    dest
  3662.         SETPE    dest
  3663.     Modifies flags: none
  3664.  
  3665.  
  3666.     Sets the byte in the operand to 1 if the Parity Flag is set,
  3667.     otherwise sets the operand to 0.
  3668.  
  3669.  
  3670. %                 Clocks            Size
  3671. %    Operands     808x  286   386   486        Bytes
  3672.  
  3673.     reg8          -    -     4        3          3
  3674.     mem8          -    -     5        4          3
  3675.  
  3676.  
  3677.     - see ~Instruction Timing~
  3678.  
  3679. :setnp:setpo
  3680. ^SETNP/SETPO - Set if No Parity / Set if Parity Odd (386+ only)
  3681.  
  3682.  
  3683.     Usage:    SETNP    dest
  3684.         SETPO    dest
  3685.     Modifies flags: none
  3686.  
  3687.  
  3688.     Sets the byte in the operand to 1 if the Parity Flag is clear,
  3689.     otherwise sets the operand to 0.
  3690.  
  3691.  
  3692. %                 Clocks            Size
  3693. %    Operands     808x  286   386   486        Bytes
  3694.  
  3695.     reg8          -    -     4        3          3
  3696.     mem8          -    -     5        4          3
  3697.  
  3698.  
  3699.     - see ~Instruction Timing~
  3700.  
  3701. :sgdt
  3702. ^SGDT - Store Global Descriptor Table (286+ privileged)
  3703.  
  3704.  
  3705.     Usage:    SGDT    dest
  3706.     Modifies flags: none
  3707.  
  3708.  
  3709.     Stores the Global Descriptor Table (~GDT~) Register into the
  3710.     specified operand.
  3711.  
  3712.  
  3713. %                 Clocks            Size
  3714. %    Operands     808x  286   386   486        Bytes
  3715.  
  3716.     mem64          -    11    9        10          5
  3717.  
  3718.  
  3719.     - see ~Instruction Timing~
  3720.  
  3721. :sidt
  3722. ^SIDT - Store Interrupt Descriptor Table (286+ privileged)
  3723.  
  3724.  
  3725.     Usage:    SIDT    dest
  3726.     Modifies flags: none
  3727.  
  3728.  
  3729.     Stores the Interrupt Descriptor Table (IDT) Register into the
  3730.     specified operand.
  3731.  
  3732.  
  3733. %                 Clocks            Size
  3734. %    Operands     808x  286   386   486        Bytes
  3735.  
  3736.     mem64          -    12    9        10          5
  3737.  
  3738.  
  3739.     - see ~Instruction Timing~
  3740.  
  3741. :shr
  3742. ^SHR - Shift Logical Right
  3743.  
  3744.     Usage:    SHR    dest,count
  3745.     Modifies flags: CF OF PF SF ZF (AF undefined)
  3746.  
  3747.  
  3748.     Shifts the destination right by "count" bits with zeroes shifted
  3749.     in on the left.  The Carry Flag contains the last bit shifted out.
  3750.  
  3751.  
  3752. %                 Clocks            Size
  3753. %    Operands     808x  286   386   486        Bytes
  3754.  
  3755.     reg,1          2    2     3              2
  3756.     mem,1        15+EA    7     7             2-4   (W88=23+EA)
  3757.     reg,CL         8+4n  5+n    3              2
  3758.     mem,CL          20+EA+4n 8+n    7             2-4   (W88=28+EA+4n)
  3759.     reg,immed8      -    5+n    3              3
  3760.     mem,immed8      -    8+n    7             3-5
  3761.  
  3762.  
  3763.     - see ~Instruction Timing~
  3764.  
  3765. :shld:shrd
  3766. ^SHLD/SHRD - Double Precision Shift (386+ only)
  3767.  
  3768.  
  3769.     Usage:    SHLD    dest,src,count
  3770.         SHRD    dest,src,count
  3771.     Modifies flags: CF PF SF ZF (OF,AF undefined)
  3772.  
  3773.  
  3774.     SHLD shifts "dest" to the left "count" times and the bit positions
  3775.     opened are filled with the most significant bits of "src".  SHRD
  3776.     shifts "dest" to the right "count" times and the bit positions
  3777.     opened are filled with the least significant bits of the second
  3778.     operand.  Only the 5 lower bits of "count" are used.
  3779.  
  3780.  
  3781. %                    Clocks            Size
  3782. %    Operands         808x  286   386   486        Bytes
  3783.  
  3784.     reg16,reg16,immed8     -     -     3       2          4
  3785.     reg32,reg32,immed8     -     -     3       2          4
  3786.     mem16,reg16,immed8     -     -     7       3          6
  3787.     mem32,reg32,immed8     -     -     7       3          6
  3788.     reg16,reg16,CL         -     -     3       3          3
  3789.     reg32,reg32,CL         -     -     3       3          3
  3790.     mem16,reg16,CL         -     -     7       4          5
  3791.     mem32,reg32,CL         -     -     7       4          5
  3792.  
  3793.  
  3794.     - see ~Instruction Timing~
  3795.  
  3796. :sldt
  3797. ^SLDT - Store Local Descriptor Table (286+ privileged)
  3798.  
  3799.  
  3800.     Usage:    SLDT    dest
  3801.     Modifies flags: none
  3802.  
  3803.  
  3804.     Stores the Local Descriptor Table (LDT) Register into the
  3805.     specified operand.
  3806.  
  3807.  
  3808. %                 Clocks            Size
  3809. %    Operands     808x  286   386   486        Bytes
  3810.  
  3811.     reg16          -    2     2        2          3
  3812.     mem16          -    2     2        3          5
  3813.  
  3814.  
  3815.     - see ~Instruction Timing~
  3816.  
  3817. :smsw
  3818. ^SMSW - Store Machine Status Word (286+ privileged)
  3819.  
  3820.  
  3821.     Usage:    SMSW    dest
  3822.     Modifies flags: none
  3823.  
  3824.  
  3825.     Store Machine Status Word (~MSW~) into "dest".
  3826.  
  3827.  
  3828. %                 Clocks            Size
  3829. %    Operands     808x  286   386   486        Bytes
  3830.  
  3831.     reg16          -    2     10    2          3
  3832.     mem16          -    3     3        3          5
  3833.  
  3834.  
  3835.     - see ~Instruction Timing~
  3836.  
  3837. :stc
  3838. ^STC - Set Carry
  3839.  
  3840.  
  3841.     Usage:    STC
  3842.     Modifies flags: CF
  3843.  
  3844.  
  3845.     Sets the Carry Flag to 1.
  3846.  
  3847.  
  3848. %                 Clocks            Size
  3849. %    Operands     808x  286   386   486        Bytes
  3850.  
  3851.     none          2    2     2        2          1
  3852.  
  3853.  
  3854.     - see ~Instruction Timing~
  3855.  
  3856. :std
  3857. ^STD - Set Direction Flag
  3858.  
  3859.  
  3860.     Usage:    STD
  3861.     Modifies flags: DF
  3862.  
  3863.  
  3864.     Sets the Direction Flag to 1 causing string instructions to
  3865.     auto-decrement SI and DI instead of auto-increment.
  3866.  
  3867.  
  3868. %                 Clocks            Size
  3869. %    Operands     808x  286   386   486        Bytes
  3870.  
  3871.     none          2    2     2        2          1
  3872.  
  3873.  
  3874.     - see ~Instruction Timing~
  3875.  
  3876. :sti
  3877. ^STI - Set Interrupt Flag  (Enable Interrupts)
  3878.  
  3879.  
  3880.     Usage:    STI
  3881.     Modifies flags: IF
  3882.  
  3883.     Sets the Interrupt Flag to 1, which enables recognition of all
  3884.     hardware interrupts.  If an interrupt is generated by a    hardware
  3885.     device, an End of Interrupt (EOI) must also be issued to enable
  3886.     other hardware interrupts of the same or lower priority.
  3887.  
  3888.  
  3889. %                 Clocks            Size
  3890. %    Operands     808x  286   386   486        Bytes
  3891.  
  3892.     none          2    2     2        5          1
  3893.  
  3894.  
  3895.     - see ~Instruction Timing~
  3896. :stos:stosb:stosw:stosd
  3897. ^STOS - Store String  (Byte, Word or Doubleword)
  3898.  
  3899.  
  3900.     Usage:    STOS    dest
  3901.         STOSB
  3902.         STOSW
  3903.         STOSD
  3904.     Modifies flags: None
  3905.  
  3906.  
  3907.     Stores value in accumulator to location at ES:(E)DI (even if operand
  3908.     is given).  (E)DI is incremented/decremented based on the size of
  3909.     the operand (or instruction format) and the state of the Direction
  3910.     Flag.    Use with ~REP~ prefixes.
  3911.  
  3912.  
  3913. %                 Clocks            Size
  3914. %    Operands     808x  286   386   486        Bytes
  3915.  
  3916.     dest          11    3     4        5          1  (W88=15)
  3917.  
  3918.  
  3919.     - see ~Instruction Timing~
  3920.  
  3921. :str
  3922. ^STR - Store Task Register (286+ privileged)
  3923.  
  3924.  
  3925.     Usage:    STR    dest
  3926.     Modifies flags: None
  3927.  
  3928.  
  3929.     Stores the current Task Register to the specified operand.
  3930.  
  3931.  
  3932. %                 Clocks            Size
  3933. %    Operands     808x  286   386   486        Bytes
  3934.  
  3935.     reg16          -    2     2        2          3
  3936.     mem16          -    3     2        3          5
  3937.  
  3938.  
  3939.     - see ~Instruction Timing~
  3940.  
  3941. :sub
  3942. ^SUB - Subtract
  3943.  
  3944.     Usage:    SUB    dest,src
  3945.     Modifies flags: AF CF OF PF SF ZF
  3946.  
  3947.  
  3948.     The source is subtracted from the destination and the result is
  3949.     stored in the destination.
  3950.  
  3951. %                 Clocks            Size
  3952. %    Operands     808x  286   386   486        Bytes
  3953.  
  3954.     reg,reg       3    2     2        1          2
  3955.     mem,reg     16+EA    7     6        3         2-4  (W88=24+EA)
  3956.     reg,mem      9+EA    7     7        2         2-4  (W88=13+EA)
  3957.     reg,immed      4    3     2        1         3-4
  3958.     mem,immed    17+EA    7     7        3         3-6  (W88=25+EA)
  3959.     accum,immed      4    3     2        1         2-3
  3960.  
  3961.  
  3962.     - see ~Instruction Timing~
  3963.  
  3964. :test
  3965. ^TEST - Test For Bit Pattern
  3966.  
  3967.     Usage:    TEST    dest,src
  3968.     Modifies flags: CF OF PF SF ZF (AF undefined)
  3969.  
  3970.  
  3971.     Performs a logical ~AND~ of the two operands updating the flags
  3972.     register without saving the result.
  3973.  
  3974.  
  3975. %                 Clocks            Size
  3976. %    Operands     808x  286   386   486        Bytes
  3977.  
  3978.     reg,reg       3    2     1        1          2
  3979.     reg,mem      9+EA    6     5        1         2-4  (W88=13+EA)
  3980.     mem,reg      9+EA    6     5        2         2-4  (W88=13+EA)
  3981.     reg,immed      5    3     2        1         3-4
  3982.     mem,immed    11+EA    6     5        2         3-6
  3983.     accum,immed      4    3     2        1         2-3
  3984.  
  3985.  
  3986.     - see ~Instruction Timing~
  3987.  
  3988. :verr
  3989. ^VERR - Verify Read (286+ protected)
  3990.  
  3991.  
  3992.     Usage:    VERR    src
  3993.     Modifies flags: ZF
  3994.  
  3995.  
  3996.     Verifies the specified segment selector is valid and is readable
  3997.     at the current privilege level.  If the segment is readable,
  3998.     the Zero Flag is set, otherwise it is cleared.
  3999.  
  4000.  
  4001. %                 Clocks            Size
  4002. %    Operands     808x  286   386   486        Bytes
  4003.  
  4004.     reg16          -    14    10    11          3
  4005.     mem16          -    16    11    11          5
  4006.  
  4007.  
  4008.     - see ~Instruction Timing~
  4009.  
  4010. :verw
  4011. ^VERW - Verify Write (286+ protected)
  4012.  
  4013.  
  4014.     Usage:    VERW    src
  4015.     Modifies flags: ZF
  4016.  
  4017.  
  4018.     Verifies the specified segment selector is valid and is ratable
  4019.     at the current privilege level.  If the segment is writable,
  4020.     the Zero Flag is set, otherwise it is cleared.
  4021.  
  4022.  
  4023. %                 Clocks            Size
  4024. %    Operands     808x  286   386   486        Bytes
  4025.  
  4026.     reg16          -    14    15    11          3
  4027.     mem16          -    16    16    11          5
  4028.  
  4029.  
  4030.     - see ~Instruction Timing~
  4031.  
  4032. :wait:fwait
  4033. ^WAIT/FWAIT - Event Wait
  4034.  
  4035.  
  4036.     Usage:    WAIT
  4037.         FWAIT
  4038.     Modifies flags: None
  4039.  
  4040.  
  4041.     CPU enters wait state until the coprocessor signals it has finished
  4042.     its operation.  This instruction is used to prevent the CPU from
  4043.     accessing memory that may be temporarily in use by the coprocessor.
  4044.     WAIT and FWAIT are identical.
  4045.  
  4046.  
  4047. %                 Clocks            Size
  4048. %    Operands     808x  286   386   486        Bytes
  4049.  
  4050.     none          4    3     6+   1-3          1
  4051.  
  4052.  
  4053.     - see ~Instruction Timing~
  4054.  
  4055. :wbinvd
  4056. ^WBINVD - Write-Back and Invalidate Cache
  4057.  
  4058.  
  4059.     Usage:    WBINVD
  4060.     Modifies flags: None
  4061.  
  4062.  
  4063.     Flushes internal cache, then signals the external cache to write
  4064.     back current data followed by a signal to flush the external cache.
  4065.  
  4066. %                 Clocks            Size
  4067. %    Operands     808x  286   386   486        Bytes
  4068.  
  4069.     none          -    -     -     5          2
  4070.  
  4071.  
  4072.     - see ~Instruction Timing~
  4073.  
  4074. :xchg
  4075. ^XCHG - Exchange
  4076.  
  4077.  
  4078.     Usage:    XCHG    dest,src
  4079.     Modifies flags: None
  4080.  
  4081.  
  4082.     Exchanges contents of source and destination.
  4083.  
  4084.  
  4085. %                 Clocks            Size
  4086. %    Operands     808x  286   386   486        Bytes
  4087.  
  4088.     reg,reg          4    3     3        3          2
  4089.     mem,reg     17+EA    5     5        5         2-4  (W88=25+EA)
  4090.     reg,mem     17+EA    5     5        3         2-4  (W88=25+EA)
  4091.     accum,reg      3    3     3        3          1
  4092.     reg,accum      3    3     3        3          1
  4093.  
  4094.  
  4095.     - see ~Instruction Timing~
  4096.  
  4097. :xlat:xlatb
  4098. ^XLAT/XLATB - Translate
  4099.  
  4100.  
  4101.     Usage:    XLAT    translation-table
  4102.         XLATB    (masm 5.x)
  4103.     Modifies flags: None
  4104.  
  4105.  
  4106.     Replaces the byte in AL with byte from a user table addressed by
  4107.     BX.  The original value of AL is the index into the translate table.
  4108.  
  4109.  
  4110. %                 Clocks            Size
  4111. %    Operands     808x  286   386   486        Bytes
  4112.  
  4113.     table          11    5     5        4          1
  4114.  
  4115.  
  4116.     - see ~Instruction Timing~
  4117.  
  4118. :xor
  4119. ^XOR - Exclusive OR
  4120.  
  4121.     Usage:    XOR    dest,src
  4122.     Modifies flags: CF OF PF SF ZF (AF undefined)
  4123.  
  4124.  
  4125.     Performs a bitwise exclusive OR of the operands and returns
  4126.     the result in the destination.
  4127.  
  4128.  
  4129. %                 Clocks            Size
  4130. %    Operands     808x  286   386   486        Bytes
  4131.  
  4132.     reg,reg       3    2     2        1          2
  4133.     mem,reg     16+EA    7     6        3         2-4  (W88=24+EA)
  4134.     reg,mem      9+EA    7     7        2         2-4  (W88=13+EA)
  4135.     reg,immed      4    3     2        1         3-4
  4136.     mem,immed    17+EA    7     7        3         3-6  (W88=25+EA)
  4137.     accum,immed      4    3     2        1         2-3
  4138.  
  4139.  
  4140.     - see ~Instruction Timing~
  4141.