GBDK libraries documentation
PrevChapter 2. The Gameboy as a TargetNext

Size of variables

The size of the various types as at 2.0b13 are:

Please see the section on the float library for more information on the format of floating point numbers. As at 2.0b13 neither float or long long support is complete.

lcc uses 'int' as the default type for most operations including array indexing and constants. To make the code more efficient the ints were made eight bit which unfortunately limits local arrays to less than 128 elements. Note that statically allocated arrays such as image or tile data dont have this limitation.

To make it easier for porting and if/when the size of an int gets changed, it is recommended that the types BYTE, UBYTE, WORD and UWORD defined in type.h are used.

The Gameboy as a TargetUpAvoiding Promotion