A89: TI-GCC help needed


[Prev][Next][Index][Thread]

A89: TI-GCC help needed





 > Recently I have taken my hand to trying to program in C for the TI-89.
 > Currently I'm working on C Drugwars 89, and I was wondering what kind of
 > features TI-GCC supports.  What are the data types supported? "int" is,
 > "float" isn't i'm pretty sure. If float isn't, how would I go about storing
 > large numbers (up to about 400 million or so). Is "double"?

Gcc does support IEEE floats, doubles and long doubles. It is your
calculator which does not. However, if you can get hold of either a
68881 emulation library or write your own IEEE compatible float
library, then you will have floats. There's a C source for a
float-only library which comes with the standard gcc distribution, 
if you are desperate.

400 million actually easily fits in a 32-bit entity, gcc on a 68k
has it:

char        8 bit
short      16 bit
int        16 or 32 bit (config dependent)
long       32 bit
long long  64 bit

 > Arrays? To what degree?
 >
 > Can I have all the standard facilities (i.e. an array inside a structure)?
 >
 > Structures?
 > 
 > Switch statements?
 > 
 > All the standard loops and decision mechanisms? For, do-while, if, if-else
 > etc.

I hope you don't want to say that there exists a program which 
calls itself a C compiler while not supporting all of the above. 
That must be a misprint or you have been seriously mislead.

Everything in ANSI C is supported (even brain damage like trigraphs) 
and a lot more: There's functions in functions, vararg macros, inline
assembly, statement expressions, trampolines, typeof and naming types, 
special features of ?:, zero length and variable length arrays,
non-constant initializers, constructor expressions, ranged cases,
union casting and select for initialisation, attributes, explicite
walk of the activation chains and quite a few more. 

Gcc is *not* a toy compiler; it is a heavy-duty unix tool ported to
every OS that's worth mentioning (and to some which isn't :-).

Regards,

Zoltan


References: