Article View: comp.os.msdos.programmer
Article #3735Capturing COMx output
From: John Eric Meyer
Date: Mon, 12 Oct 1992 03:55
Date: Mon, 12 Oct 1992 03:55
46 lines
1871 bytes
1871 bytes
I am interested in capturing the output to a serial port. For instance, the
ability to create a log of any communications software. I work in C++, primarily, and tried a small program which intercepts interrupt 14h and outputs it to
a second monochrome monitor. The simple comm package I use obviously trigers
this interrupt, but I don't know which of the fields in the REGS structure
(al, ah, bl, etc.) is the one I'm really interested in . None of them show
any recognizeable strings (e.g., ATDT, modem init str, ph #, etc). Am I even
on the right track? If you know of a pub domain utility which will serve the
same purpose, that is almost as good. Any advice or even sample code??
Here is the gist of the code I wrote. mprintf outputs to the second monitor.
This is Zortech C++ 3.0, incidently.
extern "C"{
int comtomono(struct INT_DATA *pd);
}
void main(int argc, char **argv)
{
// install interrupt hook for COM1 or COM2 as designated on command line
// int 0x0b is COM1, 0x0c is COM2
int_off();
int_intercept(0x0a+atoi(argv[1]), &comtomono, 0);
int_on();
system(argv[2]); // run comm software
// restore original interrupt service chain
int_off();
int_restore(0x0a+atoi(argv[1]));
int_on();
exit(0);
}
extern "C" {
int comtomono(struct INT_DATA *pd)
{
mprintf("%c%c\n", pd->regs.h.al, pd->regs.h.ah);
return 0;
}
}
Any help is appreciated!!
Eric
jem@vuse.vanderbilt.edu
Technical Details
Message-ID:
<BvzpJu.2C3@vuse.vanderbilt.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!vuse.vanderbilt.edu!jemShow Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!vuse.vanderbilt.edu!jem From: jem@vuse.vanderbilt.edu (John Eric Meyer) Subject: Capturing COMx output Message-ID: <BvzpJu.2C3@vuse.vanderbilt.edu> Sender: jem@vuse.vanderbilt.edu Nntp-Posting-Host: cee1 Organization: Vanderbilt University School of Engineering, Nashville, TN, USA Date: Mon, 12 Oct 1992 03:55:05 GMT Lines: 46