473,385 Members | 1,641 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,385 software developers and data experts.

small c program

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

Nov 30 '05 #1
5 1907
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.

--
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)
Nov 30 '05 #2

"Bill Cunningham" <no****@nspam.com> wrote
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.
Nov 30 '05 #3
Malcolm said:

"Bill Cunningham" <no****@nspam.com> wrote
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.


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)
Nov 30 '05 #4
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" <no****@nspam.com> дÈëÏûÏ¢ÐÂÎÅ
:Aqpjf.163$fY3.150@trnddc01...
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

Dec 1 '05 #5
On Wed, 30 Nov 2005 23:49:42 +0000 (UTC), in comp.lang.c , Richard
Heathfield <in*****@invalid.invalid> wrote:
Malcolm said:

"Bill Cunningham" <no****@nspam.com> wrote
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.


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

--
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 =----
Dec 1 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Robert Bralic | last post by:
Hi, Can anybody send to me aby small c++ program that is compilable vith gpp under Linux ,that I can belive that C++ realy exists ,(1000-2000) lines program source. robert.bralic@si.htnet.hr
2
by: BKMiller | last post by:
Hello everyone, I'm just getting started playing around with C++, so please don't laugh too loudly at my crude source code, okay? (o^^o) I'm combining together several introductory exercises...
8
by: Mike S | last post by:
Hi all, I noticed a very slight logic error in the solution to K&R Exercise 1-22 on the the CLC-Wiki, located at http://www.clc-wiki.net/wiki/KR2_Exercise_1-22 The exercise reads as...
17
by: Brian Blais | last post by:
Hello, I have a couple of classes where I teach introductory programming using Python. What I would love to have is for the students to go through a lot of very small programs, to learn the...
12
by: elty123 | last post by:
I have a small C# program (about 400 lines of code) that is only 28kb after compiled. However when it runs (takes a whole 5 seconds) it takes up nearly 20MB of memory and I don't see why. ...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
25
by: mereba | last post by:
Hello My country Ghana is changing its currency. I want to write a small programme in C++ that can covert from the old currency into the new one. I would like this programme to run behind a simple...
16
by: scholz.lothar | last post by:
I want to add some extension features to my program and this would require that i bundle a small c compiler with my program. On Unix it seems that tiny-c can do this, but i don't know about windows.
23
by: arnuld | last post by:
My friend sent me the prototype of a game written in C++ and asked for advice: IDEA: Game will ask the user to thin of a number. User will press a keystroke after he has thought of a number....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.