- 2078 Kartik · 3+5 marks
8255A at B0H: add port A and B, show on port C
Short answer
Port addresses: A=B0H, B=B1H, C=B2H, Control=B3H. Control word 92H configures ports A and B as inputs, port C as output in mode 0. Program reads ports A and B, adds the values, and outputs the sum to port C.
Draw the circuit diagram to interface 8255A PPI with 8085 microprocessor at base address B0H. Write an assembly program that determines the addition of contents of port A and port B and display the result in port C. Use appropriate control word to initialize the 8255A.
Circuit (I/O mapped, base B0H)
B0H = 1011 0000. A7 = 1, A6 = 0, A5 = 1, A4 = 1, A3 = 0 and A2 = 0 are decoded; A1 A0 select the register. Ports: A = B0H, B = B1H, C = B2H, Control = B3H.
A7 ------------------+
A6 --[NOT]-----------+
A5 ------------------+
A4 ------------------+--[ 7-input NAND ]--> CS' (low when selected)
A3 --[NOT]-----------+
A2 --[NOT]-----------+
IO/M -----------------+ (high for I/O)
A1, A0 -> A1, A0 IOR' -> RD' IOW' -> WR'
AD0-AD7 -> D0-D7 (data) RESET OUT -> RESET
PA0-PA7 <- input data 1 PB0-PB7 <- input data 2
PC0-PC7 -> output display (LEDs)
(A6, A3 and A2 are inverted so that the NAND output goes low only when A7-A2 = 101100 and IO/M = 1.)
Control word
Port A input (D4 = 1), port B input (D1 = 1), port C output (D3 = 0, D0 = 0), mode 0, D7 = 1: 1001 0010 = 92H.
Program
MVI A,92H
OUT B3H ; initialise 8255
IN B0H ; read port A
MOV B,A ; save in B
IN B1H ; read port B
ADD B ; A = A + B
OUT B2H ; display sum on port C
HLT
If the sum exceeds 255 (carry set), only the low 8 bits are displayed. The carry can be shown on another line with MVI A,00H, RAL and a separate output.
✓ Answer checked by Claude Sonnet 5.5
Related questions
- ADC at 80H with 8255A: display on port B LEDs · Instrumentation II, chapter 2
- 8255A card at F3H with keyboard and display · Instrumentation II, chapter 2
- Keyboard and printer with 8255A at 4044H · Instrumentation II, chapter 2
- 8-channel ADC interface with 8255 and 8085 · Instrumentation II, chapter 4
- ADC804 with 8255 control word and program · Instrumentation II, chapter 4
- Changing 8255A base address · Instrumentation II, chapter 2
- 8085 ALP: add upper and lower nibbles · Microprocessor, chapter 2
- 8085 ALP: add two tables, sum and carry · Microprocessor, chapter 2
- Protected specifier; student/test/result program · Object Oriented Programming, chapter 6
- Address decoding for 8 LEDs output port · Microprocessor, chapter 4