The Compiler

Table of Contents
Usage

vcc1.exe [-i] [-h] [-V <#ver>][-Wn] [-wn]<infile> [-o <outfile>]


Description

vcc1.exe reads a C file after it has been preprocessed, performs optimization, and generates an input assembler file. If no file arguments are given, vcc1.exe reads from stdin and writes to stdout. If one file argument is used, it is assumed to be the input file.

vcc1.exe performs optimization of C code using modern optimization methods such as constant expression folding, jump around jump elimination, duplicate string elimination, register allocation and many others.

The compiler does not generate native code for the HITACHI processor. For more details see Cybiko Bytecode Interpreter

vcc1.exe mostly conforms to the ANSI C standard.


Features

All number values in Cybiko’s version of C language are signed.

Besides common features of the ANSI C languages, some features are added in Cybiko’s version of the C language.
   1. SWITCHFAST keyword.
   2. EXPORT keyword.
In Cybiko’s version of C language it is possible to declare any function as exported by using EXPORT keyword.
   Syntax: EXPORT <export_index> <function description>

Export index is a zero-based number of this function in the export table. The first allowed index for user’s functions is 3 (three). That’s important to understand: functions are exported not by name, but by their indexes ONLY.


   3. IMPORT keyword.
Exported functions may be imported in the user’s program by using IMPORT keyword.
   Syntax: IMPORT <import_index> <function description>

It’s important to understand, that, if you wish to import a function that was exported before with N export index, you have to use N as the import index too! Function descriptions in both cases have to be equal, the user may change only the NAME of the importing function! The user does not have to change the type of function, the number of arguments or the type of arguments.


   4. Inheritance of structures
In Cybiko’s version of the C language, an inheritance of structures is realized. If you need, you can write:
   struct my_struct1 : public my_struct2 { field_declaration_list };
or
   struct my_struct1 : public my_struct2;

In this example my_struct1 is a descendant of my_struct2 and vice versa my_struct2 is a ancestor of my_struct1.



Options

   -i
Get information about the compiler version.


   -h
Print help message.


   -o <outfile>.asm
Use <outfile>.asm as the name of the output assembler file.


   -W(n)
Set warning level (default n=1)


   -w(n)
Issue no more than n warnings (default n=8)


   -V <bytecode_version_num>
Compatibility with bytecode.dl of mentioned version. You can find the version number and a list of changes here


   -n
generate 'native' code (that is, CPU opcodes instead of bytecodes for the virtual machine); programs generated with this switch will run much faster, though will be considerably bigger than their 'bytecode' counterparts; please note that the main() function will always compile into bytecode, disregarding the '-n' switch (Professional Edition only).

Known problems

1. The size of the output file for downloading into Cybiko computer shouldn't be bigger than 64K.

For a detailed list of compiler bugs, see Known problems