small c program

B

Bill Cunningham

Can a small C program it put at int 19 and look at 0x7c00? This may or
may not be considered a C question I guess. Or is C too small to reside in
MBR?

Bill
 
R

Richard Heathfield

Bill Cunningham said:
Can a small C program it put at int 19 and look at 0x7c00?

This seems to be a question about a particular platform. I suggest you ask
your question in a newsgroup that deals specifically with programming for
that platform.
 
M

Malcolm

Bill Cunningham said:
Can a small C program it put at int 19 and look at 0x7c00? This may or
may not be considered a C question I guess. Or is C too small to reside in
MBR?
Most C compilers will allow you to set a pointer to an absolute address.
However this is of course completely non-portable, and it might not produce
the results you expect, depending on the system.
 
R

Richard Heathfield

Malcolm said:
Most C compilers will allow you to set a pointer to an absolute address.
However this is of course completely non-portable, and it might not
produce the results you expect, depending on the system.

Yes, you'll generally be disappointed by the results if you're using a
protected-mode OS. Note, also, that to do this you will require a cast.
(That in itself is often a sign that you're doing something a bit worrisome
- but if you have to hack the hardware under a real-mode OS, it's certainly
a handy port in a storm.)
 
B

Brytison

C-compiler is dependce the OS, C program can't look 0x7c00 under the
protected-mode OS. use real-mode you will get it.
 
M

Mark McIntyre

Malcolm said:


Yes, you'll generally be disappointed by the results if you're using a
protected-mode OS.

Depends. Some people find dialog boxes advising you about illegal
memory access etc quite exciting....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,476
Latest member
blackwatermelon

Latest Threads

Top