LEA              Load Effective Address              Flags: not altered
 
LEA destination,source
 
          Logic:       destination  Addr(source)
 
    LEA transfers the offset of the source operand (rather than its value)
    to the destination operand. The source must be a memory reference, and
    the destination must be a 16-bit general register.
 
  --------------------------------------------------------------------------
   Operands                  Clocks   Transfers  Bytes   Example
   reg16, mem16              2 + EA       -       2-4    LEA BX,MEM_ADDR
  --------------------------------------------------------------------------
 
       Notes:         This instruction has an advantage over using the
                      OFFSET operator with the MOV instruction, in that
                      the source operand can be subscripted. For example,
                      this is legal:
 
                              LEA  BX, TABLE[SI]                ;Legal
 
                      whereas
 
                              MOV  BX, OFFSET TABLE[SI]         ;Not legal
 
                      is illegal, since the OFFSET operator performs its
                      calculation at assembly time and this address is not
                      known until run time.
 
  -------------------------------- Example ---------------------------------
 
    The DOS print string routine, Function 09h, requires a pointer to the
    string to be printed in DS:DX. If the string you wished to print was
    at address "PRINT-ME" in the same data segment, you could load DS:DX
    with the required pointer using this instruction:
 
          LEA     DX, PRINT-ME

Seealso:



This page last updated on Fri Nov 30 10:49:50 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster