0% found this document useful (0 votes)
15 views29 pages

Micro 2

The document provides instructions for an assembly language program that copies the contents of register B to register C on the 8085 microprocessor. It includes: 1) Step-by-step instructions for entering and running the program on an 8085 kit, including entering addresses, opcodes, and data. 2) A flowchart and program listing showing the MVI, MOV, and HLT instructions used to load data into register B and copy it to register C. 3) A note that the procedure can also be done using an 8085 simulator by typing instructions into an editor window.

Uploaded by

Hchadan Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views29 pages

Micro 2

The document provides instructions for an assembly language program that copies the contents of register B to register C on the 8085 microprocessor. It includes: 1) Step-by-step instructions for entering and running the program on an 8085 kit, including entering addresses, opcodes, and data. 2) A flowchart and program listing showing the MVI, MOV, and HLT instructions used to load data into register B and copy it to register C. 3) A note that the procedure can also be done using an 8085 simulator by typing instructions into an editor window.

Uploaded by

Hchadan Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Microprocessors CS 354 CO22329

Practical 2
Aim: Application of data transfer instructions to develop relevant programs.
a) Write a program to copy content of register B to register C
b) Develop a program that load the accumulator with the content of memory location
pointed by DE pair and store it at 3000H.
c) Create a program that transfer data from memory location 2050H to register D.
d) Create a program that load the accumulator with the content of memory location
2050H using LDA and then store it at 3000H.Also move the content to register B.
e) Program to place content of 2001H in register C and 82H in register B and add both of
them.After adding transfer content of accumulator to register D.
Hardware Requirements: 8085 Microprocessor, Power Supply to provide the necessary
voltage and current to the components.
Introduction to data transfer group : A "data transfer group" in assembly language
consists of instructions designed to transfer data from source to destination without altering
the content of source.Some of the data transfer instructions are as follows:
MOV - Move
• Syntax: MOV destination, source
• This instruction copies the contents of the source operand (register/memory) into the
destination operand (register). It is used to transfer data between registers or between a
register and memory.
MVI - Move Immediate:
• Syntax: MVI destination, data
• Moves an immediate 8-bit data value directly into the specified register or memory
location. It is used to load immediate data into registers or memory.
LDA - Load Accumulator Directly from Memory:
• Syntax: LDA memory_address
• Loads the accumulator register with the 8-bit data stored at the specified memory
address. Used to fetch data from memory into the accumulator.
STA - Store Accumulator Directly in Memory:
• Syntax: STA memory_address
• Stores the content of the accumulator into the memory location specified by the memory
address. Used to store data from the accumulator into memory.
LHLD - Load HL Pair Directly from Memory:
• Syntax: LHLD memory_address

Teacher’s signature………… 1|Page


Microprocessors CS 354 CO22329

• Loads the H and L registers with a 16-bit value stored at the specified memory address.
It transfers a pair of registers from memory into the H and L registers.
SHLD - Store HL Pair Directly in Memory:
• Syntax: SHLD memory_address
• Stores the content of the H and L registers into memory at the specified address. It
transfers a pair of registers from the H and L registers to memory.
LXI - Load Register Pair with Immediate data:
• Syntax: LXI register_pair, data
• Loads a 16-bit immediate value into the specified register pair. Common register pairs
are BC, DE, HL.
LDAX - Load Accumulator from Address in Register Pair:
• Syntax: LDAX register_pair
• Loads the accumulator with the 8-bit data from the memory location addressed by the
specified register pair. Used for indirect memory access.
STAX - Store Accumulator in Address in Register Pair:
• Syntax: STAX register_pair
• Stores the content of the accumulator into the memory location addressed by the
specified register pair. Used for indirect memory storage.
XCHG - Exchange HL register pair with DE register pair :
• Syntax: XCHG
• Swaps the content of the HL register pair with DE register pair.

A. Procedure for program to copy content of register B to register C :


▪ Register used : B,C
▪ Flag affected: No flag affected
▪ Initial Memory location :2021H

When you supply power to 8085 microprocessor kit


it will show “UP 85” as shown in fig(A.i).

Fig(A.i) 8085 kit displaying UP 85


(Source: lab)

Teacher’s signature………… 2|Page


Microprocessors CS 354 CO22329

Press the RESET button to reset the 8085 kit and


then press REL EXMEM.

After this you will see 8085 kit will look like as
shown in fig (A.ii).

Fig(A.ii) 8085 kit after pressing REL


EXMEM (Source: lab)
Now you have to enter the starting address of your
program say 2021.

After entering address you have to Press MEMC


NEXT

Type the hex code of the instruction in our case first


instruction is MVI B,02H . Hexcode for MVI is 06
Fig(A.iii) Entering Hexcode for MVI after entering it press
B,d8 on kit
(source: lab)
MEMC NEXT.This step is depicted by fig (A.iii)

After MEMC NEXT display will show next address


i.e 2022H at this address we have to enter data
which we want to move in register B.
Press MEMC NEXT
Fig(A.iv) represents this instruction.

Fig(A.iv) Entering 8-bit data which we


want to store in register B
(source: lab)

After MEMC NEXT display will show next address


i.e 2023H at this address we have to enter hexcode
for MOV C,B instructions,
therefore we input 48 at this address.
Press MEMC NEXT.

Fig(A.v) represents this instruction.


Fig(A.v) Hexcode for MOV C,B
instruction
(Source: lab)

Teacher’s signature………… 3|Page


Microprocessors CS 354 CO22329

Now input Hexcode of HLT instruction(i.e 76)


which is used to halt the program

Press MEMC NEXT.

Fig(A.vi) represents HLT instruction on 8085 kit.

Fig(A.vi) HLT instruction on 8085 kit


(Source: lab)

Press DEL GO.

Fig(A.vii) 8085 kit on pressing DEL GO


(Source: lab)

Enter initial address of your program (i.e from where


you write your first instruction).

Press MEMC NEXT.

Fig(A.viii) shows input of initial memory location.

Fig(A.viii) Entering of initial memory


location
(Source: lab)

After pressing MEMC NEXT the program will get


executed successfully and microprocessor kit shows
‘E’ as shown in fig(A.ix).

Fig(A.ix) Successful Execution of


program
(Source: lab)

Teacher’s signature………… 4|Page


Microprocessors CS 354 CO22329

Press RESET button.

After that press SHIFT and then EXREG to examine


the value of different registers.
Enter C as we want to check the value of register
C.The result will be displayed on 7 segment display
as shown in fig(A.x).

Fig(A.x) Displaying Result


(Source: lab)

Flowchart:

Start

MVI B,02H
Transfer 8-bit immediate
data (02H) into register B

MOV C,B
Move the content of
register B to register C

Halt

Program:
Memory Address Machine Code Opcode Operands Comments
2021H 06,02 MVI B,02H Transfer 8-bit immediate data
i.e 02H into register B
2023H 48 MOV C,B Move the content of register B
to register C
2024H 76 HLT - Halt the program

Procedure for program to copy content of register B to register C on simulator:


1. First click on tools then go to assembler after that editor window will open type your
instructions here.The editor window will be shown in fig(A.a)

Teacher’s signature………… 5|Page


Microprocessors CS 354 CO22329

Fig(A.a) Editor window to type instructions (Source : Simulator Software)

2. After typing instructions save your file and after saving go to tools and click on assemble
to assemble instructions or to check it for errors. Fig(A.b) shows input instructions with
zero error.

Fig(A.b) Assembling of instructions (Source :Simulator Software)


3. Close editor window and load program by clicking File and then go to load program
and select desired file.
4. Click on rate and then check step by step option to execute the instructions step by step.
Then click on simulation and then on start to start execution of program and then click
on function key 2 to execute the next instructions as shown in fig(A.c) .

Teacher’s signature………… 6|Page


Microprocessors CS 354 CO22329

Fig(A.c) Showing execution of each step on 8085 simulator (Source : Simulator software)
5. After successful completion of instructions when we see the value of register C it come
out to be 02H.
Output: The output of the program is that the value of register C equals to 02H which is
same as that of value of register B.This shows successful transferring of data from one
register to another.

