Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > MSDOS Programmer > Trap Int21h pro...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 438 of 494
Post > Topic >>

Trap Int21h problem

by "gerotica" <pgerotica@[EMAIL PROTECTED] > Mar 23, 2007 at 08:56 PM

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(&regs, &regs);
  }


Im not sure if this pointers operations are correct but Im interested
about what happens inside the int21 function.
Tks in advance




 2 Posts in Topic:
Trap Int21h problem
"gerotica" <  2007-03-23 20:56:19 
Re: Trap Int21h problem
"gerotica" <  2007-03-24 00:35:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon May 12 5:22:47 CDT 2008.