Connecting Tech Pros Worldwide Forums | Help | Site Map

small c program

Bill Cunningham
Guest
 
Posts: n/a
#1: Nov 30 '05
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




Richard Heathfield
Guest
 
Posts: n/a
#2: Nov 30 '05

re: small c program


Bill Cunningham said:
[color=blue]
> Can a small C program it put at int 19 and look at 0x7c00?[/color]

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.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Malcolm
Guest
 
Posts: n/a
#3: Nov 30 '05

re: small c program



"Bill Cunningham" <nospam@nspam.com> wrote[color=blue]
> 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?
>[/color]
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.


Richard Heathfield
Guest
 
Posts: n/a
#4: Nov 30 '05

re: small c program


Malcolm said:
[color=blue]
>
> "Bill Cunningham" <nospam@nspam.com> wrote[color=green]
>> 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?
>>[/color]
> 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.[/color]

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.)

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Brytison
Guest
 
Posts: n/a
#5: Dec 1 '05

re: small c program


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

"Bill Cunningham" <nospam@nspam.com> 写入消息新闻
:Aqpjf.163$fY3.150@trnddc01...[color=blue]
> 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
>
>
>[/color]


Mark McIntyre
Guest
 
Posts: n/a
#6: Dec 1 '05

re: small c program


On Wed, 30 Nov 2005 23:49:42 +0000 (UTC), in comp.lang.c , Richard
Heathfield <invalid@invalid.invalid> wrote:
[color=blue]
>Malcolm said:
>[color=green]
>>
>> "Bill Cunningham" <nospam@nspam.com> wrote[color=darkred]
>>> 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?
>>>[/color]
>> 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.[/color]
>
>Yes, you'll generally be disappointed by the results if you're using a
>protected-mode OS.[/color]

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

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Closed Thread