Instructions

176Compiler
© 2013 Conrad Electronic
byte glob[10] = {1,2,3,4,5,6,7,8,9,10};
flash byte fglob[2][2]={10,11,12,13};
void main(void)
{
byte loc[5]= {2,3,4,5,6};
byte xloc[2][2];
xloc= fglob;
}
Because there is more flash memory than RAM available, it is possible with the flash keyword to
define data that are written in the flash memory only. These data can be copied to a RAM array with
same dimensions with an assignment operation. In this example this is done through "xloc= fglob".
This kind of assignment is not available in normal "C".
Direct Access to flash Array entries
With version 2.12 it is possible to access single entries in flash arrays:
flash byte glob[10] = {1,2,3,4,5,6,7,8,9,10};
void main(void)
{
int a;
a= glob[2];
}
There is still one limitation: Only references to arrays that lie in RAM can be passed as function
parameters. This is not possible with references to flash arrays.
Strings
There is no explicit "String" data type. A string is based on a character array. The size of the array
must be chosen in such a way that all characters of the string fit into the character array. Addition-
ally some space is needed for a terminating character (decimal Zero) inorder to indicate the end of
the character string.
Example for a character string with a 20 character maximum:
char str1[21];
As an exception char arrays may have character strings assigned to. Here the character string is
placed between quotation marks.
str1="hallo world!";
You may embed special characters in strings that are started with a "\" (backslash). The following
sequences are defined: