0% found this document useful (0 votes)
21 views3 pages

MPI Lab Manual 8

The document outlines Experiment No. 8 for a Microprocessor and Interfacing course, focusing on writing assembly language programs for reversing an 8-bit data block using stack and creating a decade counter with a 1 ms delay using an 8085 simulator. It includes objectives, equipment needed, program codes, observations, conclusions, and a quiz related to the 8085 microprocessor. The experiment emphasizes practical skills in programming and logic building.

Uploaded by

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

MPI Lab Manual 8

The document outlines Experiment No. 8 for a Microprocessor and Interfacing course, focusing on writing assembly language programs for reversing an 8-bit data block using stack and creating a decade counter with a 1 ms delay using an 8085 simulator. It includes objectives, equipment needed, program codes, observations, conclusions, and a quiz related to the 8085 microprocessor. The experiment emphasizes practical skills in programming and logic building.

Uploaded by

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

Microprocessor and Interfacing (3160712) 230213107009

Experiment No - 8

Aim: (A) Write an assembly language program to reverse the block of 8-bit data using stack in
8085 simulator.

(B) Write an assembly language program for decade counter with 1 ms delay between two
successive counts using 8085 simulator.

Date: 02/04/2025

Competency and Practical Skills: Logic building, Programming and Analyzing

Relevant CO: CO3

Objectives: (a) To recall concepts of stack in 8085 microprocessor


(b) To use PUSH and POP instructions in 8085 microprocessor.
.
Equipment/Instruments: 8085 microprocessor kit / 8085 Simulator

Program:

(A) Program to reverse the block of 8-bit data using stack in 8085 simulator.

Input : (2050H): 03H


(2051H): 10H
(2052H): 11H
(2053H): 12H

Output : (2100H): 12H


(2101H): 11H
(2102H): 10H

Addres
Label Mnemonics Hex Code Comments
s
0000H LXI H, 2050H 21 50 20 Load source address into HL
0003H MOV C, M 4E Move count from memory to register C
0004H INX H 23 Point to first data byte

0005H LXI SP, 3000H 31 00 30 Initialize stack pointer


PUSH_LOO
0008H MOV A, M 7E Load data byte into A
P
0009H PUSH PSW F5 Push A onto stack

000AH INX H 23 Next memory location

30
Microprocessor and Interfacing (3160712) 230213107009
000BH DCR C 0D Decrement count

000CH JNZ PUSH_LOOP C2 08 00 Loop until all bytes pushed

000FH LXI H, 2100H 21 00 21 Set HL to destination

0012H MVI C, 03H 0E 03 Reload count

0014H POP_LOOP POP PSW F1 Pop value from stack

0015H MOV M, A 77 Store value at destination

0016H INX H 23 Next destination location

0017H DCR C 0D Decrement count

0018H JNZ POP_LOOP C2 14 00 Loop until all values popped

001BH HLT 76 Halt the program

(B) Program for decade counter with 1 ms delay between two successive counts using
8085 simulator

Input : C : 09H

Output : PORT01 : 01H

Address Label Mnemonics Hex Code Comments


0000 MVI C, 09H 0E 09 Load 9 into register C (start count)
0002 LOOP MOV A, C 79 Move C to accumulator A
0003 OUT 01H D3 01 Output A to port 01H

0005 CALL DELAY CD 0C 00 Call delay subroutine

0008 DCR C 0D Decrement C

0009 JNZ LOOP C2 02 00 Jump to LOOP if C ≠ 0

000C HLT 76 Halt the program

000D DELAY MVI B, D6H 06 D6 Load 214 into register B

000F DL1 DCR B 05 Decrement B

0010 JNZ DL1 C2 0F 00 Loop until B = 0

0013 RET C9 Return from subroutine

Observations:
In Program A, stack operations were successfully used to reverse a block of 8-bit data. Each byte
from memory was pushed onto the stack and then popped into another memory location in reverse
order, confirming correct use of stack in 8085.

In Program B, the decade counter output from 9 to 0 was observed on port 01H with
31
Microprocessor and Interfacing (3160712) 230213107009
approximately 1 ms delay using an 8-bit register for delay timing. The use of subroutine provided
a clean and reusable delay mechanism.

Conclusion:
Program A Conclusion: Stack operations in 8085 can be effectively used to reverse a sequence of
data in memory. This exercise demonstrated practical application of LIFO behavior of the stack.
Program B Conclusion: Delay subroutines allow time-controlled execution in microprocessor
programs. Counting from 9 to 0 with a 1 ms delay between steps was achieved using minimal
registers, demonstrating efficient timing control.

Quiz:
(1) What is the use of NOP instruction in 8085 microprocessors?
Ans: It performs no operation and is used for timing or instruction alignment.

(2) What is the application of delay counter program in 8085 microprocessor?


Ans: It creates time delays between operations, useful in timing-sensitive applications like
LED blinking or counters.

(3) What is the use of PUSH and POP instructions?


Ans: PUSH stores register pair data on the stack; POP retrieves it. They're used for temporary
storage and subroutine calls.

Suggested Reference:

8085 – Microprocessor architecture, programming and interfacing by Ramesh S. Goankar, 5 th edition,


prentice hall publication.

References used by the students:

https://www.geeksforgeeks.org/

Rubric wise marks obtained:

Problem Completeness
Knowledge Logic
Recognition and accuracy Ethics (2)
Rubrics (2) Building (2) Total
(2) (2)
Good Average Good Average Good Average Good Average Good Average
(2) (1) (2) (1) (2) (1) (2) (1) (2) (1)

Marks

32

You might also like