B. Procedure for program that load the accumulator with the content of
memory location pointed by DE pair and store it at 3000H:
▪ Register used : D Initial Memory location :2021

Supply power to 8085 microprocessor kit.

Press the RESET button to reset the 8085 kit and


then press REL EXMEM.

After this you will see 8085 kit will look like as
shown in fig (B.i).
Fig(B.i) 8085 kit after pressing REL
EXMEM (Source: lab)

Now you have to enter the starting address of


your program say 2021.

After entering address you have to Press MEMC


NEXT

Type the hexcode of the instruction in our case


instruction is LXI D,2000H . Hexcode for
instruction is 11 after entering press
Fig(B.ii) Entering Hexcode for LXI on kit MEMC NEXT.This step is depicted by fig (B.ii)
(source: lab)

Teacher’s signature………… 7|Page


Microprocessors CS 354 CO22329

After MEMC NEXT display will show next


address i.e 2022H at this address we have to
enter lower byte of data which we want to load
in DE pair.
Press MEMC NEXT
Fig(B.iii) represents this instruction.

Fig(B.iii) Entering lower byte of data


(Source: lab)

After MEMC NEXT display will show next


address i.e 2023H at this address we have to
enter upper byte of data i.e 20 which we want to
load in DE pair.
Fig(B.iv) represents this instruction.

Fig(B.iv) Entering upper byte of data


(Source: lab)

Press MEMC NEXT.


At next address input the hexcode of LDAX D
instruction which will load accumulator
indirectly with the content of memory location
pointed by DE pair.
Fig(B.v) represents this instruction.

Fig(B.v) Entering Hexcode for LDAX D


instruction
(source: lab)

Press MEMC NEXT to save the previous


instruction and at the updated address i.e 2025H
enter hexcode for STA instruction (as shown in
fig(B.vi) ) which is used to store the
accumulator’s content at the specified memory
location.

Fig(B.vi) Hexcode of STA instruction


(Source: lab)

Teacher’s signature………… 8|Page


Microprocessors CS 354 CO22329

Enter the lower byte of memory location ie 00


where you want to store the content of
accumulator.

Press MEMC NEXT to save the instruction.

Fig(B.vii) represents execution of this


Fig(B.vii) Entering lower byte of memory instruction on kit.
location
(Source: lab)

Enter the upper byte of memory location ie 30


where you want to store the content of
accumulator.

Press MEMC NEXT to save the instruction.

Fig(B.viii) represents execution of this


Fig (B.viii) Entering upper byte of memory instruction on kit.
location
(Source: lab)

Now input Hexcode of HLT instruction(i.e 76)


which is used to halt the program

Press MEMC NEXT.

Fig(B.ix) represents HLT instruction on 8085 kit.

Fig(B.ix) HLT instruction on 8085 kit


(Source: lab)

Press RESET button .

Then REL EXMEM and enter the data at


memory location which we have used in LXI
instruction i.e 2000H.

Press MEMC NEXT .


Fig(B.x) Enter data at memory location
Fig(B.x) depict this instruction on 8085 kit.
(2000H)
(Source: lab)

Teacher’s signature………… 9|Page


Microprocessors CS 354 CO22329

Press DEL GO.

Fig(B.xi) 8085 kit after pressing DEL GO


(Source: lab)

Enter initial address of your program (i.e from


where you write your first instruction).

Press MEMC NEXT.

Fig(B.xii) shows input of initial memory


location.

Fig(B.xii) Enter initial memory location


(Source: lab)

After pressing MEMC NEXT the program will


get executed successfully and microprocessor kit
shows ‘E’ as shown in fig(B.xiii).

Fig(B.xiii) Successful Execution of program


(Source: lab)

Press RESET button.

After that press REL EXMEM and enter memory


location where the content of accumulator is
stored i.e 3000H and press MEMC NEXT the
result will display on the seven segment display.

