C02 - An 8-bit optimized C syntax compiler for the 6502
Re: C02 - An 8-bit optimized C syntax compiler for the 6502
Just an idea: How about maintaining a short piece of sample code so we can see the current syntax? I like the way http://coffeescript.org/ explains the language by example.
Re: C02 - An 8-bit optimized C syntax compiler for the 6502
unclouded wrote:
Just an idea: How about maintaining a short piece of sample code so we can see the current syntax? I like the way http://coffeescript.org/ explains the language by example.
Re: C02 - An 8-bit optimized C syntax compiler for the 6502
CurtisP wrote:
A dense, but fairly exhaustive sample code section has been added to the README file
Code: Select all
do (c = getchr(); putchr(c); while (c<>13)I see that:
Code: Select all
i:+Code: Select all
i>=0Re: C02 - An 8-bit optimized C syntax compiler for the 6502
unclouded wrote:
Is this one correct?
It looks to the untrained eye like there's an unmatched parenthesis following `do`
Code: Select all
do (c = getchr(); putchr(c); while (c<>13)Code: Select all
do {c = getchr(); putchr(c);} while (c<>13)unclouded wrote:
I see that:
..is a condition for "i is positive". It might be friendlier to just recognise as a degenerate comparison and emit the `BMI` pattern.
Code: Select all
i:+Code: Select all
i>=0Re: C02 - An 8-bit optimized C syntax compiler for the 6502
After a few months hiatus, I've started working on C02. I fixes a bug with break & continue in do/while loops, add a tag for strings to printf() in library stdiox.
I also added a new library memio, which mimics file i/o functions, but reads and writes directly to memory, for use with machines and emulators that do not have file system support, but do support loading and saving blocks of memory to and from a storage device. I did this to allow development of programs that would normally interact with files on these systems.
I also added a new library memio, which mimics file i/o functions, but reads and writes directly to memory, for use with machines and emulators that do not have file system support, but do support loading and saving blocks of memory to and from a storage device. I did this to allow development of programs that would normally interact with files on these systems.
Re: C02 - An 8-bit optimized C syntax compiler for the 6502
I fixed a bug in the parsing of escape sequences in strings (dumb mistake, but took me a while to find it).
But more importantly I made two changes to expression parsing and compilation: Expressions may be used as indexes in any subscripted array references within expressions, and function calls may appear in any term of an expression
My next step is to allow expressions as the second (and possibly third) arguments of function calls. I figure the less quirks in the language specification the better.
All changes have been pushed up to the github repository at https://github.com/RevCurtisP/C02
But more importantly I made two changes to expression parsing and compilation: Expressions may be used as indexes in any subscripted array references within expressions, and function calls may appear in any term of an expression
My next step is to allow expressions as the second (and possibly third) arguments of function calls. I figure the less quirks in the language specification the better.
All changes have been pushed up to the github repository at https://github.com/RevCurtisP/C02
Re: C02 - An 8-bit optimized C syntax compiler for the 6502
Just to note, I stumbled on this old thread, and am pleased to see active development still going on in the repository. Nice!