Keil Logo

Implementation-defined Behavior

The following section describes the implementation-defined behavior of the Cx51 Compiler.

CPU Startup and Main Function

At reset the CPU starts executing the startup and initialization code that is explained in Advanced Programming - Customization Files. The C function called by this startup code must be defined with void main (void) or int main (void). No arguments or parameters are passed to this main function and a return from main will cause undefined behavior. Therefore the main function must never return.

Source Code and Identifiers

The source character set is the standard ASCII character set. There is no mapping of ASCII characters which indicates that the target uses also standard ANSI character set. Multibyte characters and locale are not supported.

Refer to Appendix D. Compiler Limits for significant characters in identifiers and other compiler limitations.

Variable Types

The available variable types are explained under Advanced Programming - Data Storage Format and values are stored in big endian format. A plain char is treated as signed char.

Converting an int or long value to a shorter value is made by truncation. Any value that is assigned to the data type bit is tested against 0; values that are not 0 result in 1 when assigned to a bit value. When an integer number is cast to a float value, the value is rounded down.

A struct bitfield is always treated as unsigned integer value. Only char, unsigned char, int, and unsigned int are supported as storage unit for bitfields. Bitfields are allocated within the storage unit from the least-significant to the most-significant bit and a bitfield cannot straddle across a storage unit boundaries.

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.