home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / ibm / pc / hardware / 33853 < prev    next >
Encoding:
Text File  |  1992-12-21  |  2.0 KB  |  56 lines

  1. Newsgroups: comp.sys.ibm.pc.hardware
  2. 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
  3. From: hinker@acl.lanl.gov (Paul J. Hinker)
  4. Subject: Reading the Parallel Port
  5. Message-ID: <HINKER.92Dec21101541@booboo.acl.lanl.gov>
  6. Sender: news@newshost.lanl.gov
  7. Reply-To: Paul J. Hinker <hinker@acl.lanl.gov>
  8. Organization: Advanced Computing Lab, LANL, NM
  9. Date: Mon, 21 Dec 1992 17:15:41 GMT
  10. Lines: 44
  11.  
  12.      I've recently aquired a video digitizer that connects to the
  13. parallel port.  What I need is a code fragment or pointer to
  14. literature describing how one would go about reading the parallel port
  15. on a PC type machine.
  16.  
  17.      I realize that most PC's don't have bi-directional parallel ports
  18. but I've purchased one for my wife's machine [386DX/25] so that's not
  19. the problem.
  20.  
  21.      The following piece of code [with different addresses, of course]
  22. works fine on my Amiga but gets me nowhere on the PC.  Note : This is
  23. not a 'My machine is better than your machine' post.  I'm simply not
  24. familiar with the PC way of doing things and am trying to learn.
  25.  
  26. void main()
  27. {
  28.    unsigned char *Parallel_Port = 0x378; /* 0xbfd200 on the Amiga */
  29.    int i;
  30.  
  31.    for (i = 0 ; i < 320 * 200 ; i++)
  32.       printf("%d\n", *Parallel_Port);
  33.  
  34. }
  35.  
  36.    From what I can tell, the 0x378 port number is missing a base
  37. address and the above code fragment is simply reading the value from
  38. somewhere in my program's current data segment.
  39.  
  40.    Could some kind soul tell me where to find the base address [so I
  41. can construct the correct FAR pointer with a MK_FP call] for the
  42. parallel port?
  43.  
  44.    Alternately, can anyone recommend a good reference for doing
  45. this kind of thing?
  46.  
  47.    Any and all help is greatly appreciated.
  48.    
  49.  
  50.    
  51. --
  52. Paul Hinker hinker@acl.lanl.gov    ///  If it works, it's not state-of-the-art
  53. MS B287        505-665-6396          ///                           --Hansen's Law
  54. Los Alamos National Labs ACL  \\\///    All our stuff is broke
  55. Los Alamos, NM  87545          \XX/                    --Forslund's Corollary
  56.