English
Language : 

CC78K4 Datasheet, PDF (398/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
(24) Division function
Division Function
CHAPTER 11 EXTENDED FUNCTIONS
#pragma div
FUNCTION
• Outputs the code that divides the value of an expression to an object with direct inline expansion instead of
function call and generates an object code file.
• If there is not a #pragma directive, the function for division is regarded as an ordinary function.
EFFECT
• Codes utilizing the data size of the division instruction I/O are generated. Therefore, codes with faster
execution speed and smaller size than the description of ordinary division expressions can be generated.
USAGE
• Describe in the same format as that of a function call in the source. There are the following two functions for
division.
divuw, moduw
[List of division functions]
(a) unsigned int divuw(x, y);
unsigned int x;
unsigned char y;
Performs unsigned division of x and y and returns the quotient.
(b) unsigned char moduw(x, y);
unsigned int x;
unsigned char y;
Performs unsigned division of x and y and returns the remainder.
• Declare the use of the functions for division with the #pragma div directive of the module.
However, the following items can be described before #pragma div.
• Comments
• Other #pragma directives
• Preprocessing directives that neither define nor reference variables or functions.
• Keywords following #pragma can be described in either uppercase or lowercase letters.
398
User’s Manual U15556EJ1V0UM