All data items are held in the native byte order of the AVR processor. The plain character type is signed by default. The floating-point types float and double are implemented as 32-bit and 64-bit IEEE floating-point.

###### Standard data types and alignments

Data Type | Size in bytes | Alignment in bytes
char | 1 | 1
unsigned char | 1 | 1
int | 2 | 2
unsigned int | 2 | 2
short | 2 | 2
unsigned short | 2 | 2
long | 4 | 2
unsigned long | 4 | 2
long long | 8 | 2
unsigned long long | 8 | 2
float | 4 | 2
double (compiled with -msd) | 4 | 2
double | 8 | 2
long double | 8 | 2
type * (pointer) | 2 | 2
enum (enumeration) | 2 | 2

###### Pointer types

The MAXQ pointer registers can work in two modes, either as a pointer to a byte or as a pointer to a word. Thus, all data items in the MAXQ have a byte address and a corresponding word address. For byte-addressable data, the CrossWorks compiler stores a standard byte-address pointer. However, for data that can only be addressed as words, the compiler stores a word-address pointer.

The compiler does this to improve code density and execution speed, and in many cases this is exactly what you want. There are, however, a number of things that you must be aware of when passing pointers from C code to assembly language subroutines.

- All data types that are exclusively byte-addressable use byte pointers. Specifically, a pointer to a char is held as a byte pointer.
- All data types that are exclusively word-addressable use word pointers. Specifically, a pointer to an int is held as a word pointer.
- Structures that have both byte-addressable data and word-addressable data in them use byte pointers as the smallest addressable unit is one byte.
- All function pointers are word pointers.
- A pointer to void is a byte pointer.

##### Examples

Consider the structure:

    struct bytes
    {
      char c1;
      char c2;
    };

Because the structure contains only byte-aligned data, a "struct bytes *" pointer is a byte address pointer.

Consider the structure:

    struct words
    {
      int i;
      float f;
    };

Because the structure contains only word-aligned data, a "struct words *" pointer is a word address pointer.

Now consider the structure:

    struct mixed
    {
      int i;
      char c;
      float f;
    };

Because the structure contains both word-aligned and byte-aligned data, a "struct mixed *" pointer is a byte address pointer.

The compiler transforms between byte pointers to word pointers transparently. However, because accesses to structures with members that have mixed data alignments are common, the C compiler will need to transform pointers between byte and word pointers with structures of this type which can lead to inefficient code. To improve code density and execution speed you could change the data types held in the structure so they all have the same alignment.