C6805 Product News

The following sections describe new features in Byte Craft Limited Products.

For more information on these directives, see section 10.2 of the printed manual.

#pragma CHECKSUM;

This directive informs the compiler that you wish to checksum the ROM. This directive reserves a single ROM location as a location for the checksum routine. The symbol table reference is __CHECKSUMPAD. This location contains the 2s complement checksum value for the rest of ROM memory. __CHECKSUM() is a library function that returns the checksum value for all of memory. A zero return means that the checksum has no error while a non-zero value means that there is a checksum error. __CHECKSUM() can access all memory locations generated in ROM by the compiler including interrupt vectors. Code need not be contiguous.

 #pragma checksum;
char a,b,c;
void main(void){      a=b/c;
     #ifdef __CHECKSUM             if (__CHECKSUM() !=0) NOP();
     #endif      NOP();
} #pragma memory ROMPROG[4096] @0x1100;
void MoreCode(void){      NOP();
     NOP();
} 

#pragma memory LOCAL

Described above.

#pragma option NOINIT;

This option turns off the default initialization. Using this directive has two effects:

  1. The reset vector is not set to point to the start of the program. This becomes the responsibility of the programmer.

  2. Global variables are not initialized before main(). The compiler usually generates an error if you try to create a function called __RESET because this conflicts with the automatic setting of the reset vector. When NOINIT is used, the compiler allows you to create a __RESET function. However, you are responsible for jumping to the start of the program at the end of the __RESET function.

#pragma option CALLMAP;

This option displays a call tree for the functions in your program in the list file.