;

                    
                               ZDENSTAL vs 1.0

                        Copyright 1989 Carson Wilson

                        A-   User Options           
                        B-   Terminal Installation  
                        C-   Printer Installation   
                        D-   Macro Keys             
                        E-   Restoring Defaults     
                        F-   Patching               
:a

User Options:

Create BAKup files (Y/N)   - Should  a backup file  be made when  you  edit an
                             existing file?   Choose "Y" to play safe,  "N" to
                             save disk space.

Default file mode (W/A/N)  - Which  of  the  three  file  modes  "W", "A", "N" 
                             described in ZDE.DOC  do you want as the default?  
                             (Originally "A".)

Auto mode select filetypes - You can  specify  two  filetypes (or masks, using 
                             "?" as  a wildcard) to automatically  set  a file 
                             mode other than  the default.   For example,  you 
                             can declare  all  "ASM" files to be "N" mode,  or 
                             all filetypes "?88" to  be "W",  by default.   If
                             not  used,  fill with some illegal character like
                             ".".


Default insert on (Y/N)    - Do you want  the INSERT  toggle to  start  out ON 
                             when first entering ZDE?  (Originally No.)

Default ruler on (Y/N)     - Do you want the Ruler line  (^OT) to start out ON
                             when first entering ZDE?  (Originally No.)

Default HCR display on     - Do  you want  Hard CR  display (^OD) to start out
   (Y/N)                     ON when  entering  a Document  file ("W/A" mode)?  
                             Originally Yes.   (The  default is  always OFF in 
                             "N" mode.)

Enable hyphenation (Y/N)   - Do you  want  hyphenation (^OH)  to  start out ON
                             when first entering ZDE?  Originally Yes.

Left and Right margin      - Default margin  settings  for  "W/A" modes.   Set 
 columns (1-255)             both  to  1  to  entirely  disable  wordwrap  and 
                             reformatting.


Scroll overlap (0-255)     - This is  the  number  of  lines  overlap  between 
                             screens when scrolling  with ^R/^C.  The smaller, 
                             the larger the scroll.   Keep  this  smaller than 
                             your screen size!

Show system files (Y/N)    - Do you  want  files with the  SYStem attribute to 
                             show in the ZDE directory display?

Fixed drives (A-P)         - This lets you specify that up to two CP/M logical
                             drives are nonremovable media (hard or RAM disk),
                             so ZDE won't reset them  before writing  to them, 
                             speeding up some  systems.  Enter two drives from
                             "A" to "P";  to  leave  either blank,  enter "@".  
                             (The default is "@@",  or none; if you have a RAM
                             drive C:, enter "C@".)   Caution: naming a floppy
                             drive here can cause serious  BDOS errors on CP/M 
                             2 systems.


Ring bell on error (Y/N)   - Do you want your terminal bell to ring when a ZDE
                             error message displays?

Enable help menus (Y/N)    - Do you want to  have the  help  menus (^J, ESC-H) 
                             available?  Normally "Y".   If you change this to 
                             "N",  you will have about 1K more free memory for 
                             editing.

Alternate video in header  - Do you  want the header,  messages, etc to appear 
   (Y/N)                     in a contrasting video mode (if installed)?

Suppress header by default - Do you want header  display  (^OQ)  to  start out 
   (Y/N)                     off?  Normally "N", and the header is displayed.

Clock speed in MHz (01-FF) - Set this hex  value  to reflect  CPU clock speed; 
                             most Z80 computers are 4.0 MHz (use 40 here).


Horizontal scroll delay    - This value affects  the  delay  between scrolling 
   (01-FF)                   the current line and the rest of the screen, when 
                             working  beyond  the right screen edge.   Average 
                             value is 80; adjust up or down as you like.

Hard Tab display spacing   - This determines how  any actual Tabs (^I) in your 
                             text will display.   Usually 8,  this can be made 
                             2, 4, 16,  or  any  other  power  of two.   Other 
                             values will produce erratic results.

Variable tab stops         - Enter  a  list  of  up  to  8 variable  tab  stop 
                             columns, in  ascending order.   (Column 1  is the 
                             leftmost.)    Fill   unused  values   with  zero.  
                             Originally 6, 11, 16, 21.


   Next you will  be  asked  whether you  want  to continue to  MODIFY DEFAULT 
CHARACTERS? (Y/N)   Ordinarily you will NOT; however,  if a default assignment 
in ZDE conflicts with some  special application,  you can change these values.  
When entering  control codes (00-1F),  avoid standard ASCII values ^H, ^I, ^J, 
^L, ^M, ^Z (ASCII 08, 09, 0A, 0C, 0D, 1A).

