Merlin Executive Mode 4. Executive Mode The EXECUTIVE mode is the program level provided for file maintenance operations such as loading or saving code or cataloging the disk. The following sections summarize each command available in this mode. Note that each command consists of a single letter WITHOUT a RETURN key operation. If the command requires further data, you will be prompted for same. 4.1 C:Catalog After displaying the catalog, this command accepts any disk command you may wish to give, using standard DOS syntax. Unlike the LOAD, APPEND and SAVE, you must type the ".S" suffix when referring to a source file. This facility is provided primarily for locking and unlocking files. Do not use it to load or save files. If you do not wish to give a disk command, just Type:. In order to cancel a partially typed command you can: a. Type:^X b. Assure that the command has the wrong syntax by typing multiple commas. c. Backspace to the beginning of the line, Type:^H or use the back arrow. If you Type:^C after the "COMMAND:" prompt,you will be presented with the EXEC prompt of "%". You can then issue any EXEC command, such as "L" for LOAD. This permits you to give an EXEC command while the catalog is still on the screen. Typing of ^C at the catalog pause point causes printing of the remainder of the catalog to be aborted. 4.2 L:LOAD Load is used to load a source file from disk. You will be asked for the name of the file. You must not append ".S" since Merlin does this automatically. From the foregoing you will notice that ALL source files must end in ".S" or Merlin will not load them. If you have such a file, refer to the Merlin Catalog command and use the DOS RENAME facility to remedy the situation. If you Type:L by mistake, just Type: and the command will be cancelled without affecting any file that may be in memory. After a Load or Append command, you are automatically placed in th EDITOR mode, just as if you had typed "E". Subsequent Load/Save commands will display the last used filename, followed by a flashing "?". If you Type:Y, the current filename will be used for the command. If you type any other character (e.g. ), the cursor will be placed on the first character of the remembered filename, and you may type in the desired name. Of course, tracing over the remembered filename with the arrow keys (<- and ->) will cause the characters traced over to be entered as all or part of the command's filename. This is a useful feature when you wish to read/save a modified file with the same name except a different suffix. All you do in this case is Type:L(trace with arrow keys to desired point)"type remainder" and the file will be read/saved under the new name. Practice with "uncritical" files if you feel unsure about this feature. If you type instead of entering a filename, the command will be cancelled. 4.3 S:Save Use this command to save a source file to disk. As with the Load command, you must NOT specify the ".S" suffix, Merlin will supply it. If you do Type:filename.S, it will be saved as "filename.S.S". On subsequent Load/Save/Append commands, you would Type:L/S/A "filename.S". Merlin would the append from "filename.S.S". As with Load, you can type the appropriate number of to cancel the command PRIOR to any other keyboard input. Note that the address and length of the file are shown on the menu and are for informational purposes only and should (cannot) be used for Saving the file. If the file in memory was entered totally from the keyboard and this is the first time it is to be saved, there is no remembered filename (obvious, don't you think?). However, if the file was read using the Load command or it has been saved before in this session, there will be a remembered filename (equally obvious from the previous comment). The same procedures with regards to using the arrow keys or not, apply here. 4.4 A:APPEND This reads in the specified file and Appends (concatenates) it to the end of the file already in memory. The Append command does not affect the remembered (default) file in any way. In fact, if Append is used when there is NO file in memory it will load the file and still will not change the remembered filename (NULL); that is dedication to design! 4.5 D:Drive Typing the command "D" causes the default drive to toggle between 1 and 2. The currently selected drive is shown on the menu. When Merlin is first BRUN, the selected drive will be the one selected by the BRUN. Of course, booting Merlin with PR#6, open apple,... causes the default drive to be 1. There is no command to specify the slot number. However, this can be accomplished by typing "C" for CATALOG which will display the current disk's directory. At the end Type:CATALOG,Sn,Dm", where n is the new slot number and m is the drive in that slot. The above will Catalog the selected drive and more importantly, change the slot number Merlin uses for it's disk commands. 4.6 E:EDITOR This command places you in the EDITOR/ASSEMBLER mode. NOTE: The defaults for a number of EDITOR commands are set when moving from the EXEC to the EDITOR mode. If you change some of these defaults while in the EDITOR, then "Q"uit to the EXEC, followed by "E" to go back to the EDITOR; These defaults will be changed back to their default value. Those commands that experience this phenomenon, are commented as such in the EDITOR section. Stay alert! 4.7 O:Object Code Save You are permitted to use this command ONLY after a successful assembly (ASM) of a source file. In this case you will see the address and length of the object code on the menu. As with the source address, it is given for information only. The object address shown is that of the program's ORG (or $8000 if an ORG is not supplied) and not the actual location of the assembled code (which is $8000 or whatever OBJ you have used). No, the previous sentence did not take leave of it's mind. You have got to get it straight that when we say "object", we mean "object", not "object". Enough of this mirth. The object address shown on the EXEC menu refers to the address that the object program will be loaded too when it is BRUN/BLOADed. Unfortunately, there is an assembler pseudo-op called "OBJ" that is used to specify where the object is to be stored during the assembly process. With this in mind, the first sentence is saying, "If OBJ is not specified, the object code is stored at $8000 during assembly (almost always exactly what you want). Furthermore, If an ORG statement is not provided, the program will be defaulted to run at location $8000." Now, back to the big "O" command. When using this command you are asked for the name of the object file (the source filename without the ".S" is the default). The object will be saved under whatever name you chose WITHOUT any suffix being supplied by Merlin. 4.8 Q:Quit Q exits to BASIC. Later, you may re-enter Merlin by typing the "ASSEM" command. The re-entry will be a warm start, which means it will not destroy the source file currently in memory. While Merlin will not destroy the source in this case, what did you do while you were out there where we couldn't watch you? Did you do something that did destroy Merlin's memory? The moral of this is: Why take chances? store your source prior to exiting Merlin and then reload it when you return. If the source is small and can be checked and/or retyped in a short time, go ahead. The idea behind "ASSEM" is to allow you to exit and type disk commands if it is more convenient than the method provided via the "C" command. 4.9 R:Read This command reads text files into Merlin. They are always appended to the present contents of the buffer. If this is not what is desired: 1. Enter the EDITOR and Type:NEW This will cause the buffer to become empty. 2. Exit back to the EXEC mode. Type:Q 3. Now perform the "R"ead command and the file will be appended to NULL. Note that the "R"command always causes the default filename to be the last file read in this fashion. When the read is complete, you are placed in the EDITOR. If the file contains lines greater than 255 characters, they will be divided into two or more lines by the Read routine. The file will be read only until it reaches HIMEM, that will cause a memory error if it attempts to go beyond and only the data read to that point will remain (we had hoped to preserve the data not read to that point. However, you know how it goes on government jobs). The Read and Write commands will prefix a "T." to the filename unless you precede the filename with a space or any other character in the ASCII range of $20 through $40. Since the character is simply a flag to Merlin to tell it to not prefix the "T." to the filename, you are showing off if you use anything except a space. I repeat, the "no T." character will not be given to DOS and will not become part of the actual filename. 4.10 W:Write This writes a Merlin file into a disk text file instead of a binary file. See the previous Read command for a discussion of the "T." prefix. The speed of the read (poet) and Write routines is approximately that of a BLOAD or BSAVE. However, the Write routine does a VERIFY after the Write. This will convince you (rightly so) that the process is taking much longer than a "normal" "S"ave.