Re: Utility to reset LPT1



<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/


.



Relevant Pages

  • Re: Printing to a network printer
    ... yes, the MFC is a GDI printer, so you cannot simply redirect the DOS output ... Load from the desktop with the batch file & it ... sits in the background & prints all the reports. ... anything is printed & myfile.prn changes the printer prints it. ...
    (comp.lang.clipper)
  • Re: Batch file wont finish installing security updates
    ... Local security policy> User Rights Assignment> Debug ... Admin rights, bounced the box, the batch file ran fine. ... On all the rest of my machines ...
    (microsoft.public.win2000.security)
  • Re: Directshow Editing Services leaks memory like a sieve... or maybe Im just clueless
    ... The only difference that I noticed is that on my system and the other dev system, dxdiag shows that several of the dx dlls are debug builds. ... The other systems are running all retail versions of the dlls. ... DxDiag reports that it is running all retail versions. ...
    (microsoft.public.win32.programmer.directx.video)
  • [PATCH net-2.6 0/3]: TCP fixes
    ... Here are some TCP fixes that resulted from the last weeks reports ... FRTO patch is once again result of code review rather than some ... with debug patch because none of these ... All of them are also valid for stables but please note that it won't ...
    (Linux-Kernel)
  • Re: scheduled task can not access shared drive
    ... I've created a batch file on server A to generate a report and copy it ... when I use the task scheduler to run the batch it fails. ...
    (microsoft.public.win2000.general)