Open source
  • Bandwidth benchmark
  • TouchWidgets UI lib
  • Diviner big number math
  • Documentation
  • x86 instructions ref
  • GIT quick ref
  • GPG quick ref
  • Avoid Ubuntu
  • Android malware risks
  • iOS malware risks
  • OS/X security tips
  • Who blocks Tor
  • Software engineering
  • BASH aliases
  • I.B. pro/con
  • Nutrition
  • Other apps
  • Blog
  • Contact
    1 at zsmith dot co

    The Intel 8086 / 8088 / 80186 / 80286 / 80386 / 80486 Instruction Set

    This HTML version of the file intel.doc from the PC Game Programmer's guide was produced by , veritasNOSPAM@comcast.net. Fancy HTML modifications are copyright © 2005 by , all rights reserved. This information is provided in the hope that it will be useful, but without any warranty; it is provided AS-IS, without even the implied warranty of fitness for a particular purpose.

    R Instructions

    RCL - Rotate Through Carry Left
     
        Usage:  RCL     dest,count
        Modifies flags: CF OF
    
            +-----+-----------------------+
        +---|  C  | 7 <---------------- 0 |<--+
        |   +-----+-----------------------+   |
        |                                     |
        +-------------------------------------+
    
        Rotates the bits in the destination to the left "count" times with
        all data pushed out the left side re-entering on the right.  The
        Carry Flag holds the last bit rotated out.
    
                                 Clocks                 Size
        Operands         808x  286   386   486          Bytes
    
        reg,1             2     2     9     3            2
        mem,1           15+EA   7     10    4           2-4  (W88=23+EA)
        reg,CL           8+4n  5+n    9    8-30          2
        mem,CL        20+EA+4n 8+n    10   9-31         2-4  (W88=28+EA+4n)
        reg,immed8        -    5+n     9   8-30          3
        mem,immed8        -    8+n    10   9-31         3-5
    

    RCR - Rotate Through Carry Right
     
        Usage:  RCR     dest,count
        Modifies flags: CF OF
    
            +-----------------------+-----+
        +-->| 7 ----------------> 0 |  C  |---+
        |   +-----------------------+-----+   |
        |                                     |
        +-------------------------------------+
    
        Rotates the bits in the destination to the right "count" times with
        all data pushed out the right side re-entering on the left.  The
        Carry Flag holds the last bit rotated out.
    
                                 Clocks                 Size
        Operands         808x  286   386   486          Bytes
    
        reg,1             2     2     9     3            2
        mem,1           15+EA   7     10    4           2-4   (W88=23+EA)
        reg,CL           8+4n  5+n    9    8-30          2
        mem,CL        20+EA+4n 8+n    10   9-31         2-4   (W88=28+EA+4n)
        reg,immed8        -    5+n    9    8-30          3
        mem,immed8        -    8+n    10   9-31         3-5
    

    REP - Repeat String Operation
     
        Usage:  REP
        Modifies flags: None
    
        Repeats execution of string instructions while CX != 0.  After
        each string operation, CX is decremented and the Zero Flag is
        tested.  The combination of a repeat prefix and a segment override
        on CPU's before the 386 may result in errors if an interrupt occurs
        before CX=0.  The following code shows code that is susceptible to
        this and how to avoid it:
    
         again:  rep movs  byte ptr ES:[DI],ES:[SI]   ; vulnerable instr.
                     jcxz  next              ; continue if REP successful
                     loop  again             ; interrupt goofed count
         next:
    
                                 Clocks                 Size
        Operands         808x  286   386   486          Bytes
        none              2     2     2                   1
    

    REPE/REPZ - Repeat Equal / Repeat Zero
     
        Usage:  REPE
                REPZ
        Modifies flags: None
    
        Repeats execution of string instructions while CX != 0 and the Zero
        Flag is set.  CX is decremented and the Zero Flag tested after
        each string operation.   The combination of a repeat prefix and a
        segment override on processors other than the 386 may result in
        errors if an interrupt occurs before CX=0.
    
                                 Clocks                 Size
        Operands         808x  286   386   486          Bytes
        none              2     2     2                   1
    

    REPNE/REPNZ - Repeat Not Equal / Repeat Not Zero
     
        Usage:  REPNE
                REPNZ
        Modifies flags: None
    
        Repeats execution of string instructions while CX != 0 and the Zero
        Flag is clear.   CX is decremented and the Zero Flag tested after
        each string operation.   The combination of a repeat prefix and a
        segment override on processors other than the 386 may result in
        errors if an interrupt occurs before CX=0.
    
                                 Clocks                 Size
        Operands         808x  286   386   486          Bytes
        none              2     2     2                   1
    

    RET/RETF - Return From Procedure
     
        Usage:  RET     nBytes
                RETF    nBytes
                RETN    nBytes
        Modifies flags: None
    
        Transfers control from a procedure back to the instruction address
        saved on the stack.  "n bytes" is an optional number of bytes to
        release.  Far returns pop the IP followed by the CS, while near
        returns pop only the IP register.
    
                                 Clocks                 Size
        Operands         808x  286    386   486         Bytes
    
        retn            16/20  11+m  10+m    5            1
        retn immed      20/24  11+m  10+m    5            3
        retf            26/34  15+m  18+m    13           1
        retf (PM, same priv.)   -    32+m    18           1
        retf (PM, lesser priv.) -      68    33           1
        retf immed      25/33  15+m  18+m    14           3
        retf immed (PM, same priv.)  32+m    17           1
        retf immed (PM, lesser priv.)  68    33           1
    

    ROL - Rotate Left
     
        Usage:  ROL     dest,count
        Modifies flags: CF OF
    
      +---+       +-----------------------+
      | C |<---+--| 7 <---------------- 0 |<--+
      +---+    |  +-----------------------+   |
               |                              |
               +------------------------------+
    
        Rotates the bits in the destination to the left "count" times with
        all data pushed out the left side re-entering on the right.  The
        Carry Flag will contain the value of the last bit rotated out.
    
                                 Clocks                 Size
        Operands         808x  286   386   486          Bytes
    
        reg,1             2     2     3     3             2
        mem,1           15+EA   7     7     4            2-4  (W88=23+EA)
        reg,CL           8+4n  5+n    3     3             2
        mem,CL        20+EA+4n 8+n    7     4            2-4  (W88=28+EA+4n)
        reg,immed8        -    5+n    3     2             3
        mem,immed8        -    8+n    7     4            3-5
    

    ROR - Rotate Right
     
        Usage:  ROR     dest,count
        Modifies flags: CF OF
    
              +-----------------------+        +---+
          +-->| 7 ----------------> 0 |---+--->| C |
          |   +-----------------------+   |    +---+
          |                               |
          + ------------------------------+
    
        Rotates the bits in the destination to the right "count" times with
        all data pushed out the right side re-entering on the left.  The
        Carry Flag will contain the value of the last bit rotated out.
    
                                 Clocks                 Size
        Operands         808x  286   386   486          Bytes
    
        reg,1             2     2     3     3             2
        mem,1           15+EA   7     7     4            2-4  (W88=23+EA)
        reg,CL           8+4n  5+n    3     3             2
        mem,CL        20+EA+4n 8+n    7     4            2-4  (W88=28+EA+4n)
        reg,immed8        -    5+n    3     2             3
        mem,immed8        -    8+n    7     4            3-5
    



    © Zack Smith