_bios_memsize

Description

Calls the BIOS memory-size service, using INT 0x12.

#include <bios.h>

unsigned _bios_memsize( void );

Remarks

The _bios_memsize routine uses INT 0x12 to determine the total amount of main memory installed.

Return Value

The routine returns the total amount of installed memory in 1K blocks. The maximum return value is 640, representing 640K of main memory.

Compatibility

Standards:None

16-Bit:DOS, QWIN, WIN, WIN DLL

32-Bit:None

Example

/* BMEMSIZE.C: This program displays the amount of memory installed. */

#include <bios.h>

#include <stdio.h>

void main( void )

{

unsigned memory;

memory = _bios_memsize();

printf ( "The amount of memory installed is: %dK\n", memory );

}

Output

The amount of memory installed is: 640K