🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3757

Re: Capturing COMx output

#3757
From: Jerzy Tarasiuk
Date: Tue, 13 Oct 1992 15:39
28 lines
2177 bytes
>>>>> On Mon, 12 Oct 1992 03:55:05 GMT, jem@vuse.vanderbilt.edu (John Eric Meyer) said:
John> I am interested in capturing the output to a serial port.  For instance, the
John> 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
John> a second monochrome monitor.  The simple comm package I use obviously trigers
John> this interrupt, but I don't know which of the fields in the REGS structure
John> (al, ah, bl, etc.) is the one I'm really interested in .  None of them show
John> any recognizeable strings (e.g., ATDT, modem init str, ph #, etc).  Am I even
John> on the right track?  If you know of a pub domain utility which will serve the
John> same purpose, that is almost as good.  Any advice or even sample code??

Int 14h uses AH for function code (0-init,1-send,2-receive,3-status),
AL for data (for init data is formed from port setup parameters like
baud rate, parity, stop bits, char size), DX as port index.
Return value: AH=status, AL=data (send/receive) or modem status.
Note almost all communication programs doesn't use Int 14h unless it is
requested - BIOS service of Int 14h is not suitable for communications.

John> // install interrupt hook for COM1 or COM2 as designated on command line
John> //  int 0x0b is COM1, 0x0c is COM2

In fact, int 0x0B is COM2, 0x0C is COM1. But it is HARDWARE interrupt.

John> int comtomono(struct INT_DATA *pd)
John> {
John>    mprintf("%c%c\n", pd->regs.h.al, pd->regs.h.ah);

Hardware interrupt doesn't give anything in registers...
If you want display what is in registers, intercept int 14h !
Technical Details
Message-ID: <JT.92Oct13163950@fizyk1.fuw.edu.pl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!fuw.edu.pl!cocos!jt
References: <BvzpJu.2C3@vuse.vanderbilt.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!fuw.edu.pl!cocos!jt
From: jt@fuw.edu.pl (Jerzy Tarasiuk)
Subject: Re: Capturing COMx output 
In-Reply-To: jem@vuse.vanderbilt.edu's message of Mon, 12 Oct 1992 03:55:05 GMT
Message-ID: <JT.92Oct13163950@fizyk1.fuw.edu.pl>
Sender: news@fuw.edu.pl
Nntp-Posting-Host: fizyk1
Organization: Warsaw University Physics Dept.
References: <BvzpJu.2C3@vuse.vanderbilt.edu>
Date: Tue, 13 Oct 1992 15:39:50 GMT
Lines: 28