Wildcard character         - Normally ^Z (1A), this is the character that will
                             be used as a wildcard in FIND strings.  Change if 
                             you wish.

Block mark character       - Normally ^@ (00),  but if you  need to imbed that 
   (00-1F)                   code in your files for  any reason you can change 
                             this.

Print toggles (00-1F)      - These are the  codes  that will  call up the four 
                             toggles defined  in  your  Printer  installation.  
                             Normally ^B,  ^D,  ^S,  ^Y,  corresponding  to WS
                             bold, doublestrike, underline, and ribbon/italic.



Print switches (00-1F)     - These are the  codes  that  will call up the four 
                             switches defined  in  your Printer  installation.  
                             Normally ^Q, ^W, ^E, ^R.
:b

Terminal Installation:

Terminal ID                - Identify the terminal  you  are  installing.  (16 
                             characters)

Viewable screen columns    - Enter the width of  your screen in columns.   The 
   (40-255)                  normal value is 80 for a standard screen.

Screen lines (4-255)       - Enter  the  number   of  lines  on  your  screen.  
                             Normally 24 for  a  standard screen.   Must be at 
                             least 4.

DELete character (00-7F)   - ZDE always accepts DEL (7F) as  a delete key.  If
                             your keyboard can't generate this you can install
                             an alternate value here (example:  1F  enables ^_
                             on an Osborne 1).   Also, if you prefer to have a 
                             destructive (deleting) Backspace, you can install
                             ^H (08) here.   Otherwise you  can  leave this at 
                             the default value, FF for "not used".


