Numeric constants in ROM (__data8__, __data16__, etc.)

The instructions __data8__, __data16__, __data32__, __dataf__ and __datat__ allow to insert 8 bit, 16 bit, 32 bit, floating point or text data in ROM. Inserting 8 bit or 16 bit data was previously possible via the __asm__ instruction, but inserting 32 bit or floating point data was very tricky.
Another difference with the previous solution is that the data list is now processed a C level, not at assembly level. As a consequence, any valid C constant expression can be used to specify the data value, as below:

__data16__(4) ; // size of the table, as a 16 bit integer
__dataf__(2.718281, 3.141592/180., 1/3.0E7, 55 ) ; // constant values
Note 1: The last value is an int in the previous example, but it will be automatically converted to float.



Alain Gibaud 2015-07-09