Optimizing Compiler and Linker features

SourceBoost IDE Integration

The BoostC compiler integrates seamlessly into the MS Windows SourceBoost IDE (Integrated Development Environment).

Base Data types:

  • 8 bit char - signed and unsigned.
  • 16 bit int - signed and unsigned.
  • 32 bit long - signed and unsigned.

Special Data types:

  • Single bit - single bit data type for efficient flag storage.
  • Fixed address - fixed address data types allow easy access to target device registers.
  • Read only code memory based variables.

Code Producing Features:

  • ANSI 'C' compatible - Makes code highly portable.
  • Produces optimized code for both PIC16 (14bit core) and PIC18 (16bit core) targets.
  • Support for Data Structures and Unions - Data structures and arrays can be comprised of base data types or other data structures. Arrays of base data types or data structures can be created.
  • Support for pointers - pointers can be used in "all the usual ways".
  • Inline Assembly - Inline assembly allows hand crafted assembly code to be used when necessary.
  • Inline Functions - Inline functions allows a section of code to be written as a function, but when a reference is made to it the inline function code is inserted instead of a function call. This speeds up code execution.
  • Eliminates unreachable (or dead) code - reduces code memory usage.
  • Removal of Orphan (uncalled) functions - reduces code memory usage.
  • Minimal Code Page switching - code where necessary for targets with multiple code pages.
  • Automatic Banks Switching for Variables - allows carefree use of variables
  • Efficient RAM usage - local variables in different code sections can shared memory. The linker analyzes the program to prevent any clashes.
  • Function pointers.
  • Dynamic memory management.
  • Output file in Intel Hex format.

Debugging features:

  • Source Level and Instruction Level Debugger - linker Generates COF file output for source level debugging under SourceBoost Debugger.
  • Step into, Step over, Step out - functions operate at source level and instruction level.
  • Multiple Execution Views - see where the execution of the code is at source level and assembly level at the same time.
  • Monitoring variables - variables can be added to the watch windows to allow there values to be examined. There is no need to know where a variable is stored.

Librarian:

  • Allows generations of library files - this simplifies management and control of regularly used code.
  • Reduce compilation time - using library files reduces compilation time.

Code Analysis:

  • Call tree view - in SourceBoost IDE displays the function call tree.
  • Target Code Usage - From the complete program, down to Function level the code space usage can be view in SourceBoost IDE.
  • Target RAM Usage - From the complete program, down to Function level the RAM usage can be view in SourceBoost IDE.

 

C language superset

BoostC compiler has some advanced features "borrowed" from C++ language. These features allows to develop more flexible and powerful code but one doesn't have to use them.

References

References can be used as function arguments. This provides very effective way to change values of the variables passed into a function as references:

void foo( char& x )  //'x' is a reference
{
  x = 10;
}

void main( void )
{
  char a = 1;
  foo( a );  //before the call 'a' is 1 and after the call it becomes 10
  ...
}

Function overloading

Functions can have same names and differ only by number and type of their arguments:

void foo( void )  //'foo' number 1
{
...
}

void foo( char *ptr )  //'foo' number 2
{
...
}

void foo( char a, char b )  //'foo' number 3
{
...
}

void main( void )
{
  foo();  //'foo' number 1 gets called
  foo( "test" );  //'foo' number 2 gets called
  foo( 10, 20 );  //'foo' number 3 gets called
  ...
}

Function templates

Functions can be declared and defined using data type placeholders. This feature allows writing very general code (for example linked lists) that isn't tightened to a particular data type and what may be more important to create libraries in form of header files:

template <class T>
void foo( T *t )
{
...
}

void main( void )
{
  short s;
  foo<char>( "test" );  //'foo( char* )' gets called
  foo<short>( &s );  //'foo( short* )' gets called
  ...
}