Arrows up, down, right,    - ZDE always  accepts  Wordstar  arrows ^E, ^X, ^D, 
   left (00-7F)              ^S,  as  well  as  ^H  (backspace)  and  ANSI ESC 
                             sequences.   If your terminal has arrow keys that 
                             generate different values,  you  can install them 
                             as alternates here.  Omit high (parity) bits; ZDE
                             strips  these.   Use  "FF"  for  "not used".   By 
                             default, no alternative  arrow  keys are defined.  
                             To install CP/M ^K, ^J, ^L, as arrow keys,  enter 
                             0B0A0CFF.     (Don't  install  ^H   here.)     If 
                             specified, these keys will no longer function as
                             Wordstar synonyms.

Terminal init, deinit      - Enter the codes  you want sent to initialize your 
                             screen on entry into ZDE,  and to deinitialize on
                             exit,  in the form (# of bytes),bytes.   Example: 
                             ^Z is (01)1A.   Minimally,  both  sets  of  codes 
                             should clear the screen.


Autowrap at line end (Y/N) - Usually Yes,  as most terminals wrap  down to the 
                             next line  when  a  character is  printed  at the 
                             right  edge  of the screen.   If  yours  discards 
                             characters instead, set this to No.

Clear to end of line       - Enter the codes  to  clear  to  end  of line,  as
                             (#),bytes.  Example: ESC-T is (02)1B54.   If your
                             terminal can't do this then zero it out (00).

Alternate video on/off     - Enter the codes (#),  bytes to turn your favorite
                             video   attribute   (e.g.,   reverse,   dim,   or 
                             underline) on  and off.   This will  be  used for 
                             control  codes  and (optionally) the  header  and 
                             messages.   If your terminal  has  no attributes, 
                             zero these out (00).

Use high bit for alt.      - If your terminal needs  the high bit set on chars
    video (Y/N)              to put them  in  alternate video,  zero the above 
                             strings out and say Yes here; otherwise, No.


Console filter (7D-FF)     - This is the highest ASCII  code that will be sent
                             to  the screen.   Normally 7F;  if  your terminal 
                             can't display codes  7F or  7E  (DEL  and tilde), 
                             lower this to 7E or 7D.   Characters filtered out
                             will display as a "?".

Cursor positioning mode    - This tells ZDE how  your terminal  can be made to 
   (S/R/A/N)                 put the  cursor  at any  given  row/column on the 
                             screen:
                             "S"tandard = leadin byte(s), row byte, column 
                                          byte (default).
                             "R"eversed = leadin byte(s), column byte, row 
                                          byte.
                             "A"NSI std = ANSI standard sequences 
                                          "ESC[rr;ccH".
                             "N"one     = no absolute cursor addressing 
                                          supported.


Cursor positioning         - This is  the actual sequence  used to address the 
   sequence                  cursor.   IF YOU CHOSE "A"  mode  above,  you can 
                             skip  this entirely.   IF YOU CHOSE  "S" or  "R", 
                             then enter the 4-byte sequence for addressing the
                             cursor to the top left:  two lead bytes, then two
                             row/column   offsets.     Most   terminals    use 
                             ESC,=,20h+row,20h+col, or 1B3D2020.   If you have 
                             only one lead byte, enter 00 for the second.   IF 
                             YOU CHOSE "N",  then you  must  enter  two 2-byte 
                             sequences instead: first one  to home the cursor, 
                             then one to move it right.  If either is only one 
                             byte, enter 00 for the second.   Typical  values:
                             home=1Eh, right=0Ch, which would make 1E000C00.

Delay after cursor         - Normally 00.  Some slow terminals require a delay
   positioning (00-FF)       here to accomplish  cursor movement;  adjust this 
                             value upwards as necessary.  


Insert, Delete line        - Sequences that will cause the current cursor line
                             to be deleted,  or  a  new  line  inserted there.  
                             Most  terminals  can  do  this.  Example:  on  an 
                             ADM3-style terminal,  ESC-E or (02)1B45 inserts a 
                             line  before  the  current one,  while  ESC-R  or 
                             (02)1B52 deletes  a line.   For  a few terminals, 
                             you have to specify which line is to be inserted/
                             deleted; in this case,  enter  the  sequences for 
                             line  1  (the  second  screen  line).    If  your 
                             terminal can't do this  at  all,  zero  these out 
                             (00).

Ins/del specific to line 1 - Usually No;  set  to  Yes  only  if  the  ins/del 
                             sequences you  installed  above  are  for  line 1 
                             only, rather than general.

[NOTE: the installation of arrow keys affects ZDE's command behavior.   If the 
keys ^J, ^K, or ^L are in use as arrow keys,  as in many of the CP/M defaults, 
they will not function as Wordstar synonyms.]
:c

Printer Installation:

Printer ID                 - Identify the printer you are installing.  (16 
                             characters)

Send LF after CR (Y/N)     - Normally Yes.  But with some printers, which 
                             manufacture their own LF on receiving a CR, you 
                             will want No here.

Page length (0-255)        - Set the number of text lines to print on a page.
                             (Does not include the top margin or 3 extra lines
                             for a header, if used.)  Setting to 0 disables 
                             pagination entirely.

Top margin (0-255)         - Set the number of blank lines, if any, to skip at
                             the top of each page when printing.  (Originally 
                             0, none.)



Left margin (0-255)        - Set the number of blank columns to skip at the 
                             left of each line when printing.  (Originally 0.)

Printer initialization     - Enter an optional string of code (#),bytes to 
                             send to the printer before each print job, to set
                             margins, print modes etc.

Printer deinit             - Enter another optional string (#),bytes to send 
                             to the printer after each print job, to restore 
                             printer to desired state on exit.



Codes for toggles          - Enter the actual hex codes (#),bytes to send to
                             the printer on encountering each of the four 
                             toggle codes, first to turn a feature on, then 
                             off.  The WordStar conventions are:

                             ^B  boldface             ^S  underline
                             ^D  doublestrike         ^Y  ribbon/italic

                             but you can use these however you like.

Codes for switches         - Enter the actual hex codes (#),bytes to send to
                             the printer on encountering each of the four 
                             switches.  These have no pre-established meaning.

[NOTE: The default printer installation is  a basic Teletype (no special codes 
enabled); ZDE assumes only that the printer responds normally to Backspace (if
^P-H is used), Linefeed, and Formfeed.   You will probably want  to redo this, 
so you will have access to your printer's special features.]
:d


Macro Keys:

   The default macro definitions are  those  attached to the commands ESC-0..9 
when ZDE is first entered.   By changing them you  can configure  ZDE  to suit 
your own specialized writing requirements.  (Any Keys defined with ESC-# while
running ZDE override the defaults.)



   ZDENSTAL gives you a display much like this:

MACRO KEYS:  (01C6 bytes free)  <---- note free bytes (500)
<0><>
<1><>                           <---- "<>" flag means empty
<2><>
<3>^[;^C                        <---- normal macro key
<4><>
<5><N>World Wide Widgets Inc.   <---- "<N>" flag means no-rpt key
<6><>
<7><Q>^QR^[B^QC^[T^[C           <---- "<Q>" flag means quiet key
<8><>
<9><>

   This is pretty straightforward; you just  select  the number of the Key you 
wish to redefine,  then type in the new definition,  much as you would in ZDE.  
All the same rules apply  (but ZDENSTAL will  accept longer  keys,  up  to 128 
bytes).  If the new definition is too long to fit it will be rejected.
:e


Restore Defaults:

     This option is provided in  the event  that someone has so mucked up your 
copy of ZDE that you can't sort out what's wrong.   This should return  ZDE to 
nearly the  state it  was  distributed in:  all User Options restored to their 
defaults, Terminal Installation set to Generic (or Osborne Exec),  printer set 
to a basic Teletype, no Macro Keys, no User Patch code.
:f


Patching:  User Patch Area

   Entry to ZDE is  via  a JP instruction  at 0100h.   The  current  value  is 
JP 0490h.   Thus, to add a user entry routine,  you can instead JP to your own 
code in the User Patch area,  and finish it  with JP 0490h.   Exit from ZDE is 
via a JP instruction at 010Bh, normally JP 0000h.  To add a user exit routine,
you can instead JP to code in the  Patch  area,  ending  it  with  a warm boot 
(RST 0).

   The address of the User Patch area will be given to you by ZDENSTAL.   This
small region in ZDE  can  be  used  to install any  extra patch code you need.
(Example:  if your video in/out routines won't fit into 16 bytes, you can jump
to the User Patch area and  put more  code there.)  This is the ONLY such area 
available, as ZDE uses  all  available  memory  after its own code for editing 
text.  Note: if you find the User Patch area too small, you can also use up to
32 extra bytes before it.   This is  the Print Switch code area; you must then 
avoid using the four Switch codes.


   ZDENSTAL also tells you the addresses of the command tables in ZDE/M.   You 
may find this useful if  you need to go in and  change  a ZDE command key that 
conflicts with  your computer's  firmware.   There  are  four  command tables: 
basic, ESC/^K, ^O, and ^Q.   Each is a list of 3-byte entries, with a one byte 
keycode, then a two byte address.   (Examples: you will find the ^T command in 
the basic table;  the ^OX command appears in  the ^O table, as ^X. )  Find the 
problem keycode, and use DDT or another utility to change it.   (You will also 
see the "keycodes" 00 and 80-84h in the tables;  these are used internally for 
arrow keys and other functions.)



Patching:  Using Overlays

   If your computer requires special additional code,  and you know how to use
an assembler, you may want to make an overlay to add this code to ZDE.   Write
the overlay file, generate a HEX file with your assembler,  then merge it with
ZDE.COM using MLOAD or a similar utility.  (Be sure the code fits!)



   Example: the following overlay adds special code for the NEC Starlet to the
User Patch area, where it is immediately executed when ZDE is called up.   The 
Starlet has  different terminal  emulations and  key definitions; most of this 
code just ensures that it's in Soroc mode  (which is what ZDENSTAL sets ZDE up 
for), and sets the cursor and DEL key definitions properly.

     There is another problem:  the ZDE  case  toggle  command (^^) has  to be 
changed, as it will conflict with one of the Soroc arrow keys.  (On some other 
computers,  you can't  generate ^^ from  the keyboard  at all.)   Note how the 
overlay finds the address of the main command menu (all the menu addresses are
stored at 0112-011Ch in ZDE.COM;  alternatively,  you can get ZDENSTAL to tell 
you what they are), adds the appropriate offset (determine this yourself), and
then changes the command key to something else.   Note the  flags  "*--->" for 
data that may change with versions of ZDE.   You can also add code such as the
following to ZDE.COM using the "a" command to enter assembler  mnemonics in  a 
debugging utility like DDT or (Z)SID.

       ;NEC8401 Patch for ZDE 1.00 (Z80 mnemonics)
       org  0100h             ;At beginning of ZDE.COM,
              jp   entry      ; jump to User Patch area
*--->  org  0260h             ;At User Patch area,
       entry: ld   c,08h      ; set screen mode:
              ld   e,81h      ;  Soroc, wrap on, fnkeys off, etc
              rst  10h        ;   call special BIOS
              ld   c,4Eh      ; set cursor keys:
              ld   e,3        ;  to mapped codes
              rst  10h        ;   call special BIOS
              ld   c,4Dh      ; set definable key:
              ld   de,data    ;  using data below
              rst  10h        ;   call special BIOS
*--->         ld   hl,(0112h) ; get address of main command menu
*--->         ld   de,7*3     ;  offset of ^^ (this may change)
              add  hl,de      ;   point to offending ^^ code
              ld   (hl),'\'   ;    change it to a backslash
*--->         jp   0490h      ;Jump to ZDE Start point
       data:  db  4,7Fh,0,0   ;Data to set "DEL" key as DEL (7F)
              end
