CoCo Urbane

Crunch is Done

First I made crunch work. I had an inc-pair routine that kept track of the current name pair at all times. It was complicated but direct. Of course it was easy to write the pair when it came time. Unfortunately when searching the symbol table, inc-pair was called each time that one went to the next symbol in the table. I changed it so that inc-pair just incremented the lsb until it reached zero then it started the lsb over again and incremented the msb. When the msb reached zero it printed a warning that there were only 35 name pairs left. Now when traversing the symbol table it usually only did one increment for each symbol looked at. Every 36th symbol it was only a little worse. The routine to write the name pair was less complicated than the original inc-pair routine and it only ran once for each name looked up. My other improvement was to add a byte count to each symbol table entry. Then when you first knew that the symbol didn’t match, two instructions, load b and add b to x, moved to the next symbol in the table. I’m satisfied that I won’t be able to make it much better. Another advantage is it was easier to check the code. A symbol could only be shorter or longer than the entry in the table. My code was defective but it was easy to fix. The lsb is A-Z, 0-9. By changing the starting values I was easily able to check the difficult changes. Z to 0 and then back 9 to A. I left the values in the code so I can use them in uncrunch which is next.

By earlcasper

Retired US Postal Clerk. BS at University of Washington. Studied computers at Arizona State University. Lives in Kansas City KS.

Leave a Reply

Your email address will not be published. Required fields are marked *