Fig(B.xiv) Displaying Result


(Source: lab)

Teacher’s signature………… 10 | P a g e
Microprocessors CS 354 CO22329

Flowchart:

Start

LXI D,2000H Load


the 2000 into a DE
register pair

LDAX D Load
accumulator indirect

STA 3000H Store the


content of accumulator
at 3000H

Halt

Program:
Memory Address Machine Code Opcode Operands Comments
2021H 11,00,20 LXI D,2000H Load the data into a DE
register pair.
2024H 1A LDAX D Load accumulator indirectly
by the content of memory
location pointed by DE pair.
2025H 32,00,30 STA 3000H Store the content of
accumulator at 3000H
2028H 76 HLT - Halt the program

Procedure to execute the same program on simulator.


1. Open editor window, type your instructions there. After typing instructions save your
file and after saving go to tools and click on assemble to assemble instructions.

Fig(B.a) Assembling of instructions (Source :Simulator Software)


Teacher’s signature………… 11 | P a g e
Microprocessors CS 354 CO22329

2. Close editor window and load program by clicking File and then go to load program
and select desired file.
3. Enter data at memory location 2000H as 06H.Memory editor will be shown in fig(B.b).

Fig(B.b) Memory editor (Source : Simulator software)

4. Click on rate and then check step by step option to execute the instructions step by
step.Then click on simulation and then on start to start execution of program and then
click on function key 2 to execute the next instructions as shown in fig(B.c) .

Fig(B.c) Showing execution of each step on 8085 simulator (Source : Simulator software)
5. After successful completion of instructions when we see the value at 3000H memory
address it come out to be 06H.Also no flag get affected in this case.

Output: The output of the program is that the value of accumulator is equals to 06H which
is same as that of value at memory location pointed by DE pair and 06H is stored at a 3000H
memory location.

Teacher’s signature………… 12 | P a g e
Microprocessors CS 354 CO22329

C. Procedure for program that transfer data from memory location 2050H to
register D. [ Register used : D and Initial memory location : 2021H ]
Supply power to 8085 microprocessor kit .
Press the RESET button then press REL
EXMEM.Now enter the starting address of your
program say 2021H.After entering address you
have to Press MEMC NEXT.
Type the hex code of the instruction in our case
first instruction is LXI H,2050H . Hexcode for
LXI is 21 after entering press
Fig(C.i) Entering Hexcode for LXI on kit
MEMC NEXT.This step is depicted by fig (C.i)
(source: lab)

After MEMC NEXT display will show next


address i.e 2022H at this address we have to
enter lower byte of data which we want to load
in HL pair.
Press MEMC NEXT
Fig(C.ii) represents this instruction.
Fig(C.ii) Entering lower byte of data
(Source: lab)

After MEMC NEXT display will show next


address i.e 2023H at this address we have to
enter upper byte of data i.e 20 which we want
to load in HL pair.
Fig(C.iii) represents this instruction.

Fig(C.iii) Entering upper byte of data


(Source: lab)

Press MEMC NEXT.


At next address input the hexcode of MOV D,M
instruction which will move the content of
memory location pointed by HL pair into
register D.
This instruction is as shown in fig(C.iv).
Fig(C.iv) Hexcode for MOV A,M instruction
(Source: lab)

Teacher’s signature………… 13 | P a g e
Microprocessors CS 354 CO22329

Now input Hexcode of HLT instruction(i.e 76)


which is used to halt the program

Press MEMC NEXT.

Fig(C.v) represents HLT instruction on 8085 kit.

Fig(C.v) HLT instruction on 8085 kit


(Source: lab)

Press RESET button .

Then REL EXMEM and enter the data at


memory location which we have used in LXI
instruction i.e 2050H.

Press MEMC NEXT .


Fig(C.vi) depict this instruction on 8085 kit.

Fig(C.vi) Enter data at memory location


(2050H)
(Source: lab)

Press DEL GO.

Fig(C.vii) 8085 kit after pressing DEL GO


(Source: lab)

Enter initial address of your program (i.e from


where you write your first instruction).

