Page 5 of 5
Re: which *int* ?
Posted: Tue Oct 27, 2009 5:07 am
by Solar
Hobbes wrote:Smeezekitty apparently doesn't care about scalability or portability, but IMHO that's exactly the point of this topic.
There's a crucial difference between
being aware of an issue and ignoring it, or being
unaware of an issue.
He said he's using "unsigned long", and that's 100% OK with me. But "because I am in real mode" isn't the right kind of reason for such a decision, and "so in 16bit you use long to get 32 bits" is dangerous advice.
Re: which *int* ?
Posted: Tue Oct 27, 2009 12:04 pm
by qw
Then again, is there a single C compiler in the world that produces 16 bits real mode code and does not define long as 32 bits?
Re: which *int* ?
Posted: Tue Oct 27, 2009 1:08 pm
by Combuster
I do know one that does not define int as 16 bits...
Re: which *int* ?
Posted: Thu Oct 29, 2009 8:34 am
by qw
Combuster wrote:I do know one that does not define int as 16 bits...
Really? Which one is that?
Re: which *int* ?
Posted: Thu Oct 29, 2009 8:51 am
by Combuster
You're probably using it: GCC
(and please, google .code16gcc before attempting to fail

)
Re: which *int* ?
Posted: Thu Oct 29, 2009 8:53 am
by qw
GCC doesn't produce 16 bits real mode code, does it?
Re: which *int* ?
Posted: Thu Oct 29, 2009 8:55 am
by Combuster
Too late with the edit
But you still failed.

Re: which *int* ?
Posted: Thu Oct 29, 2009 8:59 am
by Solar
Last time I looked, there was some experimental, somewhat unreliable, not officially supported way to make GCC produce "pure" 16bit code mentioned in the GNU 'as' documentation (.code16gcc), but certainly nothing I would use outside the GCC maintenance team.
Re: which *int* ?
Posted: Thu Oct 29, 2009 9:03 am
by qw
Combuster,
Ah no, GCC still produces 32 bits code. The .code16gcc directive just tells GAS to add a32/o32 prefixes so it may run in 16 bits mode.
Solar,
D.J. Delorie did something like that:
http://www.delorie.com/djgpp/16bit/gcc/.
Re: which *int* ?
Posted: Thu Oct 29, 2009 9:05 am
by Combuster
@Solar, Counter-question: What's better supported: Turbo C++ 1.0 or .code16gcc?
Ah no, GCC still produces 32 bits code.
Ah the red herring. GCC
emits binaries which run in 16 bit mode.