Write a program to take input from 8 switches connected to PORTB of 8255A PPI and display the status of the switches to 8 LEDs connected to PORTA of 8255A PPI. switches to 8 LEDs connected to PORTA of 8255A PPI.

From Inupt / Output Interfaces chapter in PU/ Microprocessor and Assembly Language Programming

Asked on 7 Feb, 2021

Like 0 Dislike 249 Views

Write a program to take input from 8 switches 
connected to PORTB of 8255A PPI and display the status of the switches to 8 LEDs connected to PORTA of 8255A PPI.
switches to 8 LEDs connected to PORTA of 8255A PPI.

Add a comment

1 Answers

arjun adhikari on 7 Feb, 2021 Like 0 Dislike

Given:
PORTA: Output Port
PORTB: Input Port
Mode of Operation: Mode 0 (Simple IO)

Control Word=10000010=82H

Consider:
Address of PORTA=8000H 
Address of PORTB=8001H 
Address of PORTC=8002H 
Address of Control register=8003H

8085 Program
MVI A, 82H ;move control word to A
STA 8003H ; store control word to control register 
LDA 8001H ;load input from port B into A
STA 8000H ;send output to port B
HLT

Add a comment


Add your answer