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

    L Instructions

    LAHF - Load Register AH From Flags
          Usage: LAHF
    
          Modifies Flags: None
    
          Copies bits 0-7 of the flags register into AH. 
          This includes flags AF, CF, PF, SF and ZF other bits 
          are undefined.
    
          AH := SF ZF xx AF xx PF xx CF
    
    Timing:
    Operands 286 386 486 Size in Bytes
    none 2 2 3 1

    LAR - Load Access Rights (286+ protected)
          Usage: LAR dest,src
    
          Modifies Flags: ZF
    
          The high byte of the of the destination register is overwritten
          by the value of the access rights byte and the low order byte
          is zeroed depending on the selection in the source operand. 
          The Zero Flag is set if the load operation is successful.
    
    Timing:
    Operands 286 386 486 Size Bytes
    reg16,reg16 14 15 11 3
    reg32,reg32 15 11 3
    reg16,mem16 16 16 11 3-7
    reg32,mem32 16 11 3-7

    LEA - Load Effective Address
          Usage: LEA dest,src
    
          Modifies Flags: None
    
          Transfers offset address of "src" to the destination register.
    
          This is a deceptively simplistic instruction that can be used for
          additions that do not affect the carry flag as well as
          multiplications by small constants. An example:
    
          LEA RAX, [RAX + RAX*4]
    
          This multiplies a number by five.
    
    Timing:
    Operands 286 386 486 Size Bytes
    reg,mem 3 2 1 2-4
     

    LEAVE - Restore Stack for Procedure Exit (80188+)
          Usage: LEAVE
    
          Modifies Flags: LEAVE
    
          Releases the local variables created by the previous ENTER
          instruction by restoring SP and BP to their condition before 
          the procedure stack frame was initialized.
    
    Timing:
    Operands 286 386 486 Size Bytes
    none 5 4 5 1
     

    LDS - Load Pointer Using DS
          Usage: LDS dest,src
    
          Modifies Flags: None
    
          Loads 32-bit pointer from memory source to destination 
          register and DS. The offset is placed in the destination 
          register and the segment is placed in DS. To use this 
          instruction the word at the lower memory address must 
          contain the offset and the word at the higher address 
          must contain the segment. This simplifies the loading 
          of far pointers from the stack and the interrupt vector table.
    
    Timing:
    Operands 8088 286 386 486 Size Bytes
    reg,mem 24+EA7 7 6 2-4
    reg,mem (PM) 22 12 5-7
     

    LES - Load Pointer Using ES
          Usage: LES dest,src
    
          Modifies Flags: None
    
          Loads 32-bit pointer from memory source to destination 
          register and ES. The offset is placed in the destination 
          register and the segment is placed in ES. To use this 
          instruction the word at the lower memory address must 
          contain the offset and the word at the higher address 
          must contain the segment. This simplifies the loading 
          of far pointers from the stack and the interrupt vector table.
    
    Timing:
    Operands 8088 286 386 486 Size Bytes
    reg,mem 24+EA7 7 6 2-4
    reg,mem (PM) 22 12 5-7
     

    LFS - Load Pointer Using FS
          Usage: LFS dest,src
    
          Modifies Flags: None
    
          Loads 32-bit pointer from memory source to destination
          register and FS. The offset is placed in the destination 
          register and the segment is placed in FS. To use this 
          instruction the word at the lower memory address must 
          contain the offset and the word at the higher address must 
          contain the segment. This simplifies the loading of far pointers 
          from the stack and the interrupt vector table.
    
    Timing:
    Operands 286 386 486 Size Bytes
    reg,mem 7 6 5-7
    reg,mem (PM) 22 12 5-7
     

    LGDT - Load Global Descriptor Table (286+ privileged)
          Usage: LGDT src
    
          Modifies Flags: None
    
          Loads a value from an operand into the Global Descriptor Table
          (GDT) register.
    
    Timing:
    Operands 286 386 486 Size Bytes
    mem64 11 11 11 5
     

    LGS - Load Pointer Using GS (386+)
          Usage: LGS dest,src
    
          Modifies Flags: None
    
          Loads 32-bit pointer from memory source to destination 
          register and GS. The offset is placed in the destination 
          register and the segment is placed in GS. To use this 
          instruction the word at the lower memory address must 
          contain the offset and the word at the higher address must 
          contain the segment. This simplifies the loading of far pointers 
          from the stack and the interrupt vector table.
    
    Timing:
    Operands 286 386 486 Size Bytes
    reg,mem 7 6 5-7
    reg,mem (PM) 22 12 5-7
     

    LIDT - Load Interrupt Descriptor Table (286+ privileged)
          Usage: LIDT src
    
          Modifies Flags: None
    
          Loads a value from an operand into the Interrupt Descriptor 
          Table (IDT) register.
    
    Timing:
    Operands 286 386 486 Size Bytes
    mem64 12 11 11 5
     

    LLDT - Load Local Descriptor Table (286+ privileged)
          Usage: LLDT src
    
          Modifies Flags: None
    
          Loads a value from an operand into the Local Descriptor Table 
          Register (LDTR).
    
    Timing:
    Operands 286 386 486 Size Bytes
    reg16 17 20 11 3
    mem16 19 24 11 5
     

    LMSW - Load Machine Status Word (286+ privileged)
           Usage: LMSW src
    
          Modifies Flags: None
    
          Loads the Machine Status Word (MSW) from data found at "src".
    
    Timing:
    Operands 286 386 486 Size Bytes
    reg16 3 10 13 3
    mem16 6 13 13 5
     

    LOCK - Lock Bus
          Usage: LOCK
                 LOCK: (386+ prefix)
    
          Modifies Flags: None
    
          This instruction is a prefix that causes the CPU assert bus lock 
          signal during the execution of the next instruction. Used to 
          avoid two processors from updating the same data location. 
          The 286 always asserts lock during an XCHG with memory 
          operands. This should only be used to lock the bus prior to 
          XCHG, MOV, IN and OUT instructions.
    
    Timing:
    Operands 286 386 486 Size Bytes
    none 0 0 1 1
     

    LODS - Load String (Byte, Word or Double)
          Usage: LODS src
                 LODSB
                 LODSW
                 LODSD (386+)
    
          Modifies Flags: None
    
          Transfers string element addressed by DS:SI (even if 
          an operand is supplied) to the accumulator. SI is incremented 
          based on the size of the operand or based on the instruction 
          used. If the Direction Flag is set SI is decremented, if 
          the Direction Flag is clear SI is incremented. Use with REP
          prefixes.
    
    Timing:
    Operands 286 386 486 Size Bytes
    src 5 5 5 1
     

    LOOP - Decrement CX and Loop if CX Not Zero
          Usage: LOOP label
    
          Modifies Flags: None
    
          Decrements CX by 1 and transfers control to "label" if CX
          is not Zero. The "label" operand must be within -128 or 127
          bytes of the instruction following the loop instruction.
    
    Timing:
    Operands 286 386 486 Size Bytes
    label: jump 8+m 11+m 6 2
    no jump 4 ? 2 2
     

    LOOPE/LOOPZ - Loop While Equal / Loop While Zero
          Usage: LOOPE label
             LOOPZ label
    
          Modifies Flags: None
    
          Decrements CX by 1 (without modifying the flags) and
          transfers control to "label" if CX != 0 and the Zero Flag is set.
          The "label" operand must be within -128 or 127 bytes of 
          the instruction following the loop instruction.
    
    Timing:
    Operands 286 386 486 Size Bytes
    label: jump 8+m 11+m 9 2
    no jump 4 ? 6 2
     

    LOOPNE/LOOPNZ - Loop While Not Equal / Loop While Not Zero
          Usage: LOOPNZ label
             LOOPNE label
    
          Modifies Flags: None
    
          Decrements CX by 1 (without modifying the flags) and 
          transfers control to "label" if CX != 0 and the Zero Flag 
          is clear. The "label" operand must be within -128 or 127 
          bytes of the instruction following the loop instruction.
    
    Timing:
    Operands 286 386 486 Size Bytes
    label: jump 8+m 11+m 9 2
    no jump 4 ? 6 2
     

    LSL - Load Segment Limit (286+ protected)
          Usage: LSL dest,src
    
          Modifies Flags: ZF
    
          Loads the segment limit of a selector into the destination 
          register if the selector is valid and visible at the current 
          privilege level. If loading is successful the Zero Flag is set, 
          otherwise it is cleared.
    
    Timing:
    Operands 286 386 486 Size Bytes
    reg16,reg16 14 20/25 10 3
    reg32,reg32 20/25 10 3
    reg16,mem16 16 21/26 10 5
    reg32,mem32 21/26 10 5
    386 times are listed "byte granular" / "page granular"
     

    LSS - Load Pointer Using SS (386+)
          Usage: LSS dest,src
    
          Modifies Flags: None
    
          Loads 32-bit pointer from memory source to destination 
          register and SS. The offset is placed in the destination 
          register and the segment is placed in SS. To use this 
          instruction the word at the lower memory address must 
          contain the offset and the word at the higher address must 
          contain the segment. This simplifies the loading of far pointers
          from the stack and the interrupt vector table.
    
    Timing:
    Operands 286 386 486 Size Bytes
    reg,mem 7 6 5-7
    reg,mem (PM) 22 12 5-7
     

    LTR - Load Task Register (286+ privileged)
          Usage: LTR src
    
          Modifies Flags: None
    
          Loads the current task register with the value specified in "src".
    
    Timing:
    Operands 286 386 486 Size Bytes
    reg16 17 23 20 3
    mem16 19 27 20 5
     



    © Zack Smith