Program to simulate decimal down counter in 8085 Microprocessor


Here we will see one 8085 Microprocessor program. In this program we will see how to simulate the decimal down counter.

Problem Statement 

Write an 8085 Assembly language program to simulate decimal down counter. It will count from 9 down to 0, and comeback to 9 again.

Discussion 

In this section we are simulating the decimal down counter. Here the counter will count 100 decimal numbers from 99 to 0. All values will be updated in each 0.5 seconds. For decimal count we are using the DAA instruction.

Note: Here for simplicity we are storing the numbers into memory. To simulate it like a counter we can use 7-segment display to show the numbers

Input

Here we are not providing any input.

Flow Diagram

Program

Address
HEX Codes
Labels
Mnemonics
Comments
F000
3E, 99
 
MVI A,99H  
Initialize A with 99H
F002
32, 00, 80
LOOP
STA 8000H  
Store A into 8000H
F005
CD, 11, F0
 
CALL DELAY
Wait for 0.5 second
F008
3A, 00, 80
 
LDA 8000H  
Get back the data from 8000H
F00B
C6, 99
 
ADI 99H
Add 99H with the number
F00D
27
 
DAA
Decimal adjust
F00E
C3, 02, F0
 
JMP LOOP  
Jump to LOOP
F011
01, FF, FF
DELAY
LXI B,FFFFH  
Initialize BC register pair to FFFFH
F014
0B
L1
DCX B  
Decrease BC
F015
78
 
MOV A,B
Take B to A
F016
B1
 
ORA C  
OR C and E
F017
C2, 13, F0
 
JNZ L1
If Z = 0, jump to L1
F01A
C9
 
RET
Return from subroutine

 

Output

                The numbers are storing into memory location 8000H.

Updated on: 05-Oct-2019

581 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements