home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name mmtotal -- Report total installed memory on IBM hardware.
- *
- * Synopsis ext_mem = mmtotal(pmain_mem);
- *
- * int ext_mem Amount of extended memory (in 1024-byte
- * units)
- * int *pmain_mem Returned amount of main memory (in
- * 1024-byte units)
- *
- * Description MMTOTAL reports how much memory is installed on an
- * IBM-compatible computer.
- *
- * The value returned as ext_mem can only be nonzero on an
- * IBM PC-AT (or compatible) with extended memory.
- *
- * Returns ext_mem Amount of extended memory (in 1024-byte
- * units)
- * *pmain_mem Amount of main memory (in 1024-byte units)
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1986
- *
- * Version 3.02 March 24, 1987
- * Removed a strong typing warning (no change in object
- * code).
- *
- **/
-
- #include <bmemory.h>
- #include <bquery.h>
-
- int mmtotal(pmain_mem)
- int *pmain_mem;
- {
- int ax,bx,cx,dx,flags;
- int ext_mem;
- /* Get amount of main memory */
- bios(18,pmain_mem,&bx,&cx,&dx,&flags);
-
- if (qymodel() == IBM_AT)
- {
- ax = (int) 0x8800; /* Get amount of extended */
- bios(21,&ax,&bx,&cx,&dx,&flags); /* memory */
- ext_mem = ax;
- }
- else /* Not an AT: */
- ext_mem = 0; /* no extended memory. */
-
- return ext_mem;
- }