
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_bios_memsize() reports size of system memory</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_bios_memsize() Reports size of system memory
#include <bios.h>
unsigned _bios_memsize(void);
_bios_memsize(); uses ROM-BIOS interrupt 12h to determine the total
amount of system memory.
Returns: The total number of installed 1k memory blocks available
to the system (up to 640k).
Notes: This is the amount of memory available to the entire
system. This is not the amount of memory available to the
user's program.
If RAM disks or print spoolers are installed some memory
may be hidden from the system, in which case
_bios_memsize() will report the amount of memory the
system sees, which is less than the actual installed
memory.
On PC's and XT's this service determines memory by
examining the DIP switches on the system board. If the
switches are set incorrectly _bios_memsize() will return
an incorrect value.
Portability: MS-DOS and true PC compatibles only.
-------------------------------- Example --------------------------------
This program reports the total amount of available system memory.
#include <bios.h>
main()
{
unsigned memsize;
memsize = _bios_memsize();
printf ("\nThere are %uK bytes of memory", memsize);
printf (" available to MS-DOS and user programs");
}
See Also: _bios_equiplist() int86() int86x()
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson