You are on page 1of 7

Al - Mut ha na

Uni ve r s i t y

electronics communications engineering

EXPERIMENT-2 : Data Transfer Instructions


Name : Ali Sabah
Dr. Ouda Rahim
EXP NO.2 Data Transfer

Object:
1. Explain the Data Transfer Instructions group.
2. Learn how sorting an assembly program using 8085 Microprocessor
Training Kit M85-01
Theory:
The basic machine instructions are those from the data transfer group these are
generally referred to as the move or load instructions and the main instructions are as
follows:

Instructions Description Example

Move the data between the internal processor reg., is MOV B,A
MOV Rd,Rs expressed (Rd) (Rs)

Move immediate 8-bit data value to transfer to MVI C, 08H


MVI Rd,8-bit data accumulator (A) 8-bit

LXI reg. pair, 16-bit (BC, The reg. pair being loaded with immediate 16-bit data LXI H,2400H
DE or HL) or address.

LDA 16-bits memory LDA 28EAH


location (address) This results in the A reg. being loaded with the
contents of memory location. (A) (28EA)

STA 16-bits memory STA 28F2H


location (address Similar the contents of the A reg. may be stored in a (28F2) (A)
specified memory location.

LDAX Rp Load accumulator indirect LDAX B

[A] ← [[BC]]
STAX Rp Store accumulator indirect STAX D

[[DE]] ← [A]
LHLD 16-bit memory LHLD 28A2 H
address Load the reg. pair H&L a 16-bit memory address
(L) (28A2)
using an direct addressing
(H) (28A3)
SHLD 16-bit memory Similar, store the reg. Pair H&L a 16-bit memory SHLD 28A2H
Address address using an direct addressing.
(28A2) (L)
(28A3) (H)

Exchange the contents of reg. pair HL &


XCHG
DE with (DE) (HL)
Procedure:

Implement the following programs:

a. LDA 2400H : Get a byte from monitor ROM


MOV D, A : Store it in register D
STA 2500H : AND 2500H in RAM
HLT : Stop

b. LXI H,2850H : Put 28H into register H, & 50H into register L
MVI A,70H : Put 70H immediate in Reg.A
MOV M,A : Move content of A indirect to Memory address
HLT : Stop

c. LXI H, 2100H : Put 21H into register H, & 00H into register L LXI D,
2200H : Put 20H into register H, & 00H into register L
XCHG : Swap DE with HL
HLT : Stop

A-
Address Hex Code
2000 21
2001 50
2002 28
2003 3E
2004 77
2005 77
2006 77
2600 EF

Address Input data Address Output data


2500 FA 2600 FA
B-
Address Hex Code
2000 3E
2001 00
2002 25
2003 57
2004 32
2005 00
2006 26
2600 EF

Address Input data Address Output data


A 77 2850 77

C-
Address Hex Code
2000 21
2001 55
2002 28 Address Output data
2003 11 H 22
2004 33 L 33
2005 22
D 28
2006 EB
2600 EF E 55
Discussion:
1. What is the difference between (ROM) and (RAM) memory types?
RAM is volatile memory that temporarily stores the files you are working on. ROM is
non-volatile memory that permanently stores instructions for your computer

2. What is the purpose of the Program Counter (PC) and Stack Pointer (SP)?
The Stack Pointer register will hold the address of the top location of the stack

3. Write 3 different program segments to store (05)H in memory location (2850)H

1-
MVI A,05H
STA 2850H
HLT
2-
LXI H,2850
MVI A,05H
MOV A,H
HLT
3-
LXI H,2850
MOV A,05H
MOV A,H
HLT
4. Write an 8085 program to store 4EH in memory location 2840H and store 3EH
in memory location 2841H, exchange them and store the result in memory
locations 2842H and 2843H respectively. Solve this problem using three
different methods.

MVI A,4EH
STA 2840H
MVI A,3EH
STA 2841H
LXI H,2840H
LXI D,2841H
XCHG
LXI H,2840H
LDA 2840H
STA 2841H
LXI H,2841H
LDA 2841H
STA 2842H
HLT
5. Write a program to exchange the content of memory locations [2801][2800] with
[2803][2802] .

LXI H,2800H
LXI D,2802H
XCHG
LXI H,2801H
LXI D,2803H
XCHG
HLT

You might also like