ADDITIONAL FEATURES/RANDOM NOTES -EXTENDED MNEMONICS The word mnemonics means memory aid. "LDA #$FF" is certainly easier read as "load the accumulator with the constant $FF" than is A9FF. There are times when even the mnemonic doesn't make much sense. For instance BCC, Branch if Carry Clear, does not register in most people's minds as meaning the same as branch if less than. Several 6502 instructions can be used, or recognized by the use as a different function. The BCC instruction is but one example. In order to make 6502 assembly language programming easier to use by the programmer, LISA incorporates several "extended" mnemonics. These extended mnemonics are simply redefinitions of existing mnemonics. The extended mnemonics are: BLT -BRANCH IF LESS THAN, SAME AS BCC BGE -BRANCH IF GREATER OR EQUAL, SAME AS BCS BTR -BRANCH IF TRUE, SAME AS BNE BFL -BRANCH IF FALSE, SAME AS BEQ XOR -EXCLUSIVE OR, SAME AS EOR Note that these mnem. are included IN ADDITION to the existing mnem. FALSE is defined as $00 and TRUE is defined as anything else. -SWEET-16 MNEMONICS (MNEM.) LISA incorporates a Sweet-16 assemble for use with the Sweet-16 pseudo machine interpreter in the Apple ROMs. For the most part LISA uses standard WOZ mnem. except where Wozniak used two & four character mnem. Since this tends to disrupt the nice assembly listing, all two & four character mnem. were converted to three character mnem. to improve the listing format. Sweet-16 MNEMONIC CONVERSIONS: WOZ'S LISA'S WOZ'S LISA'S SET SET BR BRA LD LDR BNC BNC ST STO BC BIC LDD LDD BP BIP STD STD BM BIM ADD ADD BZ BIZ SUB SUB BMI BMI POPD PPD BNMI BNM CPR CPR BK BKS INR INR RS RSB DCR DCR BS BSB RTN RTN BNZ BNZ WARNINGS AND OTHER EXTRANEOUS NOTES ***** The RESET key has been and always will be a major pain. When pressed at the wrong time it can cause all kinds of trouble. There are two times when RESET absolututely cannot be pressed. Whenever anything is being written out to disk, should the RESET key be pressed you will, at least, destroy the file being written. At worst you could destroy the whole disk. Users of the Autostart ROM cannot hit RESET while in the LISA I(NSERT) mode. In this case, you will be returned to the command level & part of your text file may be lost. Other than the above cases there are fixes, should you accidentally hit RESET. If you were in the command processor when RESET was pressed, simply type E003G or CTRL-C. This will return you to LISA without erasing the existing text file, or changing pointers, etc. If you were in the I(NSERT) mode when the RESET key was pressed, you CANNOT use E003G to restart LISA. If you do so, your text file will be partially destroyed. If you do hit RESET while in the I(NSERT) mode, simply type E006G from the monitor and you will be returned to the insert mode. The only data lost is the last line you type it (hopefully). To prevent depression of the RESET key you might think of removing it, a small screwdriver may pop it off easily. Coldstart is E000G (control-B) - this clears the text file, reinitializes pointers.Never set MAXIFILES to anything other than 1 while using LISA 48K. If you set to anything else LISA will be destroyed. -ADVANCED TOPICS -MEMORY ALLOCATION Upon coldstart, several parameters are initialized, in particular it sets the start of text pointer (STXT) to $1800 and the upper text file limit to $8000 (HMEM ). This gives you 4K for object code, 26K for text file use, and 5K for symbol table. Since 80% of a assembly language programs are less than 2000 lines, contain less that 512 symbols and the object code is less than 4K bytes, the coldstart setting should prove sufficient. By changing two bytes at the beginning of LISA, it is possible to change these memory "fences" anywhere in memory. For disk based operation you may want to adjust HMEM so that more than 512 labels are allowed. Likewise, you may want to decrease the size of the allowable text file and make more room for object code by setting STXT to $2000 or even $2800. Sound judgment as to how to adjust these values, you should realize that each entry in the symbol table requires 8 bytes. Also, the average line of text is about 10 bytes. Object code is generated at the approximate ratio of two bytes per line of source code. To change the parameters-- load LISA and then get into the monitor (i.e. the "BRK" command). Enter E000L. A series of jumps will be displayed and the, at location $E01B, the hex value $18 will appear. This particular byte is used to set the high order byte of STXT.By changing location $E01B to $20 and then executing a coldstart (7000G/E000G) you will set STXT to $2000. The low order byte of STXT is always set to $00. Immediately following the STXT parameter is the HMEM parameter. Currently (at location $E01C) the value $80 is stored here. This is the high order byte for HMEM. as with STXT this value can be modified and will take place on the next coldstart. Warning: If you create a large text file set up for the coresident mode, and then attempt to load this text file into LISA after modifications to STXT and/or HMEM have been made, problems may develop. If the large text files takes up more memory than is allowed by HMEM, no load error will result. Upon assembly, however, part of your text file may be destroyed by the symbol table. The aforementioned parameters should not be modified without careful consideration. -LISA'S MNEMONIC TABLE This tables format can be seen by looking at P1.L file provided on the LISA disk. -LISA'S INTERNAL FORMAT The detokenization routine for LISA is provided in the P1.L file. Check this routine to see how things are arranged internally. -LISA'S SPEED Due to the fact that the mnem. are tokenized and the input line is prescanned for syntax errors.Speed could probably be doubled by improving the symbol table search routines, but the need (for greater speed) is yet to justify the additional work. -USING A DIFFERENT EDITOR WITH LISA If you have access to a text editor that outputs text type files to disk you may be able to use it with LISA files. To do so W)rite the LISA file to disk as a text type file and load it into you text editor. To convert the file back into LISA format type control-D EXEC, followed by the filename from the command level. When doing so, always make sure the first line in the file contains "INS" so that the file is loaded in properly. You should not use an external text file while creating a file, LISA's editor is better suited for that purpose. An external editor should be used when modifying large files, such as those created by the DISASM/65 module. -CONVERTING FILES FROM LISA 1.5 TO LISA 2.5 To convert: LO(AD) th file into version 1.5 and W(RITE) the file back to disk as a TEXT type file, then EXEC the file into LISA 2.5. -LOADING LISA 2.X FILES INTO LISA 2.5 LISA 2.0, 2.1, 2.2, and 2,3 saved source files on the disk as binary files. LISA's LO)AD command only loads "L" files and will generates a FILE TYPE MISMATCH ERROR if you attempt to load a LISA 2.x binary type file. To correct this problem. the LOB command (for LOad Binary) has been included in the 2.5's command set. LOB can be used to load older LISA textfiles into 2.5, which may then be saved to disk as an "L" file from 2.5 "TRICKS" ETC. WHEN USING LISA -EFFECTIVELY USING LISA'S BUILT-IN EDITOR The first thing to remember is that all modifications to a text file affect the line numbering scheme. Line numbers are dynamic (always changing) as oppose to the static line numbering system in BASIC (static means fixed). Although the line editor is very simple, the screen editing features make it very powerful. The screen editing commands allow the user to move the cursor up (Control-O), down (Control-L), right (Control-K), and left (Control-J). Note that the mentioned control characters are NOT entered into the line buffer, nor is the character under the cursor before or after the movement takes place. The cursor control characters simply move the cursor around on the video screen. Control-H (backspace/left arrow) erase the previously entered character from the line buffer. If you try to erase past the beginning of the currently entered line the backspace will be ignored. Control-U (right arrow) copies the character currently under the cursor into the line buffer.The cursor is also moved one location to the right. These cursor commands, when combined with the normal editing commands, form the basis of a very powerful screen oriented editor. Example: if line 33 in your text file contains: "LABL LDA 00" and you wish to change it to: "LABEL LDA 00" this is easily done M(ODIFY)ing line 33 (M 33), pressing control-O to move the cursor up one line (and on top of the "L" in "labl"). Now press control-U (right arrow) three times to copy "LAB". When this is done press control-J to move the cursor back one character, next press "E". Now use the right arrow (control-U) to copy the rest of the line & hit return. After you hit return press control-E to get out of the insert mode. Now L(IST) 33. You will see your correction. As you see, insertions into the current line are performed by copying up to the desired location, moving the cursor back one character entering the insertion,and finally the right arrow is used to copy the rest of the line. To delete characters from a line, simply use control-K cursor control to skip over the undesired characters. It's also possible to use the text editor to copy or move several lines of text. To copy a block of text elsewhere in memory first L(IST) the lines you wish to copy (up to 20 lines). Next, use the IN(SERT) command to insert text where you want to copy the block of text. Now use the control-O to move the cursor over the first character of the lines you previously listed out. By using the right arrow ( and of course return at the end of each line),you can copy these lines into the new memory location. If you need to copy more that 20 lines do it in several stages., copying 20 lines each time (but remember to check the line numbers in case they may have been changed by the I(NSERT) command. To move a block of text, follow the procedure for the copy as above. Once copy is complete, delete the original lines using the D(ELETE) command. -USING THE AP(PEND) COMMAND The AP(PEND) command will take a source file from disk or tape and append it to the end of the existing text file in memory. This is useful if you need to copy a set of declarations, a copyright notice, a set of I/O routines, etc., to each of your text files. It is also useful when you need to copy a section of code several times in your program & the copy procedure mentioned above turns out to be too much work. You should be careful when AP(PEND)ing files onto a text file in memory which is very large. AP(PEND) does not check to see if the memory is full or not, so always use the LE(NGTH) command to make sure that there is enough room available. -USING THE DOS "EXEC" COMMAND The Apple DOS EXEC command can be used to create several "shells" or procedures. For instance, if you create a text file on disk (using APPLE PIE or equivalent) which contains: INS 1 ASM NLS DEL 1 When you EXEC this file, it will assemble the current text file without listing the program. The EXEC command is also useful for performing intrafile merging. By W(RITE)ing a text file out to disk and then modifying the first line so that it reads "INS " instead of just "INS" you can create a text file which when EXEC'd will insert the following text in front of line . Besides allowing you to insert text within a file, instead of just at the end of the file as with AP(PEND), this version will catch a memory full condition should it arise. In fact if you think you might run out of memory when using the AP(PEND) command, it might be a good idea to use the EXEC method of appending text files, just in case.