Crossware

Table of Contents        Previous topic       Next topic       

C COMPILER->8051 Specific Features->Compatibility Features->Support for Keil extensions

The Crossware C compiler supports the following Keil extensions:

Additional Keywords

The keywords bit, sbit, data, bdata, idata, xdata,  sfr, sfr16, code, generic, using, reentrant, interrupt and _at_ are supported.  These translate the equivalent Crossware keywords _bit, _sftbit, _data, _bdata, _idata, _xdata, _sfr, _sfrword, _code, _generic, _using, _reentrant, _interrupt and _at respectively.

Support for these additional keywords is enabled by default and can be disabled using the /Kk command line option or by unchecking the Allow Keil keywords option in the Build->Settings->Compiler tab of the Embedded Development Studio.


Additional Formats

In addition, the compiler supports the following formats:

The interrupt, using and reentrant keywords can be placed after the interrupt function name (the using keyword must follow the interrupt keyword, not the otherway around).

The memory space qualifier of an object can positioned at the beginning of the declaration.  For example:

data char x is equivalent to char data x

and

data char xdata* p is equivalent to char xdata* data p.

Note that although you can now also use the Crossware _nonreentrant keyword after the function name, it is not recommended because when the default is for reentrant functions, any bit parameters will have been converted to unsigned chars before the compiler realises that the function is non-reentrant.  The information that the object was originally declared as a bit is not available and so the compiler cannot reparse the parameter list converting them back to bits.


Instrinsic Functions

The Crossware C compiler also supports the Keil intrinsic functions except for  _chkfloat_().

These are defined in intrins.h either as macros or intrinic functions.  _nop_() and _testbit_() are macros and _cror_(), _iror_(), _lror_(), _crol_(), _irol_() and _lrol_() are intrinic functions hard coded into the compiler.

By declaring _testbit_() as a macro, it can be used on any integral object that is being used as a boolean flag, not just bits.  Therefore in the case of reentrant functions, when automatic bits are quitely converted to unsigned chars, _testbit_() will continue to function correctly.