RAW Z80 Assembler ----------------- A simple Z80 assembler. The original was written by Roland A Wadilove for the Amstrad CPC computer and was published in an Amstrad computing magazine in the late 1980s. (When I find the full references, I'll put them in.) Using the assembler is fairly easy. On running, you are prompted for a source filename and a destination filename. The assembler makes two passes through the source file and outputs the object code to the destination file. The source code can be either a text file or a BASIC program. The code layout is the same as for using the BASIC in-line assembler. Labels are declared within the assembly code by prefixing with a '.', and outside the assembler by using name=value. The origin of the code is set using P%=value outside the assembly. The assembler will manage to assemble from most BASIC source programs, most warnings generated by the non-assembly code can be safely ignored. Restrictions ------------ Not very fast... Cannot define labels as strings. Autorunning ----------- A BASIC program can be made to run the assembler, so CHAINing the BASIC program causes it to be assembled. Use a structure at the start of the program along the lines of the following: IF?&FFF7=&6C:A$=$&600 IFPAGE>&8000:SYS"GetEnv"TO A$:A$=MID$(A$,1+INSTR(A$," ",1+INSTR(A$," "))) asm$="^.AsmZ80_402" name$="outfile" IF?&FFF7<>&C3:OS."Key0 "+A$+"|M"+name$+"|M":OS."FX138,0,192":CH.asm$ Change the value of asm$ to be the filename of the assembler program and name$ to be the output name to save the object code by. Then, when the program is CHAINed, it finds it's own filename, and if not running on a Z80, passes it to the assembler program. With a properly written source program, if it is running on a Z80, it will continue and assemble using the in-line assembler. See the example programs in the Samples directory. History ------- 15/01/1992 v4.02 Minor tweeks: sets load&exec addresses after closing file. Allows more labels if sufficient memory. 05/03/1990 v4.01 Case insensitive - forces everything to upper case. Will assemble from Text file as well as BASIC. 01/03/1990 v4.00 Reads data from a file rather than within the program. 28/05/1989 v3.30 Reads data from program directly, allowing in-line assembly style coding between [ and ]. Multi-statement lines allowed. 20/05/1989 v3.00 Initial version translated from R.A.Wadilove's version for the Amstrad. Assembly statements appended to program as DATA statements.