Program to alternately display 00 and FF in the data field in 8085 Microprocessor


Here we will see one 8085 microprocessor program. This program will generate 00H and FFH alternatively.

Problem Statement 

 Write an 8085 Assembly language program that can generate 00H and FFH alternatively.

Discussion 

 The 00H and FFH are changed alternatively in each second. So we need one second delay. We have created delay subroutine to generate 1s delay.

Note: Here for simplicity we are storing the numbers into memory. To show the numbers, we can use 7 – segment display and other display function for showing it into the display.

Input

Here we are not providing any input.

Flow Diagram

Program

Address
HEX Codes
Labels
Mnemonics
Comments
F000
AF
LOOP
XRA A
Clear A register
F001
32, 50, 80
 
STA 8050H  
Store 00H at 8050H
F004
CD, 11, F0
 
CALL DELAY
Wait for 1 second
F007
3D
 
DCR A  
Decrease A to get FFH
F008
32, 50, 80
 
STA 8050H  
Store FFH at 8050H
F00B
CD, 11, F0
 
CALL DELAY
Wait for 1 second
F00E
C3, 00, F0
 
JMP LOOP  
Jump to Loop
F011
0E, 02
DELAY
MVI C,02H  
Initialize Count to 02H
F014
11, FF, FF
L1
LXI D,FFFFH
Load DE with FFFFH
F016
1B
L2
DCX D  
Decrease DE
F017
7A
 
MOV A,D
Take D to A
F018
B3
 
ORA E  
OR A and E
F019
C2, 16, F0
 
JNZ L2
If Z = 0, jump to L2
F01C
0D
 
DCR C  
Decrease C by 1
F01D
C2, 13, F0
 
JNZ L1
Jump to L1, if Z = 0
F020
C9
 
RET
Return from subroutine

 

Output

                The numbers are storing into memory location 8000H.

Updated on: 05-Oct-2019

382 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements