English
Language : 

CC78K4 Datasheet, PDF (294/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
EXAMPLE
(C source)
============ ca1.c ============
_ _callt extern int tsub ();
============ ca2.c ============
void main ()
{
int ret_val;
ret_val = tsub();
}
_ _callt int tsub ()
{
int val;
return val;
}
(Output object of assembler)
ca1 module
EXTRN
?tsub
callt
[?tsub]
ca2 module
PUBLIC _tsub
PUBLIC ?tsub
@@CALT CSEG
CALLT0
?tsub: DW
_tsub
@@CODE CSEG
_tsub:
:
Function body
:
;Declaration
;Call
;Declaration
;
;Allocation to segment
;Function definition
EXPLANATION
The callt attribute is given to the function tsub() so that it can be stored in the callt table.
COMPATIBILITY
From another C compiler to this C compiler
• Modification is not required if the keyword callt/_ _ callt is not used.
• When changing functions to callt functions, use the method above.
From this C compiler to another C compiler
• #define must be used. For details, see 11.6 Modifications of C Source.
294
User’s Manual U15556EJ1V0UM