Hi Richard, For the parallel port, use the INP() and OUT() commands. To find your port addresses, invoke debug and type: d 40:0 You'll get something like: -d 40:0 <=== this is what you typed in at the debug prompt 0040:0000 F8 03 F8 02 E8 03 E8 02-BC 03 78 03 78 02 C0 9F ..........x.x... You'll see that on my computer my port addresses are as follows: COM1 = 0x3F8 COM2 = 0x2F8 COM3 = 0x3E8 COM4 = 0x2E8 LPT1 = 0x3BC (base address) LPT2 = 0x378 (base address) LPT3 = 0x278 (base address) (you can't assume, for example, that LPT1 will always translate to a 0x3BC -- always check with debug on any machine you will use) On the parallel port: Data register = base address Status register = base address + 1 Control register = base address + 2 ' This is *no*t code that should be executed in order, these are just code snippets: ' Upon start-up, cache the control register into a global variable ControlByte = INP(ControlReg) ' Force parallel port data bus to OUTPUT mode ControlByte = (ControlByte And 223) OUT ControlReg, ControlByte ' Force parallel port data bus to INPUT mode ControlByte = (ControlByte Or 32) OUT ControlReg, ControlByte ' Read the parallel port's data bus DataByte = INP(DataReg) ' Write to the parallel port's data bus OUT DataReg, DataByte May I ask a few questions? 1) Do you have to use QBASIC? I'm just curious why you want to do this in QBASIC. Would you consider another language? 2) Do you have a bidirectional parallel port installed on the computer? If so, do you know it's address? 3) Could you give more details on exactly what you are trying to accomplish (the overall picture)? Hope this gives you a start, but please chime in to provide some more specifics since there's more than one way to skin a cat. As for the serial port, there should be QBASIC documentation for this. Best regards, Ken Pergola -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Richard Graziano Sent: Tuesday, September 16, 2003 11:03 PM To: PICLIST@MITVMA.MIT.EDU Subject: [EE] QBASIC QUESTION Does anyone know how to write a QBASIC command to transfer a byte or multiple sequence of bytes to the parallel port of a PC, and also to read a byte or multiple sequence of bytes from the parallel port? Also, the same question applies to the serial port. I would appreciate any information on this software question. Regards, Richard -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body