Re: Utility to reset LPT1
- From: "William Allen" <_wa_@xxxxxxxxx>
- Date: Wed, 31 Aug 2005 15:31:20 +0100
<wboas@xxxxxxx> wrote in message
>
> Folks,
>
> I'm running DOS 6.22 on a NEC VERSA V/50 (80486DX-50mhz)
>
> For some reason my LPT1 indicates an `i/o error' and `busy'
> as reported by MSD.
>
> When I try to use an external BACKPACK cdrom via the parallel
> port the system reports `cd rom not found' although its drivers
> are set correctly.
>
> I need advice about a utility to reset the LPT1 port, or
> some commands in DEBUG to do so.
You could try using DEBUG to call INT 17, with subfunction AH=1
(=Initialise printer), and with DX=0 (=LPT1). The value returned in AH
indicates port/printer status as follows:
Bit 7 = 1 Printer not busy
Bit 6= 1 Acknowledgement
Bit 5= 1 Out of paper
Bit 4 = 1 Printer selected (normal response with printer on and connnected)
Bit 3 = 1 I/O error
Bit 2 = Reserved
Bit 1 = Reserved
Bit 0 = 1 Time-out
The DEBUG commands to do this are:
debug
a100
mov ah,1
mov dx,0
int 17
int 3
(press [Return] to exit assembly mode)
g=100 (after you enter this, AH=two high digits of AX)
q (to quit debug)
This screen capture shows what you might expect to see if a printer
is correctly connected to LPT1 and switched on. Note: "nnnn" represents
four hex digits that will vary from system to system:
============Screen capture Windows 95
C:\WORK>debug
-a100
nnnn:0100 mov ah,1
nnnn:0102 mov dx,0
nnnn:0105 int 17
nnnn:0107 int 3
nnnn:0108
-g=100
AX=1000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=nnnn ES=nnnn SS=nnnn CS=nnnn IP=0107 NV UP EI PL NZ NA PO NC
nnnn:0107 CC INT 3
-q
C:\WORK>
============End screen capture
In the above example, AH=10 hex (=10000 binary = Printer selected)
and the printer will (usually) go through a reset as you enter the
g=100 command.
The above process is easily automated with a Batch file, as follows:
Lines that don't begin with two spaces have wrapped accidentally
====Begin cut-and-paste (omit this line)
@ECHO OFF
ECHO.debug>PSCRIPT
ECHO.a100>>PSCRIPT
ECHO.mov ah,1>>PSCRIPT
ECHO.mov dx,0>>PSCRIPT
ECHO.int 17>>PSCRIPT
ECHO.int 3>>PSCRIPT
ECHO.>>PSCRIPT
ECHO.g=100>>PSCRIPT
ECHO.q >>PSCRIPT
TYPE PSCRIPT|debug | find "AX="
DEL PSCRIPT
====End cut-and-paste (omit this line)
For Win95/98/ME study/demo use. Cut-and-paste as plain-text Batch file.
Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects
Screen capture shows operation with above pasted as DEMO.BAT
and printer connected to LPT1 and switched on:
============Screen capture Windows 95
C:\WORK>demo.bat
AX=1000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
C:\WORK>
============End screen capture
--
William Allen
Free interactive Batch Course http://www.allenware.com/icsw/icswidx.htm
Batch Reference with examples http://www.allenware.com/icsw/icswref.htm
>From email address not checked. Contact us at http://www.allenware.com/
.
- References:
- Utility to reset LPT1
- From: wboas
- Utility to reset LPT1
- Prev by Date: Re: Utility to reset LPT1
- Previous by thread: Re: Utility to reset LPT1
- Index(es):
Relevant Pages
|