English
Language : 

CC78K0S Datasheet, PDF (370/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 11 EXTENDED FUNCTIONS
#pragma section…
#pragma section…
EXAMPLE 1
Section name @@CODE is changed to CC1 and address 2400H is specified as the start address.
(C source)
#pragma section @@CODE CC1 AT 2400H
void
{
}
main()
Function body
(Output object)
CC1
_main:
CSEG AT 2400H
Preprocessing
Function body
Post-processing
ret
EXAMPLE 2
The following is a code example in which the main C code is followed by a #pragma directive. The contents are
allocated in the section following "//".
#pragma section @@DATA ??DATA
int a1;
// ??DATA
sreg int b1;
// @@DATS
int c1 = 1;
// @@INIT and @@R_INIT
const int d1 = 1;
// @@CNST
#pragma section @@DATS ??DATS
int a2;
// ??DATA
sreg int b2;
// ??DATS
int c2 = 1;
// @@INIT and @@R_INIT
const int d2 = 1;
// @@CNST
#pragma section @@DATA ??DATA2
// ??DATA is automatically closed and ??DATA2 becomes valid
int a3;
// ??DATA2
sreg int b3;
// ??DATS
int c3 = 3;
// @@INIT and @@R_INIT
const int d3 = 3;
// @@CNST
370
User’s Manual U14872EJ1V0UM