>TM=1 BM=64 LM=4 RM=76>PC=27 PC=71>C=YZ E N 8 5  ver 6.2------------------Introduction------------>PC=27 PC=72>C=N     It is so long now since I started work on Zen85 that I've lost track of some of the minor alterations, in most cases simply making default entries to prompts meaningful.  Hopefully the more important changes are all documented below and I suppose will eventually be incorporated into a new complete manual.  One of the big demands on time was the creation of the CP/M version that is now available making that operating system just about bearable.  Should you discover anything not performing as expected please let me know, probably the fault will be in the documentation rather than the software.     The biggest change since Zen84 is the inclusion of a two pass labelling disassembler, at present only disassembling from memory, and unfortunately taking up 2K of Ram.  I hope in the near future to put the assembler and disassembler into separate overlays but for the time being the end of Zen is way beyond the start of text in Scripsit and the in-memory transfer from Scripsit to Zen is no longer available.     The other significant alterations are in response to requests from a number of users some of which are given in no particular order:a. Charley Butler of TAS, who requested the relaxation of the command syntax so that spaces are now allowed between command letter and any numeric parameters.b. David Jones, assembling 150K of source at a time for Spectrum games, who wanted things a bit faster so Zen now can assemble from disc in whole files rather than a line at a time.c. Leo Knaggs, who always outputs listing files to disc with the 'F' option and he wanted the facility to change the output to different listing files during assembly.  He then suggested the CHAIN pseudo-op to link files one to another and following those two I decided that we may as well have the facility to GET files from within another file, so that went in.d. Thanks to Peter Knaggs who over the last year has come up with many suggestions and thought provoking ideas.  A chance remark of his pointed the way to save a few hundred bytes with no sacrifice on performance.e. Thanks also to Geoff Smith who bullied me into doing something about the pedestrian way in which the old Zen 'Z'apped lines of text, and whilst on the subject Geoff's specialised Scripsit out-performs every other word processor I've seen.f. Robert Madge of Intelligent Software who insisted that the Enterprise Zen should be equally happy with upper or lower case text.  Having done it on that machine it looked so good that it had to go into the TRS80 version.     This latter point raised another complication of postfixes for numerical quantities when in the hexadecimal default mode.  In other words as the letters "D" and "B" are legitimate hex characters we cannot use them to indicate decimal and binary numbers.  To overcome this I have adopted "T" for base Ten and "I" for bInary.  If anyone has a better suggestion let me know, or alternatively you can roll your own in the region of 6BE8.>C=Y>PC=27 PC=71Summary of extra commands and facilities---------------------------------------->PC=27 PC=72>C=N1.  Editor CommandsRX  Read Unknown   Reads any format disk file into End+1 upwards.                   Size of file remembered.WX  Write Unknown  Writes unknown format file to disk.These two commands permit editing of any format disk file provided it can be fitted into available memory.g   Global move of text (old command letter 'c').DU  Duplicate source code.  Prompts for Start, End and Destination.    Destination line number must be at least two lines before/beyond    block start/end repectively.Note: DU and g assume default numeric base 10 for the input parameters.R   Read from disk now automatically recognises un-numbered Edas files.    To speed up the disc read process, Zen now only checks for the    availability of 256 bytes before each sector read, rather than as    before on the availability of room for each byte as they were read    from the buffer.  This has speeded up the read enormously but at    the expense of not being able to use some 200 bytes at the top of    memory.RES Resets the source file pointers to their initial values.    Note any source file in memory is ignored and thereby killed.2.  Assembler CommandsThe following have been added to the assembler:BASE       sets the assembler default number base to parameter value,           equivalent to RADIX on some American assemblers.DEFW & DW  now take multiple parameters.SHORT      limits the listing of object code expansion to four bytes,           this is the default state for the assembler.LONG       allows full listing of object code, this was the old           default state before version 6.0.IFNOT      new conditional pseudo-op.IFNOTEQ    new conditional pseudo-op.DEFD & DD  new Define Data pseudo-op, takes two parameteres, eg:           DEFD n,d   where n = number of data bytes and,                            d = value in range 0 to 255.SLS        for the missing undocumented shift (Shift Left Set).PAGE       simply forces a new page.File handling pseudo-ops, each of these takes a "Filespec" parameter:FILE       Closes the current listing file and outputs to "Filespec".           Pseudo-op is ignored if not outputting with the 'F' option.CHAIN      Closes the current source file, any remaining text being           ignored and inputs from "Filespec".           Pseudo-op is ignored if not assembling from disc.GET        Closes the current source file but remembers filename and           line number.  Input then taken from "Filespec" until eof,           whence the original file is restored at the next line after           the GET.  Only one level of Getfile is supported.  As with           the previous pseudo-op this one is ignored if not assembling           from disc.The reserved words for use as labels are now restricted to just register names, mathematical operators and condition codes.  This permits the use of labels such as END: and LDIR: etc.A new maths operator has been added # for xor, eg:  ld a,value#20hObviously # is now included in the reserved list and so the indicator for local labels in Mac/Bas has had to be altered and is now the % character.Assembler modes of operationAn extra mode of operation, namely of assembling whole files direct from disc, rather than files in a line by line process, has been added. This "lumps" rather than "lines" mode is signalled by an asterisk "*" as the first character of input to the 'Source>' prompt, examples:Source>{enter}           As before, assemble in memory file.Source>SCRIP{enter}      As before, assemble SCRIP from disc by lines.Source>*SCRIP{enter}     Assemble SCRIP from disc as a whole file, in                         effect no different from the first example                         unless Scrip contains Get statement(s) or                         finishes with a CHAIN statement.Source>=SCRIP{enter}     As before, where SCRIP is a linking file.Source>*=SCRIP{enter}    As above where SCRIP is a linking file, but                         assembly is to be in lumps rather than lines.In any of these assembly modes, should Zen's symbol table become full then Zen automatically makes a 1000 byte increase and starts at the beginning again.  To indicate this action Zen displays a "*" on the video irrespective of output mode.The cross reference listing from REF is now sorted in the same fashion as the Sorted Symbol Table.3.  Extended DebuggerA single stepping simulator has been added to the debugger.  This operates by copying the user-instruction into an internal buffer and trapping the machine state after the instrution has been executed.Thus single stepping of both Rom and Ram with full control at the keyboard is possible.  Where subroutines are required to be executed without delay their addresses can be preset.  This extended debugger handles all of the legal Z80 op-codes and most of the illegal codes including the half register IX and IY ones.  Whilst the simulator is operating the user-register state is displayed after each instruction together with the disassembly of the next instruction at the PC address.  Optionally a 'window' on any 64 byte block of memory can also be shown in both hex and ascii.Commands:c     Call address. This command accepts the following parameters:      0             clears all stored addresses.      1 to FFFFh    stored as call address for execution in real time.      Default       display all stored addresses.DE    Toggles the extended debugger on/off.      When enabled the debugger defaults to hexadecimal number base and      the Z> prompt is changed to Z?w     Without any parameter cancels the window mode, otherwise      Parameter is stored as address of 64 byte window display block.R     Run simulator.  If the extended debugger is enabled via the 'DE'      command then 'R' will start the simulator in the 'Run' mode with      the keyboard scanned after every user-instruction.      Simulation starts at the supplied parameter address or if none      supplied then at the default user PC address.   The space-bar      freezes the action and the 'X' key returns to command mode.S     Single Step.   Similar to above but after each user-instruction      is executed action is frozen awaiting a key-press.  Any other key      than 'X' continues the simulation otherwise control returns to      Zen's command mode.Note: Whilst the simulator is active any Calls in any user program to 002B will be pre-empted by Zen's own keyboard scan even if 002B is set to be called using 'c002BH'.  To overcome this difficulty use 0049H instead and set that address to be called with 'c0049H'.Zen monitors the user stack during simulation and will force an abort if it goes above its initial value.  This allows subroutines to be stepped without the need to set a breakpoint.  Try the following command sequence:Z>DE{enter}10Z?R33{enter}Whatever was in the A register should eventually be displayed on the video and control return on completion.4.  Disassembler    As mentioned above Zen is now equipped with a comprehensive two pass labelling disassembler capable of handling code moved in memory from its executing address.  The disassembler can be used in two modes, the first is a clean quick unscrambling of the next eight instructions to the video and the second is a more comprehensive disassembly of a defined block of memory with up to 64 separately identified data areas. The data areas produce simple DB statements.  The output from the disassembler can be either to Zen's own source file buffer which naturally grows during the process, or to any of the listing devices.  The command syntax is as follows:u     Unscramble.  Either from the byte follwing the last unscramble or      from the parameter address.  Output to the video only.DA    Disassemble. Prompts are given for start, stop and execution      addresses.  The latter address is relevant should the code to be      disassembled be in a different place in memory from that which it      normally executes.  Zen assumes the start address for the      execution one if a default entry is made.  Likewise should      defaults entries be made for the first two values then these are      left unchanged from the previous disassembly.      After settling these values Zen prompts for the start and stop      addresses for any data areas.  Defaulting on entry terminates the      definition of these areas and Zen requires the output option.      Output options "V", "E" and "F" are as described for assembler      output.  The default option directs the source file to Zen's own      text buffer.  During the first pass all referred addresses are      stored in Zen's symbol table area that could run out of room and      generate a "Full" error message.Note. All numeric input to the assembler prompts is treated by Zen as being hexadecimal, there is no need to postfix with "H".  If you intend decimal input then use the "T" postfix for base Ten.5.  MiscellaneousI think all of the foregoing and the rest applies equally well to Zen4/Cmd 3.0 and the CP/M version of Zen.I've added default file extensions to Zen for most of the file orientated procedures.  Zen applies these default extensions without regard to the possibility of correctly named files already exting without extensions.  If you don't like this situation then simply replace the bytes from 569C to 56AE with 0D's.  Assuming you don't then the extensions used are as follows:/ZEN   Applies to all source file Write, Read, RI and RL operations./LNK   Applies to linking files./LST   Applies to listing files created with the "F" option./CMD   Applies to output "D" option, and RD and WD.Zen does not apply default extensions to other disk I/O such as RX, WX and kill.One small point to mention, always when using Reentry for debugging do it with CALL REENTRY and also check the actual address with the 'r' command in Zen.Printer status is now stored as Bit 7 of 5534.During the page display, now modified to displaying a grahics line, the 'Y' key is recognised to toggle the page display on/off.The unallocated space in the last sector after the end-of-file in all disk writes is now filled with zeros.  This permits Zen to be used for editing Basic programs, JCL files etc that do not contain their own internal end-of-file marker.We have not been supplied with any details regarding accessing the directory under Model 1 Dosplus.  Consequently this customising defaults to the TRS 2.3 mode.  This will generate a directory in single density if on track 17 but is unlikely to work in other configurations.             Address of pointers in Zen           Zen85 v 6.0         Zen4 v 3.1SOFP          86FB               62FBEOFP          86FD               62FDPSTAT         5534 (Bit 7)       3335REENTRY       5705               352DLIMIT         5634               3423STACK         552C               332CIMAGE         56E9               3511MBASE         5629               3418PAGENO        562C               341BTBUFF         5400               32006.  General notesZen only uses the Rom single character scan at 2BH for all keyboard input.  With Newdos80 and Dosplus this routine is treated as a valid device for 'Chained' input and consequently Zen can be operated via chain-files with both these systems.  Newdos80 actually allows the user to decide whether the single key routine is 'chain-able' as well as the line-input routine.  Unfortunately the authors of LDOS and TrsDos 6.x have decided in their wisdom that their chain file system cannot support the single character input device and therefore whilst chain files can be used to simply activate Zen they cannot provide any input. Since it is by the use of these single key commands that Zen provides the desirable facilities for scrolling through and editing the text it is unlikely that the input routines in Zen will be re-written simply to support these illogical implementations of chain files.For Newdos80 users there is the facility (/./5Y) in their chain files to drop one level of Doscall whilst within a chaining.  This means that using the 'DO' command in Zen will permit a chain file to be activated at any time so as to provide a standard sequence of keyboard input.  In its simplest form imagine creating a program called Scripsit/Cmd where the source files are in three parts, Scrip1/Zen, Sctip2/Zen and Scrip3/Zen.  After modifying any or all of these files then a standard sequence of commands would be used such as (spaces added after prompts for clarity):Z>             A<cr>Source file>   SCRIP1/ZEN, SCRIP2/ZEN, SCRIP3/ZEN<cr>Option>        D<cr>Filespec>      SCRIPSIT/CMD<cr>Z>             O<cr>Dos ready      SCRIPSIT/CMD<cr>Whilst the entering of the list of source files can be replaced by using a linking file the rest still has to be entered every time unless a chain file can be triggered to provide this input.  This can be done under Newdos80 by using Zen's 'DO' command to carry out a Dos command to start chaining a file as follows:Z>             DO DO SCRIP       or Z>DO CHAIN SCRIPwhere the file SCRIP/JCL, written with Zen of course, is:/./5YASCRIP1/ZEN,SCRIP2/ZEN,SCRIP3/ZENDSCRIPSIT/CMDOSCRIPSIT(Don Bannister uses this technique and calls the chainfile DO/JCL, thus from Zen he keys DO DO DO, known as the Sinatra option).A similar technique can be used in Newdos80 Basic to activate a chain file to replace keyboard input in mid-program via CMD"DO CHAINFIL" or even CMD"DO "+X$.  Thus allowing selective files to be activated by the logic determining the value of X$ 