[Coco] How much did I know?
Wayne Campbell
asa.rand at yahoo.com
Wed Aug 19 20:38:20 EDT 2009
As I work at typing in the source to DCom 3.5, and re-creating the source to DCom 3.1, I am faced with the realization of just how little I knew back then. DCom is too large, does everything the hard way, and never did realize my ultimate goals for the program.
Before I got the original source code back, I started working on a "new version", just to be able to successfully decode the 3.1 version. I named the program "unpack", because I finally realized that I should try to work with the terms the original programmers of Basic09 used. Since procedures are "packed" into I-Code modules, it makes sense that the reverse would be "unpacking" the I-Code to retrieve the source code.
So far, unpack does everything DCom does, with the exceptions that I haven't finished with the variable procedure yet (but mostly done), have yet to deal with the line number references and the called subroutine names, and the output is not parsed to re-order the instructions into their final form. Basically, it is DCom, DCP1, DCP2, and most of DCP3, all in one program made up of 4 procedures. When it's done, it may have 6 or 7 procedures. What there is so far loads and runs *in* Basic09 with 20K of workspace memory. Compare that with DCom, which has to be packed to even run, because the parts are too large to fit into the workspace, even at 40K.
I was brand new to programming back then, and I was trying to learn OS-9, Basic09 programming, programming in general, *and* trying to decode I-Code, all at the same time. For what it's worth, I think I accomplished alot, but that doesn't make up for the fact that DCom is a kludge. It's actually amazing to me that I was able to get DCom to work at all.
Because unpack is coming along so well, I am planning to continue its development, and create the DCom I intended to create to begin with. Unpack will be the workhorse that does the work of decoding the I-Code. DCom, which will be called DCom4, will be the user interface I wanted to create to begin with. It will allow the user to rename variables, correct errors in the TYPE statements, renumber line numbers, and save the source file.
Generic labels are necessary, when you have no idea what the variables were named in the original program, but they are difficult to associate to the function of the code. Having to load the reconstructed source into Basic09 and then rename all the variables is, IMO, an unnecessary step. I always wanted to be able to handle that as a function of DCom. Maybe now I can make it so.
Wayne
More information about the Coco
mailing list