10
Renesas C/C++ Compiler Package for M16C Series and R8C Family [M3T-NC30WA] 5.x and 6.x IAR Embedded Workbench® for Renesas RL78 1.x Assembler, C, C++, EC++ (V.6.00 only) Supported programming languages: assembler, C, Embedded C++, Extended Embedded C++, and C++. C89 For C, the C99 standard is default, but C89 can optionally be used. C99 is supported by the library. : Generate code for R8C <= 48KB : Generate code for R8C > 48KB None: Generate code for M16C : Generates code for the core without a hardware multiplier/divider. (default): Generates code for the core with a hardware multiplier/divider. Default: near RAM and far ROM Options for near ROM and far RAM Supported code models (option ): near (default): Function calls reach the first 64 Kbytes of memory. far: Function calls reach the entire 1 Mbyte memory. Default: near RAM and far ROM Options for near ROM and far RAM Supported data models (option ): near (default): Data is by default placed in the highest 64 Kbytes of memory far: Data is by default placed in the entire 1 Mbyte of memory One library for M16C and one for R8C The linker automatically selects appropriate libraries. near, far To override default placement of the selected code model, use any of these memory attributes: (default) near, far To override default placement of the selected data model, use any of these memory attributes: (default) : The highest 64 Kbytes : The entire 1 Mbyte of memory For example:

Renesas C/C++ Compiler Package for M16C Series and R8C ...supp.iar.com/FilesPublic/.../ew/doc/EWRL78_MigratingFromRenesasM1… · For example: or or or Place at desired address using

  • Upload
    vodang

  • View
    225

  • Download
    2

Embed Size (px)

Citation preview

Renesas C/C++ Compiler Package for M16C Series and R8C Family [M3T-NC30WA] 5.x and 6.x

IAR Embedded Workbench® for Renesas RL78 1.x

Assembler, C, C++, EC++ (V.6.00 only) Supported programming languages: assembler, C, Embedded

C++, Extended Embedded C++, and C++.

C89 For C, the C99 standard is default, but C89 can optionally be

used. C99 is supported by the library.

: Generate code for R8C <= 48KB

: Generate code for R8C > 48KB

None: Generate code for M16C

: Generates code for the core without a hardware

multiplier/divider.

(default): Generates code for the core with a

hardware multiplier/divider.

Default: near RAM and far ROM

Options for near ROM and far RAM

Supported code models (option ):

near (default): Function calls reach the first 64 Kbytes of

memory.

far: Function calls reach the entire 1 Mbyte memory.

Default: near RAM and far ROM

Options for near ROM and far RAM

Supported data models (option ):

near (default): Data is by default placed in the highest 64

Kbytes of memory

far: Data is by default placed in the entire 1 Mbyte of

memory

One library for M16C and one for R8C The linker automatically selects appropriate libraries.

near, far To override default placement of the selected code model, use

any of these memory attributes:

(default)

near, far To override default placement of the selected data model, use

any of these memory attributes:

(default) : The highest 64 Kbytes

: The entire 1 Mbyte of memory

For example:

For example:

or

or

or

Place at desired address using linker options or

(V.5.45 only)

Place at desired address using linker options

(V.6.00 only)

The section must be placed by customizing

the linker configuration file. See the compiler guide section

Customizing the linker configuration file.

or

Note that an interrupt function must have the return type

, and it cannot specify any parameters.

8 bits 8 bits

16 bits 16 bits

16 bits 16 bits

32 bits 32 bits

32 bits 32 bits

64 bits 32 bits

64 bits 32 bits (treated as )

(language extensions must be enabled)

-

-

-

-

(V.6.00 only) (M16C-specific)

-

(V.6.00 only)

-

-

(V.6.00 only)

(V.6.00 only) (done via linker configuration file)

(V.5.45 only) -

(V.5.45 only) -

-

- (you must conform to the calling convention)

(V.5.45 only)

-

(V.6.00 only)

-

(V.6.00 only) (done via linker configuration file)

, -

, -

, -

, -

, -

, -

, -

, -

, , , -

, , , -

, -

, -

, -

, -

, -

, -

, -

