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 / ZCPRHDR.LIB < prev    next >
Text File  |  2000-06-30  |  15KB  |  449 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    0BD00H    ;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    '$',0        ;Current Disk, User 0
  211.     db    'A'-'@','$'    ;Disk A, Current User
  212.     db    'A'-'@',0    ;Disk A, User 0
  213.     db    0        ;End of Path -- MUST be here
  214.     ENDM
  215. ;
  216.     ENDIF
  217.  
  218. ;
  219. ;   The following equate causes ERA to confirm on the files to be erased
  220. ; before it goes ahead and erases them.  If ERAOK is TRUE, then the user
  221. ; will be prompted each time; if it is FALSE, then the user will not be
  222. ; prompted.
  223. ;
  224. ERAOK    equ    TRUE         ;SET TO TRUE FOR PROMPT
  225.  
  226. ;
  227. ;   If ERAOK is TRUE, the following equate adds a Verify option to the
  228. ; ERA command which causes the user to be prompted only if the Verify
  229. ; option letter, defined by ERDFLG, is given after the file name.  If
  230. ; ERAV is TRUE, then the user will be asked to verify only when ERDFLG
  231. ; is contained in the command line; if ERAV is FALSE, the user will always
  232. ; be asked to verify.
  233. ;
  234. ERAV    equ    TRUE        ;ENABLE VERIFY OPTION
  235. ERDFLG    equ    'V'        ;SET OPTION LETTER
  236.  
  237. ;
  238. ;   The following equate enables the appearance of the current disk/user
  239. ; in the ZCPR2 prompt.  If set to FALSE, the prompt appears as '>' (assuming
  240. ; > is the current value of CPRMPT).  If set to TRUE, the prompt appears
  241. ; as 'd>' or 'dn>'.
  242. ;
  243. DUPRMPT    equ    TRUE         ;ENABLE D> OR DN> FORM
  244.  
  245. ;
  246. ;  The MULTCMD equate enables the feature of having more than
  247. ;  one command on the same line, separated by a separation char
  248. ;  which is defined by the CMDSEP equate.  If this feature is
  249. ;  enabled, the command line buffer and buffer pointers are
  250. ;  moved outside of ZCPR2 at the indicated address of CLBASE.
  251. ;
  252.  
  253. MULTCMD    equ    TRUE     ;Multiple Commands on one line permitted
  254.  
  255.     IF    MULTCMD
  256. CMDSEP    equ    ';'    ;Command Separator
  257. CLBASE    equ    0FF00H    ;Base address of buffer
  258. BUFLEN    equ    200    ;200 Bytes in Input Buffer
  259.     ENDIF
  260.  
  261. ;
  262. ;  The Wheel equate table enables the WHEEL facility of ZCPR2.  With this
  263. ;  facility, a WHEEL BYTE, which exists somewhere in memory, is examined
  264. ;  before a set of installer-selected commands are executed.
  265. ;  If this byte is not zero, then the command proceeds.  If it is zero,
  266. ;  then the command is not allowed to proceed and is exited with an error
  267. ;  message.
  268. ;
  269. ;  The following set of equates make each of the indicated commands
  270. ;  selectable to respond to the Wheel Byte or not.  For instance, if
  271. ;  WERA=TRUE, then it responds to the Wheel Byte; if WERA=FALSE, it does not.
  272. ;
  273. WHLADR    equ    3BH    ;Address of Byte to Examine
  274. WERA    equ    FALSE    ;Make ERA a Wheel-Oriented Command
  275. WREN    equ    FALSE    ; "   REN "   "       "       "
  276. WLT    equ    FALSE    ; "   L/T "   "       "       "  (LIST/TYPE)
  277. WGO    equ    FALSE    ; "   GO  "   "       "       "
  278. WSAVE    equ    FALSE    ; "   SAVE "  "       "       "
  279. WGET    equ    FALSE    ; "   GET "   "       "       "
  280. WJUMP    equ    FALSE    ; "   JUMP "  "       "       "
  281. WDU    equ    FALSE    ; "   DU: "   "       "       " (DU Change)
  282. WHEEL    equ    WERA OR WREN OR WLT OR WGO OR WSAVE OR WGET OR WJUMP OR WDU
  283.  
  284. ;
  285. ;  The INTSTACK equate is used to specify if the stack is internal or
  286. ;  external to ZCPR2.  Naturally, quite a bit of space is saved if the
  287. ;  stack is placed external to ZCPR2.  If such is the case, the user
  288. ;  should set the STKBASE equate to the beginning of the stack area
  289. ;  (bottom of the stack).  NOTE:  THIS IS THE BOTTOM OF THE STACK, NOT THE
  290. ;  TOP OF THE STACK.
  291. ;
  292. ;  If INTSTACK is TRUE, the stack is internal to ZCPR2.  If INTSTACK is
  293. ;  FALSE, the stack is external to ZCPR2, and the base of the stack
  294. ;  (bottom of the stack) is located at STKBASE.
  295. ;
  296. INTSTACK    equ    FALSE    ;Enable or Disable Internal Stack
  297.  
  298.     IF    NOT INTSTACK
  299. STKBASE        equ    0F5D0H        ;Address of Bottom of External Stack
  300. STACK        equ    STKBASE+48    ;Address of Top of Stack
  301.                     ;Stack Size should be at least 48 bytes
  302.     ENDIF    ;NOT INTSTACK
  303.  
  304. ;
  305. ;*** TERMINAL AND 'TYPE' CUSTOMIZATION EQUATES
  306. ;
  307. NLINES    EQU    24        ;NUMBER OF LINES ON CRT SCREEN
  308. WIDE    EQU    TRUE         ;TRUE IF WIDE DIR DISPLAY
  309. FENCE    EQU    '|'        ;SEP CHAR BETWEEN DIR FILES
  310. ;
  311. PGDFLT    EQU    TRUE          ;SET TO FALSE TO DISABLE PAGING BY DEFAULT
  312. PGDFLG    EQU    'P'        ;FOR TYPE COMMAND: PAGE OR NOT (DEP ON PGDFLT)
  313.                 ;  THIS FLAG REVERSES THE DEFAULT EFFECT
  314.  
  315.  
  316. ;
  317. ;*** MISCELLANEOUS EQUATES
  318. ;
  319. MAXUSR    EQU    31         ;MAXIMUM USER NUMBER ACCESSABLE
  320. MAXDISK    EQU    4        ;MAXIMUM NUMBER OF DISKS ACCESSABLE
  321. ;
  322. SYSFLG    EQU    'A'         ;FOR DIR COMMAND: LIST $SYS AND $DIR
  323. ;
  324. SOFLG    EQU    'S'        ;FOR DIR COMMAND: LIST $SYS FILES ONLY
  325. ;
  326. SUPRES    EQU    TRUE         ;SUPRESSES USER # REPORT FOR USER 0
  327. ;
  328. SPRMPT    EQU    '$'        ;CPR PROMPT INDICATING SUBMIT COMMAND
  329. CPRMPT    EQU    '>'+80H        ;CPR PROMPT INDICATING USER COMMAND
  330.                 ;... THE MSB IS SET (+80H) FOR ZEX
  331. ;
  332. NUMBASE    EQU    'H'        ;CHARACTER USED TO SWITCH FROM DEFAULT
  333.                 ; NUMBER BASE
  334. ;
  335. SECTFLG    EQU    'S'        ;OPTION CHAR FOR SAVE COMMAND TO SAVE SECTORS
  336. ;
  337. CURIND    EQU    '$'        ;SYMBOL FOR CURRENT DISK OR USER
  338. ;
  339. COMMENT    EQU    ';'        ;LINES BEGINNING WITH THIS CHAR ARE COMMENTS
  340.  
  341.  
  342. ;
  343. ; CPR COMMAND NAME TABLE
  344. ;   EACH TABLE ENTRY IS COMPOSED OF THE 4-BYTE COMMAND AND 2-BYTE ADDRESS
  345. ;
  346. NCHARS    EQU    4        ;NUMBER OF CHARS/COMMAND
  347.  
  348. CTABLE    MACRO
  349. ;
  350.     IF    DIRON
  351. ;
  352.     DB    'DIR '
  353.     DW    DIR        ;DIRECTORY DISPLAY COMMAND
  354. ;
  355.     ENDIF
  356.     IF    LTON
  357. ;
  358.     DB    'LIST'
  359.     DW    LIST        ;LIST FILE ON PRINTER COMMAND
  360.     DB    'TYPE'
  361.     DW    TYPE        ;TYPE FILE ON CONSOLE COMMAND
  362. ;
  363.     ENDIF
  364.     IF    GOON
  365. ;
  366.     DB    'GO  '
  367.     DW    GO        ;EXECUTE CURRENT TPA COMMAND
  368. ;
  369.     ENDIF
  370.     IF    ERAON
  371. ;
  372.     DB    'ERA '
  373.     DW    ERA        ;ERASE FILES COMMAND
  374. ;
  375.     ENDIF
  376.     IF    SAVEON
  377. ;
  378.     DB    'SAVE'
  379.     DW    SAVE        ;SAVE TPA COMMAND
  380. ;
  381.     ENDIF
  382.     IF    RENON
  383. ;
  384.     DB    'REN '
  385.     DW    REN        ;RENAME FILES COMMAND
  386. ;
  387.     ENDIF
  388.     IF    GETON
  389. ;
  390.     DB    'GET '
  391.     DW    GET        ;LOAD FILE INTO TPA COMMAND
  392. ;
  393.     ENDIF
  394.     IF    JUMPON
  395. ;
  396.     DB    'JUMP'
  397.     DW    JUMP        ;JUMP TO ANY MEMORY LOCATION COMMAND
  398. ;
  399.     ENDIF
  400. ;
  401.     ENDM
  402.  
  403. ;
  404. ;  This equate determines if the ZCPR2 FCB is located internal to or external
  405. ;  to ZCPR2.  If EXTFCB is TRUE, FCBADR defines where it is located.  By
  406. ;  placing the ZCPR2 FCB external to ZCPR2, more space is freed up for other
  407. ;  uses within ZCPR2.
  408. ;
  409. EXTFCB    equ    TRUE     ; Allow External FCB
  410.  
  411.     if    EXTFCB
  412. FCBADR    equ    0FFD0H    ; Address of External FCB
  413.     endif
  414.  
  415. ;
  416. ;  CMDRUN -- ZCPR2 Extended Command Processing Facility
  417. ;
  418. ;  This equate enables the ZCPR2 CMDRUN facility.  If CMDRUN is TRUE, then
  419. ;  another stage of command processing is invoked should ZCPR2 fail to find
  420. ;  a COM file when the user gives a command.  This stage involves invoking
  421. ;  the COM file specified by CMDFCB and giving it the current command line
  422. ;  as an argument.  In this way, if, say, M80 PROG2 fails as a command,
  423. ;  a new command like LRUNZ M80 PROG2, SUB M80 PROG2, or ZEX M80 PROG2 may
  424. ;  be processed.  If the new command fails, an appropriate error message is
  425. ;  given.
  426. ;
  427. ;  The ROOTONLY option causes ZCPR2 to only look at the Root (bottom of
  428. ;  path) for the Extended Command Processor if it is set to TRUE.  If it
  429. ;  is set to FALSE, the path is searched for the Extended Command Processor.
  430. ;  The tradeoff here is that ROOTONLY = TRUE is less flexible but somewhat
  431. ;  faster than ROOTONLY = FALSE.
  432. ;
  433. CMDRUN    equ    TRUE     ; Enable the Facility
  434.  
  435.     if    CMDRUN
  436. ROOTONLY    equ    TRUE     ; TRUE if look at Root Only for Extended
  437.                 ; Command Processor, FALSE if look along
  438.                 ; path
  439. CMDFCB    MACRO
  440.     db    0
  441.     db    'CMDRUN  '    ;Name of Program
  442.     db    'COM'        ;File Type
  443.     ENDM
  444.     endif    ;CMDRUN
  445.  
  446. ;
  447. ; END OF CUSTOMIZATION SECTION
  448. ;
  449.