Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!gatech!gitpyr!stat!curci From: curci@stat.uucp (Ray Curci (scri)) Newsgroups: comp.sys.ibm.pc Subject: Re: Determining if a printer is available Message-ID: <7730@pyr.gatech.EDU> Date: 27 Mar 89 13:18:27 GMT References: <2165@pembina.UUCP> Sender: news@pyr.gatech.EDU Reply-To: curci@stat.fsu.edu (Ray Curci (scri)) Organization: Dept. of Statistics, Florida State Univ. Lines: 17 In article <2165@pembina.UUCP> lake@alberta.UUCP (Robert Lake) writes: >I am trying to determine if a line printer is attached to my PC. I am One method of determining whether you have a printer or not with MS-DOS is to look at some special memory addresses. If memory serves me, at absolute address 0x400 in MS-DOS are 8 words of memory that contain the base addresses for (4)COM ports and (4)printer ports. I believe that the Lattice C compiler has a PEEK function, so use it to examine addresses 0x408 and 0x409. If both are zero, then there is no printer port, otherwise those bytes contain the base address for the printer. Additionally, I believe there are also some BIOS services that will give you the same information including information about some of the control signals (whether your printer is on-line, out-of-paper, etc,.) Look in the IBM PC or IBM AT technical reference software manuals at the BIOS routines for the printer device for more details. curci@stat.fsu.edu