#pragma inline

#include <dos.h>

#include <iostream.h>

#include <string.h>

struct INTERRUPT

{

      unsigned bp,di,si,ds,es,dx,cx,bx,ax,ip,cs,fl;

};

void interrupt (*prev)();

void interrupt mycmd(INTERRUPT);

unsigned char far *buffer;

 

void main()

{

      unsigned long far *ptr;

      ptr=(unsigned long far*)(0x21*4);

      prev=(void (interrupt far*)())*ptr;

      *ptr=(unsigned long)mycmd;

      keep(0,500);

}

 

void interrupt mycmd(struct INTERRUPT r)

{

      char command[128];

      if(_AH==0x0a)

      {

            buffer=(unsigned char far*)MK_FP(r.ds,r.dx);

            cout<<endl<<"Enter Commnand : ";

            cin>>command;

//          strcpy(buffer,command);

      }

      asm pop bp;

      asm pop di;

      asm pop si;

      asm pop ds;

      asm pop es;

      asm pop dx;

      asm pop cx;

      asm pop bx;

      asm pop ax;

      asm jmp cs:_prev;

}