Categories
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.

Categories
CoCo Urbane

Editing Urbane in Basic

Basic needs line numbers. Urbane uses the two bytes that basic uses for its line numbers for a zero byte and a screen lines in a file line count. The zero byte lets me look backwards in the file to the beginning of the previous line. The screen lines in the file line lets me see how far up in the screen I’m going. When I exit urbane I will renumber the file. When I enter urbane I’ll replace the line number bytes with my zero byte of nine for the screen lines in a file line. The maximum count is eight, so I’ll know I need to find the real count the first time I look at a line. I’ll store the count so I won’t have to do it again. Oh yeah. I discovered that Vcc has a break key. It’s <home>. Now I exit urbane when I press <home> and I delete the current line when I press shift-down-arrow. I used to use a shift-down-arrow to exit from the urbane editor. Letting the user edit the file in basic has the problem that he can edit the end of file line with disastrous results. He can also edit the symbol table which could be useful if he knew what he was doing. Changing a name in the symbol table would change it everywhere in the file. I need to give it more thought. Oh yeah. At my son’s suggestion I quit putting a phantom asterisk at the top of the file and I let the user see the end command and colon in addition to the asterisk at the end of file line. I think what I’m going to work on now is letting the user move up one screen line at a time instead of moving up one file line at a time and moving to the start of that line. I’m going to make it like the editor I use when developing urbane.  

Categories
CoCo Urbane

Blank Lines Revisited

I am so happy. My son suggested that I should have the urbane editor screen and the coco basic listing look the same. I had been feeling good because I was working hard to make the urbane screen look almost alike. Just added a quote mark to the empty line or string of quote marks in the urbane editor before I put it in the coco basic file. Before that I had treated blank lines and single quote lines as special cases. Terrible. When I saw that putting everything in loops so I could handle blank lines and any string of just quote marks simplified the code I was happy. My first try after my son’s suggestion was to change blank lines to a quote mark before I let the user leave a line. That really simplified the code. Happier. My next improvement was to check when the user started to edit a line to see if it was just a quote mark. If so I would empty the buffer. The quote mark was already on the screen. Since it was no longer in the buffer, when the user pressed a key it would go right onto the start of the line where the phantom quote was. There was a bug. While I was trying to duplicate the error, I discovered that I had a blank line in the urbane editor screen. I figured that I should have a line with a quote mark. I returned to coco basic. The line listed and ran properly. I figured out what had happened. I had put a line in the urbane editor of just a space. No surprise that the urbane editor screen showed a blank line. The great surprise was that it solved the coco basic list function’s bug of repeating the last not blank line when it encountered a blank line. Apparently a space was all it needed. And of course one can’t see a space if it’s all by itself. Even better the program ran properly. I found that the end and shift-end in Vcc acted like a space in the urbane editor. If I can figure out how that works I may have the last key I need for delete-line-function. When I’m in coco basic on Vcc the end and shift-end act as break keys. That’s ascii 3. How that changed to a space I need to find out.

Categories
CoCo Urbane

Blank Lines for Urbane

I’ve spent about a week working on my urbane project to get it to show empty lines in the editor. Coco Basic’s list command has a flaw. If there are blank lines in the file it repeats the last non blank line. If my user enters an empty line in the urbane editor I replace it with a quote mark in the basic file. That’s the comment signifier. So the program lists with quote marks and runs fine. My son suggested that I should let my user enter a quote mark by itself if he wants to. So I replace his quote mark with a pair in the basic file. My editor shows the user his single quote mark where he put it. My editor passes normal comment lines right through. The last problem I had was when I uncrunched a line from the basic file it showed the extra quote if any. I changed the line buffer and the line length count, but the extra quote mark was already on the screen. I fixed it with a kludge. I knew where the quote mark was on the screen so I poked the screen memory with the appropriate value to make it a space. Four instructions and it was fixed. What a kludge.

Categories
CoCo Urbane

I can’t believe it

I couldn’t wait to try it out. I carefully replaced all the stores with subroutine calls and cleaned it up a little. When I first tried it afterwards it didn’t work. I opened the editor and started looking around in the file. Then I noticed the save icon was red. I had forgotten to save the file before assembling and loading it. I saved it, assembled it and loaded it. Lo and behold it worked with no further changes. Now I’ll never be able to get to sleep. Oh well. It was worth it.

Categories
CoCo Urbane

Uncrunch

