Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!homxb!houxm!mhuxt!mhuxm!mhuxo!ulysses!faline!thumper!tr From: tr@thumper.UUCP Newsgroups: comp.sys.ibm.pc,comp.graphics Subject: Re: How do I determine how much EGA memory is installed? Message-ID: <620@thumper.UUCP> Date: Mon, 6-Apr-87 10:08:01 EST Article-I.D.: thumper.620 Posted: Mon Apr 6 10:08:01 1987 Date-Received: Sat, 11-Apr-87 03:44:14 EST References: <548@thumper.UUCP> <988@super.upenn.edu.upenn.edu> Organization: BellCoRe (Bell Communications Research) Lines: 40 Keywords: EGA, BIOS Xref: utgpu comp.sys.ibm.pc:2794 comp.graphics:442 Summary: This is the method ... OK, I have had help and this is what I have learned. I am enclosing an example. The function called egamem() will return an integer with a value of 64, 128, 192, or 256. This example works with Lattice C. If it does not work with your compiler, check the declarations for REGS in and make the proper modification to the program. #include #include #include main() { printf("You have %d K bytes of video RAM installed.\n", egamem()); } egamem() { union REGS *in, *out; static int amount; in = (union REGS *) malloc(sizeof(union REGS)); out = (union REGS *) malloc(sizeof(union REGS)); in->h.ah = 0x12; in->h.bl = 0x10; int86(0x10, in, out); amount = 64 * ((((int) out->h.bl) & 3) + 1); free((char *) in); free((char *) out); return(amount); } -- Tom Reingold INTERNET: tr@bellcore.com UUCP: ..!decvax!ucbvax!ulysses!bellcore!tr ihnp4!mhuxt/