2.4 Operating Instructions

This section describes how to operate the RX family C/C++ compiler.

 

The commands will take options from left to right on the command-line. When two or more options with conflicted meanings are selected and it will take neither error nor warning, the right-side option will be enabled. This results are different according to each options. For more details, please confirm each options' descriptions.

 

(1)

Operating Tools

(a)

Compiler (ccrx)

ccrx is the startup command for the compile driver.

Compilation, assemble, and linkage can be performed using this command.

When the extension of an input file is ".s", ".src", ".S", or ".SRC", the compiler interprets the file as an assembly-language file (.src, .s) and initiates the assembler.

A file with an extension other than those above is compiled as a C/C++ source file (.c, .cpp).

 

Two or more input files can be specified at the same time. Cases where two or more C/C++ language source files are specified as input files at the same time are referred to as "batch compilation."

 

[Command description format]

ccrx [<option> ][<file name>[ <option> ] ]
       <option>: -<option>[=<suboption>[=<suboption>]][, ]

(b)

Assembler (asrx)

asrx is the startup command for the assembler.

[Command description format]

asrx [<option> ][ <file name>[ <option> ] ]
       <option>: -<option>[=<suboption>][, ]

(c)

Optimizing Linkage Editor (rlink)

rlink is the startup command for the optimizing linkage editor.

The optimizing linkage editor has the following functions as well as the linkage processing.

-

Optimizes relocatable files at linkage

-

Generates and edits library files

-

Converts files into Motorola S type files, Intel hex type files, and binary files

[Command description format]

rlink [<option> ][ <file name>[ <option> ] ]
         <option>: -<option>[=<suboption>][, ]

(d)

Library Generator (lbgrx)

lbgrx is the startup command for the library generator.

[Command description format]

lbgrx [<option> ]
        <option>: -<option>[=<suboption>][, ]

(2)

Command Description Examples

(a)

Compilation, Assemble, and Linkage by One Command

Perform all steps below by a single command.

-

Compile C/C++ source files (tp1.c and tp2.c) in ccrx.

-

After compilation, assemble the files in asrx.

-

After assemble, link the files in rlink to generate an absolute file (tp.abs).

 

[Command description]

ccrx -isa=rxv1 -output=abs=tp.abs tp1.c tp2.c

Remarks 1.

When the output type specification of the output option is changed to -output=sty, the file after linkage will be generated as a Motorola S type file.

Remarks 2.

An intermediate file generated during the absolute file generation process (assembly-language file or relocatable file) is not saved. Only a file of the type specified by the output option is to be generated.

Remarks 3.

In order to specify assemble options and linkage options that are valid for only the assembler and optimizing linkage editor in ccrx, use the -asmcmd, -lnkcmd, -asmopt, and -lnkopt options.

Remarks 4.

Object files that are to be linked are allocated from address 0. The order of the sections is not guaranteed. In order to specify the allocation address or section allocation order, specify options for the optimizing linkage editor using the -lnkcmd and -lnkopt options.

(b)

Compilation and Assemble by One Command

Perform all steps below by a single command, and initiate the linker with another command to generate tp.abs.

-

Compile C/C++ source files (tp1.c and tp2.c) in ccrx.

-

After compilation, assemble the files in asrx to generate relocatable files (tp1.obj and tp2.obj).


[Command description]

ccrx -isa=rxv1 -output=obj tp1.c tp2.c
rlink -form=abs -output=tp.abs -subcommand=cmd.sub tp1.obj tp2.obj

Remarks 1.

When the -output=obj option is specified in ccrx, ccrx generates relocatable files.

Remarks 2.

In order to change relocatable file names, their C/C++ source files have to be input in ccrx, one file each.

Remarks 3.

When the form option in rlink is changed to -form=sty, the file after linkage will be generated as a Motorola S type file.

(c)

Compilation, Assemble, and Linkage by Separate Commands

Individually perform each step below by a single command.

-

Compile C/C++ source files (tp1.c and tp2.c) in ccrx to generate assembly-language files (tp1.src and tp2.src).

-

Assemble the assembly-language files (tp1.src and tp2.src) in asrx to generate relocatable files (tp1.obj and tp2.obj).

-

Link the relocatable files (tp1.obj and tp2.obj) in rlink to generate an absolute file (tp.abs).

[Command description]

ccrx -isa=rxv1 -output=src tp1.c tp2.c
asrx tp1.src tp2.src
rlink -form=abs -output=tp.abs -subcommand=cmd.sub tp1.obj tp2.obj

Remark

When the -output=src option is specified in ccrx, ccrx generates assembly-language files.

(d)

Assemble and Linkage by One Command

Perform all steps below by a single command.

-

Assemble assembly-language files (tp1.src and tp2.src) in asrx.

-

After assemble, link the files in rlink to generate an absolute file (tp.abs).

 

[Command description]

ccrx -isa=rxv1 -output=abs=tp.abs tp1.src tp2.src

Remark

Object files that are to be linked are allocated from address 0. The order of the sections is not guaranteed. In order to specify the allocation address or section allocation order, specify options for the optimizing linkage editor using the -lnkcmd and -lnkopt options.

(e)

Assemble and Linkage by Separate Commands

Individually perform each step below by a single command.

-

Assemble assembly-language files (tp1.src and tp2.src) in asrx to generate relocatable files (tp1.obj and tp2.obj).

-

Link the relocatable files (tp1.obj and tp2.obj) in rlink to generate an absolute file (tp.abs).

 

[Command description 1]

ccrx -isa=rxv1 -output=obj tp1.src tp2.src
rlink -form=abs -output=tp.abs -subcommand=cmd.sub tp1.obj tp2.obj

[Command description 2]

asrx -isa=rxv1 tp1.src tp2.src
rlink -form=abs -output=tp.abs -subcommand=cmd.sub tp1.obj tp2.obj

(f)

Create a List File of Existing Libraries

Create a list of lib1.lib with the name of lib1.lbp.

 

[Command description]

rlink -form=library -list -library=lib1.lib