Thread: Rom Bios

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    10

    Rom Bios

    I have the following simple code which retreives the amount of memory from a system:

    Code:
    #include <iostream.h>
    #include <dos.h>
    
    int main()
    {
    	const MEM = 0x12;
    	
    	// inregs and outregs variables used in int86() are of union type REGS
    	REGS regs;
    
    	int86(MEM, &regs, &regs);
    
    	cout << "\nMemory size:" << regs.x.ax;
    }
    I compile this program using Visual C++ without any error, but when I execute it I receive an error message saying it cannot execute the program.

    Any ideas?
    Thanks.

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    10
    sorry.....in function int86()...
    the &reg is actually:
    Code:
    & r e g s  // all together

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    You need an old dos compiler. Visual c is a windows compiler.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can you still view the bios screen with a bad CPU?
    By HyperCreep in forum Tech Board
    Replies: 4
    Last Post: 12-31-2006, 06:57 PM
  2. Lost BIOS menu options?
    By PJYelton in forum Tech Board
    Replies: 3
    Last Post: 11-14-2004, 08:23 AM
  3. CD rom troubles...
    By Shadow in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 11-08-2003, 10:56 PM
  4. Bios upgrade-dell latitude
    By GanglyLamb in forum Tech Board
    Replies: 4
    Last Post: 06-18-2003, 01:55 PM
  5. Bios
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 03-12-2002, 07:18 AM