| delorie.com/archives/browse.cgi | search |
| Date: | Fri, 20 Dec 2002 21:10:06 +0300 |
| From: | "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> |
| Sender: | halo1 AT zahav DOT net DOT il |
| To: | djgpp AT delorie DOT com |
| Message-Id: | <1659-Fri20Dec2002211005+0200-eliz@is.elta.co.il> |
| X-Mailer: | emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 |
| In-reply-to: | <8c83mFDGb3B@hans-juergen.taenzer.dialin.t-online.de> |
| Subject: | Re: How to get the amount of free memory |
| References: | <8c83mFDGb3B AT hans-juergen DOT taenzer DOT dialin DOT t-online DOT de> |
| Reply-To: | djgpp AT delorie DOT com |
| Errors-To: | nobody AT delorie DOT com |
| X-Mailing-List: | djgpp AT delorie DOT com |
| X-Unsubscribes-To: | listserv AT delorie DOT com |
> From: Hans-Juergen DOT Taenzer AT t-online DOT de (Hans-Juergen Taenzer)
> Newsgroups: comp.os.msdos.djgpp
> Date: 19 Dec 2002 19:10:00 +0100
>
> how do i get the amount of free real-memory (memory below 1 MB)
> from a running programm?
#include <dpmi.h>
#include <go32.h>
__dpmi_regs regs;
regs.h.ah = 0x48;
regs.x.bx = 0xffff;
__dpmi_int (0x21, ®s);
printf ("Free DOS Memory: %u Bytes\n", regs.x.bx << 4);
Note that this only gives you the size of the largest free memory
block, and I think it doesn't include the memory between 640K and 1MB.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |