Skip to main content

Assistance in Porting Files to the C Compiler Package for RL78 Family

Overview

Assistance in Porting Files to the CC-RL C Compiler for the RL78 Family from the CA78K0R and CC78K0R C Compilers for the RL78 Family and 78K0R Group, the CA78K0 and CC78K0 C Compilers for the 78K0 Group, and the NC30 C Compiler for the M16C Series and the R8C Family.

We provide two ways of handling files of C source code written for the CA78K0R, CC78K0R and NC30 compilers. One is a compiler option that selects interpretation to suit CC-RL as the files are compiled and the other is a separate code conversion program to actually port the code by converting it.

Only the latter method is available for CA78K0 and CC78K0.

For more information see the C Compiler Package for RL78 Family.

Release Information

Translation to Suit CC-RL Compiler Option

This method is suitable when the program under development only requires minor modifications.

Note: This approach does not support CA78K0 or CC78K0.

Procedure:

  1. Specify the -convert_cc option of CC-RL.
  2. Statements in the C source code files for CA78K0R (or CC78K0R) or NC30 which differ from the approach in CC-RL are interpreted to suit CC-RL, after which compilation of the code proceeds.
  • The option does not work with CA78K0 or CC78K0.
  • Source files converted for CC-RL are not output.
  • Statements which are device dependent, such as those related to the memory map and SFRs, and assembler instructions, are not translated. Modify them to statements for the target RL78 device by hand.
Image

C Source Code Converter

This method is suitable when the program under development requires major modifications.

The C source converter is software for converting files of C source code for the CA78K0R (and CC78K0R), CA78K0 (and CC78K0), and NC30 compilers to files for CC-RL. The converter can be run from the command line of WindowsR.

When files of C source code for the CA78K0R (or CC78K0R), CA78K0 (or CC78K0), or NC30 are input, statements written from the extended specifications of the given compiler are converted to the equivalent extended specifications for CC-RL, producing files for CC-RL.

Statements which are device dependent, such as those related to the memory map and SFRs, and assembler instructions, are not converted. Modify them to statements for the target RL78 device by hand.

Procedure:

Download the converter from the C Compiler Package for RL78 Family" section of our website.

  1. Download the C source converter for the compiler that is the target for conversion.
    • Downloadable executable file for CcnvCA78K0R: CcnvCA78K0R.exe
    • Downloadable executable file for CcnvCA78K0: CcnvCA78K0.exe
    • Downloadable executable file for CcnvNC30: CcnvNC30.exe
  2. Run CcnvCA78K0R, CcnvCA78K0 or CcnvNC30 from the command line of WindowsR.
  3. A file of C source code converted for CC-RL is output with the file name specified with the -o option when the converter was run.
Image

Example of Execution:


> CcnvCA78K0R input.c -o=output.c

Notes:

CcnvCA78K0R:
Command to run CcnvCA78K0R
input.c:
Name of input file
output.c:
Name of generated file