1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-05 12:06:10 +00:00
C syntax compiler optimized for the 6502 microprocessor
Go to file
2018-02-06 22:50:50 -05:00
apple1 Removed obsolete header file apple1/oldclude/apple1.h 2018-01-28 15:02:49 -05:00
doc Merge branch 'master' into select 2018-02-05 22:48:38 -05:00
include Added new function definitions to stdiox.h02 2018-02-03 12:43:05 -05:00
py65 Bug Fx: Modified bgnblk() and added to call when parsing CASE 2018-02-06 22:50:50 -05:00
test Added generic C02 test programs test/* 2018-01-28 14:47:06 -05:00
vcs Added Atari 2600 C02 test programs vcs/*.c02 2018-01-28 14:44:10 -05:00
vic20 Added VIC-20 specific C02 compile scripts vic20/c02.bat and vic20/c02.sh 2018-01-28 14:38:11 -05:00
.gitignore Added file types to .gitignore and clean02.bat 2018-02-03 13:39:17 -05:00
asm6502.c
asm.c
asm.h
c02.bat
c02.c Implemented SELECT, CASE, and DEFAULT statements 2018-02-05 21:51:30 -05:00
c02.exe Bug Fx: Modified bgnblk() and added to call when parsing CASE 2018-02-06 22:50:50 -05:00
c02.lang
c02.ppj
c02.ppx Added multiple case arguments and optimized argument 0 2018-02-06 21:31:19 -05:00
c02.sh
c02.tag Bug Fx: Modified bgnblk() and added to call when parsing CASE 2018-02-06 22:50:50 -05:00
clean02.bat Added file types to .gitignore and clean02.bat 2018-02-03 13:39:17 -05:00
clean02.sh Added cleanup scripts clean02.bat and clean02.sh 2018-01-28 14:57:18 -05:00
common.c
common.h
cond.c
cond.h
expr.c
expr.h
files.c
files.h
include.c
include.h
label.c Added multiple case arguments and optimized argument 0 2018-02-06 21:31:19 -05:00
label.h Implemented SELECT, CASE, and DEFAULT statements 2018-02-05 21:51:30 -05:00
parse.c
parse.h
README.md Updated Intro section of README.md 2018-02-03 14:10:33 -05:00
stmnt.c Bug Fx: Modified bgnblk() and added to call when parsing CASE 2018-02-06 22:50:50 -05:00
stmnt.h
test.asm
vars.c Bug Fx: Modified bgnblk() and added to call when parsing CASE 2018-02-06 22:50:50 -05:00
vars.h

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.