11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Basic data typesThe <strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong> ensures this by assigning an alignment to every datatype, ensuring that the <strong>MSP430</strong> microcontroller will be able to read the data.Basic data typesThe compiler supports both all ISO/ANSI C basic data types and some additional types.INTEGER TYPESThe following table gives the size and range of each integer data type:Data type Size Range Alignmentbool 8 bits 0 to 1 1char 8 bits 0 to 255 1signed char 8 bits -128 to 127 1unsigned char 8 bits 0 to 255 1signed short 16 bits -32768 to 32767 2unsigned short 16 bits 0 to 65535 2signed int 16 bits -32768 to 32767 2unsigned int 16 bits 0 to 65535 2signed long 32 bits -2 31 to 2 31 -1 2unsigned long 32 bits 0 to 2 32 -1 2signed long long 64 bits -2 63 to 2 63 -1 2unsigned long long 64 bits 0 to 2 64 -1 2Table 30: Integer typesSigned variables are represented using the two’s complement form.BoolThe bool data type is supported by default in the <strong>C++</strong> language. If you have enabledlanguage extensions, the bool type can also be used in C source code if you include thefile stdbool.h. This will also enable the boolean values false and true.The long long typeThe long long data type is supported with the following restrictions:●●The CLIB runtime library does not support the long long typeA long long variable cannot be used in a switch statement.170<strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>Reference Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!