Hi
I need to write a program with assembly that send data from a PC to another by parallel cable.
Please help me to do this or give me some references about this.
Thanks.
Well, 1st of all you would need to decide the connections between the 2 parallel ports. In a parallel port the pin configuration settings depend on ur BIOS settings. If u do not have a bidirectional port you will have to make a cross connection cable and then write the code.
1st thing to find out is does ur parallel port have the bidirectional port or SPP port setting in the BIOS section. If the port is bidirectional then a normal 1-1 cable will work. Otherwise wou will have to make a cable which will connect pins 2-9 of the transmitting computer to the pins 10-17 in the following order:
2 -- 14
3 -- 16
4 -- 17
5 -- 15
6 -- 13
7 -- 12
8 -- 10
9 -- 11
And of course vice versa for a 2 way communication. And also the GND connections. See the port address from BIOS. Now to write a value simply use the port address as shown in the BIOS. But reading is slightly more complicated. I don't have the exact code but here is what u can do. Read in an infinite loop the value at port number = parallel port address + 1, this will give u values at pins 11, 10, 12, 13, 15. If u short any pin to the GND u will see a value change. Comparing the previous value without short and the one with the short will tell u the bit position of each pin in the value read from this address. Now do the same for port number = parallel port + 2 for pins 14, 16, 17. After finding the bit position of all 8 pins a simple bit shifting and manipulation algorothm can be made which combines the 2 values read to give a compound 8 bit value corresponding to the 8 bits. It is possible, I have done it so u can give it a shot.
if u r not really meaning low-level parallel port programming (IO ports), u can rely on ur OS for the purpose: just open port as if it was a file using appropriate API and name LPT1 (LPT2 etc). not sure about windows but in dos u can send data to the PRN device also.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.