- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
8085 Program to alternately display 00 and FF in the data field
Now let us see a program of Intel 8085 Microprocessor. In this program we will generate 00H and FFH alternatively.
Problem Statement:
Write 8085 Assembly language program to 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.
Advertisements