, -

, -

, -

, -

(V.6.00 only)

(V.6.00 only)

(V.6.00 only)

(V.6.00 only)

-

-

( )

( )

(V.6.00 only) -

( ) -

( ) -

( ) -

( ) -

( ) (any integer type can be used)

( ) -

( ) - (default)

( ) -

( ) -

( ) (keyword)

( ) -

-

(V.5.45 only) -

( )

( ) -

-

( ) -

(V.6.00 only) -

(-fNST) -

( ) -

( ) -

( ) -

( ) -

( ) -

( ) -

( ) -

( ) -

( ) -

( )

( ) -

-

(V.5.45 only) -

-

(V.5.45 only) -

(V.6.00 only) -

(No option needed. Just add library name as input to XLINK)

(V.6.00 only)

(c99 is default)

(V.5.45 only) -

(V.6.00 only) (available as a linker option, )

(V.6.00 only) -

-

( ) -

( ) -

( ) -

( ) (V.5.45 only) -

( )

( ) -

( ) -

( ) -

( ) -

( ) -

( ) -

( )

( )

( ) -

( ) -

( ) -

(V.6.00 only)

,

(V.6.00 only) (rtti is not supported)

(V.6.00 only) (rtti is not supported)

-

(default behavior)

Run the executable without options. Do not use .

( )

( ) (V.5.45 only)

( ) -

( ) (V.5.45 only) -

( ) -

( ) -

( ) -

( ) XLINK

( ) -

( ) -

( ) -

(V.5.45 only) -

( ) XLINK option forces output

( ) -

( ) -

( ) -

( ) -

The assembler supports:

* several modules per source file

* relocatable placement

Same

All interrupt vectors for peripheral interrupts should be

placed in section , fixed interrupt vectors should be

placed in section .

Interrupt functions should be declared as so that they

cannot be discarded by the linker even if no symbols in the

segment are referred to. To insert an entry in the interrupt

vector table, define the destination with the directive, for

example like this:

Sections are only defined using the assembler directive

. There is no distinction between absolute,

relocatable, … sections.

Section types can be , or .

Code segments are defined using the assembler directives

, , , and , which means absolute,

named absolute, common, and relocatable segments. A

segment can also be defined.

, ,

:

:

Bit segments cannot be defined explicitly, but can easily be

defined using bit operators in code or data segments. As a

byte is the smallest allocatable memory segment, no memory

is lost or gained using either tool.

Not supported, should be replaced by .

Binary ,

Octal , ,

Decimal , , ,

Hexadecimal , ,

, , , -

-

-

-

,

-

-

,

-

,

-

-

-

, , , , , , , ,

,

-

, ,

, ,

-

-

,

-

-

-

-

(V.6.00 only) , ,

(see example in asm guide)

-

-

-

-

, ,

-

-

-

-

-

-

-

-

(V.6.00 only) -

-

(V.5.45 only) -

-

(V.5.45 only)

(V.5.45 only)

-

-

(V.5.45 only) ,

(V.6.00 only) ,

(V.6.00 only)

Run the executable without options. Do not use .

-

All SFR are defined in and sfrxx.inc header files. All SFRs are defined in files.

(V.5.45 only)

(V.5.45 only)

(V.6.00 only) -

(V.6.00 only)

(V.6.00 only) -

(V.6.00 only) -

(V.6.00 only)

, (V.6.00 only) -

(V.6.00 only)

(V.6.00 only) -

(V.6.00 only)

(V.6.00 only)

, , (V.6.00 only) ,

(V.6.00 only)

(V.6.00 only) (XLIB)

(V.5.45 only) -

(V.6.00 only) -

(V.6.00 only)

(V.6.00 only) -

(V.6.00 only) (XLIB)

(V.6.00 only) or

(V.6.00 only) -

(V.6.00 only) -

(V.5.45 only) Automatic, if information is present in the input files.

(V.6.00 only)

(V.5.45 only) -

