home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / nfsrc21.zip / SYSMEM.PRG < prev    next >
Text File  |  1991-08-17  |  2KB  |  78 lines

  1. /*
  2.  * File......: SYSMEM.PRG
  3.  * Author....: Glenn Scott
  4.  * CIS ID....: 71620,1521
  5.  * Date......: $Date:   17 Aug 1991 15:46:10  $
  6.  * Revision..: $Revision:   1.4  $
  7.  * Log file..: $Logfile:   E:/nanfor/src/sysmem.prv  $
  8.  * 
  9.  * This is an original work by Glenn Scott and is placed in the
  10.  * public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log:   E:/nanfor/src/sysmem.prv  $
  16.  * 
  17.  *    Rev 1.4   17 Aug 1991 15:46:10   GLENN
  18.  * Don Caton fixed some spelling errors in the doc
  19.  * 
  20.  *    Rev 1.3   15 Aug 1991 23:04:40   GLENN
  21.  * Forest Belt proofread/edited/cleaned up doc
  22.  * 
  23.  *    Rev 1.2   14 Jun 1991 19:53:04   GLENN
  24.  * Minor edit to file header
  25.  * 
  26.  *    Rev 1.1   12 Jun 1991 02:41:50   GLENN
  27.  * Documentation mod and check for ft_int86() compatibility
  28.  * 
  29.  *    Rev 1.0   01 Apr 1991 01:02:20   GLENN
  30.  * Nanforum Toolkit
  31.  *
  32.  */
  33.  
  34.  
  35. /*  $DOC$
  36.  *  $FUNCNAME$
  37.  *     FT_SYSMEM()
  38.  *  $CATEGORY$
  39.  *     DOS/BIOS
  40.  *  $ONELINER$
  41.  *     Determine the amount of conventional memory installed
  42.  *  $SYNTAX$
  43.  *     FT_SYSMEM() -> nMemSize
  44.  *  $ARGUMENTS$
  45.  *     None
  46.  *  $RETURNS$
  47.  *     A numeric corresponding to the number of K memory.
  48.  *  $DESCRIPTION$
  49.  *     FT_SYSMEM() simply reports the amount of conventional memory
  50.  *     (up to 640K) installed.
  51.  *
  52.  *     FT_SYSMEM() uses DOS interrupt 12h to get this information.
  53.  *     For information, refer to Peter Norton's _Programmer's Guide
  54.  *     to the IBM PC_ (Brady).
  55.  *
  56.  *  $EXAMPLES$
  57.  *     QOut( "Conventional memory installed: " + Str( FT_SYSMEM() ) + "K" )
  58.  *  $END$
  59.  */
  60.  
  61. #include "FTINT86.CH"
  62.  
  63. #define MEMSIZE    18
  64.  
  65. #ifdef FT_TEST
  66.   FUNCTION MAIN()
  67.   QOut( "Conventional memory: " + str( FT_SYSMEM() ) + "K installed" )
  68.   return ( nil )
  69. #endif
  70.  
  71. FUNCTION FT_SYSMEM()
  72.   LOCAL aRegs[ INT86_MAX_REGS ]
  73.  
  74.   aRegs[ AX ] := 0
  75.   FT_INT86( MEMSIZE, aRegs )
  76.  
  77. RETURN ( aRegs[ AX ] )
  78.