🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #1071

Determining Extended memory size in C program

#1071
From: Roggie Boone
Date: Fri, 09 Oct 1992 20:49
36 lines
1715 bytes
I am trying to include code in my C program that will report the
amount of memory on a computer (Conventional, EMS, Extended).
I can use the Turbo C built-in function biosmemory() to get 
conventional memory.  I am having trouble with extended
memory.  I am trying to use BIOS INT 15 Function 88 for this.

The relevant subsection of my code is as follows:

	union REGS regs;

	basemem = biosmemory();    // reports 640K 

	_AH = 0x88;
	int86(0x15, &regs, &regs);
	cout << "Extended memory: " << _AX << endl;

My system has 7168K extended memory.  However, when I run the
code above it prints out "Extended memory: 34368".  According to
the documention I have, _AX should contain the number of K of
extended memory as reported by POST.  Thus I would expect, 
to see "7168" in AX.  Am I missing some conversion or something in 
there?

Thanks in advance for your help.

R. Boone
boone@athena.cs.uga.edu




-- 
Roggie Boone
Computer Support Staff                    Internet:  boone@athena.cs.uga.edu     
Dept. of Ag and Applied Economics         Internet:  roggie@aisun1.cs.uga.edu
University of Georgia                     Phone:  (706) 542-2482
Technical Details
Message-ID: <1992Oct9.204910.6476@athena.cs.uga.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!gatech!pirates!emory!athena.cs.uga.edu!boone

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!gatech!pirates!emory!athena.cs.uga.edu!boone
From: boone@athena.cs.uga.edu (Roggie Boone)
Newsgroups: comp.sys.ibm.pc.programmer,alt.msdos.programmer
Subject: Determining Extended memory size in C program
Message-ID: <1992Oct9.204910.6476@athena.cs.uga.edu>
Date: 9 Oct 92 20:49:10 GMT
Sender: boone@athena.cs.uga.edu (Roggie Boone)
Distribution: usa
Organization: University of Georgia, Athens
Lines: 36