Path: utzoo!attcan!uunet!husc6!linus!mbunix!jcmorris From: jcmorris@mitre-bedford.ARPA (Joseph C. Morris) Newsgroups: comp.sys.ibm.pc Subject: Re: Disk inserted??? Summary: It can be done Keywords: notready diskette Message-ID: <40872@linus.UUCP> Date: 12 Oct 88 21:50:08 GMT References: <55969UH2@PSUVM> Sender: news@linus.UUCP Reply-To: jcmorris@mbunix (Morris) Distribution: na Organization: The MITRE Corporation, McLean, VA. Lines: 42 In article <55969UH2@PSUVM> UH2@PSUVM.BITNET (Lee Sailer) writes: input buffer int 025h ; absolute disk read jc readerr ; trouble jmp ready ; it worked, so it's ready readerr: cmp al,002h ; drive not ready? jne error mov al,1 ; report 'drive not ready' jmp cleanup ; error: mov al,2 ; report 'drive in trouble' jmp cleanup ; ready: sub al,al ; report 'drive ready and able' cleanup: popf ; get last piece off the stack ; It uses the absolute read DOS call to try to read a sector; DOS returns an unambiguous OK, NOT-READY, or BROKEN response. If you use it, watch out for the stack: the function POPs one fewer words than it PUSHes. (This is documented by IBM.) If anyone really needs them I've got both stand-alone and C-callable versions of the test. The code works with both PC's and AT's. Joe Morris