1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-09-29 12:54:55 +00:00
C syntax compiler optimized for the 6502 microprocessor
Go to file
2018-02-13 17:25:57 -05:00
apple1
doc Updated documentation for SELECT statement 2018-02-07 22:50:08 -05:00
include
py65 Print error messages to stderr, redirect debug messages to file 2018-02-08 22:39:20 -05:00
test
vcs
vic20
.gitignore
a02.sh Added Makefile and a02.sh shell script 2018-02-13 10:19:24 -05:00
asm6502.c
asm.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
asm.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
c02.bat
c02.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
c02.exe Refactor: combined function logvar() into vartbl() 2018-02-08 22:45:20 -05:00
c02.lang
c02.ppj
c02.ppx Changes to Pelles C project 2018-02-07 22:26:21 -05:00
c02.sh
c02.tag Refactor: combined function logvar() into vartbl() 2018-02-08 22:45:20 -05:00
clean02.bat
clean02.sh
common.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
common.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
cond.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
cond.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
dclrtn.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
dclrtn.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
expr.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
expr.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
files.c
files.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
include.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
include.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
label.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
label.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
Makefile Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
parse.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
parse.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
README.md Updated Intro section of README.md 2018-02-03 14:10:33 -05:00
stmnt.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
stmnt.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
test.asm
vars.c Fixed undeclared function warnings 2018-02-13 17:25:57 -05:00
vars.h Fixed undeclared function warnings 2018-02-13 17:25:57 -05: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.