[Coco] 6809 languages

Roger Taylor rtaylor at bayou.com
Wed Feb 9 21:33:54 EST 2005


At 08:08 PM 2/9/2005, you wrote:
>I mean, you had an interpreter, compiler, decompiler, assembler,
>interactive debugger, cooperative multitasker and editor as well as a
>nifty utility that would show you the source screens where a built in
>command was defined, all running in a 24K footprint (counting buffers and
>other system overhead). Add the ability to prototype and test both Forth
>and assembly directly from the command prompt and the fact that the
>assembler recognized inline structured conditionals (IF-ELSE-THEN and
>BEGIN-WHILE-UNTIL) and converted them directly into the proper branch
>commands (It's _amazing_ how much this does to clean up assembly
>listings).
>
>What's not to love?


CCASM is gaining high-level syntax.  I started with nested conditional 
assembly, which doesn't use any branching, so that was fairly easy to 
do.  Instead, a 32-bit flag register is rotated leftward as each 
conditional statement is encountered and evaluated.  A bit of logic is 
added to make it short-circuit/lazy.  No nested conditions can be true 
inside of a false condition.  It works great.

I'm also going to add some code-generation soon using 
.while/.endwhile,  .forever/.endfor,  .repeat/.until, and anything else I 
can think of for loops.  I'm also adding .if/.else/.elseif/.endif.  Unlike 
the conditional assembly statements, the run-time functions have to compute 
their parameters at run-time.

         .while  a>0
         deca
         .endwhile       loop until a<=0

         .forever
         deca
         .endfor

         .repeat
         inca
         .until  a=100

         .if     a=8
         jsr     delete
         .elseif a=13
         jsr     return
         .elseif a=10
         jsr     down
         .elseif a=9
         jsr     tab
         .endif

Then there's the select/case/endselect  or switch/case/endswitch which 
should be trivial.  My current concerns are with register preservation and 
signed/unsigned comparisons.


-- 
Roger Taylor




More information about the Coco mailing list