home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.ibm.pc.hardware
- Path: sparky!uunet!paladin.american.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!hellgate.utah.edu!lanl!newshost.lanl.gov!hinker
- From: hinker@acl.lanl.gov (Paul J. Hinker)
- Subject: Reading the Parallel Port
- Message-ID: <HINKER.92Dec21101541@booboo.acl.lanl.gov>
- Sender: news@newshost.lanl.gov
- Reply-To: Paul J. Hinker <hinker@acl.lanl.gov>
- Organization: Advanced Computing Lab, LANL, NM
- Date: Mon, 21 Dec 1992 17:15:41 GMT
- Lines: 44
-
- I've recently aquired a video digitizer that connects to the
- parallel port. What I need is a code fragment or pointer to
- literature describing how one would go about reading the parallel port
- on a PC type machine.
-
- I realize that most PC's don't have bi-directional parallel ports
- but I've purchased one for my wife's machine [386DX/25] so that's not
- the problem.
-
- The following piece of code [with different addresses, of course]
- works fine on my Amiga but gets me nowhere on the PC. Note : This is
- not a 'My machine is better than your machine' post. I'm simply not
- familiar with the PC way of doing things and am trying to learn.
-
- void main()
- {
- unsigned char *Parallel_Port = 0x378; /* 0xbfd200 on the Amiga */
- int i;
-
- for (i = 0 ; i < 320 * 200 ; i++)
- printf("%d\n", *Parallel_Port);
-
- }
-
- From what I can tell, the 0x378 port number is missing a base
- address and the above code fragment is simply reading the value from
- somewhere in my program's current data segment.
-
- Could some kind soul tell me where to find the base address [so I
- can construct the correct FAR pointer with a MK_FP call] for the
- parallel port?
-
- Alternately, can anyone recommend a good reference for doing
- this kind of thing?
-
- Any and all help is greatly appreciated.
-
-
-
- --
- Paul Hinker hinker@acl.lanl.gov /// If it works, it's not state-of-the-art
- MS B287 505-665-6396 /// --Hansen's Law
- Los Alamos National Labs ACL \\\/// All our stuff is broke
- Los Alamos, NM 87545 \XX/ --Forslund's Corollary
-