 Hello everyone. This is Vishwanath Chavan, Assistant Professor, Department of Computer Science and Engineering, Valchan Institute of Technology, SolarPool. Now I am here to explain Interface 8255 with microprocessor. At the end of this session, the students will be able to write an assembly language program to Interface 8255 with 8085 microprocessor. Let us see the problems based on interface concept. Problem number one, the statement is like this. Interface 8255 with 8085 microprocessor and write an assembly language program which determines the addition of content of port A and port B and store this result in port C. So, we will see this problem. Before that, we should know how the control word format of 8255 works. It has total 8 bits, D0, D1, D2, D3 up to D7. Port lower part PCL is in D0 position, then port B, D1, port B, D2, port C up to D3, port A, D4 and define D6 for mode selection of port A and D7 is bitset reset mode or IO mode. If it is one, then it will be in IO mode. Since we need to add the content of port A and port B. So, here D4 bit is port A, which is one because this one indicates that input, it will act as a input. Similarly, we are going to collect the content of port B also. And hence, this is set to one so that it acts as a input port. Port C, that is D3 bit and D0 bit, they are set to zero because it is a output port. And hence, the final value, which is 92H, 1001, 0010. So, this 92H sense that port A, port B as a input and port C as a output. This is how control word format works, how it works. So, this is port A, content from port A will be read similarly from port B. So, content of port A and port B are added. And this result is supposed to send to port C. This is how the ports are going to work. Port A and B are input. And hence, in control word format, we made the respective bits as one. Port C, which is acting as a output port. And hence, port C is set to zero position. Let us see the algorithm. First, construct the control word register that already we are done. Next step, take the input data from port A and port B. After taking input, add the content of port A and port B. After addition, send the result to port C. So, these are the four steps we need to follow while writing the program. So, let us see the port addresses. So, the first column, port address and the CWR control word register. Right side, it is address. So, port A whose address is 80. Port B whose address is 81. Port C whose address is 82. And control word register is 83. So, we are using these values while writing the assembly language program. So, before program, just think about this question and pause the video and write the answer. The question is, I see A255 has how many ports? Which group controls those ports? So, I hope you noted the answers. The answer is like this. I see A255 has three ports. Port A, 8-bit port C, 4-bit upper part controlled by group A, port B and port C lower part controlled by group B. Let us see addition of content of port A and port B. So, 92 value which we found through CWR will be copied into accumulator. And this content of accumulator will be sent to 83 which is port address corresponding to control word register. And hence, according to 92, the respective bits of control word registers are set and reset. Next, read the content from port A which is 80 and stored in accumulator. Move the content of accumulator to B that is whatever content read from port A which is copied into B. Then read content from port B that is in 81 and which is stored in accumulator. Then add the content of accumulator and B register and result will be stored in accumulator. Then out 82, so send the result to port 82 H. Then return. This is how it is reading the content of port A and port B and some is displayed on port C. So, this is about explanation of respective instruction which I have already explained. Let us see another problem statement. The problem statement is like this. Interface 8255 with 8085 microprocessor and write an assembly language program to display 99 in port A. Once complement of 99 in port B and 2 is complement of 99 in port C. If port addresses are 30, 32 and 33 H respectively. First, we will find the control word format value. Since all ports port C, B, then port C upper port A all these are 0 means all these are going to act as output port and D7 is 1 which indicates that it is in IOMO. And hence the value is 80 H. We will focus on algorithm. First construct the control word register that we saw the value. Then take the input value of accumulator and display value of accumulator in port A. Then go for once complement of content of A register which is calculated and result is displayed in port B because we require once complement of content of accumulator A on port B. Similarly, now go for 2's complement of accumulator and calculate it by adding 1 to once complement of A. Then the result will be displayed in port C. So, this is how the steps are supposed to be followed. Let us see the program. So, we already calculated control word register format value which is 80 means all ports are going to act as output. This 80 is going to store in accumulator send it to 33 control word register since the value of control word register port A, B, C are given. So, according to that you take 33 which is out 33. Then next move the content 99 in accumulator. So, your accumulator gets 99. Out 30 means content of accumulator which is 99 is forwarded to port A because port A's address is 30. Then take the complement of accumulator. Accumulator is holding 99, complement of that means once complement of that accumulator is calculated and stored in accumulator itself. Then send the content of accumulator which is once complement to port 31 which is port B. Then increment the content of accumulator by 1 and send it to port 32 which is port C. So, this is about explanation of respective instruction which I already expect. These are the references. Thank you.