procedure errormsg( x : byte); begin writeln; case x of 0 : writeln('No error.'); 1 : writeln('Bad command.'); 2 : writeln('Bad address mark.'); 3 : writeln('Write-protected disk.'); 4 : writeln('Record not found.'); 5 : writeln('Controller reset failed.'); 7 : writeln('Controller won''t accept drive parameters.'); 8 : writeln('DMA overrun.'); 9 : writeln('DMA bounds error.'); $0b : writeln('Bad track flag found.'); $10 : writeln('Bad CRC on disk read.'); $11 : writeln('Recoverable ECC error.'); $20 : writeln('Disk controller chip failure.'); $40 : writeln('Bad seek.'); $80 : writeln('Time out error.'); $BB : writeln('Undefined error.'); $ff : writeln('Sense Drive Status failure.'); end; writeln; end; { error msg } procedure setparmptr( x : paramptr ); var y : Registers; begin y.ah:=setintrp ; y.al:=disktable; y.dx:=ofs( x^); y.ds:=seg(x^); msdos(Dos.Registers(y)); { set the interrupt block to point to our block } end; { set } procedure getparmptr( var x : paramptr ); var y : Registers; begin y.ah:= getintrp; y.al:=disktable; msdos(Dos.Registers(y)); x:= ptr(y.es,y.bx); end; { getpar } procedure smooth; { have to get this to be only exit } { and make sure it restores disk params to normal } begin setparmptr(oldROMparms); end; { smoothexit }