MM 1
MM 1
in Microprocessor
8086/8088
SS:SP-2 =2000:00FEH F2
AX
SS:SP-1 =2000:00FFH 31
31 F2
SS:SP =2000:0100H
BL=54 H at SP=0100H
BH=DF at SP+1=0101H
After POP operation, SP← SP+2=0102H
Data Movement Instructions
POP
Stack Stack
Data Movement Instructions
PUSH BX
31 F2
SS:SP+4 =ACED:0728
•The low-order 8 bits are removed from the location addressed by SP.
•The high-order 8 bits are removed from the location addressed by
SP+1
• The SPProf. Fraeyegz Fi.sMt. Eel-rSouissy incremented by 2
Data Movement Instructions
LEA
❖ Load-Effective Address (LEA)
❖ LEA stands for load effective address.
LEA Register, Src
❖ It loads a 16-bit register with the offset address
of the data specified by the Src.
LEA AX, NUMB
❖ AX ← operand offset address MUMB
Data Movement Instructions
LEA
Example:
LEA BX, [DI] ; loads offset address
specified by [DI] (contents
of DI) into BX register
MOV BX, [DI] ; loads the data stored at
the memory location
addressed by [DI] into BX
register
MOV BX, DI
= LEA BX, [DI]
Data Movement Instructions
LEA
MOV BX, DI performs in less time and is often
preferred to LEA BX, [DI]
Example:
LEA SI, [BX+DI]
If BX = 1000H, DI = 2000
Solution:
SI=BX+DI
=1000+2000=3000H (16-bit offset
address)
Data Movement Instructions
LEA
The sum generated by this instruction
LEA SI, [BX+DI]
is a modulo-64K sum drops any carry out of the
16-bit result
Example:
LEA SI, [BX+DI]
If BX = 1000H, DI = FF00H, SI = 0F00H
Solution:
SI=BX+DI
=1000+FF00=0F00 H instead of 10F00H
Data Movement Instructions
LDS
❖ POPF:
❖ Pops the stack top to flag register.
Prof. Fayez F. M. El-Sousy
Data Movement Instructions
XCHG
XCHG Des, Src
❖ This instruction exchanges Src with Des.
❖ It Exchanges contents of a register with any other
register or memory location.
❖ It can not exchange segment registers.
❖ It can not exchange two memory locations directly.
❖ Use any addressing mode except immediate.
❖ Example:
XCHG DX, AX
DX= 3000H, AX = 1000H
❖ After Execution this Instruction
DX= 1000H, AX = 3000H
Data Movement Instructions
XCHG
Example:
XCHG DX, AX
XCHG AL, CL
XCHG CX, BP
XCHG DX, SI
XCHG AL, [DI]
Data Movement Instructions
XLAT (Translate)
XLAT
❖ This instruction Converts the contents of the AL
register into a number stored in a memory table.
❖ It performs the direct table lookup technique often
used to convert one code to another.
❖ An XLAT instruction first adds the contents of AL to
BX to form a memory address within the data segment.
❖ It copies the contents of this address into AL.
❖ It is only instruction that adds an 8-bit to a 16-bit
number
❖ Example:
AL ← DS:[BX + AL]
Data Movement Instructions
XLAT (Translate)