home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / MEMAVL.ZIP / MEMAVAIL.C next >
C/C++ Source or Header  |  1992-06-08  |  595b  |  26 lines

  1. /* memavail.c a program to display the amount of RAM available
  2.    for OS/2 to use.  BIOS int 15h, subfunction 88h is called and
  3.    it should return the free mem.
  4.    Copyright Tom Stearns, Solutions for Business Computing, 1992
  5.    all rights reserved
  6. */
  7.  
  8.  
  9. #include <dos.h>
  10. #include <stdio.h>
  11.  
  12. main()
  13.     {
  14.     union REGS inregs, outregs;
  15.     unsigned int retval;
  16.  
  17.     inregs.h.ah = 0x88;
  18.     retval = int86(0x15,&inregs,&outregs);
  19.  
  20.     printf("\n\nYour BIOS reports %8d 1KB blocks\n (not counting    %8d MB\n   first MB)      %8ld Bytes",retval,retval/1024,retval*1024L);
  21.     return 0;
  22.     }
  23.  
  24.  
  25.  
  26.