Press MEMC NEXT.

Fig(C.viii) shows input of initial memory


location.
Fig(C.viii) Enter initial memory location
(Source: lab)

Teacher’s signature………… 14 | P a g e
Microprocessors CS 354 CO22329

After pressing MEMC NEXT the program will


get executed successfully and microprocessor kit
shows ‘E’ as shown in fig(C.ix).

Fig(C.ix) Successful Execution of program


(Source: lab)

Press RESET button.

After that press SHIFT and then EXREG to


examine the value of different registers.
Enter D as we want to check the value of register
D.The result will be displayed on 7 segment
display as shown in fig(C.x).

Fig(C.x) Displaying value of Register D


(Source: lab)

Flowchart: Start

LXI H,2050H Load


the 2050 into a HL
register pair

MOV D,M Move the


content of memory
location pointed by HL pair
to D

Halt

Program:
Memory Address Machine Code Opcode Operands Comments
2021H 21,50,20 LXI H,2050H Load the HL pair with 2050H
2024H 56 MOV D,M Move the content of memory
location pointed by HL pair
into a register D
2025H 76 HLT - Halt the program
Teacher’s signature………… 15 | P a g e
Microprocessors CS 354 CO22329

Procedure for program that transfer data from memory location 2050H to register
D on simulator.
1. First click on tools then go to assembler after that editor window will open type your
instructions there.After typing instructions save your file and after saving go to tools
and click on assemble to assemble instructions or to check it for errors. Fig(C.a)
shows input instructions with zero error.

Fig(C.a) Assembling of instructions (Source :Simulator Software)


2. Close editor window and load program by clicking File and then go to load program
and select desired file.
3. Enter data at memory location 2050H as 02H.Memory editor will be shown in fig(C.b)

Fig(C.b) Memory editor (Source : Simulator software)

4. Click on rate and then check step by step option to execute the instructions step by
step.Then click on simulation and then on start to start execution of program and then
click on function key 2 to execute the next instructions as shown in fig(C.c) .

Teacher’s signature………… 16 | P a g e
Microprocessors CS 354 CO22329

Fig(C.c) Showing execution of each step on 8085 simulator (Source : Simulator software)

6. After successful completion of instructions when we see the value of register D it come
out to be 02H.Also no flag get affected in this case.
Output: The output of the program is that the value of register D equals to 02H which is
same as that of value at memory location 2050H.This shows successful transferring of data
from memory location to register .
D. Procedure for program that load the accumulator with the content of
memory location 2050H using LDA and then store it at 3000H.Also move
the content to register B.
▪ Register used: B Initial Memory location :2021H
▪ Input location:2050H Flag affected :No flag affected
Supply power to 8085 microprocessor kit .
Press the RESET button to reset the 8085 kit and
then press REL EXMEM.
Now you have to enter the starting address of
your program say 2021H.
After entering address you have to Press MEMC
NEXT.
Type the hex code of the instruction in our case
first instruction is LDA 2050H . Hexcode for
Fig(D.i) Entering Hexcode for LDA on kit
LDA is 3A after entering press
(source: lab) MEMC NEXT.This step is depicted by fig (D.i)

After MEMC NEXT display will show next


address i.e 2022H at this address we have to
enter lower byte of memory location from where
we want to load content in accumulator .
Press MEMC NEXT
Fig(D.ii) represents this instruction.

Fig(D.ii) Entering lower byte of address


(Source: lab)

Teacher’s signature………… 17 | P a g e
Microprocessors CS 354 CO22329

After MEMC NEXT display will show next


address i.e 2023H at this address we have to
enter upper byte of address i.e 20 from where we
want to load content in accumulator .
Fig(D.iii) represents this instruction.

Fig(D.iii) Entering upper byte of address


(Source: lab)

Press MEMC NEXT.


At next address input the hexcode of MOV B,A
instruction which will move the content of
accumulator register B.
This instruction is as shown in fig(D.iv).

Fig(D.iv) Hexcode for MOV B,A


instruction
(Source: lab)

