Next Previous Contents

2. The compiler

The compiler translates one C source into one assembly source, for each invocation. It does not create object files directly, and it is not able to translate more than one file per run.

In the example above, we would use the following command line, to translate hello.c into hello.s:

        cc65 -O -t c64 hello.c

The -O switch tells the compiler to do an additional optimizer run, which is usually a good idea, since it makes the code smaller. If you don't care about the size, but want to have slightly faster code, use -Oi to inline some runtime functions.

The -t switch is followed by the target system name.

If the compiler does not complain about errors in our "hello world" program, we will have a file named "hello.s", in our directory, that contains the assembly source for the hello module.

For more information about the compiler, see cc65.html.


Next Previous Contents