SlideShare a Scribd company logo
1 of 40
Download to read offline
Prof. Munish Vashishath
Department of Electronics Engineering
J.C.Bose University of Science & Technology
YMCA,Faridabad
Data Movement Instructions
in Microprocessor
8086/8088
Objectives of Data Movement
Instructions in Microprocessor 8086/8088
Upon completion of this chapter, you will be able to:
Explain the operation of each data movement
instruction with applicable addressing modes.
Select the appropriate assembly language
instruction to accomplish a specific data
movement task.
Data Movement Instructions in
Microprocessor 8086/8088
These instructions are used to transfer
data from source to destination.
The operand can be a constant, memory
location, register or I/O port address.
8-bit 8-bit 8-bit
OP CO DE OPERAND
1 byte 1 to 2 byte
Data Movement Instructions
MOV
❖ MOV Des, Src
❖ Src operand can be register, memory location or
immediate operand.
❖ Des can be register or memory operand.
❖ Both Src and Des cannot be memory location at
the same time.
❖ Example:
MOV CX, 037AH
MOV AL, BL
MOV BX, [0301H]
Data Movement Instructions
MOV
MOV Des, Src
0727H
0726H
0725H
0724H
0723H
0722H
Example: DS=ACDEH, SI=0724H
MOV AX, [SI]
072CH
072BH
072AH
0729H
0728H
AD5F4H
AD5F3H
AD5F2H
AD5FCH
AD5FBH
AD5FAH
AD5F9H
AD5F8H
AD5F7H
AD5F6H
AD5F5H
18H
A3H
7EH
69H
AAH
2EH
00H
55H
02H
72H
11H
❖ Physical Address
= ACEDx10H + 0724H
= AD5F4H, AD5F5H
AX=5502H
55 02
AH AL
Data Movement Instructions
PUSH and POP
PUSH and POP Instructions
❖ Both are important to store and retrieve data
from the LIFO structure (stack).
❖ PUSH Operand
❖ It pushes the operand into top of stack.
❖ Example:
PUSH BX
❖ POP Des
❖ It pops the operand from top of stack to Des.
❖ Example:
POPAX
Data Movement Instructions
PUSH
PUSH:
In 8088 and 8086 PUSH always transfer 2
bytes of data to the stack.
It has the following syntax:
PUSH src
Src could be any 2 byte register or memory
location or immediate value.
Data Movement Instructions
PUSH
How does PUSH executes?
Simply when we push 2 bytes of data to
the stack, the most significant byte is
stored in stack segment pointed to by SP-1,
and the least significant to location pointed
by SP-2, see the following example
Example:
Let AX=31F2H, SP=100H, SS=2000H,
CX=FFFFH, BX=413AH
Data Movement Instructions
PUSH
31 F2
AX F2
31
Least Significant Byte
Most Significant Byte
SS:SP-2 =2000:00FEH
SS:SP-1 =2000:00FFH
SS:SP =2000:0100H
PUSH AX
SS:[SP-1] ← AH, 1st(most significant) byte.
SS:[SP-2] ← AL, 2nd(least significant) byte.
After PUSH operation, SP ← SP - 2
Data Movement Instructions
PUSH
The effect of the PUSH AX instruction on SP and stack
memory locations 37FFH and 37FEH. AX=6AB3H
Data Movement Instructions
POP
How does POP executes?
❖POP : performs the inverse operation of PUSH
❖POP : removes data from stack and place it into
target 16-bit register.
POP BX
❖BL ← SS:[SP]
❖BH ← SS:[SP+1]
❖after POP operation, SP← SP+2
POP CS ; is not a valid instruction
Data Movement Instructions
POP
DF 54
54
DF
SS:SP =3000:0100H
Least Significant Byte
Most Significant Byte
SS:SP+2 =3000:0102H
SS:SP+1 =3000:0101H
POP BX
BL ← SS:[SP]
BH ← SS:[SP+1]
After POP operation, SP ← SP + 2
BX
Data Movement Instructions
POP
Example:
Let BX=DF54H, SP=100H, SS=3000H
POP BX
BL=54 H at SP=0100H
BH=DF at SP+1=0101H
After POP operation, SP← SP+2=0102H
Data Movement Instructions
POP
The POP BX instruction, showing how data
are removed from the stack. POP BX
Data Movement Instructions
PUSH
Example:
Let
AX=31F2H
SP=072AH
SS=ACEDH
CX=FF67H
BX=413AH
PUSH AX
PUSH BX
PUSH CX
SS:SP-2 =ACED:0728
SS:SP-1 =ACED:0729
CH CL
67
FF
31 F2
AH AL
41 3A
BH BL
SS:SP-4 =ACED:0726
SS:SP-3 =ACED:0727
SSololuuttiionon::
SS:SP-6 =ACED:0724
SS:SP-5 =ACED:0725
SS:SP =ACED:072A
Data Movement Instructions
PUSH
0727H
0726H
0725H
0724H
0723H
0722H
072CH
072BH
072AH
0729H
0728H
AD5F4H
AD5F3H
AD5F2H
AD5FCH
AD5FBH
AD5FAH
AD5F9H
AD5F8H
AD5F7H
AD5F6H
AD5F5H
18H
A3H
7EH
69H
AAH
2EH
00H
55H
02H
72H
11H
0727H
0726H
0725H
0724H
0723H
0722H
072CH
072BH
072AH
0729H
0728H
AD5F4H
AD5F3H
AD5F2H
AD5FCH
AD5FBH
AD5FAH
AD5F9H
AD5F8H
AD5F7H
AD5F6H
AD5F5H
18H
A3H
7EH
31H
F2H
41H
3AH
FFH
67H
72H
11H
before after
Stack Stack
Data Movement Instructions
PUSH BX
•The high-order 8 bits are placed in the location addressed by SP – 1
•The low-order 8 bits are placed in the location addressed by SP – 2
•After the data are stored by a PUSH, the contents of the SP register
decrem
Pro
e
f.n
Fat
y
tez
b
F.y
M. t
E
tlw
-Soo
u
o
sy
Prof. Fayez F. M. El-Sousy
Data Movement Instructions
POP
Example:
Let
SP=0724H
SS=ACEDH
POP CX
POP BX
POPAX
SS:SP+4 =ACED:0728
SS:SP+5 =ACED:0729
CH CL
67
FF
31 F2
AH AL
41 3A
BH BL
SS:SP+2 =ACED:0726
SS:SP+3 =ACED:0727
SS:SP =ACED:0724
SS:SP+1 =ACED:0725
Prof. Fayez F. M. El-Sousy
Data Movement Instructions
POP
0727H
0726H
0725H
0724H
0723H
0722H
072CH
072BH
072AH
0729H
0728H
AD5F4H
AD5F3H
AD5F2H
AD5FCH
AD5FBH
AD5FAH
AD5F9H
AD5F8H
AD5F7H
AD5F6H
AD5F5H
67H
18H
A3H
7EH
31H
F2H
41H
3AH
FFH
11H
72H
Stack
SS:SP+4 =ACED:0728
SS:SP+5 =ACED:0729
CH CL
67
FF
31 F2
AH AL
41 3A
BH BL
SS:SP+2 =ACED:0726
SS:SP+3 =ACED:0727
SS:SP =ACED:0724
SS:SP+1 =ACED:0725
Solution:
Data Movement Instructions
POP CX
•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 SP
P
rof. F
ra
e
ye
g
z F
i.
s
M
t
. E
el-
r
Sou
is
s
y
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.
LEAAX, NUMB
❖ AX ← operand offset address MUMB
Data Movement Instructions
LEA
Example:
LEA BX, [DI]
MOV BX, [DI]
; loads offset address
specified by [DI] (contents
of DI) into BX register
; 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
❖ LDS Des, Src
❖ It 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.
Data Movement Instructions
LDS
❖ LDS Des, Src
❖ Example:
LDS BX, [DI]
❖ If DS= 1000H, DI = 1000H
❖ The LDS BX, [DI] instruction loads register BX
from addresses 11000H and 11001H and register
DS from locations 11002H and 11003H. This
instruction is shown at the point just before DS
changes to 3000H and BX changes to 127AH.
Data Movement Instructions
LDS
Data Movement Instructions
LDS
Data Movement Instructions
LES
❖ LES Des, Src
❖ It 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 instruction is very similar to LDS except
that it initializes ES instead of DS.
❖ LES Des, Src
❖ Example:
LES BX, [DI]
❖ If ES= 1000H, DI = 1000H
❖ The LES BX, [DI] instruction loads register BX
from addresses 11000H and 11001H and register
ES from locations 11002H and 11003H. This
instruction is shown at the point just before ES
changes to 3000H and BX changes to 127AH.
Data Movement Instructions
LES
Data Movement Instructions
LES
❖ LAHF:
❖ It transfer the lower byte of flag register to AH.
AH ← FLAG (Lower 8-bit)
❖ SAHF:
❖ It transfer the contents of AH to lower byte of
flag register.
FLAG (Lower 8-bit) ← AH
❖ PUSHF:
❖ Pushes flag register to top of stack.
❖ POPF:
❖Prof. F
P
aye
o
z F
p
. M
s
. El-
t
So
h
usy
e stack top to flag register.
Data Movement Instructions
LAHF, SAHF, PUSHF, POPF
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
XCHG
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)
Data Movement Instructions
XLAT (Translate)
The operation of the XLAT instruction at the point just before
6DHP
iro
sf. F
la
o
ye
a
z F
d
. M
e.
d
El-S
io
n
usy
to AL.
❖ IN Accumulator, Port Address
❖ This instruction transfers the operand from specified
port to accumulator register.
IN AX, 0028 H
❖ An IN instruction transfers data from an external I/O
device into AL or AX
❖ OUT Port Address, Accumulator
❖ This instruction transfers the operand from accumulator
to specified port.
OUT 0028 H, AX
❖ An OUT transfers data from AL or AX to an external
I/O device.
Data Movement Instructions
IN and OUT
IN & OUT instructions perform I/O operations.
Contents of AL or AX are transferred only
between I/O device and microprocessor.
Two forms of I/O device (port) addressing:
Fixed-port addressing allows data transfer
between AL, or AX using an 8-bit I/O port
address.
Port number follows the instruction’s opcode.
IN AX, 0028 H
OUT 0028 H, AX
Data Movement Instructions
IN and OUT
Variable-port addressing allows data transfers
between AL or AX and a 16-bit port address.
The I/O port number is stored in register DX,
which can be changed (varied) during the
execution of a program.
MOV DX, 0028H
IN AX, DX
OUT DX, AX
Data Movement Instructions
IN and OUT
Data Movement Instructions
IN and OUT
The signals found in the microprocessor-based system for an OUT
19H, AX instruction.
Data Movement Instructions
IN and OUT