Again Press MEMC NEXT to save the previous


instruction and at the updated address input 32
which is the hexcode for STA instruction which
will store the data of accumulator at a given
memory location .The execution of this
instruction is shown in fig(D.v).

Press MEMC NEXT


Fig(D.v) Hexcode of STA instruction
(Source: lab)

Enter the lower byte of memory location ie 00


where you want to store the content of
accumulator.

Press MEMC NEXT to save the instruction.

Fig(D.vi) represents execution of this instruction


on kit.
Fig(D.vi) Enter lower byte of memory
location
(Source: lab)

Teacher’s signature………… 18 | P a g e
Microprocessors CS 354 CO22329

Enter the upper byte of memory location ie 30


where you want to store the content of
accumulator.

Press MEMC NEXT to save the instruction.

Fig(D.vii) represents execution of this instruction


Fig (D.vii) Entering upper byte of memory
location on kit.
(Source: lab)

Now input Hexcode of HLT instruction(i.e 76)


which is used to halt the program

Press MEMC NEXT.

Fig(D.viii) represents HLT instruction on 8085


kit.
Fig(D.viii) HLT instruction on 8085 kit
(Source: lab)

Press RESET button .

Then REL EXMEM and enter the data at memory


location which we have used in LXI instruction i.e
2050H.

Press MEMC NEXT .


Fig(D.ix) depict this instruction on 8085 kit.

Fig(D.ix) Enter data at memory


location(2050H)
(Source: lab)

Press DEL GO.

Fig(D.x) 8085 kit after pressing DEL GO


(Source: lab)

Teacher’s signature………… 19 | P a g e
Microprocessors CS 354 CO22329

Enter initial address of your program (i.e from


where you write your first instruction).

Press MEMC NEXT.

Fig(D.xi) shows input of initial memory location.

Fig(D.xi) Entering of initial memory


location
(Source: lab)

After pressing MEMC NEXT the program will get


executed successfully and microprocessor kit
shows ‘E’ as shown in fig(D.xii).

Fig(D.xii) Successful Execution of program


(Source: lab)

Press RESET button.

After that press SHIFT and then EXREG to


examine the value of different registers.
Enter B as we want to check the value of register
B.The result will be displayed on 7 segment
display as shown in fig(D.xiii).

Fig(D.xiii) Displaying value of Register B


(Source: lab)

Press RESET button.

After that press REL EXMEM and enter memory


location where the content of accumulator is
stored i.e 3000H and press MEMC NEXT the
result will display on the seven segment display as
shown in fig(D.xiv)
Fig(D.xiv) Displaying value at 3000H
(Source: lab)

Teacher’s signature………… 20 | P a g e
Microprocessors CS 354 CO22329

Flowchart:
Start

LDA,2050H Load
accumulator direct

MOV B,A Move


content of accumulator
to register B

STA 3000H Store the


content of accumulator
at 3000H

Halt

Program:
Memory Address Machine Code Opcode Operands Comments
2021H 3A,50,20 LDA 2050H Load accumulator directly by
the content of memory
location 2050H.
2024H 47 MOV B,A Move the content from
accumulator to register B
2025H 32,00,30 STA 3000H Store the accumulator content
at 3000H memory location.
2028H 76 HLT - Halt the program

Procedure to execute this program on a 8085 simulator:


1. Open editor window, type your instructions there. After typing instructions save your
file and after saving go to tools and click on assemble to assemble instructions.

Fig(D.a) Assembling of instructions (Source :Simulator Software)

Teacher’s signature………… 21 | P a g e
Microprocessors CS 354 CO22329

2. Close editor window and load program by clicking File and then go to load program
and select desired file.
3. Enter data at memory location 2050H as 05H.Memory editor will be shown in fig(D.b)

Fig(D.b) Memory editor (Source : Simulator software)

4. Click on rate and then check step by step option to execute the instructions step by
step.Then click on simulation and then on start to start execution of program and then
click on function key 2 to execute the next instructions as shown in fig(D.c) .

