Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Re: How to program by assembler connecting 2 PC by using LPT
well, its a classic problem in micro-computer and its peripherial.
first of all, you need to be aware that there're several modes in parallel port on pc, e.g. spp, ecp and epp. for any mode, there are 3 ports, data port (in some mode it can be used in one direction only, while in bi-directions in others) , control port (usually for writing only) and state port (usually for reading only), each with a given address which can be set in BIOS.
If you want to establish a communication between 2 PC by using LPT (or COM), you have to design a communication protocol, which defined when to send or receive datum. You can design such a protocol as your wish, however, in general, we use data port to send or receive data packet (8 byte per packet), use control port to send communication command, such as STROBE and ACK, use state port to check whether the sender has finished the preparing for the next packet and the receiver has finished the receiveing of the last packet.
Assuming that we will send some data from PC "A" to PC "B", you have to write a send-program on A and a receive-program on B. At the beginning of the communication PC A check for the BUSY state on PC B, until it find that PC B is not BUSY, then it will send a packet to its data port by using an OUT instruction in assembly, and then it send a STROBE command to B by setting the corresponding bit of its control port with another OUT instruction, now A can check for ACK from B which means that B has finished the receiving of the packet. For B, at the beginning, it sets BUSY bit of its control port to be "Not Busy", which means that "I'm ready for recieving data", and then B checks the STROBE signal from A, once B was strobed, it reads its data port by using an IN instruction, after that, B will send a "ACK" signal to A by setting the corresponding bit of its control port, to tell A that "I have received the last packet, and you can send me the next one."
As described above, its easy to implement a communication between 2 PCs by using LPT.