Tutorialspoint.dev

Interface 8255 with 8085 microprocessor for addition

Problem – Interface 8255 with 8085 microprocessor and write an assembly program which determine the addition of contents of port A and port B and store 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 –



Mnemonics Comments
MVI A, 90 A ← 92
OUT 83 Control Register ← A
IN 80 A ← Port A;
MOV B, A B ← A;
IN 81 A ← Port B;
ADD B A ← A+B;
OUT 82 Port C ← A
RET Return

Explanation –

  1. MVI A, 92 means that the value of control regidter 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.
  2. OUT 83 putting the vaue of A in 83H which is the port number of port control register.
  3. IN 80 taking input from 80H which is the port number of port A.
  4. MOV B, A copies the content of A register to B register.
  5. IN 81 take input feom 81H which is the port number of port B.
  6. ADD B add the contents of A register and B register.
  7. OUT 82 displaying the result in 81H which is the port number of port C.
  8. RET return


This article is attributed to GeeksforGeeks.org

leave a comment

code

0 Comments

load comments

Subscribe to Our Newsletter