Fig(D.c) Showing execution of each step on 8085 simulator (Source : Simulator software)
5. After successful completion of instructions when we see the value of register B it come
out to be 05H and value at 3000H memory location is also 05H.
Output: The output of the program is that the value of register B equals to 05H which is
same as that of value at memory location 2050H and 05H is stored at a 3000H memory
location.

Teacher’s signature………… 22 | P a g e
Microprocessors CS 354 CO22329

E. Procedure for program to place content of 2001H in register C and 82H in


register B and add both of them.After adding transfer content of
accumulator to register D. [Register : C,B,D & Initial location : 2021H]
Supply power to kit and press the RESET button,
then press REL EXMEM.
Now you have to enter the starting address of your
program say 2021H.
After entering address you have to Press MEMC
NEXT.
Type the hex code of the instruction in our case
Fig(E.i) Entering Hexcode for LXI on kit
(source: lab) first instruction is LXI H, 2001H Hexcode for LXI
is 21 after entering press MEMC NEXT.This step
is depicted by fig (E.i)

After MEMC NEXT display will show next


address i.e 2022H at this address we have to enter
lower byte of data which we want to load in HL
pair.
Press MEMC NEXT
Fig(E.ii) represents this instruction.

Fig(E.ii) Entering lower byte of data


(Source: lab)

After MEMC NEXT display will show next


address i.e 2023H at this address we have to enter
upper byte of data i.e 20 which we want to load in
HL pair.
Fig(E.iii) represents this instruction.

Fig(E.iii) Entering upper byte of data


(Source: lab)

Press MEMC NEXT.


At next address input the hexcode of MOV C,M
instruction which will move the content of
memory location pointed by HL pair to register C.
This instruction is as shown in fig(E.iv).

Fig(E.iv) Hexcode for MOV C,M


instruction
(Source: lab)

Teacher’s signature………… 23 | P a g e
Microprocessors CS 354 CO22329

Press MEMC NEXT.

Type the hex code for the next instruction in our


case next instruction is MVI B,82H. Hexcode for
MVI is 06 after entering it press MEMC NEXT.
The execution of this instruction is shown in
fig(E.v).
Fig(E.v) Hexcode of MVI instruction
(Source: lab)

After MEMC NEXT display will show next


address i.e 2026H at this address we have to enter
data which we want to move in register B.
Press MEMC NEXT
Fig(E.vi) represents this instruction.

Fig(E.vi) Enter 8-bit data which we want


to store in register B
(source: lab )

At next address input the hexcode of MOV A,C


instruction which will move the content of register
C to accumulator.
This instruction is as shown in fig(E.vii).

Fig (E.vii) Enter hexcode for MOV A,C


instruction
(Source: lab)

Press MEMC NEXT

At next address input the hexcode of ADD B


instruction i.e 80, which will add the content of
register B to accumulator.
This instruction is as shown in fig(E.viii).

Fig (E.viii) Entering hexcode for ADD B


instruction
(Source: lab)

Teacher’s signature………… 24 | P a g e
Microprocessors CS 354 CO22329

Press MEMC NEXT

At next address input the hexcode of MOV D,A


instruction which will move the content of
accumulator to register D.
This instruction is as shown in fig(E.ix).

Fig(E.ix) Enter hexcode for MOV D,A


instruction
(Source: lab)

Now input Hexcode of HLT instruction(i.e 76)


which is used to halt the program

Press MEMC NEXT.

Fig(E.x) represents HLT instruction on 8085 kit.

Fig(E.x) HLT instruction on 8085 kit


(Source: lab)

Press RESET button .

Then REL EXMEM and enter the data at memory


location which we have used in LXI instruction i.e
2001H.

Press MEMC NEXT .


Fig(E.xi) depict this instruction on 8085 kit.
Fig(E.xi) Enter data at memory
location(2001H)
(Source: lab)

Press DEL GO.

Fig(E.xii) 8085 kit after pressing DEL GO


(Source: lab)

Teacher’s signature………… 25 | P a g e
Microprocessors CS 354 CO22329

