Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.14 $; site siemens.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!siemens!jrv From: jrv@siemens.UUCP Newsgroups: net.micro.pc Subject: Re: Device checking in Turbo Message-ID: <23900007@siemens.UUCP> Date: Thu, 27-Feb-86 09:50:00 EST Article-I.D.: siemens.23900007 Posted: Thu Feb 27 09:50:00 1986 Date-Received: Sat, 1-Mar-86 03:13:57 EST References: <198@dcc1.UUCP> Lines: 31 Nf-ID: #R:dcc1:-19800:siemens:23900007:000:1119 Nf-From: siemens!jrv Feb 27 09:50:00 1986 For testing the status of a device, MS-DOS provides function 44h - I/O control for Devices. To check for printer status set the registers before the function call as follows: ah = 44h I/O Control for Devices al = 07h Get output status bx = 04h Standard printer file handle You'll need to find the exact Turbo-Pascal syntax to do this. On return from the function call Al = 0ffh if the printer is ready and 00 if it is not. (I just tested this to make sure.) If you want to test other than the standard printer then you will have to open that device first to get a file handle for it to place in the BX register. For testing disk drives I know of no way other than trying to read/write to them. You then run into the problem of getting the MS-DOS error if the disk drive is not ready (i.e. an open floppy door). To trap this you have to substitute for the Critical Error Handler at Interrupt 24h. However, you still have to wait for the floppy drive to power up and find that it is not ready. Has anyone found a better way to test for disk ready status?? Jim Vallino {allegra,inhp4}!princeton!siemens!jrv