6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Jun 26, 2024 3:41 am

All times are UTC




Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Fri Mar 16, 2018 11:03 pm 
Offline

Joined: Tue Feb 24, 2015 11:07 pm
Posts: 81
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.


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 17, 2018 8:21 pm 
Offline

Joined: Thu Feb 10, 2011 3:14 am
Posts: 79
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.

A dense, but fairly exhaustive sample code section has been added to the README file, along with the new logo designed by Triangular


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 19, 2018 8:03 am 
Offline

Joined: Tue Feb 24, 2015 11:07 pm
Posts: 81
CurtisP wrote:
A dense, but fairly exhaustive sample code section has been added to the README file

Very nice! Is this one correct?
Code:
do (c = getchr(); putchr(c); while (c<>13)

It looks to the untrained eye like there's an unmatched parenthesis following `do`

I see that:
Code:
i:+

..is a condition for "i is positive". It might be friendlier to just recognise
Code:
i>=0
as a degenerate comparison and emit the `BMI` pattern.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 19, 2018 7:59 pm 
Offline

Joined: Thu Feb 10, 2011 3:14 am
Posts: 79
unclouded wrote:
Is this one correct?
Code:
do (c = getchr(); putchr(c); while (c<>13)

It looks to the untrained eye like there's an unmatched parenthesis following `do`
This should have been
Code:
do {c = getchr(); putchr(c);} while (c<>13)
I'll fix it.

unclouded wrote:
I see that:
Code:
i:+

..is a condition for "i is positive". It might be friendlier to just recognise
Code:
i>=0
as a degenerate comparison and emit the `BMI` pattern.
That won't work, because all variables, expressions, and comparisons are unsigned. So (128 > 1) is true even though (128:+) is not, and (128>0) should work the same way.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 19, 2018 4:40 am 
Offline

Joined: Thu Feb 10, 2011 3:14 am
Posts: 79
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.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 20, 2018 6:58 pm 
Offline

Joined: Thu Feb 10, 2011 3:14 am
Posts: 79
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


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 23, 2020 5:15 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
Just to note, I stumbled on this old thread, and am pleased to see active development still going on in the repository. Nice!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 55 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: