8085 program to change states LEDs according to input switches.

MicroprocessorMicrocontroller8085

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

 

 

raja
Published on 17-Jun-2019 12:05:58
Advertisements