Keil Logo

C51: ?C? Long/Float Math Library Routines


Information in this article applies to:

  • C51 Version 6.x and later

NOTE

The Keil C51 library includes a number of helper routines for the C51 compiler. These routines perform mundane tasks that are best not included in-line.

These routines are named using the following convention: ?C?ttfff

where:

  • tt is the type field,
  • and fff is the operation field.

TYPE FIELD

The type field may be one of the following:

  • L indicates 2 longs passed in R0/R1/R2/R3 and R4/R5/R6/R7.
  • FP indicates 2 floating-pointer numbers (float) passed in R0/R1/R2/R3 and R4/R5/R6/R7.

OPERATION FIELD

The operation field indicates the math operation to perform:

  • ADD indicates addition.
  • SUB indicates subtraction.
  • MUL indicates multiplication.
  • DIV indicates division.
  • CMP indicates comparison.
  • AND indicates bitwise and.
  • OR indicates bitwise or.
  • XOR indicates bitwise exclusive or.

The results of the operation are returned in R4/R5/R6/R7.

MORE INFORMATION

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  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.