Keil Logo

Variable Size

Members of the 8051 family are all 8-bit MCUs. Operations that use 8-bit types (like char and unsigned char) are much more efficient than operations that use int or long types. For this reason, always use the smallest data type possible.

The Cx51 Compiler directly supports all byte operations. Byte types are not promoted to integers unless required. Refer to the INTPROMOTE directive for more information.

An example may be illustrated by examining a multiplication operation. The multiplication of two char objects is done inline with the 8051 instruction MUL AB. To accomplish the same operation with int or long types requires a call to a compiler library function.

  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.