home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / TEST / TEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-06  |  1.3 KB  |  62 lines

  1.  
  2. /*
  3.             TEST.C:         small example C program using PAL.
  4.  
  5. */
  6.  
  7. #include    <pal.h>
  8.  
  9.  
  10.  
  11.     char    *s;
  12.     char  **ss;
  13.     char      c;
  14.     unsigned i,n;
  15.         unsigned char *video_pointer;
  16.  
  17.  
  18.  
  19. int main(int argc, char *argv[])
  20. {
  21.  
  22. char * system;
  23.  
  24.        *(int*)&video_pointer = 0xA0000 - (int)_zero;
  25.  
  26.  
  27. /**** display the environment ********/
  28. /*
  29.        for (i=(ulong)environ ; ; i += sizeof (char *))
  30.       {
  31.         s = *(char **)i;
  32.         if ( *s == 0 ) break;
  33.     printf("%s \n",s);
  34.       }
  35.     */
  36.  
  37.     if (dos32system == 1) system="raw DOS";
  38.     if (dos32system == 2) system="XMS";
  39.     if (dos32system == 4) system="VCPI";
  40.     if (dos32system == 8) system="DPMI";
  41.  
  42.  
  43. //     printf(" %s \n",getenv("COMSPEC"));
  44.  
  45.     printf(" Executable file name           %s\n",argv[0]);
  46.     printf(" Executable file size           %d bytes\n",exesize);
  47.     printf(" Number of command line args    %d\n",argc);
  48.     printf(" System type                    %s\n",system);
  49.     printf(" DOS32 Version                  %x.%x%x\n",dos32version >> 8,(dos32version >> 4) & 0xF,dos32version & 0xF);
  50.     printf(" Avalible memory                %dK\n",maxavail()>>10);
  51.  
  52.  
  53.  
  54.     printf("\nPress any key to exit\n");
  55.     for (; !kbhit() ;);
  56.  
  57.  
  58.  
  59.  
  60. return EXIT_SUCCESS;
  61. }
  62.