Last updated on the page, compiler or documentation: January 13, 2014
(see News to recent changes)
Index

Description
The language ccz80 has a syntax based on C language. It works in command line mode under Windows, but it is possible use it on Linux with WINE or MONO and also on MacOS with MONO. From a program written in the language ccz80 the compiler generates an executable binary file for a computer-based Z80 or an emulator and also can generates an assembler file equivalent.
The compiler is free for any use and the existing library of functions on this page is open source, but the source code of compiler is not released.
You need to have installed the library Microsoft. NET Framework 4 Client Profile to use the compiler, IDE and setup utility.
Using
We recommend using the ccz80 IDE, including a specialized ccz80 code editor and comfort to compile, locate errors, correct them in different files, specify compiler options menu, etc. from the same program.
If not used IDE ccz80 need the following tools (we recommend creating a dedicated folder to the compiler, the function library files and source files, object and binary generated):
  • A text editor to write the program source in language ccz80 as UltraEdit, PSPad, NotePad++, etc.
  • The compiler ccz80 (ccz80.exe file).
  • The standard library (standard.ccz80 file).
  • Library files necessary depending on the destination computer program (files cpc464.ccz80, cpc6128.ccz80, Spectrum.ccz80 or msx.ccz80).
If you write and save a program ccz80 called program.ccz80 and want to run in the address #A000 (40960), to compile it can be written on the command line:
ccz80 programa.ccz80 /org=#A000
This will have created the binary file programa.bin, or the equivalent programa.asm assembler code if the option /asm is specified, if the compilation is correct. After this it is necessary to pass the binary file to a real computer or an emulator.
To facilitate the editing and compilation can optionally use the IDE corresponding to the file ccz80IDE.exe.

Examples
This example serves to create a program under Windows for the the ZX Spin emulator of the ZX Spectrum. The steps recommended are:
  1. Create a new folder on your hard drive.
  2. Download the compiler and copy the file ccz80.exe, the standard library standard.ccz80 and the spectrum library spectrum.ccz80 to the folder you created.
  3. Open a text editor (eg Notepad), write and save with the name characters.ccz80 in the folder you created the following ccz80 language program (after saving this program is not necessary to close the text editor):

    include "spectrum.ccz80"; // Use the library of Spectrum (the standard library is included for the library spectrum)
    byte i; // Declaring a variable byte
    stream (2); // Set the current channel to the main screen
    for (i = 32; i <= 128; ++i) // Loop where i starts with 32 and ending with 128 to execute the next line
        printc (i) // Call to function printc (included in the library spectrum.ccz80)
    return; // Ends the program and returns to BASIC

  4. In Windows click Start/Run, type cmd and press OK to open a command window.
  5. In the command window, go to the folder created using the command CD.
  6. When in the folder you created to write the following sentence in the command window:

    ccz80 characters.ccz80 /org=50000

    If it shows an error message, check the source program written in step 3 and save it after correcting it. Is not necessary to close the command window for the next steps.
  7. Run emulator ZX Spin and use the File/Load binary file. Push the button and browse to the folder characters.bin generated find the file in the folder was created after the preliminary step, typing 50000 as initial address and click the Load button to load the contents of the file in the memory of the emulator.
  8. Finally typing the command in the emulator RANDOMIZE USR 50000 to run the program. That's it.
You can go back to the text editor to modify the program and repeat operations to create new programs.
Another example, also under Windows, for the model Amstrad CPC 464:
  1. Create a new folder on your hard drive.
  2. Download the compiler and copy the file ccz80.exe, the standard library standard.ccz80 and the Amstrad library cpc464.ccz80 to the folder you created.
  3. Open a text editor (eg Notepad), write and save with the name characters.ccz80 in the folder you created the following ccz80 language program (after saving this program is not necessary to close the text editor):

    include "cpc464.ccz80"; // Use the library Amstrad CPC 464 (the standard library is included for the library Amstrad)
    byte i = 32; // Declare a variable byte and initialize with 32
    repeat (224) // Loop 224 repetitions to execute the next line
        printc (i++); // Call to function printc (included in the library cpc464.ccz80) and post-increase variable i
    return; // End the program and return to BASIC

  4. In Windows click Start/Run, type cmd and press OK to open a command window.
  5. In the command window to go to the folder created using the command CD.
  6. When in the folder created to write the following sentence in the command window:

    ccz80 characters.ccz80 /org=#A000

    If you see an error message, check the source program written in step 3 and save it after the corrections. Is not necessary to close the window of command for the next steps.
  7. Run the emulator WinCPC and use the File/Load binary file, enter as load address A000 and in the emulator type the setence CALL &A000 to run the program ccz80 created.

Downloads
The compiler, IDE, documentation and utilities can be downloaded here:
If the installation is to be done inside a folder protected by the system, for example C:\Program files, you must run the setup utility with administrator permissions. Similarly, to allow modification configuration file, the IDE application must also be executed with administrator privileges.

Links
Links to some programs and utilities listed on this page:

News
Jan 13 2008 Released the initial version 1.0.0 of compiler, libraries and documentation.
Jan 14 2008 Compiler version 1.0.2
  • Correction in operating of decrease variables word.
  • Correction in optimizing lines preceded by blank line.
Jan 17 2008 Compiler version 1.0.3
  • Change in the format of error messages.
  • Internal changes to further speed up the compilation.
Small improvements in the documentation of ccz80.
Added a file syntax to use with UltraEdit (in the downloads section).
Added a dedicated forum (in Contact section).
Jan 20 2008 Compiler version 1.1.0
  • Added sentences const and string.
  • Corrections in the evaluation of the operators & & and ||.
  • Corrections in the evaluation of addition of numerical constants.
  • Some changes to try faster compilation.
  • Allow write comments anywhere in the code and eliminate them from the assembly code produced.
  • Limit to about 130 characters per line of assembly code produced, for compatibility with more assemblers.
  • Constant characters are written as is, not as ASCII code corresponding to improve understanding of the program.
  • Labels for the declaration of variables, arrays, strings, etc.. appear on a single line in the assembler code for supporting more assemblers.
Changes in the documentation for new sentences.
Jan 26 2008 Released initial version 1.0.0 of the IDE ccz80 (in the Downloads section is the application and documentation).
Jan 29 2008 Released version 1.0.1 of the IDE ccz80 with some bugs fixed and new options for recharging a file and change the font from the edition windows.
Feb 03 2008 Released version 1.0.2 of the IDE ccz80 correcting the activation of some hot keys.
Feb 06 2008 Added a basic library for MSX.
Feb 20 2008 New link associated with MSX.
Feb 24 2008 Compiler for Linux.
Apr 02 2008 Compiler version 2.0.0
  • Added the inline clause in the definition of functions.
  • Assembler integrated to generate the binary file directly besides the file assembler equivalent
  • Changes in the syntax of some elements in the assembler code generated for the integrated assembly.
  • Other minor corrections.
Changes in the documentation for new sentences.
Changes in the syntax of the libraries of functions (standard, Amstrad CPC, Spectrum and MSX) for the integrated assembly.
Changes in some functions in libraries for optimization by clause inline.
Change in the documentation of language ccz80 to explain the news.
Elimination of the version of the compiler for Linux (use the Windows version with WINE or APE).
Apr 04 2008 Update file syntax for UltraEdit.
Apr 15 2008 Compiler version 2.0.1
  • Added the / asm ccz80 the compiler.
  • Some improvements in the optimization of code.
Change in the documentation to describe the parameter /asm.
Apr 28 2008 Compiler version 2.0.2
  • Avoid specify the value as a source file "".
  • Avoid notice 'Constant not used' when it is used.
  • Corrections in the evaluation of expressions.
Sep 11 2008 Compiler version 2.0.3
  • Correction of the error when using a label as a parameter to an argument of type byte in the call to a function.
Oct 23 2008 Added Spanish version of the website.
Minor corrections and additions to the content of the website.
Oct 29 2008 Added Spanish version of the document language specification.
Corrections in the English version of the website.
Nov 24 2008 Version 1.0.3 of ccz80 IDE with little corrections.
Manual ccz80 IDE in spanish.
Corrections of manual ccz80 IDE in english.
Released the source code of ccz80 IDE.
Dec 27 2008 Published the library and documentation for use the Sprites Alive routines in Amstrad CPC.
Jan 11 2009 Compiler version 2.0.4
  • Fixed the evaluation of operator ! for values type word.
  • Added label __end_program at end of assembler code source generated to find out where the free space in memory.
Mar 27 2009 Compiler version 2.0.5
  • New option /include to specify paths to files to be included in the program.
  • Allowed the use of labels with the operators == and !=.
  • Allowed assembler undocumented instructions (using registers IXh, IXl, IYh, IYl and rotate/shift instructions).
  • If the parameter of the repeat command is set to 0 no loop is executed (previously it was executed 65536 times).
  • No runtime error when an element is omitted in a list separated by commas (for instance in function parameters).
  • Optimization to remove function parameters from the stack after its execution.
  • Improvements in multiplication, division and modulo operations and some imprevements to optimize the code.
  • Improvements in the assembler source code generated when using the option /asm.
  • A message is shown when the compilation is finished without errors.
