Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Interface 8255 with 8085 microprocessor for addition

  • Difficulty Level : Expert
  • Last Updated : 07 Apr, 2022

Problem – Interface 8255 with 8085 microprocessor and write an assembly program that determines the addition of contents of port A and port B and stores the result in port C. 

Example –  

Algorithm – 

  1. Construct the control word register
  2. Input the data from port A and port B
  3. Add the contents of port A and port B
  4. Display the result in port C

Program –  

MnemonicsComments
MVI A, 92HA ← 92
OUT 83HControl Register ← A
IN 80HA ← Port A;
MOV B, AB ← A;
IN 81HA ← Port B;
ADD BA ← A+B;
OUT 82HPort C ← A
RETReturn

Explanation –  

  • MVI A, 92H means that the value of the control register is 92. 
D7=1 as it is in I/O mode.
D6=0 & D5=0 as Poet A is in m0 mode.
D4=1 as Port A is taking input.
D3=0 & D0=0 as Port C is not taking part.
D2=0 as mode of Port B is m0.
D1=1as Port B is taking the input.
  • OUT 83H putting the value of A in 83H which is the port number of the port control register.
  • IN 80H taking input from 80H which is the port number of port A.
  • MOV B, A copies the content of A register to B register.
  • IN 81H takes input from 81H which is the port number of port B.
  • ADD B add the contents of A register and B register.
  • OUT 82H displays the result in 81H which is the port number of port C.
  • RET return

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!