[Coco] scary old code

Wayne Campbell asa.rand at gmail.com
Sat Jul 24 12:28:05 EDT 2010


My wish list for Basic09 is:

ability to save the internal tables to files
unpack command (uses above tables) to unpack I-Code in a pinch (when you 
accidentally delete the only copy of the source code you have)
ability to have a workspace larger than 40K (to hold all of those comments)

When I began writing unpack, and then decode, I found that much commenting 
can be done just using variable names. The problem with it is that the 
longer word-names fills the workspace faster, even though the internal 
I-Code is using tokens, and the variable names are kept in a table. The 
single most important thing that could be done to Basic09, in this regard, 
is a larger workspace.

Basic09 creates 3 tables, variable reference list, line reference list, and 
comments list. The comments list contains all of the comment lines, blank 
lines and line reference lines whose line number is not referenced in a 
GOTO, GOSUB, THEN <lref>, or RESTORE <lref> statement. The 4th "table" is 
the i-code produced when Basic09 compiled the source as it was loaded. When 
packing, the line reference offset addresses, and possibly the variable 
reference addresses are modified. The variable references point to data 
memory instead of the variable list, and line number references are replaced 
with the relative offset within the procedure instead of the line reference 
list. All comments and blank lines and unused line reference lines are just 
lost. I don't know how difficult it would be to make Basic09 capable of 
doing what I wish it could do. The program is already as large as a single 
program can be and still do the work it does.

Wayne

----- Original Message ----- 
From: "Willard Goosey" <goosey at virgo.sdc.org>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Friday, July 23, 2010 12:54 AM
Subject: Re: [Coco] scary old code


> On Thu, Jul 22, 2010 at 07:18:59PM -0700, Wayne Campbell wrote:
>> You are correct, Bob. However, as I was working on my CoCo3 at the time,
>> trying to maintain 2 different files was difficult.
>
> Yeah, you need some good tools to make that work.  diff and patch,
> maybe.  Unfortunately, machines with diff and patch don't have
> languages so limited by source-file size that you'd need a commented
> version and an uncommented version.
>
> Or, do all your work with a commented version, and automatically
> generate an uncommented version to feed to your compiler/interpeter,
> which is another option that the CoCo interpeters wouldn't make easy.
>
> I kind of wish we had a version of BASIC-09 that was strictly a
> non-interactive compiler.  That would make it a lot easier to layer on
> pre-processors (like include or m4), comment strippers, etc onto the
> language.
>
> Willard
> -- 
> Willard Goosey  goosey at sdc.org
> Socorro, New Mexico, USA
> I search my heart and find Cimmeria, land of Darkness and the Night.
>  -- R.E. Howard
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco 




More information about the Coco mailing list