Printer TSR with watcom

Printer TSR with watcom

Post by s4somes » Fri, 09 Jan 2004 19:27:35


We are using causway 32-bit extender for watcom compiler. We are
working with a PRINTER related program. In this we want to capture the
BYTE send to printer, this is done when printer interrupt
occures(which is 23 or 17h).

This task is possible through Borland's TURBO C++ compiler. It allows
directly to access the data byte in register with _AL, _AH variables.
Following code works with Turbo C++,it replaces any char from file
with 'P' while sending to printer.The same I want to use with causway
32-bit extener with watcom compiler.

-----------------------
#include<dos.h>

void interrupt (*prev)();
void interrupt our();

void interrupt our()
{
if(_AH==0)

_AL='P';

/* Here _AL returns the exact character going to print, which can be
captured */

(*prev)();
}


void main()
{

prev = getvect(23);
setvect(23,our);
keep( 0, 1000 );

}


When i compiled code with watcom,
it giving Error for _AL/_AH variables.
so i wanna know :

1.How to get the BYTE being send to printer ?
2.Is there any other method to access the data which is going to
printer after the interrupt 23 occures?



Somesh Bartakke
Software Engineer
ImagePoint Technologies Pvt Ltd
Pune (India)