473,796 Members | 2,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1925
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.c om> 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.c om> 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.c om> дÈëÏûÏ¢ÐÂÎÅ
: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*****@invali d.invalid> wrote:
Malcolm said:

"Bill Cunningham" <no****@nspam.c om> 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
2989
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
2060
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 into one small program. My compiler and IDE is Visual C++ Express Edition, and the book I'm using is Teach Yourself C++ in 24 hours by Jesse Liberty and David Horvath. While playing around with the code a little bit I found something I couldn't...
8
3089
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 follows: "Write a program to 'fold' long input lines into two or more shorter
17
3454
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 basic programming structure. Things like, return the maximum in a list, making lists with certain patterns, very simple string parsing, etc. Unfortunately, it takes a lot of time to grade such things by hand, so I would like to automate it as much...
12
12156
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. Some of the assembly I used: using System; using System.Collections.Generic;
169
9224
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 untaking to create a toolchain for it. Way back when, there used to be something called "Small C". I wonder if the creator(s) of that would want to embark on creating a nice little Small C++ compiler devoid of C++ language features that make...
25
5960
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 calculator- looking interface. I'm quite new to C++, and I would need some help. Please any suggestion is welcome :) The following is what I have been able to do so far:
16
3368
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
6710
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. Then program will ask him to do some little arithmetic and will finally ask for the result. It will then print what user has thought of. Here is what I finished with. Any advice is appreciated :)
0
9533
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10461
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10019
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6796
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4122
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.