I saw a lot of info about the problems of trapping int21h, but I
really don=B4t understand what happens. I need to watch some serial
operations from another program, wich uses fopen() function as
interface for the comm port. Here=B4s my code:
void interrupt (*old21)();
void interrupt int21(void)
{
char far* str;
if (_AH =3D=3D 0x3d)
{
str =3D MK_FP(_DS, _DX);
if (_fstricmp(str, "com1:") =3D=3D 0)
reboot(); //Debugging purpouses
}
old21();
}
void main(void)
{
union REGS regs;
long far* vect;
old21 =3D getvect(0x21);
vect =3D MK_FP(0, 0x21 * 4); //using direct address cause setvect
could cause conflict??
*vect =3D int21 // Not sure about this
reboot =3D MK_FP(0xffff, 0x0000);
regs.x.ax =3D 0x3100;
regs.x.dx =3D 0x1000;
intdos(®s, ®s);
}
Im not sure if this pointers operations are correct but Im interested
about what happens inside the int21 function.
Tks in advance


|