Enter initial address of your program (i.e from


where you write your first instruction).
Press MEMC NEXT.
Fig(E.xiii) shows input of initial memory location.

After pressing MEMC NEXT the program will get


executed successfully and microprocessor kit
Fig(E.xiii) Enter initial memory location shows ‘E’ on seven segment display.
(Source: lab)
Press RESET button.

After that press SHIFT and then EXREG to


examine the value of different registers.
Enter D as we want to check the value of register
D.The result will be displayed on 7 segment display
as shown in fig(E.xiv).
Fig(E.xiv) Displaying value of Register D

Flowchart: Start

LXI H,2001H Load


Register pair
immediate

MOV C,M Move


content from memory
to register C

MVI B,82H Move


immediate data 82H to
register B

MOV A,C Move


content from register C
to accumulator

ADD B Add content


of register B to
accumulator

MOV D,A Move


content of accumulator
to register D

Halt

Teacher’s signature………… 26 | P a g e
Microprocessors CS 354 CO22329

Program:
Memory Address Machine Code Opcode Operands Comments
2021H 21,01,20 LXI H,2001H Load HL pair with 2001H
2024H 4E MOV C,M Move the content of memory
location pointed by HL pair
to register C.
2025H 06,82 MVI B,82H Move immediate data 82H to
register B
2027H 79 MOV A,C Move content of register C to
accumulator .
2028H 80 ADD B Add content of register B to
accumulator
2029H 57 MOV D,A Move content of accumulator
to register D .
202AH 76 HLT - Halt the program

Procedure for the same program on simulator:


1. First click on tools then go to assembler after that editor window will open type your
instructions here.The editor window will be shown in fig(E.a)

Fig(E.a) Editor window to type instructions (Source : Simulator Software)

2. After typing instructions save your file and after saving go to tools and click on assemble
to assemble instructions or to check it for errors. Fig(E.b) shows input instructions with
zero error.

Fig(E.b) Assembling of instructions (Source :Simulator Software)

Teacher’s signature………… 27 | P a g e
Microprocessors CS 354 CO22329

3. Close editor window and load program by clicking File and then go to load program
and select desired file.
4. Enter data at memory location 2001H as 01H.Memory editor will be shown in fig(E.c).

Fig(E.c) Memory editor (Source : Simulator software)

5. Click on rate and then check step by step option to execute the instructions step by
step.Then click on simulation and then on start to start execution of program and then
click on function key 2 to execute the next instructions as shown in fig(E.d) .

Fig(E.d) Showing execution of each step on 8085 simulator (Source : Simulator software)

Teacher’s signature………… 28 | P a g e
Microprocessors CS 354 CO22329

6. After successful completion of instructions when we see the value of register D it come
out to be 83H.Also Z,AC,P,CF flags get affected in this case.
Output:
The output of the program is that the value of register C equals to 01H which is same as that
of value at memory location 2001H and value of register B is 82H.After adding both their
result will be stored in register D (i.e 83 H)
Precautions:
1. Handle the kit carefully.
2. Press the Microprocessor kit keys properly.
3. Ensure the correct power supply voltage and polarity according to the trainer kit's
specifications.

Lesson Learnt: Through this experiment I have learned how to use data transfer instructions
set on microprocessor trainer kit as well as on the 8085 simulator. I learned about the
functionality of various instructions like MOV, LDA, STA, MVI, LXI and LDAX etc.

Frequently Asked Questions (FAQ)

Q1 : What does LDA stand for?


Ans: Load Accumulator Direct.
Q2 : What does STA stand for?
Ans: Store Accumulator Direct.
Q3 : What does XCHG instruction do?
Ans: It will interchange the content of HL and DE pair.
Q4 : What is a data transfer group in assembly language?
Ans: A data transfer group in assembly language refers to a set of instructions specifically
designed for transferring data from a source to a destination without modifying the content of
the source.
Q5 : Define SHLD.
Ans: Store H and L with the Destination Address.
Q6 : Can data transfer group instructions modify the source data?
Ans: No.

Teacher’s signature………… 29 | P a g e

You might also like