1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-25 06:31:25 +00:00
C syntax compiler optimized for the 6502 microprocessor
Go to file
2018-03-11 15:16:22 -04:00
apple1 Removed obsolete header file apple1/oldclude/apple1.h 2018-01-28 15:02:49 -05:00
apple2 Add/update Apple ][ test programs 2018-03-03 13:28:22 -05:00
bin Added customized py65 monitor 2018-03-03 21:50:18 -05:00
doc Added size-of operator 2018-03-08 20:07:31 -05:00
include Updated include and test files 2018-03-03 14:35:12 -05:00
py65 Added size-of operator 2018-03-08 20:07:31 -05:00
src Added size-of operator 2018-03-08 20:07:31 -05:00
test Added size-of operator 2018-03-08 20:07:31 -05:00
vcs Added Atari 2600 C02 test programs vcs/*.c02 2018-01-28 14:44:10 -05:00
vic20 Added VIC-20 6560 Chip Include File 2018-03-11 15:16:22 -04:00
.gitignore Moved compiler source code to ./src directory 2018-03-03 14:26:50 -05:00
a02.sh Added Makefile and a02.sh shell script 2018-02-13 10:19:24 -05:00
c02.bat Added DOS batch, Bash script, and Notepad++ language files 2018-01-28 13:43:17 -05:00
c02.lang Added DOS batch, Bash script, and Notepad++ language files 2018-01-28 13:43:17 -05:00
c02.ppj Moved compiler source code to ./src directory 2018-03-03 14:26:50 -05:00
c02.sh Added DOS batch, Bash script, and Notepad++ language files 2018-01-28 13:43:17 -05:00
clean02.bat Fixed type in block.h02. modified clean02.bat 2018-02-13 19:53:45 -05:00
clean02.sh Added cleanup scripts clean02.bat and clean02.sh 2018-01-28 14:57:18 -05:00
Makefile Reset Makefile to Unix newlines 2018-03-03 14:34:04 -05:00
README.md Updated Intro section of README.md 2018-02-03 14:10:33 -05:00
test.asm Initial commit of c02.c and test.asm 2017-03-28 00:09:18 -04:00

C02

C02 is a simple C-syntax language designed to generate highly optimized code for the 6502 microprocessor. The C02 specification is a highly specific subset of the C standard with some modifications and extensions

The compiler generates assembly language code, currently targeted to the DASM assembler.

See the top-level documentation for more information.

Building the Compiler

In Linux, use gcc and the Makefile.

In Windows use the Pelles C IDE and the file ./C02.ppj.

Compiling C02 programs

At a command line, cd into the appropriate directory, e.g. py65 or vic20.

Execute the c02 compiler from the parent directory using the c02 source file (without the .c02 extension) as an argument.

For example, to compile the program conds.c02, in the py65 directory, use the command

../c02 conds

in Linux, or

..\c02 conds

in Windows.

Some of the subdirectories contain a c02.bat file, which will compile the .c02 program, then run dasm to assemble the code. However, the path to dasm is hardcoded, so you will likely need to change it.

The file c02.sh provides the same functionality in Linux, but it may not be in a working state.