Apr 11 2009 New format in section downloads.
Apr 17 2009 Compiler version 2.0.6
  • Fixed errors when use quotation mark (\") or semicolon (;) in a constant string.
  • New option /post to run others applications after compilation.
  • New directive datafile to include a binary file in the program ccz80.
Jul 24 2009 IDE version 1.0.6, save the options in a .INI file, not in Windows register.
Jul 26 2009 Included in package for Amstrad CPC the sprUtilCPC library for use sprites in programs ccz80 (documentation only in Spanish).
Aug 5 2009 Compiler ccz80 version 2.0.7: allow clause register for one parameter functions passing the parameter value in register, not in stack.
Optimization of standard library and specific libraries for each computer for use clause register.
Updated sintax files for editors for new clause.
Updated documentation for clause register.
Fixed some errors in libraries.
Oct 11 2009 ccz80 IDE version 1.0.7: fixed some little bugs.
Oct 20 2009 Included library for use routines of Fourspriter 1.0 for Spectrum.
Feb 15 2010 New compiler version ccz80 2.0.8:
  • Allow initializate a text string with string instruction.
  • Fixed functions printf, fprintf and lprinf in libraries for Amstrad CPC for write negatives real numbers.
  • Show information about the binary file created.
Apr 13 2010 New compiler version ccz80 3.0.0:
  • Lets write keywords in uppercase or lowercase.
  • Add the ability to create macros with the instruction define.
  • Remove const statement whose functionality is replaced by define.
Oct 29 2010 Fixed bug in save function for Amstrad CPC.
Nov 2 2010 New compiler version ccz80 3.0.1 for Microsoft .NET 4 with 25% more speed compiler.
Nov 12 2010 New version ccz80 3.0.2:
  • Use Microsoft .NET 4 Client Profile to reduce the requirements for the computer.
  • Add some optimizations for generated code.
ccz80 IDE and sprUtilCPC sprites editor for Amstrad CPC is also compiled to Microsoft .NET 4 Client Profile.
Syntax files for editors adapted to ccz80 version 3.
Nov 19 2010 Fixed and improved the application and documentation for ImgEditSprUtilCPC to design sprites to use with sprUtilCPC.
Nov 23 2010 Included setup utility to download and install the compiler, documentation, tools, etc.
Jan 5 2011 New IDE version 2.
Jan 8 2011 ccz80 IDE minor improvements and documentation.
Jan 22 2011 Improved setup utility:
  • Facilitate the implementation of ccz80 for different computers.
  • Create shortcuts for all installed documentation.
Compiler ccz80 version 3.1.0:
  • Allows you to specify constant values of type byte, word and string as an expression of constant operands.
  • Review and improvements to syntax check the source code.
Feb 2 2011 Improvements in ccz80 IDE:
  • New option Edit/Select block.
  • Improvements in the outcome of the option Format / Formatting assembler.
  • New button on Find/replace window to copy the marked matched lines to clipboard.
  • Fix in the replacement of text within a selection.
  • Initially mark all matches found in the Find/replace window.
Compiler ccz80 version 3.1.1:
  • Fix for running applications indicated by the /post option when the path contains spaces.
  • Improved formatting of generated assembly code with /asm option.
Feb 3 2011 New library function for Amstrad PCW. Also applies with some exceptions for Amstrad CPC in 6128 and Spectrum +3 CP/M Plus.
Added in setup utility the option to install the environment for Amstrad PCW using this new library.
Feb 9 2011 Compiler ccz80 version 3.1.2: improvement and fixed error in the previous version to format the assembly code.
New version of ccz80 IDE: imporovement and error correction formatting assembly code.
Mar 4 2012 Compiler ccz80 version 3.1.3:
  • Fixed the value returned by relational operators.
  • Allow positive and negative values at the displacement of the assembly instructions with indexed records.
  • Division by zero detection in expressions in ccz80 code and in expressions in assembler code.
  • Fixed character encoding of text files generated.
  • Allow constant string as second parameter in substract.
  • Alloc numeric constant as condicion of condicional operator.
  • Added label __begin_program at start of program.
  • Added new functions in standard.ccz80 library: absb, absw, sgnb, sgnw, min, max, sqrt, power, previousrand, signedword, endprogram.
  • Fixed functions btoh and wtoh in standard.ccz80 library.
  • Fixed functions cursor, key, finputc, finputs and eof in Amstrad CPC libraries.
  • Optimization of function copychr and improvement in function save in Amstrad CPC libraries.
Mar 17 2012 ccz80 IDE version 2.0.0.5: fixed problem that blocked the IDE when the result of the compilation produced too much text.
Jan 13 2014 ccz80 IDE version 2.0.0.6: fixed problem has always showed that it could not find file ccz80.exe when a compilation error.
May 17 2014 Compiler version 3.1.4:
  • Fixed error in product with word types.
  • Fixed error in product with word types.
  • Fixed error in optimization with comparations using constant values in range 1 to 4.
  • Change to allow for loop without condition.
  • Change to allow integration inside anothers compilers.
Jan 2 2015 Compiler version 3.1.5:
  • Fixed error in assignment to variables or parameters type short of values out of range.
Apr 24 2023 Add link to cc2msx utility.

Contact
To contact the author of the compiler and communicate ccz80 errors, suggestions, etc. you can write to:

e-mail


If you want to receive news update on this development, writing an email with the subject "News" to be added to the mailing list.

You can visit the forum devoted

ccz80 forum


Thanks for your interest.