The Compiler

Description

RCC16 is an Oric targeted version of the LCC Compiler.

This compiler is decently ANSI compliant, and event support C++ comments as well as standard C comments.

The "official" source repository whre all the changes for the compiler are made before they reach the OSDK is Fabrice Frances' GitHub

Here is the primary source for the C Cross-Compiler targetting the 6502 processor that is included in the OSDK (Oric Software Development Kit). I am (Fabrice) putting it here so that it eventually becomes more familiar to people willing to maintain it in the long term...

Also, in order to increase its maintenability, I will try to progressively document what my 6502 code generator does. If you are interested in it, the first thing to read is Hanson & Fraser's interfacing document (docs/INTERFAC.pdf): the lcc65 compiler is built from Hanson & Fraser's frontend, and my small 6502 backend (6502/src/gen.c).

The frontend supplies the backend with forest of dags (directed acyclic graphs), the backend is responsible for code generation. The following options are accepted by the backend and affect the generated output; comparison of these outputs give a better understanding of what the backend does...

Last but not least, you have to know that the sources of the lcc frontend are very old (these are from LCC 1.9), written in K&R style (yeah!), so if you compile them you will get zillions of warnings. Moreover, I was told it is very difficult to compile them on Windows with Visual Studio, so I have added a project file for Code::Blocks in the src directory. Of course Linux users have a simple Makefile that should work on most systems.

Optimisation level can be modified using the OSDKCOMP variable: Since OSDK 1.14 this variable will be initialized by default to -O3 value (used to be -O2).

Data types

Since the 6502 is an 8 bit processor, the data size are as follow:

Libraries

Some standard functions (memcpy, printf, ...) are implemented, but most of the standard library is not available.

Some functions are just quick hacks done by directly calling the ROM functions. Unfortunately, ROM releases are different, and thus any code calling these functions will work only on ATMOS.

Historic

Here is the list of all releases with a short description of things that changed:

Version 1.36

- fixes for the -O0 output

Version 1.35

- defstring is used by the frontend not only to define strings (signed char data) but also for initializing unsigned char arrays. In this case, defstring will receive char data with possible negative char values which have to be printed as their corresponding unsigned char value.