Search This Blog

Loading...

Program to show the System Configuration using interrupt 11h

# include <stdlib.h>
# include  <stdio.h>
# include  <conio.h>
# include   <bios.h>
# include    <dos.h>

 int main( )
 {
    int iCount=15;
    unsigned int uiMaxValue=32768;
    unsigned int uiAX;

    geninterrupt(0x11);
    uiAX=_AX;

    clrscr( );
    textmode(BW80);

    printf(" * * * * * * * * * *  System Configuration  * * * * * * * * * *\n\n");
    printf(" Configuration Word Value = ");

    for(iCount=15;iCount>=0;iCount--)
    {
       if((iCount%4)==3)
      printf(" ");

       if((uiAX&uiMaxValue)==uiMaxValue)
      printf("1");

       else
      printf("0");

       uiMaxValue/=2;
    }

    printf("\n\n\r Boot From Disk = ");

    switch((uiAX&0x0001))
    {
       case 0 : printf("No");
        break;

       case 1 : printf("Yes");
        break;
    }

    uiAX>>=1;

    printf("\n Floating-point Coprocessor = ");

    switch((uiAX&0x0001))
    {
       case 0 : printf("No");
        break;

       case 1 : printf("Yes");
        break;
    }

    uiAX>>=1;

    printf("\n Motherboard RAM Size = ");

    switch((uiAX&0x0003))
    {
       case 0 : printf("16k");
        break;

       case 1 : printf("32k");
        break;

       case 2 : printf("48k");
        break;

       case 3 : printf("64k");
        break;
    }

    uiAX>>=2;

    printf("\n Initial Video Mode = ");

    switch((uiAX&0x0003))
    {
       case 0 : printf("unused");
        break;

       case 1 : printf("40x25 BW with color card");
        break;

       case 2 : printf("80x25 BW with color card");
        break;

       case 3 : printf("80x25 BW with mono card");
        break;
    }

    uiAX>>=2;

    printf("\n Number of Disk Drives = %d",((uiAX&0x0003)+1));

    uiAX>>=2;

    printf("\n Direct Memory Access (DMA) = ");

    switch((uiAX&0x0001))
    {
       case 0 : printf("Available");
        break;

       case 1 : printf("Not Available");
        break;
    }

    uiAX>>=1;

    printf("\n Number of COM (Serial) Ports = %d",(uiAX&0x0007));

    uiAX>>=3;

    printf("\n Game I/O Port = ");

    switch((uiAX&0x0001))
    {
       case 0 : printf("Not Available");
        break;

       case 1 : printf("Available");
        break;
    }

    uiAX>>=1;

    printf("\n Serial Printer Attached = ");

    switch((uiAX&0x0001))
    {
       case 0 : printf("No");
        break;

       case 1 : printf("Yes");
        break;
    }

    uiAX>>=1;

    printf("\n Number of Parallel Printers Installed = %d",(uiAX&0x0003));
    printf("\n\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");

    getch( );
    return 0;
 }


Output:

No comments:

Post a Comment