473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ROM BIOS interrupts in Borland C++ 5.02

dfound
52
Hello, I am using Borland C++ 5.02 and I was trying to make ROM BIOS interrupts in a c program. But when I compile the program it says undefined structure REGS.
I tried the program in a cpp program too but with same result.
Here's my code
Expand|Select|Wrap|Line Numbers
  1. #include <dos.h>
  2.  
  3. #define VIDEO 0x10
  4.  
  5. void movetoxy(int x, int y)
  6. {
  7.     union REGS regs;
  8.  
  9.    regs.h.ah = 2;  /* set cursor position */
  10.     regs.h.dh = y;
  11.    regs.h.dl = x;
  12.    regs.h.bh = 0;  /* video page 0 */
  13.     int86(VIDEO, &regs, &regs);
  14. }
  15.  
  16. int main(void)
  17. {
  18.     clrscr();
  19.     movetoxy(35, 10);
  20.     printf("Hello\n");
  21.     return 0;
  22. }
  23.  
  24.  
Please help me with the problem. Thanks .
May 6 '08 #1
6 4984
JosAH
11,448 Expert 8TB
I googled a bit for "union REGS" and found that all the code that uses that union
also included the <bios.h> file but I don't think you can use that bios directly from
a MS Windows environment (I might be totally wrong though).

kind regards,

Jos
May 7 '08 #2
weaknessforcats
9,208 Expert Mod 8TB
JosAH is not wrong. Windows protects the bios and all access to this union is prohibited.
May 7 '08 #3
dfound
52
Yes I used the bios.h header file. I just tried a function in the help file .
The fuction was _bios_memsize() . But the compiler says call to undefined function.
My code is (this is code is exactly as is in the help file)

Expand|Select|Wrap|Line Numbers
  1.  
  2. #include <stdio.h>
  3. #include <bios.h>
  4.  
  5. int main(void)
  6. {
  7.   unsigned   memory_size;
  8.  
  9.   memory_size = _bios_memsize();   /* returns value up to 640K */
  10.  
  11.   printf("RAM size = %dK\n", memory_size);
  12.  
  13.   return 0;
  14. }
  15.  
  16.  
Please tell me what is wrong
May 10 '08 #4
weaknessforcats
9,208 Expert Mod 8TB
Why can't you use the Windows functions that provide this capability?
May 10 '08 #5
dfound
52
Why can't you use the Windows functions that provide this capability?
I cant see to find any functions equivalent to ROM-BIOS functions in Win32. I tried searching but of no use. It would be a great help if you give me the functions or where I can find them. Thanks
May 12 '08 #6
weaknessforcats
9,208 Expert Mod 8TB
You use Windows Management Instrumentation (WMI).

Start here: http://msdn.microsoft.com/en-us/libr...77(VS.85).aspx.
May 12 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Gavin | last post by:
Hi, I'm a newbie to programming of any kind. I have posted this to other groups in a hope to get a response from anyone. Can any one tell me how to make my VB program read the Bios serial number...
1
by: J. Rodrigo A. V. | last post by:
There was this guy in alt.es.hackers asking if there is a way to crack bios password bys software. I of course know you can always resort to the "almigthy" jumper and reset the CMOS. So the...
10
by: just4me | last post by:
Exactly how do I read a specific location in the bios eprom. (such as debug.exe location ffff:0000)
1
by: just4me | last post by:
I would like to access the bios flash using watcom c. To start, I would like to be able to read the entire bios and back it up into a file. I can do everything except reading the bios flash. Any...
2
by: Nowhere Girl | last post by:
I had to purchase an Adapter USB2 Connect CardBus adapter for my Compaq Presario 2700T notebook (WinXP). I did this because the HP DVD Burner I bought requires USB 2.0. The USB 2.0 wasn't working...
2
by: standard149 | last post by:
Basically, what im attempting to do is add some preliminary procedures onto my usb drive. Currently I have a distro of linux, knoppix in my case, which will boot and run entirely from the drive. I...
1
by: adi | last post by:
Hi Is there a possibility to read/write BIOS values? I develop an application that should start running at 6 a.m. every day, so I need to make sure that the computer will start at that time. So...
4
by: jmarcrum | last post by:
I have to modify this assembly code in order to make it use interrupts. Right now, when I push button 1 on the microprocessor the count increments once (the LED's count in binary, using only 3 LED's...
1
by: JKaur | last post by:
hello frnds, please tell me the difference between DOS interrupts and interrupts invoked using int86() function in C (are those 8086 intrupts?). In some text i have read these are different, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.