JACKSOFT Z80 ASSEMBLER BY HANS GEORG ZEZSCHWITZ. (instructions re-written by Brian Cavers and Brian Gaff) ------------------------------ JACKSOFT's a program editor like BASIC - you type in a line number and a command, then ENTER to add the line to a program listing. None of these commands can be entered as DIRECT COMMANDS, i.e. without a line number as BASIC commands may, but there are other "control commands" or "assembler directives" to provide various functions in JACKSOFT, and these are listed alphabetically on the following pages for reference. The final program listing cannot be "RUN" immediately like BASIC but must be "assembled" first, into pure machine code and then "RUN" from within JACKSOFT (for quick testing)or SAVEd, re-loaded and used with a USR command from BASIC. If you know nothing about machine code or assemblers you should print out the following pages for reference and then get hold of a good tutorial on the subject. You could do worse than read SPEC - BYTES! In a similar way to 48K BASIC, a program line may be DELETED by typing in its number and ENTER; CHANGED by re-typing the number and the entire line again or MODIFIED by pressing E and edit- ing the line as needed. JACKSOFT also has a full-screen editor so the listing may be amended by use of the cursor keys to move the edit cursor over a line, make a change, and ENTER to finalize. Note that only ONE command may be entered on a line and NO line may be longer than two "screen lines". If using the full-screen edit facility on a program line that uses two "screen lines", the cursor MUST be on the lower of the "screen lines" when ENTER is pressed to finalize the change. Moreover,the lower line MUST NOT BEGIN WITH A DIGIT OR LETTER! In use you will discover the only occasion a program line uses two screen lines, is when there is a comment (like a BASIC REM). It's recommended that when entering a line with a comment you use the TAB command, (see later) so you can see how the line will be set out in the listing, and put a SPACE at the start of the lower line. A "*", "!", "+" - anything but a digit or letter will also do! ALL input,including Z80 commands, may be in capital letters, small letters, or mixed. LABELS must BEGIN with a letter of the alphabet, but may thereafter use digits or the underline character, "_" up to a maximum of 6 characters... JACKSOFT ASSEMBLER DIRECTIVES (Press ENTER after typing) ----------------------------- A As A0 A0 ASSEMBLE listing into a machine code program A1 As A0 + show labels used A2 As A0 + show listing+code A3 As A1 + A2 together A4 As A0 A5 As A1 with printer A6 As A2 with printer A7 As A3 with printer CAPS+1 INSERT CHARACTER (creates a space in a program line by moving all text to the right of the cursor one character further right. You can then type in a new character in the space created CAPS+2 CAPS LOCK on/off in the normal way. CAPS+3 MOVE CURSOR to the end of the line CAPS+4 CLS - clears the screen CAPS+5 MOVE CURSOR one char LEFT CAPS+6 " " " " DOWN CAPS+7 " " " " UP CAPS+8 " " " " RIGHT (arrow keys) CAPS+9 TAB RIGHT TO NEXT PART OF LINE. Each line has 5 sections: Line number, label, command, argument and comment. TAB skips right to the start of the next section. This may be ignored when entering a line as JACKSOFT will space out the line automatically in the listing but see remarks above about entering a line with a comment. C CONVERT Hisoft Assembler text file (listing) into JACKSOFT format. Load the Hisoft file first using J command (see later) and then enter C once only. (Not tested) Dn,m DELETE lines n to m. To DELETE a whole listing use D1,n where n is any number greater than your last line number. By the way, the maximum line number is 32767! En EDIT line n (line n is displayed and the cursor is placed at the start of line. H,term HEX CALCULATOR. Any term, calcuation or expression may be used - the result's shown in both hex and decimal. It may also be used with label values. The term may be in decimal, hex or binary. Prefix hex values with # and binary with %.Valid arith- metic may be employed and use "&" for AND, "@" for OR and "!" for EXCLUSIVE OR. Examples: H,START shows value of the label START in decimal+ hex H,#FF shows the hex value FF in decimal & hex. H,55000 shows the value 55000 in both decimal & hex H,(5+3)*5 shows result in hex & decimal. Standard evaluation rules are obeyed. Note that there must not be spaces in the term. In INCREMENT n for automatic line numbering. E.g. I20 initializes auto line numbering in steps of 20. Then enter your next line in the normal way with a number. On completion (after pressing ENTER) the next number appears automatically. Stop this temporarily, e.g. to enter a directive, by DELETEing back over the number. Next time you enter a line number it will recommence automatic line numbering with the same increment. SWITCH OFF auto-line numbering with I0. J,name LOAD a text file listing called name. File names up to 10 characters- no need to use quotation marks. IMPORTANT - Any file loaded will be ADDED at the end of any listing already in JACKSOFT and the listing will be renumbered. Thus, the command may be used to add previously written standard routines (MACROS). This command, with the block line DELETE and the block line SAVE, may be used to get any MERGE arrangement you wish! REMEMBER though, if you just wish to load a file, use the D command first if any listing is already in JACKSOFT. J,< LOAD a BASIC file called "run" (DISCIPLE version may be different). The file name and "<" prompt may be altered by changing BASIC line 8000. I added this command to exit JACKSOFT. It can be used to return to basic. This will give an error when used with drives, but if a tape based system is being used, it is the same as LOAD "". Kn Set the number of program lines to appear after the L (LIST) command, before further keypress is needed. There is no "scroll?" message in JACKSOFT as in BASIC, but the program waits anyway for a key to be pressed after n program lines are listed, before scrolling up the listing. I recommend you use K5 to K10 if many of your program lines take up two screen lines. Listings get whisked off screen before you can read them with K20 or more! Ln LIST program from line n onward. NOTE WELL: USE BREAK (SHIFT+SPACE) to end or you may scroll through an entire listing to regain control! Nn,m RE-NUMBER program lines from n onwards, in steps of m. (the maximum step is 255) R RUN machine code program from within JACKSOFT (to test it). ENT instruction needed (see below). The final register contents are displayed. Be very careful with this, save your work in case of a crash! Sn,m,f SAVE listing from line n to line m under any filename. (f = filename, no quotes required) Sn,m,*name (Note the "*"!) SAVE the assembled code under the filename "*name". n and m can be any number below 32768 as they are used only so that the syntax is acceptable to JACKSOFT and the "*" prefix will divert the SAVE to my routine at BASIC line 9000 which also PRINTs up the code start and length on screen. Line 9000 may be easily altered if you prefer some other prefix. X DISPLAY ADDRESS OF END OF LISTING. RAMTOP is at 24999, the JACKSOFT code starts at 25000 and the end of the code , if there are no program lines present is 31715. As you add program lines you use up more addresses higher and higher in memory, so you need to be alert that you do not overwrite any machine code program you have previously assembled. A large listing may also run out of memory! If assembling modest routines starting in the 60000 plus region there is no danger of conflict but anyway, the X command shows the address of the end of the listing so you can check. Even if you use lots of comments you're not likely to run into trouble and you can use the PSO command also (see later). Finally, there are some pseudo - instructions which aren't direct commands. They are entered in the listing but not assembled into code. They're instructions TO the assembler rather than instructions to be ASSEMBLED into the machine code program. Here is a list of these:- ORG n Declares the address at which you want the code to be assembled. THIS SHOULD NOT BE LESS THAN THE END OF THE PROGRAM LISTING! (see X above) ENT n Declares the address at which you wish to ENTER & run the machine code. EQU name EQUALS - used to define labels (like variables) DEFM "X" DEFINE MESSAGE followed by text in quote, tells the assembler to put the ASCII codes for the text in memor y at that point in the machine code. DEFB n DEFINE BYTE tells the assembler to place the following value n in memory at that point in the code. DEFW n DEFINE WORD as for DEFB but for DOUBLE-BYTE values. DEFS n DEFINE SPACE tells the assembler to leave n addresses empty (0) in the code. PSO n PARTICULARLY SPECIAL ORDER! (yerwot?) Used to assemble code to run at low addresses below X (see above and ORG). Use a higher ORG address than you want and follow it with PSO n where n is the REAL address you want the code to be. You cannot RUN the code from within JACKSOFT but must SAVE it and re-load at the address n. ; The semi-colon is like REM in BASIC and may be on a line on its own or at the end of a line after a command. IMPORTANT! THERE MUST BE A SPACE BEFORE THE ";" or longer Z80 instructions may corrupt, e.g., LD BC,(23675) is mis-assembled as LD BC,23675. Don't put comments after these instructions. Well that's it! I think it's a fine assembler and I take my hat off to the author Hans Georg Zezschwitz. I've seen commercial assemblers far worse than this and Hans (who is now only 19 years old so must have been about 17 when he wrote JACKSOFT) has placed this program in the public domain.HE sends a message from Hamburg:- "GREETINGS TO ALL BRITISH SINCLAIR-USERS!". FOOTNOTE-LAST MINUTE BUG FOUND! When saving a file from JACKSOFT use RUN after a drive error such as "microdrive full". Do NOT use CONTINUE to re-try as although it SAVEs the file, the Spectrum re-sets on re-entry to JACKSOFT! (Only checked on m/drive so far). Brian Cavers As with many PD programs, some bugs exist, but even I managed to write a short routine in this assembler, so its not too hard to use. Be careful when using RUN though, amd watch those spaces before ";", and avoid alphanumerics as the first character of the second line of a comment! Brian G.