English
Language : 

CC78K4 Datasheet, PDF (377/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler 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
Postprocessing
ret
EXAMPLE 2
This example shows a description in which this #pragma directive is described following the C text. The
statement beginning with the double slashes (//) indicates the section to be located.
#pragma section @@DATA ??DATA
int a1;
_sreg int b1;
int c1 = 1;
const int d1 = 1;
#pragma section @@DATS ??DATS
int a2;
_sreg int b2;
int c2 = 2;
const int d2 = 2;
#pragma section @@DATA ??DATA2
int a3;
_sreg int b3;
int c3 = 3;
const int d3 = 3;
// ??DATA
// @@DATS
// @@INIT and @@R_INIT
// @@CNST
// ??DATA
// ??DATS
// @@INIT and @@R_INIT
// @@CNST
// ??DATA is closed automatically and ??DATA2 becomes valid.
// ??DATA2
// ??DATS
// @@INIT and @@R_INIT
// @@CNST
User’s Manual U15556EJ1V0UM
377