home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Microsoft Programmer's Library 1.3
/
Microsoft-Programers-Library-v1.3.iso
/
sampcode
/
alde_c
/
turbo_c
/
extmem
/
xmemasm.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
C/C++ Source or Header
|
1987-09-14
|
352 b
|
25 lines
#include <bios.h>
#include <dos.h>
#pragma inline
#define EM_MEMSIZE 0x88
#define EM_INT 0x15
unsigned int get_size( void )
{
unsigned int flags;
unsigned int res;
_AH = EM_MEMSIZE;
geninterrupt( EM_INT );
asm pushf;
asm pop bx;
flags = _BX;
res = _AX;
if ( (flags & 1) != 0 )
return( 0 );
return( res );
}