(V.6.00 only) (related to

(V.5.45 only) No separate option. Enter library names separated with

blanks.

(V.5.45 only)

(V.6.00 only) No separate option. Enter library names separated with

blanks.

(V.6.00 only)

(V.5.45 only) ,

, (V.6.00 only) Always output except in silent ( ) mode

(V.5.45 only) (module and segment map)

(V.5.45 only) (M16C-specific)

(V.5.45 only) (M16C-specific)

(V.6.00 only)

(V.6.00 only) -

, (V.6.00 only) -

(V.5.45 only), (V.5.45 only)

(V.6.00 only)Includes all segment parts in a linked module in the list file,

not just the segment parts that were included in the output.

(V.6.00 only) -

(V.5.45 only)

(V.5.45 only)

(V.6.00 only)

(V.5.45 only) ,

(V.6.00 only)

(V.6.00 only)

(V.6.00 only) -

(V.6.00 only) (related to and )

(V.5.45 only) -

(V.5.45 only) -

(V.6.00 only)

(V.6.00 only)

(V.6.00 only) (XLIB)

(V.6.00 only) (Related to , link the content in one location, place the

bytes at some other location and have the copied to other

location before they are used)

(V.6.00 only) -

(V.6.00 only)

(V.6.00 only) -

(V.6.00 only) -

(V.6.00 only) (V.6.00 only) -

(V.6.00 only) -

(V.6.00 only)

(V.6.00 only)

(V.6.00 only) -

(V.6.00 only) ,

(V.6.00 only) -

(V.6.00 only)

(V.6.00 only) -

(V.5.45 only) - (see error message listing in XLINK manual)

(V.6.00 only) Always output except in silent ) mode

(V.5.45 only) (Includes all segment parts in a linked module in the list file,

not just the segment parts that were included in the output)

(V.6.00 only) -

(V.5.45 only) Run the executable without options. Do not use .

(V.6.00 only) -

(V.5.45 only) -

(V.6.00 only) -

(V.5.45 only) -

(V.6.00 only) (via compiler )

(V.5.45 only)

, ,

(V.6.00 only)

(V.6.00 only)

(V.5.45 only) ,

(V.6.00 only)

(V.6.00 only)

, ,

Not fixed. Can be forced to a user defined segment with

or

,

,

all except char, short, near pointer

8-bit values in: 8-bit values in: , , , , ,

16-bit values in: 16-bit values in: , ,

24-bit values in: 24-bit values in: Stack

32-bit values in: stack 32-bit values in:

Floating-point values in: stack Floating-point values in:

8-bit values in: 8-bit values in:

16-bit values in: 16-bit values in:

24-bit values in: 24-bit values in:

32-bit values in: 32-bit values in:

64-bit values in:

Floating-point values in: Floating-point values in:

None and

- -The registers , , and . -Registers that are used as register parameters and for returning values by a function.

The system startup code can either be delivered in assembler files ( + ) or in C source files.

The system startup code is located in the ready-made file. In addition, you specify additional settings,

for example for the stack and heap size. It is likely that you need to customize the code for system initialization. For example, your application need to initialize memory-mapped special function registers, or omit the default initialization of data segments performed by cstartup. You can do this by providing a customized version of the routine , which is called from cstartup before the data segments are initialized. Modifying cstartup directly should be avoided.

Static and global variables are initialized: not-initialized variables are cleared and the values of other initialized variables are copied from ROM to RAM memory.

Static and global variables are initialized: zero-initialized variables are cleared and the values of other initialized variables are copied from ROM to RAM memory. This initialization can be overrided by returning 0 from the

function. Variables declared which are not initialized at all:

Not all library functions are reentrant. Refer to Appendix E of NC30 User's Manual for details.

The compiler is always reentrant when using the DLIB library.

IAR, IAR Systems, IAR Embedded Workbench, C-SPY, visualState, The Code to Success, IAR KickStart Kit, IAR, and the logotype of IAR Systems are trademarks or registered trademarks owned by IAR Systems. J-Link and J-Trace are trademarks licensed to IAR Systems.

All information is subject to change without notice. IAR Systems assumes no responsibility for errors and shall not be liable for any damage or expenses.

© 2011 IAR Systems AB. Part number: MRenesasM16C/R8C_To_IARRL78-1. First edition: September 2011