I’m working on my immediate version of urbane which runs on the coco2. With only a few changes it will run on the coco3 I hope. I was getting all kinds of weird results when I tried to open a new line at the end of the file. I remembered that I had done a complete rewrite of the uncrunch routine. Turns out I didn’t get the improvement that I had hoped for. I still needed to use a 256 byte buffer. I had these strange results, too. I went back to this uncrunch routine that I had rewritten. I spent a lot of time making it clean. One minor overlook, I pushed one more register than I pulled. When I fixed that it ran perfectly. I had to hold on tight to keep myself from charging ahead and attacking more features. I’m going to put out next weeks pills and balance our checkbook which I was supposed to do last weekend and maybe read in my kindle. Hopefully I’ll be relaxed enough then to go to sleep easily. I just thought of how I can get the results I wanted to with the new uncrunch routine. The coco2 and the coco3 when running in 32 column video mode let one read and write directly to the video memory. It will be a little harder, but I’ll be able to use less memory which might be an issue. I can hardly wait for tomorrow to come so I can try it out.

Categories
CoCo Urbane

IMUrbane is done

When the user loads or saves a file he is prompted with the last name loaded or saved successfully. F now loads a find screen of lines with labels. Shift-up does a page-up. Shift-down does a page-down. Up-arrow does a line-up. Down-arrow does a line-down. Enter returns to the editor at the selected label. I now plan to use the system to improve my EARL (Easy Assembler Robot Language) program which has a greater-than or less-than symbol moving back and forth on a line and increasing and decreasing numbers occasionally. The goal is to add or multiply distances on the line. A one is placed at each distance. When done the character stops at the added distance.

Categories
CoCo Urbane

load and edit name

When I had trouble calling the kbd routine in my crunch program I solved the problem by inserting the kbd routine from my version 002 system into the version 001c that I’m working on now. I wanted to check to be sure it worked all right. I discovered that when I backed up the entire floppy image to the hard drive after inserting the new files, the cursor blinked just once each time I hit a key. I noticed that if I reset the system and then ran the program again I had the blinking cursor that I had worked so hard to get in version 002. I tried making a batch file to copy each file I was using, so I could find out which file was causing the problem. It worked just fine. I never did find out what was causing the single blink. Who cares. If I only copy the files I use it’s faster than backing up the whole floppy image. Now when I update my files and insert them into the floppy image I just run my batch file and I’m in business. I think that I’ll go back to just copying the files that I’ve changed. Maybe run the batch file once in a while. I’m just working on two file right now: ed2 and crunch. I have a name file. If when I run ed2 the name file isn’t there I tell the user to run line 3 to initialize that file to temp.txt and initialize temp.txt to be print “sam”. The load routine loads the name in the name file into to top of ed2. The load routine adds $40 to the length of the name and stores it just before the name The top line is just a long comment. My edit function copies that name into a later spot in the line. Then backspace works on this new name. If there are no characters in the line it ignores the backspace. If there are 12 characters in it already the edit routine ignores the new character. When the user presses the carriage return the edit routine returns the new name in the same descriptor as it was called with. Next comes saving the new name in the name file.

Categories
CoCo Urbane

Load or Save

I’m trying to use GitHub. At one place my project saved properly but didn’t load. At another it loaded properly but didn’t save. The save and load are taken care of in two files. I copied the last versions of the two files into a folder to look at later. I moved the two files from the version that loaded properly into the last version. Lo and behold the load worked. The save didn’t work in the version I copied the files from, but once I copied the files to the latest version, the load and the save both worked. Hooray. I’m working on keeping the user filename in a file. Right now it prints the old filename, prompts for a new name then automatically loads the old user file.

Right now my wife’s exercise machine is in the communal living room. The parents want it out of there. We’re the grandparents. I moved furniture around to have a space for the machine in our room. I was just going to move the machine in. My wife wanted me to vacuum the space and spray vinegar on it so the cats wouldn’t be as likely to pee there. I vacuumed most of the room while I was about it. Just before I finished, the canister filled up clear to the top. I had the ask how to empty it. It was still making a noise. I cleaned off the rollers. It still made a noise. I cleaned a lot of cat hair out of the tubes. At that point it sounded like it did at the start. Our floor looks so fine. Well the exercise machine is too big for our door. We’re going to put it in the pantry. It’s quite big. Now I’m clearing out a space for the machine there. I find that when I work a while at chores then a while at my computer project I have the best results.

The weather is very cold right now here. It won’t be much above freezing until Saturday. No riding on my adult pedal tricycle. I miss doing that. I hope to be able to use my wife’s exercise machine in the future. Oh well, more time to work on my programs and projects.

Categories
CoCo Urbane

I’m Back

I haven’t worked on my project for quite a while. My son has got me working with GitHub.. I plan to use it to publish my IMUrbane project when I get it back to working again. It was working when I quit working on it. Now the user can’t save his file. Oh well I’m having fun. As you may recall there is a full screen editor. It uses labels instead of line numbers and all the characters in variable names and labels are significant. I use lwasm from lwtools. I still use decb from toolbox. I still use Vcc, a coco emulator with a virtual hard drive. I guess I had better call it quits for tonight and get some sleep.