home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1994 February
/
psl_9403.zip
/
psl_9403
/
DOS
/
UT_SYSTM
/
HMA.ZIP
/
FREEXMS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-29
|
1KB
|
44 lines
/*----------------------------------------------------------------
Report on DOS managed free space in HMA (unlike XMS managed
by HIMEM.SYS).
When DOS 5/6 are loaded with DOS=HIGH, the DOS kernel
manages the "slack" space left over. This little utility
reports on the amount of HMA space left over. With
typical configurations this space will be in the 12-19K
range and is available for allocation by TSR's and device
drivers via the quasi-doc'd Int 2F fn 4A02 API documented
in Kyle & Brown's PC Interrupts book.
This utility reports on the free HMA available by using
the quasi-doc'd Int 2F fn 4A01 that reports on this memory.
------------------------------------------------------------------
Compile me with TC or BC++ (small model)
----------------------------------------------------------------*/
#include <dos.h>
#include <stdio.h>
void _setenvp(void){} /* minimize EXE size */
void _setargv(void){} /* minimize EXE size */
void main(void)
{
unsigned FreeHMA, es, di;
_AX = 0x4A01;
geninterrupt(0x2F);
FreeHMA = _BX;
es = _ES;
di = _DI;
if (FreeHMA)
{
printf("There are [%u] bytes available in the HMA\n", FreeHMA);
printf("HMA pointer is %04.2X:%04.2X\n", es, di);
}
else
{
printf("There's no room in the HMA, or DOS=LOW\n");
}
}