#include <dos.h>

#include <iostream.h>

#include <stdio.H>

void main()

{

      union REGS i,o;

      int inte;

      int cho1,cho2;

      cout<<endl<<"1. Full(X)";

      cout<<endl<<"2. High Low(H,L)";

      cout<<endl<<endl<<"Enter Choice : ";

      cin>>cho1;

      if(cho1==1)

      {

            cout<<endl<<endl<<"Enter AX : ";

            cin>>i.x.ax;

            cout<<endl<<"Enter BX : ";

            cin>>i.x.bx;

            cout<<endl<<"Enter CX : ";

            cin>>i.x.cx;

            cout<<endl<<"Enter DX : ";

            cin>>i.x.dx;

      }

 

      if(cho1==2)

      {

            cout<<endl<<"1. High Registers : ";

            cout<<endl<<"2. Low Registers : ";

            cout<<endl<<"Enter Choice : ";

            cin>>cho2;

            if(cho2==1)

            {

                  cout<<endl<<endl<<"Enter AH : ";

                  cin>>i.h.ah;

                  cout<<endl<<"Enter BH : ";

                  cin>>i.h.bh;

                  cout<<endl<<"Enter CH : ";

                  cin>>i.h.ch;

                  cout<<endl<<"Enter DH : ";

                  cin>>i.h.dh;

            }

 

            if(cho2==2)

            {

                  cout<<endl<<endl<<"Enter AL : ";

                  cin>>i.h.al;

                  cout<<endl<<"Enter BL : ";

                  cin>>i.h.bl;

                  cout<<endl<<"Enter CL : ";

                  cin>>i.h.cl;

                  cout<<endl<<"Enter DL : ";

                  cin>>i.h.dl;

            }

      }//if(cho1==2)

 

      cout<<endl<<"Enter Interrupt Number(in decimal) : ";

      cin>>inte;

      int86(inte,&i,&o);

      cout<<endl<<endl<<"RESULTS : ";

      cout<<endl<<endl<<"AX : "<<o.x.ax;

      cout<<endl<<"BX : "<<o.x.bx;

      cout<<endl<<"CX : "<<o.x.cx;

      cout<<endl<<"DX : "<<o.x.dx;

      cout<<endl<<endl;

 

      printf("\n%d",o.h.ah);

      printf("\n%d",o.h.al);

      cout<<endl<<"AH : "<<o.h.ah;

      cout<<endl<<"AL : "<<o.h.al;

      cout<<endl<<"BH : "<<o.h.bh;

      cout<<endl<<"BL : "<<o.h.bl;

      cout<<endl<<"CH : "<<o.h.ch;

      cout<<endl<<"CL : "<<o.h.cl;

      cout<<endl<<"DH : "<<o.h.dh;

      cout<<endl<<"DL : "<<o.h.dl;

 

 

      cout<<endl;

}