|
CC78K0S Datasheet, PDF (393/520 Pages) NEC – C Compiler Ver.1.30 or Later Language | |||
|
◁ |
CHAPTER 11 EXTENDED FUNCTIONS
BCD Operation Function
#pragma bcd
(11) unsigned int bcdtow (x) ;
unsigned int x ;
Decimal numbers are converted to binary numbers.
(12) unsigned int wtobcd (x) ;
unsigned int x ;
Decimal numbers are converted to binary numbers. However, if the value of x exceeds 10000, 0xffff is returned.
(13) unsigned char btobcd (x) ;
unsigned char x ;
Decimal numbers are converted to binary numbers. However, the overflow is discarded.
Caution The above-mentioned function declarations are not influenced by the -ZI and -ZL options.
COMPATIBILITY
<From another C compiler to this C compiler>
⢠Modification is not needed if functions for BCD operations are not used.
⢠To change another function to the function for BCD operation, modify according to USAGE above.
<From this C compiler to another C compiler>
⢠A BCD operation function name can be used as a function name by deleting the #pragma bcd statement or
delimiting it with #ifdef.
⢠To use pragma bcd as a BCD operation function, modify the program according to the specifications of each
compiler (#asm, #endasm or asm(); etc.).
Userâs Manual U14872EJ1V0UM
393
|
▷ |