More Related Content

What's hot

Assembly Langauge Chap 1
Assembly Langauge Chap 1Assembly Langauge Chap 1
Assembly Langauge Chap 1warda aziz
 
Introduction to ibm pc assembly language
Introduction to ibm pc assembly languageIntroduction to ibm pc assembly language
Introduction to ibm pc assembly languagewarda aziz
 
Microprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualMicroprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualyeshwant gadave
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086Dr. AISHWARYA N
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...warda aziz
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Bilal Amjad
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Bilal Amjad
 
Chapter 2 The 8088 Microprocessor
Chapter 2   The 8088 MicroprocessorChapter 2   The 8088 Microprocessor
Chapter 2 The 8088 MicroprocessorDwight Sabio
 
Organization of the ibm personal computers
Organization of the ibm personal computersOrganization of the ibm personal computers
Organization of the ibm personal computerswarda aziz
 
chapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionschapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionswarda aziz
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...Bilal Amjad
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Bilal Amjad
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Bilal Amjad
 
Assembly language (coal)
Assembly language (coal)Assembly language (coal)
Assembly language (coal)Hareem Aslam
 
Bcd and ascii arithmetic instructions
Bcd and ascii arithmetic instructionsBcd and ascii arithmetic instructions
Bcd and ascii arithmetic instructionsDr. Girish GS
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programmingKartik Sharma
 
Chapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registersChapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registerswarda aziz
 

What's hot (20)

Instruction set of 8086 Microprocessor
Instruction set of 8086 Microprocessor Instruction set of 8086 Microprocessor
Instruction set of 8086 Microprocessor
 
Assembly Langauge Chap 1
Assembly Langauge Chap 1Assembly Langauge Chap 1
Assembly Langauge Chap 1
 
Introduction to ibm pc assembly language
Introduction to ibm pc assembly languageIntroduction to ibm pc assembly language
Introduction to ibm pc assembly language
 
Microprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualMicroprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannual
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
 
Chapter 2 The 8088 Microprocessor
Chapter 2   The 8088 MicroprocessorChapter 2   The 8088 Microprocessor
Chapter 2 The 8088 Microprocessor
 
Organization of the ibm personal computers
Organization of the ibm personal computersOrganization of the ibm personal computers
Organization of the ibm personal computers
 
chapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionschapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructions
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 5 (The Processor...
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
Assembly language (coal)
Assembly language (coal)Assembly language (coal)
Assembly language (coal)
 
Bcd and ascii arithmetic instructions
Bcd and ascii arithmetic instructionsBcd and ascii arithmetic instructions
Bcd and ascii arithmetic instructions
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programming
 
Chapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registersChapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registers
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 

Similar to mm_1.pdf

Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086Mahalakshmiv11
 
Chap 3_2.ppt
Chap 3_2.pptChap 3_2.ppt
Chap 3_2.pptinian2
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptssuser2b759d
 
Instruction set-of-8086
Instruction set-of-8086Instruction set-of-8086
Instruction set-of-8086mudulin
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086aviban
 
Microprocessor.pptx
Microprocessor.pptxMicroprocessor.pptx
Microprocessor.pptxNishatNishu5
 
1344 Alp Of 8086
1344 Alp Of 80861344 Alp Of 8086
1344 Alp Of 8086techbed
 
Addressing mode of 80286 microprocessor
Addressing mode of 80286 microprocessorAddressing mode of 80286 microprocessor
Addressing mode of 80286 microprocessorpal bhumit
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086Vijay Kumar
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)AmitPaliwal20
 
