2.4.1 Command line operation

You can launch the ccrh command (the compilation driver) to perform compilation, assembly, linking, and other actions.

The assembler (asrh) and optimizing linker (rlink) can also start by itself.

(1)

Specification format

Enter the following on the command line.

>ccrh[option]...file[file|option]...
>asrh[option]...file[file|option]...
>rlink[{file|option}...]

 

option: Option name

file: File name

[ ]: Can be omitted

...: Pattern in proceeding [ ] can be repeated

{ }: Select from items delimited by the pipe symbol ("|")

: One or more spaces

 

The following points should be noted when entering a command.

-

The specification formats of options depend on the command that is used.
See "2.5.1 Compile options", "2.5.2 Assemble options"and "2.5.3 Link options" for cautions about options of each command.

-

A file name supported by Windows can be specified.
However, "@" cannot be used at the beginning of a file name because it is regarded as the subcommand file specification.
"-" cannot be also used at the beginning of a file name because it is regarded as the option specification.
"(" and ")" cannot be also used for a file name because they are regarded as the part of link options.


-

The length that can be specified for a file name depends on Windows (up to 259 characters).

-

Uppercase characters and lowercase characters are not distinguished for the alphabet of a file name.

-

Two or more files can be specified as input.
Files which have different types (C source file and assembly source file or object file, and the like) can be mixed.
Note that two or more files having the same source file name except for the extension cannot be specified (even when they are stored in separate folders).
In this case, even if there is an error in one file, processing of the remaining files will continue if processing is possible.
The generated object file is not deleted after linking.



(2)

Example of operations

The examples of operations on the command line are shown below.

Remark

See "2.5 Option" for details about each option.

(a)

Performing compilation, assembly, and linking by one command

C source file "file1.c" is compiled by ccrh, and then assembly source file "file1.asm" is generated.

Next, assembly source file "file1.asm" and "file2.asm" are assembled by asrh, and then object file "file1.obj" and "file2.obj" are generated.

Assemble list file "sample.prn" are also output.

Finally, object file "file1.obj", "file2.obj", and "file3.obj" are linked by rlink, and then link map file "sample.map" and load module file "sample.abs" are generated.

>ccrh file1.c file2.asm file3.obj -Xasm_option=-Xprn_path=sample.prn -Xlk_option=-list -osample.abs -Xcommon=rh850

Remark

In the ccrh command line, use the -Xasm_option option to specify an option dedicated to asrh; to specify an option dedicated to rlink, use the -Xlk_option option.

(b)

Performing compilation and assembly by one command, and linking separately

C source file "file1.c" is compiled by ccrh, and then assembly source file "file1.asm" is generated.

Next, assembly source file "file1.asm" and "file2.asm" are assembled by asrh, and then object file "file1.obj" and "file2.obj" are generated.

Assemble list file "sample.prn" are also output.

>ccrh -c file1.c file2.asm -Xasm_option=-Xprn_path=sample.prn -Xcommon=rh850

Remark

In the ccrh command line, use the -Xasm_option option to specify an option dedicated to asrh.

 

Object file "file1.obj", "file2.obj", and "file3.obj" are linked by rlink, and then link map file "sample.map" and load module file "sample.abs" are generated.

>rlink file1.obj file2.obj file3.obj -output=sample.abs -list

(c)

Performing compilation, assembly, and linking separately

C source file "file1.c" is compiled by ccrh, and then assembly source file "file1.asm" is generated.

>ccrh -S file1.c -Xcommon=rh850

 

Assembly source file "file1.asm" and "file2.asm" are assembled by asrh, and then object file "file1.obj" and "file2.obj" are generated.

Assemble list file "sample.prn" are also output.

>asrh -c file1.asm file2.asm -Xprn_path=sample.prn -Xcommon=rh850

 

Object file "file1.obj", "file2.obj", and "file3.obj" are linked by rlink, and then link map file "sample.map" and load module file "sample.abs" are generated.

>rlink file1.obj file2.obj file3.obj -output=sample.abs -list