
Instruction Set
4-133
LEA
Load Effective Address
LEA
What It Does
LEA loads the offset of a memory component into a register.
Syntax
Description
LEA calculates the effective address (offset part) of the component and stores it in the
specified register.
Operation It Performs
Flag Settings After Instruction
Examples
This example fills a string in memory with a character. Because the Direction Flag (DF) is
cleared to 0 using CLD, the bytes are filled, one by one, from first to last.
Form
Opcode
Description
Clocks
Am186 Am188
LEA
r16,m16
8D
/r
Load offset for m16 word in 16-bit register
6
6
LEA
offset,component
/* copy offset of component */
offset = &component;
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
–
–
–
–
–
– res – res – res –
STRING
DB
128 DUP (?)
ASTERISK
DB
’*’
; 2Ah
; fill string with character
; set up registers and flags
MOV
AX,SEG STRING
MOV ES,AX
MOV
AL,ASTERISK
; copy character to AL
LEA
DI,STRING
; load offset (segment = ES)
MOV
CX,LENGTH STRING
; set up counter
CLD
; process string low to high
; fill string
REP
STOSB
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...