Assembler/Editor Non-Tutorial
Assembler/ Editor...... A NON-TUTORIAL
By Charles Bachand
One of the editors called me, quite unexpectedly the other day. "Hi, this is Lee", he said. "I just came up with a
great idea for an article that you can write for the next issue. How 'bout a tutorial on the new Assembler/Editor
cartridge?" Now, I hate to even read tutorial articles, let alone write them, but I kept listening anyway. "Oh, and by
the way", he said as he baited his trap, "when the article is finished, I will let you borrow my video tape copy of
FLASH GORDON That did it. I had to turn out some kind of tutorial article. Even though I hate tutorials, I was
being forced to submit one for publication. After all, how long could it possibly take to write one little tutorial? It
shouldn't take more than five or six double spaced sheets of paper, maybe a week to ten days at the most. "When
do you need this finished?", I asked, not expecting the answer that followed. "I need this article by Friday", was his
reply. He couldn't mean this Friday? This Friday was only three days away. "That's this Friday", he reiterated. My
worst fears about Lee's mental stability had been confirmed. He had lost his mind!
Since I missed "FLASH GORDON" when it was playing at the theater, giving Lee the benefit of the doubt seemed the safest thing to do. After all, a person writing a tutorial has three choices. He can write a tutorial, or he can write about something else and call it a tutorial (hoping that a certain person, in his crazed state will not notice), or he can do a little of both, like I am doing. I just don't want to bore myself when I have to read this later, checking the spelling, etc.
This is a good time as any to put in a word about writing articles for A.N.A.L.O.G. magazine. We need you to share your ideas with the rest of us ATARI owners. People are always complaining that they can just type into their computers. It is really your own fault. Half the enjoyment of writing a ,(game" program, for example, is knowing that other people are enjoying your work right along with you. And when it is printed in a magazine, thousands can join in the fun too. Now I do have a selfish reason for telling you all this. The more people who write articles and submit programs, the less I have to do, and I can get down to the business of writing terrific game programs.
The Assembler /Editor cartridge which was released only a few months ago, is a much needed accessory, useful by those who are serious about writing compact and efficient programs. It was a long time in coming, since the cartridge was ready almost a year before the documentation. ATARI decided to wait until the manual was ready before releasing the ROM. The people who created this program managed to get a lot of features in the 8K memory space they had to work with. There are three separate sections or the Assembler/Editor.
The Editor, is an enhanced version of the screen editor built into the ATARI personality module. Besides the regular edit features of the cursor positioning and character-line insertion and deletion, it also contains commands to renumber lines (the line numbering increments at a specified interval), so if the line numbers originally were 10, 12, 13, 22, then typing REN would produce line numbers of the sequence 10, 20, 30, 40. Besides deleting a line by typing it's line number, you can now delete a group of lines in a program by typing DEL XX, YY. If you want to erase all the lines in a program between 300 and 450 inclusive, all you would have to do is DEL 300, 450.
Did you ever get bored of typing the line numbers of the program in, especially when they are set up in a numerical sequence? Did you ever wish that the machine could do it for you? Well, get out your whistles and party hats, the Assembler/Editor can do it all for you! After you type in the statement NUM, the editor will come up with the line numbers after every return you type in. You enter the statements. The computer does the rest. Oh, I wish that a few of these features had been implemented in ATARI BASIC.
We now come to the two string type commands that someone was thoughtful enough to include in the editor. The first is FIND. This command is used to find a specified string in a program. For example, let's say we want to find the string "START". Just type in 'FIND/START/,' and the first occurrence of this string will be listed. More than likely, you want to list all occurrences of the string that you are looking for. just append an 'A', to the command so that it becomes 'FIND/START/,A' and the machine will list all the lines which contain the string "START" to the screen. You can even specify line delimiters, listing all lines between line X and line Y that have the string. During all of this, I have been using the character "/" as a delimiter. In reality, any character except a space, tab, and return can be used. And if the string you I are searching for contains the character "/", you will have to use something else. FIND./2.,A is legal. Here "." was used instead of "/", because the string contained a "/". FIND?/2?,A is also legal. It sure beats looking through a 500 line program listing for a few spelling errors.
What if, after finding all the occurrences of string "/2", you realize that you have made a mistake. You want them all to be "/4" instead. You can either go through every line that contains the string, or you can let the computer do it for us. This brings us to the last edit feature that I find note worthy. That is the command REP. To replace all occurrences of string "/2" with "/4" all we have to type is REP./2./4.,A and presto chango, it is done. This time I used the period "." as a delimiter, as long as the character used is not in the strings. If the "/,A" was left off the end, only the first occurrence of "/2" would have changed. You can even specify a line number range in which to replace, like the command "FIND". But what if you do not want to replace every occurance? If you tack an ",Q' on the end of the command instead of an ",A", the computer will list the line with the string and prompt you with a question "?". If you type a "Y" followed by a return, the string will be changed. If you just type a return, the string will be left intact.
To do 1/0 (Input/Output) to the editor, you have three statements that may be used. Loading a program into the computer is the function of the command "ENTER". You type the word ENTER followed by the pound sign "#", and the device to load from. Entering a program from the cassette is "ENTER#C:". From a disk file, you could use "ENTER#D:YIPPIE".
Saving a program is done with a variation of the "LIST" command. Normally the LIST command is used to list a program on the screen, "LIST", or on a printer. "LIST#P:". In order to save a program on the cassette recorder, we LIST it to device C:; LIST#C:. To save it on a disk file, one types "LIST#D:YIPPIE". The cartridge does have the commands "LOAD" and "SAVE" but these are used in the storage of binary load files only.
A variation on LIST is the command PRINT. PRINT does the same thing as LIST except it drops the line numbers in the process. I have not found much use for this command yet, except in one instance. One day while generating a data file of strings (yes folks, this cartridge does not check for syntax errors like BASIC does, because it does not store programs in a tokenized form). I had typed in the lines with line numbers so that the editor would not accept them as commands. After all the editing was done and the line numbers were no longer needed, I was going to write a BASIC program to read them in, and write them back out, minus the line numbers. Lee, however, came up with a great idea. "Why not do a PRINT to the disk drive with the data, then you don't have to write a conversion program", he said. You know, there may be hope for him yet.
Now, how would you like to use the added editing features on your BASIC programs. That is right! You can delete groups of lines, replace character strings, and enter lines with automatic line numbers. How do you do all this to your BASIC programs, you ask? First, after powering up with BASIC and loading your program, you LIST it to your storage device, be it cassette -C:" or disk "D:YIPPIE". Then you remove the BASIC cartridge and insert the Assembler/Editor cartridge. As ENTER from your cassette or disk is performed, and voila, you can now work on your BASIC program with a much superior editor. To go back, we simply LIST the program to the storage device, swap back to BASIC, and perform ENTER from the device in BASIC. Now, it is just a simple matter of resaving programs, and you are done.
In this issue, I have discussed only the features of the Editor. In the next issue the Assembler will be covered, which
allows you to produce machine language programs. And the Debugger, which allows you to examine memory locations, trace program execution, disassemble machine code, and many other things. This cartridge is well worth having, and like I said before, a long time in coming.
So you don't think I read articles before they go in Charlie??? Well next issue, you had
better get me that assembly language tutorial or no borrowing
any more science fiction video tapes! --Lee
Digitized by CyberRoach Publishing for CyberRoach’s Digital A.N.A.L.O.G. Archive; restored here with permission.