Q2- Interfacing an 8255 chip with 8086 Microprocessor to work as an I/O ports which is shown in the figure below. Initialize port A as Input port, Port B as Output port and Port C upper as Output port. Control word register address should be 00FEh, PPI A0 is connected to 8086 Microprocessor, PPI A is connected to 8086 Microprocessor A1CC, FBO, PBI, IGI, PB, PB, GA, PB, IDD, PA, 8255, PAI, PA, PA, PA4, PAS, PAS, RD, PA, WR, PC4, PC5, PC6, PC7, YGND
WWW, K1, WWW, AAAAAAZ
Dy-De
IORD, IOWR, Reset-
+5V
K
Write one tiny model assembly program to do the following: 50 MARK
1- Display in the Port C upper the total number of switches which turn on (pressed by the user) out of 8 switches.
2- By using subroutine with name SW_Pressed, use INT21h/Ah=2 to print "SW is Pressed" to the console every time a switch is pressed by the user. Each printing operation should be at the beginning of a new line on the console.
3- Read the 8-bit data from Port A (switches status) and display the status on 8-bit LEDs on Port B.