home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / ZCPR33 / A-R / ARNZ09N1.LBR / ARUNZ09N.HZS / ARUNZ09N.HIS
Text File  |  2000-06-30  |  22KB  |  658 lines

  1. This material, which serves as the ARUNZ09N history file, was extracted from
  2. the comments at the beginning of the source code.
  3.  
  4.  
  5. ; Program: ARUNZ
  6. ; Author: Jay Sage
  7. ; Version: 0.9N
  8. ; Date: June 4, 1988
  9.  
  10.  
  11. VERSION$UNIT    EQU    '0'
  12. VERSION$TENTH    EQU    '9'
  13. VERSION$LETTER    EQU    'N'
  14.  
  15. ; The following value is used by the type-4 version of ARUNZ, since CODEND
  16. ; does not return a correct value from a PRL file.  Instead, ARUNZ detects
  17. ; that it is a type-4 program and uses this value as an offset from the
  18. ; starting address of the code.  The size of the code can be determined from
  19. ; the message put out by the linker when it links the main code with the
  20. ; libraries.  The value can be patched in following the ascii string SIZE in
  21. ; the configuration at the beginning of the program.
  22.  
  23. ; It is also necessary to patch the load address word in the program header
  24. ; (not the type-4 header).  The linker sets this value to 0100 for a PRL
  25. ; file.  The value has to be the total amount of memory required to run
  26. ; ARUNZ, including its code and all data space it needs.  From trial
  27. ; and error, this value is 900H larger than the value of CODESIZE.
  28.  
  29. CODESIZE    EQU    1500H
  30.  
  31. .comment \
  32.  
  33. VERSION 0.9N
  34.  
  35. I added a token data type 'S' for 'short prefix' that returns the directory
  36. prefix, if any, without the colon.
  37.  
  38. I also added the parameter '$@' that returns the contents of the memory
  39. location otherwise specified by the '$A' and '$+' parameters.  The format is
  40.  
  41.     $@fat   or   $@f+t####
  42.  
  43. where '$@' is the parameter leadin, 'f' is the number conversion format ('H',
  44. 'F', 'D', 'T', or 'O' as with '$M' and '$R' parameters), and 'm' is the
  45. memory module to use as the address or base address.  With the '+' form, the
  46. four hex digits specify the offset from the base address.
  47.  
  48. I added a flag (after the ascii string TABFLAG) to determine where space only
  49. of either space or tab will be used to delimit command-line tokens.  The
  50. normal setting of this flag is '00' so that only spaces are used as the
  51. delimiter.  If this is changed to a value of '09', then tabs will be used also.
  52.  
  53. ;--------------------
  54.  
  55. VERSION 0.9M
  56.  
  57. I put back in the code to allow ARUNZ to work without the Z33/Z34 parser call,
  58. but I included the Z33ONLY equate to govern which version would be generated. 
  59. If BGii is upgraded to Z34 compatibility, then Z33ONLY can be turned on even if
  60. BGii is going to be used.
  61.  
  62. Following a suggestion from Rick Charnes, I added a series of parameters to
  63. return the DateStamper date fragments.  If DateStamper is not running, then 00
  64. will be returned for all the values (and null for the AM/PM flag).  At some
  65. point in the future it might be good to provide a patch point where the user
  66. could provide the address of a routine to be called that returns the date in
  67. ASCII, as DS does, or perhaps some other alternative forms.  The date
  68. parameters have the form $Dt, where the 't' type options are:
  69.  
  70.     Y    Year (YY)
  71.     M    Month (MM)
  72.     D    Day (DD)
  73.     H    Hour in military form 00-23 (HH)
  74.     C    hour in Civil form 01-12 (CC)
  75.     N    miNute
  76.     A    Am/pm flag (AM or PM)
  77.  
  78. Added code to check for adequate TPA space for data buffers.  Added support
  79. for a type-4 version of ARUNZ.
  80.  
  81. ;--------------------
  82.  
  83. VERSION 0.9L
  84.  
  85. Made prompted input responses go into buffers so that user's answers can be
  86. used more than once.  Parameters are now requested using only the parameter
  87. $".  The user's response can later be invoked using a parameter of the form
  88. $'tn, where 't' is the type of data desired and 'n' is the index to the
  89. prompt (starting with 1).  The allowed types can include any of those allowed
  90. for token parameters (see below: 'D', 'U', 'P', 'F', 'N', 'T', 'C') or any of
  91. the following:
  92.  
  93.     'L'    the entire line as the user entered it
  94.     ';'    a single command (i.e., terminated by null or semicolon)
  95.     'E'    an exact token (terminated by a null, a semicolon, a space,
  96.         or a tab)
  97.  
  98. The register ($R) and memory ($M) parameters were extended to allow the
  99. specification of the type of conversion to be performed.  After the 'R' or
  100. 'M', one of the following letters specifies the format:
  101.  
  102.     'H'    two hexadecimal digits
  103.     'F'    floating decimal (one, two, or three digits)
  104.     'D'    three decimal digits
  105.     'T'    two decimal digits
  106.     'O'    one decimal digit
  107.  
  108. The 'T' and 'O' conversion options will give script parameter error messages
  109. if the number is two big to represented in the designated number of digits.
  110.  
  111. Following the conversion type character will be either two (for $R) or four
  112. (for $M) characters that will be taken as the register or memory address. 
  113. Register values from 00 to 1F are allowed.
  114.  
  115. I have finally rationalized the parameter forms for the system files and the
  116. command line tokens.  For the system files we have the $S parameter with the
  117. format $Sp#, where 'p' is the part of the file name and '#' is the system
  118. file number (1..4).  The part 'p' can be:
  119.  
  120.     N    file name
  121.     T    file type
  122.     F    name and type together
  123.  
  124. For the command line tokens, the parameter is, similarly, of the form $Tp#. 
  125. The part options are are 'N', 'T', and 'F' plus the following:
  126.  
  127.     D    drive (or default)
  128.     U    user (or default)
  129.     P    directory prefix (including the colon)
  130.     C    converted file specification with DIR: form, if present
  131.         changed to equivalent DU: (if invalid name, then no
  132.         conversion is performed)
  133.  
  134. The old parameters for the system files and command line tokens have been
  135. eliminated.
  136.  
  137. To keep the code under 4K, I dropped some obscure error reports.
  138.  
  139. ----------------------------------------
  140.  
  141. VERSION 0.9K
  142.  
  143. Added parameter $+ that takes the value otherwise returned by the $a
  144. parameters and adds an offset to it.  For example, one might write:
  145.  
  146.     $+e001D
  147.  
  148. to get the address of the maxuser byte in the ENV.  I also made it possible
  149. to echo control characters in prompts by preceeding a with a caret.  The
  150. dollar sign is used as an escape; any character entered after a dollar sign
  151. is echoed as is.  Thus $$ gives $, $^ gives ^, $" gives ", and $' gives '. 
  152. Finally, I put the type-3 safety header into the code.
  153.  
  154. ----------------------------------------
  155.  
  156. VERSION 0.9J
  157.  
  158. Extended parameters $: and $. to take digit 0 so that the verb can be parsed
  159. into a file name and type.  $D0 and $U0 now return the drive and user
  160. specified in the command token.  A new parameter $H gives the home directory
  161. information.  $HD gives the drive letter; $HU gives the user number; and $HB
  162. gives both (i.e., full DU).  Added special character TYPECHAR (default '>')
  163. to signal comparison with filetype only in the command verb.  Added $A
  164. parameter with following option letters B, C, D, E, F, I, L, M, N, P, R, S,
  165. X to return in ASCII form the address of various system modules (BIOS, CCP,
  166. DOS, ENV, FCP, etc.). Added ability to call the Z33 or later token parser.
  167.  
  168. ----------------------------------------
  169.  
  170. VERSION 0.9I
  171.  
  172. Added parameter $! to represent the entire command as entered by the user.
  173.  
  174. ----------------------------------------
  175.  
  176. VERSION 0.9H
  177.  
  178. Changed to support Z34's ability to pass bad commands with wildcard
  179. characters and file types to ECP.  Equates now define the wildcard character
  180. (standard is '_' instead of '?'), the option character (standard is ','
  181. instead of '.'), and the default alias character (standard is ':' as
  182. before).  ARUNZ now determines the kind of error if the alias is not found
  183. and returns it to the command processor. Also added code to strip leading
  184. spaces and tabs in the script.
  185.  
  186. ----------------------------------------
  187.  
  188. VERSION 0.9G
  189.  
  190. Fixed bug introduced in 0.9f that required alias names to be entered in
  191. upper case.  Also fixed a bug that occurred with prompted input when no
  192. closing quote was provided.
  193.  
  194. ----------------------------------------
  195.  
  196. VERSION 0.9F
  197.  
  198. Added code to shut off ZEX input during input prompting.  The parameter $I
  199. can be used to turn on ZEX input redirection for the next input prompt.  I
  200. eliminated the automatic upper-casing of the ALIAS.CMD input so that prompts
  201. will be displayed as they appear in the alias script.  Extended the $R
  202. (register input) function to accept not only registers 0..9 but also
  203. registers 'A'..'F'.  The register that is used to set the configuration of
  204. ARUNZ can now be in the range 0..1FH.  Put data into a DSEG so that
  205. uninitialized data will not be included in the file.
  206.  
  207. ----------------------------------------
  208.  
  209. VERSION 0.9E
  210.  
  211. Added configuration option to control whether or not the current directory
  212. will be scanned for ALIAS.CMD (assuming path searching is ON and rootpath is
  213. OFF).  Also added option of using a user register to control all the flags.
  214.  
  215. ----------------------------------------
  216.  
  217. VERSION 0.9D
  218.  
  219. Fixed a problem with the use of the root path when the user's path was
  220. completely empty.  In that case, the fixed DU specification will be used
  221. instead.
  222.  
  223. ----------------------------------------
  224.  
  225. VERSION 0.9C
  226.  
  227. Converted to ZCPR33 type-3 environment.  Added code to skip leading spaces
  228. and a leading colon in the command tail so that the command line ":VERB
  229. etc." can invoke the alias VERB.  Turned of SCANCUR in search for ALIAS.CMD
  230. along the path.  Added minimum truncation feature.  If an alias name
  231. contains a dot ('.'), then any characters after the dot only have to match
  232. if they are present.
  233.  
  234. ----------------------------------------
  235.  
  236. VERSION 0.9B
  237.  
  238. Fixed help test not to invoke help screen when alias name starts with a
  239. control character.  In fact, modified routines to allow and process alias
  240. names with control characters other than tab.
  241.  
  242. ----------------------------------------
  243.  
  244. VERSION 0.9A
  245.  
  246. Fixed two relative jump range errors.  My previous definition of the macro
  247. @GENDD was inadequate with a single-pass assembler (or perhaps any
  248. assembler, really).  I rewrote the Zilog code to use the MACLIB Z80 pseudo-
  249. op of the SLRMAC assembler.  Those using other assemblers may have to alter
  250. this code.
  251.  
  252. ----------------------------------------
  253.  
  254. VERSION 0.9
  255.  
  256. Fixed bug in CMPNAME code that caused subsequent script names to be ignored
  257. if a previous script name matched but was longer than the one specified
  258. (e.g., NAME1=NAME SCRIPT).  On user input, modified code to skip leading
  259. spaces.
  260.  
  261. ----------------------------------------
  262.  
  263. VERSION 0.8
  264.  
  265. Changed code at ONAME to get the alias name not from the default FCB but
  266. from the command tail.  This will allow alias names longer than 8 characters
  267. and also avoid the problem caused by the bug in ZCPR3.ASM that messes up the
  268. FCB.  Added parameters $" and $' to allow user input.  Added parameter $M to
  269. return the contents of a memory location in hex and $R to return the hex
  270. representation of the value of a register.  Added macros for Z80 opcodes and
  271. put them in some of the code (may have missed a few places).
  272.  
  273. ----------------------------------------
  274.  
  275. VERSION 0.7
  276.  
  277. Put configuration flag code into a macro to eliminate possibility of making
  278. a code change in the wrong place (I did so several times). Added code to
  279. display a warning message when a bad script format is detected (bad
  280. parameter usage).  Added the facility to enter control characters using the
  281. form "^c", where "c" is any character.  "$^" is used to enter a caret into
  282. the line.  Added code for using root of path option.  Added capability to
  283. have multiple names for the same script using the form "NAME1=NAME2=..=NAMEn
  284. SCRIPT".  Also implemented wildcard name matching so that a name like "?DIR"
  285. will match a request for "XDIR" or "SDIR", etc.
  286.  
  287. ----------------------------------------
  288.  
  289. VERSION 0.5
  290.  
  291. Added patches to make a quiet version, using two flags with the other ones
  292. just before START.  These flags use individual bits to control the display
  293. of specific messages.  The bit assignments are documented below at the
  294. QUIETF label.  The alternate flag QUIETECP is used when ARUNZ is called as
  295. an ECP.
  296.  
  297. The program also has a default alias feature.  An alias name in the file
  298. ALIAS.CMD that begins with a colon will be taken as a match for any alias
  299. name.  If used, such an alias script should be placed at the end of the
  300. file.
  301.  
  302. \
  303. ;=============================================================================
  304.  
  305. ;            E Q U A T E S
  306.  
  307. NO    EQU    0
  308. YES    EQU    NOT NO
  309.  
  310. WILDCHAR    EQU    '_'
  311. OPTCHAR        EQU    ','
  312. DEFLTCHAR    EQU    ':'
  313. TYPECHAR    EQU    '>'
  314. NPROMPTS    EQU    4    ; Number of prompted input parameters
  315. BUFSIZE        EQU    8    ; File input buffer in records
  316. Z33ONLY        EQU    NO    ; Yes if relying on Z33 parser
  317.  
  318. PINPUT    EQU    YES        ; Include user input parameters $", $'
  319. PREG    EQU    YES        ; Include register parameter $R
  320. PMEM    EQU    YES        ; Include memory parameter $M
  321. PENV    EQU    YES        ; Include ENV address parameter $A
  322. PDATE    EQU    YES        ; Include datestamper date parameter
  323.  
  324. TBUFF    EQU    80H
  325. FCB    EQU    5CH
  326. CR    EQU    0DH
  327. LF    EQU    0AH
  328. TAB    EQU    09H
  329. BELL    EQU    07H
  330. EOT    EQU    1AH
  331.  
  332.  
  333. ; ----------   Error codes
  334.  
  335. ; ZCPR34 uses the error byte at the beginning of the message buffer as a flag
  336. ; to show what kind of error occurred.  Advanced error handlers will be able
  337. ; to help the user further by suggesting the possible cause of the error.
  338.  
  339. ecbaddir    equ    2    ; Bad directory specification -- logging of
  340.                 ; ..user number beyond legal range,
  341.                 ; ..nonexistent named directory
  342.  
  343. ecbadcmd    equ    5    ; Bad command form -- wildcard or file type
  344.                 ; ..present in command verb
  345.  
  346. ececperr    equ    6    ; ECP error --  command could not be executed
  347.                 ; ..by ECP, error handling was forced by a
  348.                 ; ..transient for its own reasons
  349.                 ; (DO NOT CHANGE FROM 6)
  350.  
  351.  
  352. ;=============================================================================
  353.  
  354. ;        U S E R   M A C R O S
  355.  
  356. ; This macro places configuration flags in the code.
  357.  
  358. CONFIG     MACRO    
  359.  
  360.     DEFB    'SIZE'
  361. CODESIZ:
  362.     DEFW    CODESIZE
  363.  
  364.     DEFB    'TABFLAG'
  365. TABFLAG:
  366.     DEFB    0        ; Set to 09 to allow tabs as token
  367.                 ; ..delimiters
  368.  
  369. ; These two flags, which appear just before the marker string 'REG' determine
  370. ; which messages will be displayed by ARUNZ.  The QUIETECP flag applies when
  371. ; ARUNZ has been invoked as an extended command processor.  If invoked by the
  372. ; user, QUIETF applies.  Contrary to what the symbol name would imply, setting
  373. ; bits in the flag turns on the display of that message.
  374.  
  375. QUIETECP:
  376.     DEFB    00000100B    ; Quiet flag for ECP invocation
  377. QUIETF:    DEFB    00001110B    ; Flag to control display of messages
  378.                 ;     ||||||||    ;set bit to display msg
  379.                 ;     |||||||*---- signon message
  380.                 ;     ||||||*----- running alias "x" message
  381.                 ;     |||||*------ alias.cmd file not found
  382.                 ;     ||||*------- alias "x" not found
  383.                 ;     |||*-------- ECP error
  384.                 ;     ||*--------- shell invocation error
  385.                 ;     **---------- bits not assigned
  386.  
  387. ; If the value of REGF is in the range 0..1FH, then that user register will be
  388. ; used to set the values for the three path-related flags to follow.  Bit 0
  389. ; is used to select path searching of some kind.  If it is not set, then the
  390. ; fixed DU is used.  Bit 1 determines whether only the root will be searched.
  391. ; If it is not set, then the entire path will be searched.  Bit 2 determines
  392. ; whether full path searches will include the current directory first.
  393.  
  394.     DEFB    'REG'
  395. REGF:    DEFB    0FFH
  396.  
  397. ; PATHF determines whether path searching will be used to locate ALIAS.CMD.
  398. ; If the flag is 0, then the fixed DU area below will be used.  If it is 0FFH,
  399. ; then the other path-related flags will be used to determine how the search
  400. ; is performed.
  401.  
  402.     DEFB    'PATH'
  403. PATHF:    DEFB    YES        ; Path search flag (NO = use DU given below)
  404.  
  405. ; ROOTF determines whether only the root of the path will be searched.  If it
  406. ; is 0FFH, then only the root will be used; if it is 0, then the entire path
  407. ; will be searched.
  408.  
  409.     DEFB    'ROOT'
  410. ROOTF:    DEFB    YES        ; NO = use entire path / YES = root only
  411.  
  412. ; If full path searching is selected, then SCANCUR determines whether or not
  413. ; to include the current directory first.
  414.  
  415.     DEFB    'SCANCUR'
  416. SCANCUR:
  417.     DEFB    YES        ; YES = search current DU first
  418.  
  419. ; If path searching is disabled, then the explicit directory specified here
  420. ; will be searched for ALIAS.CMD.
  421.  
  422.     DEFB    'DU'
  423. CMDDRV:    DEFB    0        ; Drive to use if not path (drive A = 0)
  424. CMDUSR:    DEFB    0        ; User to use if not path
  425.  
  426.      ENDM
  427.  
  428. ;=============================================================================
  429.  
  430. ;        E X T E R N A L    R E F E R E N C E S
  431.  
  432.  
  433. ; DSLIB
  434.  
  435.     EXT    FINDCK,RDCLK
  436.  
  437. ; Z33LIB or Z34LIB
  438.  
  439.     EXT    Z33CHK,SCAN,FCB1CHK,PRTTYPE,GETCCP
  440.  
  441. ; Z3LIB
  442.  
  443.     EXT    Z3INIT,GETEFCB,GETCL1,GETENV,GETFN2,GETPATH,GETREG
  444.     EXT    ZFNAME
  445.  
  446. ; SYSLIB
  447.  
  448.     EXT    CODEND,SKSP,CAPS,PRINT,CRLF,COUT,ACASE1
  449.     EXT    FXI$OPEN,FX$GET,PFIND,INITFCB
  450.     EXT    LOGUD,PUTUD,GETUD,RETUD
  451.     EXT    GETCST,PUTCST,GETMSG
  452.  
  453.      IF    PINPUT
  454.     EXT    BLINE,GETZEX,PUTZEX
  455.      ENDIF
  456.  
  457.      IF    PMEM OR PREG
  458.     EXT    MA2HC,MA3DC,MAFDC
  459.      ENDIF
  460.  
  461.      IF    PREG
  462.     EXT    GETREG
  463.      ENDIF
  464.  
  465.      IF    PMEM OR PENV OR PREG
  466.     EXT    EVAL16
  467.      ENDIF
  468.  
  469.      IF    PENV
  470.     EXT    MHL4HC
  471.      ENDIF
  472.  
  473. ;=============================================================================
  474.  
  475. ;        Z C P R    I N I T I A L I Z A T I O N
  476.  
  477.  
  478. ; TYP3HDR.Z80, Version 1.1, safety header
  479.  
  480. entry:
  481.     jr    start00        ; Must use relative jump
  482.     defb    0        ; Filler
  483.     db    'Z3ENV'
  484. type:
  485.     db    3        ; Type-3 environment
  486. z3eadr:
  487.     dw    0        ; Filled in by Z33
  488.     dw    entry        ; Intended load address
  489.  
  490.     CONFIG            ; Macro with configuration flags
  491.  
  492. IOCTL:                ; I/O control block for alias file
  493.  
  494.     DEFB    BUFSIZE        ; Buffer size in records
  495.     DEFS    1        ; Eof flag (filled in by FXIO)
  496.     DEFS    2        ; Byte counter (filled in by FXIO)
  497.     DEFS    2        ; Next byte pointer (filled in by FXIO)
  498. BUFADR:    DEFW    0        ; Buffer address (filled in by code later)
  499.  
  500. IOFCB:
  501.     DEFS    1        ; Initialized by FXIO
  502.     DEFB    'ALIAS   '    ; File name
  503.     DEFB    'CMD'        ; File type
  504.     DEFS    24        ; Initialized by FXIO
  505.  
  506. ;=============================================================================
  507.  
  508. ;        M A I N    P R O G R A M    C O D E
  509.  
  510. start00:
  511.     ld    hl,0        ; Point to warmboot entry
  512.     ld    a,(hl)        ; Save the byte there
  513.     di            ; Protect against interrupts
  514.     ld    (hl),0c9h    ; Replace warmboot with a return opcode
  515.     rst    0        ; Call address 0, pushing RETADDR onto stack
  516. retaddr:
  517.     ld    (hl),a        ; Restore byte at 0
  518.     dec    sp        ; Get stack pointer to point
  519.     dec    sp        ; ..to the value of RETADDR
  520.     pop    hl        ; Get it into HL and restore stack
  521.     ei            ; We can allow interrupts again
  522.     ld    de,retaddr    ; This is where we should be
  523.     xor    a        ; Clear carry flag
  524.     push    hl        ; Save address again
  525.     sbc    hl,de        ; Subtract -- we should have 0 now
  526.     pop    hl        ; Restore value of RETADDR
  527.     jr    z,start        ; If addresses matched, begin real code
  528.  
  529.     ld    de,notz33msg-retaddr ; Offset to message
  530.     add    hl,de
  531.     ex    de,hl        ; Switch pointer to message into DE
  532.     ld    c,9
  533.     jp    0005h        ; Return via BDOS print string function
  534.  
  535. notz33msg:
  536.     defb    'Bad load address',bell,'$'
  537.  
  538. START:                ; Initialize
  539.     LD    HL,(Z3EADR)    ; Pt to ZCPR3 environment
  540.     CALL    Z3INIT        ; Initialize ZCPR3 environment
  541.  
  542.      IF    Z33ONLY
  543.  
  544.     CALL    Z33CHK        ; Require Z33 or later
  545.     JR    Z,STARTA
  546.     CALL    PRINT
  547.     DEFB    'Z33 or later required',bell,0
  548.     RET
  549. STARTA:
  550.      ENDIF    ;Z33ONLY
  551.  
  552.     LD    (STACK),SP    ; Save system stack pointer
  553.     LD    SP,STACK    ; Set up local stack
  554.  
  555.     CALL    SAVEUD        ; Save user/disk information
  556.  
  557.     LD    A,(REGF)    ; See if user register is setting configuration
  558.     CP    20H        ; If not 00..1FH, use hard-coded options
  559.     JR    NC,START0
  560.  
  561.     LD    B,A        ; Get value of register
  562.     CALL    GETREG
  563.     LD    HL,PATHF    ; Set up PATHF from user register
  564.     BIT    0,A        ; ..based on bit 0
  565.     CALL    INITFLAG
  566.     LD    HL,ROOTF    ; Set up ROOTF based
  567.     BIT    1,A        ; ..on bit 1
  568.     CALL    INITFLAG
  569.     LD    HL,SCANCUR    ; Set up SCANCUR based
  570.     BIT    2,A        ; ..on bit 2
  571.     CALL    INITFLAG
  572.  
  573. START0:
  574.     XOR    A        ; Set rflag for non-recursive script
  575.     LD    (RFLAG),A
  576.  
  577.      IF    PINPUT
  578.     LD    A,2        ; Set ZEX input redirection flag off
  579.     LD    (ZEXFL),A
  580.      ENDIF    ;PINPUT
  581.  
  582.     CALL    GETCST        ; Get command status flag
  583.     LD    (CSFLAG),A    ; Save for later
  584.     AND    100B        ; See if ECP invocation
  585.     JR    Z,START1    ; If not, skip on
  586.     LD    A,(QUIETECP)    ; If so, substitute flag quietecp
  587.     LD    (QUIETF),A
  588.  
  589.                 ; Define data buffer areas
  590.  
  591. START1:
  592.     CALL    CODEND        ; Command line will be here at end
  593.  
  594.     LD    A,(TYPE)    ; If type 4, we cannot rely on CODEND value
  595.     CP    4
  596.     JR    NZ,START2
  597.     LD    HL,(CODESIZ)    ; Size of code, including lib routines
  598.     LD    DE,ENTRY
  599.     ADD    HL,DE        ; HL now has address of end of code
  600. START2:
  601.     LD    (CLBUF),HL
  602.  
  603.      DSEG
  604. CLBUF    DS    2
  605.      CSEG
  606.  
  607.     LD    DE,100H        ; Allow 256 bytes for new command line
  608.     ADD    HL,DE
  609.     LD    (TAILBUF),HL    ; Command tail buffer will be here
  610.     LD    DE,80H        ; Allow 128 bytes
  611.     ADD    HL,DE
  612.  
  613.      DSEG
  614. TAILBUF:
  615.     DS    2
  616.      CSEG
  617.  
  618.      IF    PINPUT        ; Allow space for user responses to prompts
  619.     LD    (PROMPTBUF),HL
  620.     LD    DE,NPROMPTS*80H
  621.     ADD    HL,DE
  622.     XOR    A        ; Initialize prompt count
  623.     LD    (PROMPTCNT),A
  624.      DSEG
  625. PROMPTBUF:
  626.     DS    2
  627. PROMPTCNT:
  628.     DS    1        ; Number of prompts
  629.      CSEG
  630.      ENDIF    ;PINPUT
  631.  
  632.     LD    (BUFADR),HL    ; File buffer will be here
  633.  
  634.     LD    B,BUFSIZE    ; Compute ending memory address
  635.     LD    DE,80H        ; ..by adding file buffer space
  636. FINDEND:
  637.     ADD    HL,DE
  638.     DJNZ    FINDEND
  639.     EX    DE,HL        ; Ending address into DE
  640.     CALL    GETCCP        ; Get CCP starting address
  641.     XOR    A        ; Make sure carry is clear
  642.     EX    DE,HL
  643.     SBC    HL,DE
  644.     JR    C,FINDEND1    ; If carry set, we have enough room
  645.     CALL    PRINT
  646.     DEFB    'Insufficient TPA',BELL,0
  647.     JP    ERRQUIT
  648.  
  649. FINDEND1:
  650.     CALL    SAVETAIL    ; Save the command tail in tailbuf
  651.     CALL    HELPCHK        ; See if built-in help requested
  652.     CALL    FINDFILE    ; Find the ALIAS.CMD file
  653.     CALL    FINDALIAS    ; Find the named alias script
  654.     CALL    PRTALIAS    ; Display alias-running message
  655.  
  656.                 ; Process the alias script
  657.  
  658.