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 / ZCPR2 / ZCPR2-MD.LBR / ZCPRHDR.LIB < prev   
Text File  |  2000-06-30  |  15KB  |  447 lines

  1.  
  2. *************************************************************************
  3. *                                    *
  4. *  Z C P R 2 -- Z80-Based Command Processor Replacement, Version 2.0    *
  5. *                                    *
  6. *  Copyright (c) 1982 by Richard Conn                    *
  7. *  All Rights Reserved                            *
  8. *                                    *
  9. *  ZCPR2 is Copyright (c) 1982 by Richard Conn, who assumes no respons- *
  10. *  ibility or liability for its use.  ZCPR2 is released to the public   *
  11. *  domain for non-commercial use only.                    *
  12. *                                    *
  13. *  The public is encouraged to freely copy and use this program for    *
  14. *  non-commercial purposes.  Any commercial use of ZCPR2 is prohibited    *
  15. *  unless approved by the author, Richard Conn, in writing.        *
  16. *                                    *
  17. *  This is the RELEASE VERSION of ZCPR2.                *
  18. *                                    *
  19. *************************************************************************
  20.  
  21. ;
  22. ;  Module:  ZCPRHDR
  23. ;  Author:  Richard Conn
  24. ;  Module Used By:  ZCPR2 Version 2.x
  25. ;  Note:  ZCPRHDR contains the key customization equates for ZCPR2.  These
  26. ;    equates allow the user to select various ZCPR2 options and do an
  27. ;    extensive amount of tailoring of ZCPR2 to the user's desires.
  28. ;  Note:  This is the RELEASE VERSION of ZCPR2
  29. ;
  30.  
  31. ;
  32. ;  The following equates may be used to customize this CPR for the user's
  33. ;    system and integration technique.  The following constants are provided:
  34. ;
  35. ;    REL - TRUE if integration is to be done via MOVCPM
  36. ;        - FALSE if integration is to be done via DDT and SYSGEN
  37. ;
  38. ;    BASE - Base Address of user's CP/M system (normally 0 for DR version)
  39. ;           This equate allows easy modification by non-standard CP/M (eg,H89)
  40. ;
  41. ;    CPRLOC - Base Page Address of CPR; this value can be obtained by running
  42. ;          the BDOSLOC program on your system, or by setting the
  43. ;          MSIZE and BIOSEX equates to the system memory size in
  44. ;          K-bytes and the "extra" memory required by your BIOS
  45. ;          in K-bytes. BIOSEX is zero if your BIOS is normal size,
  46. ;          and can be negative if your BIOS is in PROM or in
  47. ;          non-contiguous memory.
  48. ;
  49. REL    EQU    FALSE    ;SET TO TRUE FOR MOVCPM INTEGRATION
  50. ;
  51. BASE    EQU    0    ;BASE OF CP/M SYSTEM (SET FOR STANDARD CP/M)
  52. ;
  53.     IF    REL
  54. CPRLOC    EQU    0    ;MOVCPM IMAGE
  55.     ELSE
  56. ;
  57. ; If REL is FALSE, the value of CPRLOC may be set in one
  58. ; of two ways.  The first way is to set MSIZE and BIOSEX
  59. ; as described above using the following three lines:
  60. ;
  61. ;MSIZE    EQU    56    ;SIZE OF MEM IN K-BYTES
  62. ;BIOSEX    EQU    0    ;EXTRA # K-BYTES IN BIOS
  63. ;CPRLOC    EQU    3400H+(MSIZE-20-BIOSEX)*1024    ;CPR ORIGIN
  64. ;
  65. ; The second way is to obtain the origin of your current
  66. ; CPR using BDSLOC or its equivalent, then merely set CPRLOC
  67. ; to that value as as in the following line:
  68. ;
  69. CPRLOC    EQU    0DC00H    ;FILL IN WITH BDOSLOC SUPPLIED VALUE
  70. ;
  71. ; Note that you should only use one method or the other.
  72. ; Do NOT define CPRLOC twice!
  73. ;
  74. ; The following gives the required offset to load the CPR into the
  75. ; CP/M SYSGEN Image through DDT (the Roffset command); Note that this
  76. ; value conforms with the standard value presented in the CP/M reference
  77. ; manuals, but it may not necessarily conform with the location of the
  78. ; CPR in YOUR CP/M system; several systems (Morrow Designs, P&T, Heath
  79. ; Org-0 to name a few) have the CPR located at a non-standard address in
  80. ; the SYSGEN Image
  81. ;
  82. ;CPRR    EQU    0980H-CPRLOC    ;DDT LOAD OFFSET
  83. CPRR    EQU    1100H-CPRLOC    ;DDT LOAD OFFSET FOR MORROW DESIGNS
  84.     ENDIF
  85.  
  86.  
  87. ;
  88. ; The following equate identifies the location of the BIOS.  This equate
  89. ; (as provided in the release copy of ZCPR2HDR) assumes the standard sizes
  90. ; of 800H for ZCPR2 and 0E00H for BDOS and does not need to be modified if
  91. ; the user is running a standard CP/M configuration.
  92. ;
  93. BIOS    EQU    CPRLOC+800H+0E00H    ;ADDRESS OF BIOS
  94.  
  95.  
  96. ;
  97. ;   The following macros define the file types of the command object files
  98. ; (COM files under CP/M 2.2) to be loaded when a non-resident ZCPR2 command
  99. ; is given and of the indirect command files (SUB files under CP/M 2.2) to
  100. ; be used to extract commands from when the indirect command facility is
  101. ; invoked.
  102. ;
  103. COMTYP    MACRO
  104.     DB    'COM'        ;FILE TYPE OF COMMAND FILE
  105.     ENDM
  106.  
  107. SUBTYP    MACRO
  108.     DB    'SUB'        ;FILE TYPE OF INDIRECT COMMAND FILE
  109.     ENDM
  110.  
  111. ;
  112. ;   The following flag enables or disables the ability of ZCPR2 to process
  113. ; SUBMIT files (command files of the form $$$.SUB).  If SUBON is TRUE, then
  114. ; ZCPR2 will process such files like CP/M's CCP normally does; if SUBON is
  115. ; FALSE, ZCPR2 will not process such files (ignore them).  In such a case,
  116. ; only indirect command file facilities like ZEX will work.
  117. ;
  118. SUBON    EQU    TRUE      ;SET TO TRUE TO ENABLE PROCESSING OF $$$.SUB
  119.  
  120.  
  121. ;
  122. ;   The following flag allows ZCPR2 to accept commands of the form "du:cmnd".
  123. ; If DRVPREFIX is TRUE, this form is accepted; if FALSE, this form is not
  124. ; accepted.  This flag has the additional side effect of automatically
  125. ; selecting files in the current disk/current user if the command
  126. ; is of the form "cmnd".  The DRVPFATT determines the attributes of the
  127. ; selected files if DRVPREFIX is TRUE.
  128. ;
  129. DRVPREFIX    equ    TRUE     ;ENABLE PREFIX
  130.  
  131.  
  132.  
  133. ;
  134. ;   The following flag allows the user to select the attributes of the files
  135. ; in the current disk/current user to be examined if the DRVPREFIX flag
  136. ; is TRUE.  The following values are defined:
  137. ;
  138. ;        DRVPFATT    Files Selected
  139. ;            0        System
  140. ;           80H        Directory
  141. ;            1        Both System and Directory
  142. ;
  143. DRVPFATT    equ    1    ;SELECT BOTH SYSTEM AND DIRECTORY
  144.  
  145.  
  146.  
  147. ;
  148. ;   The following flag enables or disables the ability to switch user areas.
  149. ; For a more secure system, it is recommended that this ability be disabled and
  150. ; the CD.COM facility be employed instead.
  151. ;
  152. USERON    equ    TRUE         ;ENABLE USER SPECIFICATION
  153.  
  154.  
  155. ;
  156. ;  The following flags enable or disable various ZCPR2-resident commands.
  157. ; The user may invoke these as desired, but should keep in mind the size
  158. ; of the resulting ZCPR2 and make sure it does not exceed the required
  159. ; limits.
  160. ;
  161. DIRON    equ    TRUE     ;DIR
  162. LTON    equ    TRUE     ;LIST, TYPE
  163. GOON    equ    TRUE     ;GO
  164. ERAON    equ    TRUE     ;ERA
  165. SAVEON    equ    TRUE     ;SAVE
  166. RENON    equ    TRUE     ;REN
  167. GETON    equ    TRUE     ;GET
  168. JUMPON    equ    TRUE     ;JUMP
  169.  
  170.  
  171.  
  172. ;
  173. ;   The following equate specifies the address of the PATH to be followed
  174. ; for the PATH command-search if the PATH is to be initialized by the BIOS
  175. ; and set by the user via a PATH.COM program.  The value of PATH should
  176. ; be the address of the PATH data area in memory.  If the internal PATH
  177. ; provided by ZCPR2 is to be used, then INTPATH should be equated to TRUE,
  178. ; which selects the PATH located just after the MEMLOAD routine.  If the
  179. ; external PATH is to be used, then INTPATH should be equated to FALSE and
  180. ; and equate for the address of the PATH should be provided.
  181. ;   A PATH is a series of byte-pairs, terminated by a binary 0.  The first
  182. ; byte of each pair is the disk number (1-16 for disks A-P), and the second
  183. ; byte of each pair is the user number (0-31).  The special character '$'
  184. ; indicates the current user or current disk.  For example, the path
  185. ; from current disk/current user to current disk/user 0 to disk A/user 0
  186. ; is selected by the following sequence:
  187. ;        DB    '$$'    ;current disk/user
  188. ;        DB    '$',0    ;current disk/user 0
  189. ;        DB    1,0    ;disk A/user 0
  190. ;        DB    0    ;end of path
  191. ;    NOTE:  If DRVPREFIX is TRUE, then current disk/user is automatically
  192. ; searched, and including it in the command search path causes it to be
  193. ; searched twice, wasting time (and space in the path).  Since many environs
  194. ; will run with DRVPREFIX = TRUE, then a good command search path would not
  195. ; include the current disk/user.
  196. ;
  197. INTPATH    equ    FALSE        ;EXTERNAL ZCPR2 PATH SELECTED
  198.  
  199.     IF    NOT INTPATH    ;External Path Selected
  200. ;
  201. ;  This equate defines the base address of the external path
  202. ;
  203. PATH    equ    40H        ;External ZCPR2 PATH at CBIOS Buffer Area
  204.  
  205.     ELSE            ;Internal Path Selected
  206. ;
  207. ;  The following macro defines the n-element internal path
  208. ;
  209. IPATH    MACRO
  210.     db    'A'-'@',0    ;Disk A, User 0
  211.     db    0        ;End of Path -- MUST be here
  212.     ENDM
  213. ;
  214.     ENDIF
  215.  
  216. ;
  217. ;   The following equate causes ERA to confirm on the files to be erased
  218. ; before it goes ahead and erases them.  If ERAOK is TRUE, then the user
  219. ; will be prompted each time; if it is FALSE, then the user will not be
  220. ; prompted.
  221. ;
  222. ERAOK    equ    TRUE         ;SET TO TRUE FOR PROMPT
  223.  
  224. ;
  225. ;   If ERAOK is TRUE, the following equate adds a Verify option to the
  226. ; ERA command which causes the user to be prompted only if the Verify
  227. ; option letter, defined by ERDFLG, is given after the file name.  If
  228. ; ERAV is TRUE, then the user will be asked to verify only when ERDFLG
  229. ; is contained in the command line; if ERAV is FALSE, the user will always
  230. ; be asked to verify.
  231. ;
  232. ERAV    equ    TRUE        ;ENABLE VERIFY OPTION
  233. ERDFLG    equ    'V'        ;SET OPTION LETTER
  234.  
  235. ;
  236. ;   The following equate enables the appearance of the current disk/user
  237. ; in the ZCPR2 prompt.  If set to FALSE, the prompt appears as '>' (assuming
  238. ; > is the current value of CPRMPT).  If set to TRUE, the prompt appears
  239. ; as 'd>' or 'dn>'.
  240. ;
  241. DUPRMPT    equ    TRUE         ;ENABLE D> OR DN> FORM
  242.  
  243. ;
  244. ;  The MULTCMD equate enables the feature of having more than
  245. ;  one command on the same line, separated by a separation char
  246. ;  which is defined by the CMDSEP equate.  If this feature is
  247. ;  enabled, the command line buffer and buffer pointers are
  248. ;  moved outside of ZCPR2 at the indicated address of CLBASE.
  249. ;
  250.  
  251. MULTCMD    equ    TRUE      ;Multiple Commands on one line permitted
  252.  
  253.     IF    MULTCMD
  254. CMDSEP    equ    ';'    ;Command Separator
  255. CLBASE    equ    0FA00H    ;Base address of buffer
  256. BUFLEN    equ    200    ;200 Bytes in Input Buffer
  257.     ENDIF
  258.  
  259. ;
  260. ;  The Wheel equate table enables the WHEEL facility of ZCPR2.  With this
  261. ;  facility, a WHEEL BYTE, which exists somewhere in memory, is examined
  262. ;  before a set of installer-selected commands are executed.
  263. ;  If this byte is not zero, then the command proceeds.  If it is zero,
  264. ;  then the command is not allowed to proceed and is exited with an error
  265. ;  message.
  266. ;
  267. ;  The following set of equates make each of the indicated commands
  268. ;  selectable to respond to the Wheel Byte or not.  For instance, if
  269. ;  WERA=TRUE, then it responds to the Wheel Byte; if WERA=FALSE, it does not.
  270. ;
  271. WHLADR    equ    3BH    ;Address of Byte to Examine
  272. WERA    equ    FALSE    ;Make ERA a Wheel-Oriented Command
  273. WREN    equ    FALSE    ; "   REN "   "       "       "
  274. WLT    equ    FALSE    ; "   L/T "   "       "       "  (LIST/TYPE)
  275. WGO    equ    FALSE    ; "   GO  "   "       "       "
  276. WSAVE    equ    FALSE    ; "   SAVE "  "       "       "
  277. WGET    equ    FALSE    ; "   GET "   "       "       "
  278. WJUMP    equ    FALSE    ; "   JUMP "  "       "       "
  279. WDU    equ    FALSE    ; "   DU: "   "       "       " (DU Change)
  280. WHEEL    equ    WERA OR WREN OR WLT OR WGO OR WSAVE OR WGET OR WJUMP OR WDU
  281.  
  282. ;
  283. ;  The INTSTACK equate is used to specify if the stack is internal or
  284. ;  external to ZCPR2.  Naturally, quite a bit of space is saved if the
  285. ;  stack is placed external to ZCPR2.  If such is the case, the user
  286. ;  should set the STKBASE equate to the beginning of the stack area
  287. ;  (bottom of the stack).  NOTE:  THIS IS THE BOTTOM OF THE STACK, NOT THE
  288. ;  TOP OF THE STACK.
  289. ;
  290. ;  If INTSTACK is TRUE, the stack is internal to ZCPR2.  If INTSTACK is
  291. ;  FALSE, the stack is external to ZCPR2, and the base of the stack
  292. ;  (bottom of the stack) is located at STKBASE.
  293. ;
  294. INTSTACK    equ    FALSE    ;Enable or Disable Internal Stack
  295.  
  296.     IF    NOT INTSTACK
  297. STKBASE        equ    0F9D0H        ;Address of Bottom of External Stack
  298. STACK        equ    STKBASE+48    ;Address of Top of Stack
  299.                     ;Stack Size should be at least 48 bytes
  300.     ENDIF    ;NOT INTSTACK
  301.  
  302. ;
  303. ;*** TERMINAL AND 'TYPE' CUSTOMIZATION EQUATES
  304. ;
  305. NLINES    EQU    24        ;NUMBER OF LINES ON CRT SCREEN
  306. WIDE    EQU    TRUE         ;TRUE IF WIDE DIR DISPLAY
  307. FENCE    EQU    '|'        ;SEP CHAR BETWEEN DIR FILES
  308. ;
  309. PGDFLT    EQU    TRUE          ;SET TO FALSE TO DISABLE PAGING BY DEFAULT
  310. PGDFLG    EQU    'P'        ;FOR TYPE COMMAND: PAGE OR NOT (DEP ON PGDFLT)
  311.                 ;  THIS FLAG REVERSES THE DEFAULT EFFECT
  312.  
  313.  
  314. ;
  315. ;*** MISCELLANEOUS EQUATES
  316. ;
  317. MAXUSR    EQU    31         ;MAXIMUM USER NUMBER ACCESSABLE
  318. MAXDISK    EQU    2        ;MAXIMUM NUMBER OF DISKS ACCESSABLE
  319. ;
  320. SYSFLG    EQU    'A'         ;FOR DIR COMMAND: LIST $SYS AND $DIR
  321. ;
  322. SOFLG    EQU    'S'        ;FOR DIR COMMAND: LIST $SYS FILES ONLY
  323. ;
  324. SUPRES    EQU    TRUE         ;SUPRESSES USER # REPORT FOR USER 0
  325. ;
  326. SPRMPT    EQU    '$'        ;CPR PROMPT INDICATING SUBMIT COMMAND
  327. CPRMPT    EQU    '>'        ;CPR PROMPT INDICATING USER COMMAND
  328.                 ;... THE MSB IS SET (+80H) FOR ZEX
  329. ;
  330. NUMBASE    EQU    'H'        ;CHARACTER USED TO SWITCH FROM DEFAULT
  331.                 ; NUMBER BASE
  332. ;
  333. SECTFLG    EQU    'S'        ;OPTION CHAR FOR SAVE COMMAND TO SAVE SECTORS
  334. ;
  335. CURIND    EQU    '$'        ;SYMBOL FOR CURRENT DISK OR USER
  336. ;
  337. COMMENT    EQU    ';'        ;LINES BEGINNING WITH THIS CHAR ARE COMMENTS
  338.  
  339.  
  340. ;
  341. ; CPR COMMAND NAME TABLE
  342. ;   EACH TABLE ENTRY IS COMPOSED OF THE 4-BYTE COMMAND AND 2-BYTE ADDRESS
  343. ;
  344. NCHARS    EQU    4        ;NUMBER OF CHARS/COMMAND
  345.  
  346. CTABLE    MACRO
  347. ;
  348.     IF    DIRON
  349. ;
  350.     DB    'DIR '
  351.     DW    DIR        ;DIRECTORY DISPLAY COMMAND
  352. ;
  353.     ENDIF
  354.     IF    LTON
  355. ;
  356.     DB    'LIST'
  357.     DW    LIST        ;LIST FILE ON PRINTER COMMAND
  358.     DB    'TYPE'
  359.     DW    TYPE        ;TYPE FILE ON CONSOLE COMMAND
  360. ;
  361.     ENDIF
  362.     IF    GOON
  363. ;
  364.     DB    'GO  '
  365.     DW    GO        ;EXECUTE CURRENT TPA COMMAND
  366. ;
  367.     ENDIF
  368.     IF    ERAON
  369. ;
  370.     DB    'ERA '
  371.     DW    ERA        ;ERASE FILES COMMAND
  372. ;
  373.     ENDIF
  374.     IF    SAVEON
  375. ;
  376.     DB    'SAVE'
  377.     DW    SAVE        ;SAVE TPA COMMAND
  378. ;
  379.     ENDIF
  380.     IF    RENON
  381. ;
  382.     DB    'REN '
  383.     DW    REN        ;RENAME FILES COMMAND
  384. ;
  385.     ENDIF
  386.     IF    GETON
  387. ;
  388.     DB    'GET '
  389.     DW    GET        ;LOAD FILE INTO TPA COMMAND
  390. ;
  391.     ENDIF
  392.     IF    JUMPON
  393. ;
  394.     DB    'JUMP'
  395.     DW    JUMP        ;JUMP TO ANY MEMORY LOCATION COMMAND
  396. ;
  397.     ENDIF
  398. ;
  399.     ENDM
  400.  
  401. ;
  402. ;  This equate determines if the ZCPR2 FCB is located internal to or external
  403. ;  to ZCPR2.  If EXTFCB is TRUE, FCBADR defines where it is located.  By
  404. ;  placing the ZCPR2 FCB external to ZCPR2, more space is freed up for other
  405. ;  uses within ZCPR2.
  406. ;
  407. EXTFCB    equ    FALSE     ; Allow External FCB
  408.  
  409.     if    EXTFCB
  410. FCBADR    equ    0FFD0H    ; Address of External FCB
  411.     endif
  412.  
  413. ;
  414. ;  CMDRUN -- ZCPR2 Extended Command Processing Facility
  415. ;
  416. ;  This equate enables the ZCPR2 CMDRUN facility.  If CMDRUN is TRUE, then
  417. ;  another stage of command processing is invoked should ZCPR2 fail to find
  418. ;  a COM file when the user gives a command.  This stage involves invoking
  419. ;  the COM file specified by CMDFCB and giving it the current command line
  420. ;  as an argument.  In this way, if, say, M80 PROG2 fails as a command,
  421. ;  a new command like LRUNZ M80 PROG2, SUB M80 PROG2, or ZEX M80 PROG2 may
  422. ;  be processed.  If the new command fails, an appropriate error message is
  423. ;  given.
  424. ;
  425. ;  The ROOTONLY option causes ZCPR2 to only look at the Root (bottom of
  426. ;  path) for the Extended Command Processor if it is set to TRUE.  If it
  427. ;  is set to FALSE, the path is searched for the Extended Command Processor.
  428. ;  The tradeoff here is that ROOTONLY = TRUE is less flexible but somewhat
  429. ;  faster than ROOTONLY = FALSE.
  430. ;
  431. CMDRUN    equ    TRUE     ; Enable the Facility
  432.  
  433.     if    CMDRUN
  434. ROOTONLY    equ    TRUE     ; TRUE if look at Root Only for Extended
  435.                 ; Command Processor, FALSE if look along
  436.                 ; path
  437. CMDFCB    MACRO
  438.     db    0
  439.     db    'CMDRUN  '    ;Name of Program
  440.     db    'COM'        ;File Type
  441.     ENDM
  442.     endif    ;CMDRUN
  443.  
  444. ;
  445. ; END OF CUSTOMIZATION SECTION
  446. ;
  447.