- 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 change states LEDs according to input switches.
Here we will see how to change the state of LEDs with the input switches using 8085.
Problem Statement
According to the ON/OFF states of input switches connected at port A change the states of output LEDs to ON/OFF states connected to port B.
Discussion
To solve this problem, we have to use the IN and OUT instructions. The IN instruction is used to take the input from the input port to the accumulator, and OUT instruction is used to send output from Accumulator to the output port. Here 8255 chip is used. In the port A of this chip is connected to the input switches, and port B is connected to the LEDs. Using proper control word, we can read from port A and write to port B.
Program
Address | HEX Codes | Labels | Mnemonics | Comments |
---|---|---|---|---|
8000 | 3E, 99 | START: | MVI A, CW | Load the CW in the accumulator |
8002 | D3, 43 | | OUT 43 H | Output the CW to control register |
8004 | DB, 40 | | IN 40H | Read switch condition from port A |
8006 | D3, 41 | | OUT 41 H | Put the pattern byte at output port |
8008 | 76 | | HLT | Stop |
Advertisements