User Tools

Site Tools

한국어

moacon:data_types_and_memory

Data Types

The MOACON Studio compiler supports the following data types:

char Signed 8-bit number
unsigned char Unsigned 8-bit number
short Signed 16-bit number
unsigned char Unsigned 16-bit number
int Signed 32-bit number
unsigned int Unsigned 32-bit number
long Same as int
unsigned long Same as unsigned int
float 32-bit floating point number (IEEE single-precision)
double 64-bit floating point number (IEEE single-precision)
long long Signed 64-bit number

To make the syntax more compact, the following types have also been defined:

#define u8 unsigned char
#define u16 unsigned short
#define u32 unsigned long

These types have already been pre-defined, so it is not necessary for users to define them. They can be used right out of the box.

void cmain(void)
{
 u8 i; // 8-bit unsigned number
 u32 li; // 32-bit unsigned number
 //...
}

Memory

The MOACON has 512KB of flash memory for executable code. However, some of this memory is consumed by the MOACON OS. The exact amount of memory depends on the MOACON OS version, but at the time this manual was written it was about 20KB.

The MOACON also has 64KB of data memory. Like the program memory, some of this is consumed by the MOACON OS. Again the exact amount consumed depends on the MOACON OS version, but at the time this manual was written it was about 10KB.

The size of the program can be determined when a program is compiled. If the program exceeds the amount of available memory, an “out of memory” error will occur. The MOACON also has 32KB of non-volatile memory that is retained even when the MOACON is powered off. This memory can be accessed with the framRead and framWrite functions. The MOACON does not have a battery backup feature, so, if data must be retained between power cycles, be sure to store this data in FRAM.

moacon/data_types_and_memory.txt · Last modified: 2016/04/14 11:03 (external edit)