It seems like I had a bad extract.bas program in release.001 I think it won’t matter. No one will use my program. Let alone try to work on the system. Oh well. Here is a working version.
The purpose of this project is to make all of the characters in names significant in the Coco 2 basic language. It comes out of the box with just two characters significant. In addition line numbers are replaced by labels. E enters the full screen editor. D toggles debug mode. L loads the urbane file EARL.TXT and S saves it. Reset the coco or emulator before you edit ED2 to change the name. I’ve included all the asm and bas files I used to develop the system on Vcc, a coco3 RGBDos emulator, using EDTASM6309. I debugged as I went by writing one of my favorite programs using this project. go sub, return, on, for, to, step, next, and error messages remain, but I want to take a break so I think I’ll publish this on my blog nuts4cocos.org
Back when the coco 2 was new, a professor in California wrote a KARL program for it. A symbol moved around the screen picking things up and putting them down. He wrote an article about it in the Rainbow magazine, a huge national magazine devoted just to cocos. He showed how to add two distances. He said if anyone could show how to multiply them before the next issue came out he’d give them a copy of his program. It was very fancy. That was back in the days when you saved and loaded your programs on audio cassette players. I wrote a bare bones version and figured out how to multiply distances. I typed up what KARL needed to do to multiply distances. One of his assistants typed it in and made a couple of typos. Of course it didn’t work. I sent a tape in to prove that it worked. He couldn’t load it because the tape had a flaw on it. I never did send it in again. Ever since then have been writing KARL programs. Easy Assembler Robot Language. My name is Earl. If one substitutes b = bra for g = go to. s = bsr for go sub, and r = rts for return then one has an assembly language system, which I did when I wrote my first EARL program.
IMUrbane: arrows move around the screen. shift-left is bksp. shift right is del. enter opens a line. alt is shift-home on Vcc. I seem to have heard that is shift-clear on cocos. alt then enter deletes a line. shift-up toggles insert mode. shift down exits edit mode. alt followed by any key gives you what the coco would normally show for that key. Backup the floppy. RUN”ED”. Type L. It’s slow but well worth the wait. Now when you type RUN it runs the loaded urbane program EARL.TEXT Now you have a menu. L loads the famed add program. R and it runs. E and you can edit it with the same rules as IMUrbane. lines begin with a count byte. lines end with a zero byte. a star-line separates the file and the symbol table. symtab points at the byte count after the star line. there are two zero bytes at the start of the file. eof points at the final zero byte (zero length lines).
Sub, return, on, for, to, step, next, restore, read, data, binary save, binary load, and error messages remain to be implemented. A real drawback is before I load my drivers s a m acts like sam or s am. No distinction. I don’t see any easy fix. Maybe I’ll just ignore the problem. for-next and sub-return would be very hard to implement because of my decision to fix the $=” problem by adding a “+” changed where things are in my copy buffer from the file space when I execute things. I would have to have to count the “+” ‘s that I had added every time I came to a sub, return, for, or next. It could be done but I don’t think I want to. When I got done I wouldn’t have much. I would have 30k for the user program, but my EARL program is only 6k. It would fit nicely in the ordinary coco program space. I could use the upper 8k of ram, which is not used by the coco2 or coco 3 I think, for my program and the user leaving me with something worth while. I think I’m going to publish what I have and convert it over to this new system and then I’ll have something good. My next post is going to be the readme file for IMUrbane and a link to the disk holding all the files. Then I’m off and running for the new system.
I copy lines from behind the Coco rom as I execute them. Unfortunately the real Cocos take advantage that their user’s file is always in the same place so if you say a$=”sam” it just puts a pointer to the “sam” in a$. When it executes my line it puts a pointer to where “sam” is in the buffer. When it comes time to use a$ it looks in the buffer and it has something else in it. I was going to tell everyone to say a$=””+”sam” to force Coco’s basic to put “sam” into the string area. I increased the size of the buffer and when I come across a $=” if there isn’t a “+” after it I supply it. It’s a little slower and and the buffer has to be a little bigger, but it works. Another problem I have to address is octal and hex numbers. If the Coco comes across an & it expects an octal or hex number. If you print &MEN it prints 0 and the value of the variable MEN. I change multi character variables in two character name. If I happen to make the variable MEN into HA the Coco sees &HA and prints 10. I’m afraid I can’t use A-F H or O. I guess I’ll drop G, too. I used some fancy programming to crunch and uncrunch variable names. I think I’ll rewrite those parts and make it very strait forward. KISS. Keep it simple stupid. And think about it some more. Time spent thinking about it before you start programming is time well spent.
It’s 3am in the morning but I’m glad that I kept at it. All of the assembly language programming is done. When I was working on it before I had decided that I wouldn’t try to do rem and ‘remarks. And colons would come and go willy-nilly. The rem command works. The quote remarks work. No extraneous colons appear. I am so happy. All that’s left is the readme file and the label list for the EARL urbane program. And maybe a read program to help users read the readme file. Well I have a doctor’s appointment tomorrow so maybe I should call it quits and go to bed.
My son turned me on to the online book The Art of Unix Programming. It is really good. I’m having a great time using IMUbane to program and run my EARL program. Easy Assemble Robot Language. It edits and runs a small program to move a < and > character along a line. I’ve been fixing little things in IMUrbane to make it match my latest urbane. I noticed that quote comments crashed the system. I found a place where I had tried to fix it. I tested for $83. I called it the remark keyword. When I assembled and tried to run it, everything worked except the where I messed with the quote keyword. I went back to the first part where I worked with files and the screen. It worked. It was very fancy. I went back to where I tried to put in the multiple significant character feature, quote remarks crashed. Remark keywords worked and I did nothing about them, so I quit checking for the quote keyword. Everything seemed to be working. I have this debug feature where I can see crunched lines above the cursor and uncrunched lines below. and the first few multiple character names at the bottom. Multiple character names were being crunched to two letters before and after the remark keywords. I couldn’t make heads or tails of how I had made the fancy fix. The online book my son turned me on to talked about it. It said that if it was too complicated it would be hard to add features. That is exactly what I have done. But it looks and works fine. I think that I will leave it. I am so overconfident that I want to move on to a coco3 version. I think that I will talk to my son about it.
I was updating my menus and realized that I had never published my working EDTASM6309 version. I got back to where I was before I abandoned my urbane file in lo-mem version. In fact I even fixed the quote comment I mentioned earlier. Now when I uncrunch a line only the single quote appears with no colon before it. Hooray. So it’s back to my working version. Of course when I put them on a virtual disk they didn’t work. The last basic file kept giving me an undefined line error. There was an exec command in the line. That’s where I usually find that error. Many hours later I realized it really was an undefined line error. I had renumbered the file without updating the targets. Then I kept fixing files on the coco instead of fixing them in notepad++. As soon as I reloaded my files, the changes disappeared. Oh well. I’m going great guns now. I had forgotten how the programs worked. I decided to update the readme file as I relearned how the programs worked. Lo and behold I had already done that when I was working on them before. I’ve got the working version working again. Now I’ve just got to figure out how to put it here in my blog.
I’m almost back to where I was when decided to go back to urbane file in hi-mem. All I have to do is connect edline with edfile and handle when the new line is the same length as the old line and when it is longer. I go plunging ahead and then I go back and rewrite something I thought I was done with. Right now I’m fighting the urge to rewrite kbd and edline. Kbd has this nasty habit of pausing every once in a while. And I want to make edline go up a screen line like notepad++ that I’m using to work on my .asm and .bas files instead of a file line like my urbane editor does now. I think it would be quite easy. One thing I have to fix is my fancy uncrunch routine which leaves the colon before the comment starting single quote. Right now it will add another colon every time I crunch then uncrunch. But first I’ve got to get back to where I was. And I am so thankful that my blog is working again. I was so despondent when it broke.
I’ve decided to go back to my urbane file in hi-mem. Nothing needs to be changed in edline. I’ve just started in edfile. Very little needs to be changed. If it’s worth doing it’s worth doing right. I have evening duo calls with my son. It went well for a while. He was busy and eventually I was just talking on and on. He still updated the certificate date on this blog. He is a real blessing. My wife is another blessing. I had this nasty sore patch on my foot. She carefully trimmed away the dead skin and applied this salve we got from the doctor. It’s nice to have doctors who help us out, too. Now that I’ve done my thanks I think that I’ll go back to working on my urbane for the coco.
I’ve reached a new decision on what kind of labels to use. I’ve decided to use the abilities of lwasm since lwasm is available to most everyone. You can have labels of any length and local labels can have any length, too. They are case-sensitive. It makes commenting my program a lot easier. I had noticed that a lot of my comments were just explaining what the cryptic labels meant. I’m copying and pasting code from my original system of programs which I wrote with an assembly language system that had labels with a maximum of six characters. The system I used when I did cross assembly years ago is case insensitive. It would be even harder to move what I had to there. I was going to go with the most restrictive. Six character labels, case insensitive. and no local labels. Supposedly people were going to rush to look it. I’m amazed how great it feels to use what lwasm has available. When I use my old cross assembler it says it is deprecated, use lwasm. I guess that’s the new standard. So far I’ve finished the line editing, edline and have made a good start on screen. I’m having a great time.