Chapter 2 Development Environment
7
2.3.1 Create Your Own C Source Program
The first step is to create or modify the desired C programs using any text editors. We
recommend that you use "
.C
" as the file extension and create them under the USER
directory, and then use the USER directory as the working directory. We also recommend
that you divide the whole program into modules while retaining function integrity, and put
modules into separate files to reduce compilation time.
2.3.2 Compile
To compile the C programs, use
cc900
command in the directory of the target file.
cc900 -[options] FILENAME.C
For the usage of
cc900
command and the options, please refer to
cc900.hlp
in the ETC
subdirectory.
The batch file "
Y.BAT
" which can be found under the USER directory has been created to
simplify the compiling process.
Y FILENAME.C
This batch file invokes the C compilation program which in turn calls many other
executable programs under the BIN directory. As these programs are invoked by the
compiler sequentially, their usages can be ignored. Also, many parameters are set in calling
the compiler driver to accommodate target machine environments. It is recommended to
use the
Y.BAT
file directly. If you attempt to write your own batch file, remember to put the
same parameters as shown below.
-XA1, -XC1, -XD1, -Xp1: alignment setting, all 1
-XF: no deletion of assembly file, if it is not necessary to examine the assembly file.
This option can be removed.
-O3: set optimization level (can be 0 to 3, but not the maximum optimization). If code
size and performance is not a problem, this option can be removed which will then set to
the default - O0, that is, no optimization at all. If optimization is enabled, care must be
taken that some instructions might be optimized and removed. For example,
Test()
{
unsigned int old_msec;
old_msec = sys_msec;
while (old_msec == sys_msec);
}
Содержание Optimus R
Страница 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Страница 6: ......
Страница 8: ...2 C Programming Guide For Optimus S R...
Страница 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Страница 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Страница 24: ...18 C Programming Guide For Optimus S R...
Страница 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...
Страница 232: ...226 C Programming Guide For Optimus S R 4 11 Implementation defined Limits limits h float h Refer to limit h and float h...
Страница 238: ...232 C Programming Guide For Optimus S R...