22 February 2004 Commentary update I haven't done much at all with Karig for the past week. Instead, I've been working on the ColorForth commentary. My excuse is that I want to build a proto-system to install on my laptop, which I will then use to develop Karig piece by piece. This proto-system must include a compiler of some kind, and my current plan is to base my compiler on the one in ColorForth. To do this, I have to understand the ColorForth system reasonably thoroughly before I can create something similar. Writing this commentary is basically my way of studying ColorForth's innards. Progress on the commentary continues. Here's what I have done so far: I've redone the source-code files. They are smaller, which is always a virtue for web pages. I split up the COLOR.ASM file into eight files, so that you don't have to download a 100KB file every time. For each label X in the source, I've added links to other labels (Refs) for code or data that references X (call X; jnz X; dd offset X; mov [eax], X; etc.) This means that if you are exploring the code, you can jump in both directions: Not only can you follow a link from a caller to a called routine, or from a routine to a variable used by the routine, but you can also move in the opposite direction. The source code itself has been cleaned up. Spaces have been replaced with tabs (which shrinks the files); all of the text has been converted to lowercase; routines are separated by blank lines; labels are printed in boldface. Labels that are listed in either of the two wordlists in ColorForth are printed in red, to indicate that the code you're looking at is the definition of a word in a wordlist. I've begun adding one-line descriptive comments under some labels to describe what routines do, though I haven't added very many yet. I've also added comments to the right of a few lines of source code in places, to spell out in detail what each line is doing. I've also begun re-adding the actual commentary to the files. (The sheer size of the COLOR.ASM file, after I added hyperlinks and commentary to it, is what prompted me to split the file up.) Here are the routines I've documented so far:
That's it so far, although it should be more than enough for somebody who knows assembly language who wants to explore the code in his web browser by clicking links and the Back button. I don't want to spend forever on this, and I'll probably take a break from the commentary once I've worked out the parts that pack, unpack, define, compile, and execute words. That will give me enough knowledge, I think, to build a similar if simpler system for my laptop. Check the index for other entries. |