8086 instruction set (with simulator)
8086 instruction set (with simulator)8086 instruction set (with simulator)
8086 instruction set (with simulator)Aswini Dharmaraj
 
15CS44 MP &MC Module 3
15CS44 MP &MC Module 315CS44 MP &MC Module 3
15CS44 MP &MC Module 3RLJIT
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086sravanithonta79
 
Assembly Language Lecture 4
Assembly Language Lecture 4Assembly Language Lecture 4
Assembly Language Lecture 4Motaz Saad
 

Similar to mm_1.pdf (20)

Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086
 
Chap 3_2.ppt
Chap 3_2.pptChap 3_2.ppt
Chap 3_2.ppt
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.ppt
 
Instruction set-of-8086
Instruction set-of-8086Instruction set-of-8086
Instruction set-of-8086
 
Instruction set
Instruction setInstruction set
Instruction set
 
Lecture5
Lecture5Lecture5
Lecture5
 
Lecture5(1)
Lecture5(1)Lecture5(1)
Lecture5(1)
 
8086 ins1 data copy
8086 ins1 data copy8086 ins1 data copy
8086 ins1 data copy
 
Chap3 8086 data transfer
Chap3 8086 data transferChap3 8086 data transfer
Chap3 8086 data transfer
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Microprocessor.pptx
Microprocessor.pptxMicroprocessor.pptx
Microprocessor.pptx
 
1344 Alp Of 8086
1344 Alp Of 80861344 Alp Of 8086
1344 Alp Of 8086
 
Addressing mode of 80286 microprocessor
Addressing mode of 80286 microprocessorAddressing mode of 80286 microprocessor
Addressing mode of 80286 microprocessor
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)
 
8086 instruction set (with simulator)
8086 instruction set (with simulator)8086 instruction set (with simulator)
8086 instruction set (with simulator)
 
15CS44 MP &MC Module 3
15CS44 MP &MC Module 315CS44 MP &MC Module 3
15CS44 MP &MC Module 3
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086
 
Assembly Language Lecture 4
Assembly Language Lecture 4Assembly Language Lecture 4
Assembly Language Lecture 4
 
8086 add mod
8086 add mod8086 add mod
8086 add mod
 

Recently uploaded

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

mm_1.pdf

  • 1. Prof. Munish Vashishath Department of Electronics Engineering J.C.Bose University of Science & Technology YMCA,Faridabad Data Movement Instructions in Microprocessor 8086/8088
  • 2. Objectives of Data Movement Instructions in Microprocessor 8086/8088 Upon completion of this chapter, you will be able to: Explain the operation of each data movement instruction with applicable addressing modes. Select the appropriate assembly language instruction to accomplish a specific data movement task.
  • 3. Data Movement Instructions in Microprocessor 8086/8088 These instructions are used to transfer data from source to destination. The operand can be a constant, memory location, register or I/O port address. 8-bit 8-bit 8-bit OP CO DE OPERAND 1 byte 1 to 2 byte
  • 4. Data Movement Instructions MOV ❖ MOV Des, Src ❖ Src operand can be register, memory location or immediate operand. ❖ Des can be register or memory operand. ❖ Both Src and Des cannot be memory location at the same time. ❖ Example: MOV CX, 037AH MOV AL, BL MOV BX, [0301H]
  • 5. Data Movement Instructions MOV MOV Des, Src 0727H 0726H 0725H 0724H 0723H 0722H Example: DS=ACDEH, SI=0724H MOV AX, [SI] 072CH 072BH 072AH 0729H 0728H AD5F4H AD5F3H AD5F2H AD5FCH AD5FBH AD5FAH AD5F9H AD5F8H AD5F7H AD5F6H AD5F5H 18H A3H 7EH 69H AAH 2EH 00H 55H 02H 72H 11H ❖ Physical Address = ACEDx10H + 0724H = AD5F4H, AD5F5H AX=5502H 55 02 AH AL
  • 6. Data Movement Instructions PUSH and POP PUSH and POP Instructions ❖ Both are important to store and retrieve data from the LIFO structure (stack). ❖ PUSH Operand ❖ It pushes the operand into top of stack. ❖ Example: PUSH BX ❖ POP Des ❖ It pops the operand from top of stack to Des. ❖ Example: POPAX
  • 7. Data Movement Instructions PUSH PUSH: In 8088 and 8086 PUSH always transfer 2 bytes of data to the stack. It has the following syntax: PUSH src Src could be any 2 byte register or memory location or immediate value.
  • 8. Data Movement Instructions PUSH How does PUSH executes? Simply when we push 2 bytes of data to the stack, the most significant byte is stored in stack segment pointed to by SP-1, and the least significant to location pointed by SP-2, see the following example Example: Let AX=31F2H, SP=100H, SS=2000H, CX=FFFFH, BX=413AH
  • 9. Data Movement Instructions PUSH 31 F2 AX F2 31 Least Significant Byte Most Significant Byte SS:SP-2 =2000:00FEH SS:SP-1 =2000:00FFH SS:SP =2000:0100H PUSH AX SS:[SP-1] ← AH, 1st(most significant) byte. SS:[SP-2] ← AL, 2nd(least significant) byte. After PUSH operation, SP ← SP - 2
  • 10. Data Movement Instructions PUSH The effect of the PUSH AX instruction on SP and stack memory locations 37FFH and 37FEH. AX=6AB3H
  • 11. Data Movement Instructions POP How does POP executes? ❖POP : performs the inverse operation of PUSH ❖POP : removes data from stack and place it into target 16-bit register. POP BX ❖BL ← SS:[SP] ❖BH ← SS:[SP+1] ❖after POP operation, SP← SP+2 POP CS ; is not a valid instruction
  • 12. Data Movement Instructions POP DF 54 54 DF SS:SP =3000:0100H Least Significant Byte Most Significant Byte SS:SP+2 =3000:0102H SS:SP+1 =3000:0101H POP BX BL ← SS:[SP] BH ← SS:[SP+1] After POP operation, SP ← SP + 2 BX
  • 13. Data Movement Instructions POP Example: Let BX=DF54H, SP=100H, SS=3000H POP BX BL=54 H at SP=0100H BH=DF at SP+1=0101H After POP operation, SP← SP+2=0102H
  • 14. Data Movement Instructions POP The POP BX instruction, showing how data are removed from the stack. POP BX
  • 15. Data Movement Instructions PUSH Example: Let AX=31F2H SP=072AH SS=ACEDH CX=FF67H BX=413AH PUSH AX PUSH BX PUSH CX SS:SP-2 =ACED:0728 SS:SP-1 =ACED:0729 CH CL 67 FF 31 F2 AH AL 41 3A BH BL SS:SP-4 =ACED:0726 SS:SP-3 =ACED:0727 SSololuuttiionon:: SS:SP-6 =ACED:0724 SS:SP-5 =ACED:0725 SS:SP =ACED:072A
  • 17. Data Movement Instructions PUSH BX •The high-order 8 bits are placed in the location addressed by SP – 1 •The low-order 8 bits are placed in the location addressed by SP – 2 •After the data are stored by a PUSH, the contents of the SP register decrem Pro e f.n Fat y tez b F.y M. t E tlw -Soo u o sy
  • 18. Prof. Fayez F. M. El-Sousy Data Movement Instructions POP Example: Let SP=0724H SS=ACEDH POP CX POP BX POPAX SS:SP+4 =ACED:0728 SS:SP+5 =ACED:0729 CH CL 67 FF 31 F2 AH AL 41 3A BH BL SS:SP+2 =ACED:0726 SS:SP+3 =ACED:0727 SS:SP =ACED:0724 SS:SP+1 =ACED:0725
  • 19. Prof. Fayez F. M. El-Sousy Data Movement Instructions POP 0727H 0726H 0725H 0724H 0723H 0722H 072CH 072BH 072AH 0729H 0728H AD5F4H AD5F3H AD5F2H AD5FCH AD5FBH AD5FAH AD5F9H AD5F8H AD5F7H AD5F6H AD5F5H 67H 18H A3H 7EH 31H F2H 41H 3AH FFH 11H 72H Stack SS:SP+4 =ACED:0728 SS:SP+5 =ACED:0729 CH CL 67 FF 31 F2 AH AL 41 3A BH BL SS:SP+2 =ACED:0726 SS:SP+3 =ACED:0727 SS:SP =ACED:0724 SS:SP+1 =ACED:0725 Solution:
  • 20. Data Movement Instructions POP CX •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 SP P rof. F ra e ye g z F i. s M t . E el- r Sou is s y incremented by 2
  • 21. 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. LEAAX, NUMB ❖ AX ← operand offset address MUMB
  • 22. Data Movement Instructions LEA Example: LEA BX, [DI] MOV BX, [DI] ; loads offset address specified by [DI] (contents of DI) into BX register ; loads the data stored at the memory location addressed by [DI] into BX register MOV BX, DI = LEA BX, [DI]
  • 23. 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)
  • 24. 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
  • 25. ❖ LDS Des, Src ❖ It 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. Data Movement Instructions LDS
  • 26. ❖ LDS Des, Src ❖ Example: LDS BX, [DI] ❖ If DS= 1000H, DI = 1000H ❖ The LDS BX, [DI] instruction loads register BX from addresses 11000H and 11001H and register DS from locations 11002H and 11003H. This instruction is shown at the point just before DS changes to 3000H and BX changes to 127AH. Data Movement Instructions LDS
  • 28. Data Movement Instructions LES ❖ LES Des, Src ❖ It 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 instruction is very similar to LDS except that it initializes ES instead of DS.
  • 29. ❖ LES Des, Src ❖ Example: LES BX, [DI] ❖ If ES= 1000H, DI = 1000H ❖ The LES BX, [DI] instruction loads register BX from addresses 11000H and 11001H and register ES from locations 11002H and 11003H. This instruction is shown at the point just before ES changes to 3000H and BX changes to 127AH. Data Movement Instructions LES
  • 31. ❖ LAHF: ❖ It transfer the lower byte of flag register to AH. AH ← FLAG (Lower 8-bit) ❖ SAHF: ❖ It transfer the contents of AH to lower byte of flag register. FLAG (Lower 8-bit) ← AH ❖ PUSHF: ❖ Pushes flag register to top of stack. ❖ POPF: ❖Prof. F P aye o z F p . M s . El- t So h usy e stack top to flag register. Data Movement Instructions LAHF, SAHF, PUSHF, POPF
  • 32. 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
  • 33. Example: XCHG DX, AX XCHG AL, CL XCHG CX, BP XCHG DX, SI XCHG AL, [DI] Data Movement Instructions XCHG
  • 34. 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)
  • 35. Data Movement Instructions XLAT (Translate) The operation of the XLAT instruction at the point just before 6DHP iro sf. F la o ye a z F d . M e. d El-S io n usy to AL.
  • 36. ❖ IN Accumulator, Port Address ❖ This instruction transfers the operand from specified port to accumulator register. IN AX, 0028 H ❖ An IN instruction transfers data from an external I/O device into AL or AX ❖ OUT Port Address, Accumulator ❖ This instruction transfers the operand from accumulator to specified port. OUT 0028 H, AX ❖ An OUT transfers data from AL or AX to an external I/O device. Data Movement Instructions IN and OUT
  • 37. IN & OUT instructions perform I/O operations. Contents of AL or AX are transferred only between I/O device and microprocessor. Two forms of I/O device (port) addressing: Fixed-port addressing allows data transfer between AL, or AX using an 8-bit I/O port address. Port number follows the instruction’s opcode. IN AX, 0028 H OUT 0028 H, AX Data Movement Instructions IN and OUT
  • 38. Variable-port addressing allows data transfers between AL or AX and a 16-bit port address. The I/O port number is stored in register DX, which can be changed (varied) during the execution of a program. MOV DX, 0028H IN AX, DX OUT DX, AX Data Movement Instructions IN and OUT
  • 39. Data Movement Instructions IN and OUT The signals found in the microprocessor-based system for an OUT 19H, AX instruction.