This series of articles is a C language tutorial, focused on using C efficiently on Oric computers. The language combines a set of features which make it an excellent choice for most programming tasks, from system programming to Artificial Intelligence. Unfortunately, it was not designed with small eight-bit systems in mind. As a result, the Oric implementation of C is a cut-down version.

Although this is supposed to be programming on the Oric, I will try to provide a generic C tutorial, stressing differences between ANSI C and the compiler we use on the Oric. I might fail utterly, in which case Kernighan and Ritchie will appear to me in a vision and damn me to eternal debugging, but it will be fun anyway.

So, the most important question: why use C? Why not stay with Assembly, Forth or Basic? There are many answers to the Question. C is a very compact language: it comprises a minimalistic core of less than fifteen statements. Everything else (including I/O, maths, and many data types) is in external libraries, which can be linked to the program at will. This allows for very small programs and extreme flexibility. Also, C is a high-level language, but, depending on the style and knowledge of the programmer, it may work with all the power of Assembly, or with all the structure and readability of Pascal. This makes it a good choice for writing fast Oric programs easily and quickly. And of course, a language which provides such ample opportunities for puns and jokes has to be good, right?

These articles will assume you are using an 48k Oric-1 or Atmos as your testing platform. Since there is no native Oric C compiler, we use a cross-compiler (i.e. the compiler runs on one platform, and produces code which will run on another). The compiler is David R. Hanson's retargettable ANSI C compiler, lcc. The Oric version, lcc65, runs on IBM PCs and compatibles (DOS or Linux based). You can run your programs either on a real Oric, or on Fabrice Frances' Euphoric emulator.

Tags: 


Add new comment

Leave a comment