You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

515 lines
19 KiB

; File: Z34RCP.LIB
; Description: Resident Command Package (RCP) for ZCPR34
; Version: 1.4
; Author: Carson Wilson
; Date: October 4, 1989
; Changes: Added PUSER0 equate suggested by Rob Friefeld.
;
; Version: 1.3
; Author: Carson Wilson
; Date: September 29, 1989
; Changes: Added CLED (Command Line Editor Shell) command options
; and equates.
;
; Version: 1.2
; Author: Carson Wilson
; Date: August 11, 1989
; Changes: Removed several "quiet" conditional assembly equates as
; we are now sensing the QUIET flag instead.
; Changed default of WHLQUIET to false.
;
; Version: 1.1
; Author: Carson Wilson
; Date: July 10, 1989
; Changes: Changed 'S' command name to 'SP'.
; Removed wheel protection from 'Q' command and set QQUIET
; on by default.
; Changed command order.
; Version: 1.0
; Author: Carson Wilson
; Date: June 15, 1988
; This is the configuration file for the ZCPR Version 3.4 resident command
; package. You should read through this file and set the equates according
; to the features you want to implement. Since most systems have a limited
; amount of space for the resident command package, it will probably be
; impossible to include all features.
; If you are using an SLR or equivalent assembler, you will be prompted
; at assembly time for which commands to include in the RCP.
;=============================================================================
;
; A S S E M B L Y O P T I O N S
;
;=============================================================================
; SLR controls whether special pseudo-ops such as ".printx" and ".accept",
; and complex macros are used at assembly time. For SLR Systems or compatible
; macro assemblers, set this equate to true.
SLR equ true
; RCPTYPE is the final character of the RCP name in the H(elp) command,
; and determines the order in which commands are added.
if SLR
Y equ true
N equ false
H equ 'H'
F equ 'F'
.accept 'Enter "F" for floppy, "H" for fixed disk version: ',rcptype
else
rcptype equ 'F' ; Floppy disk version
endif ; SLR
; ZRL controls whether named common labels are used in the code. To create
; absolute code, modify RCPBASE.LIB to reflect your system's addresses, set
; ZRL to false and instruct your assembler to generate absolute code (either
; a .COM or .HEX file).
;
; To create a relocatable file for use with Bridger Mitchell's JetLDR or
; Joe Wright's NZCOM, you must use an assembler which recognizes named
; common blocks. If your assembler has this capability, set ZRL to true
; and instruct the assembler to generate relocatable (.REL) code.
ZRL equ true
;=============================================================================
;
; M A C R O S
;
;=============================================================================
; SLR assemblers allow selection of options during assembly.
if SLR
select macro option default comment
.accept comment,option ; Prompt user for selection
endm
.printx
.printx Answer "Y" to include, "N" to exclude commands:
.printx
else
select macro option default comment
option equ default ; Use selections from file
endm
endif ; SLR
;=============================================================================
;
; R E S I D E N T C O M M A N D S S E L E C T I O N
;
;=============================================================================
; Commands to include in the resident command package
; There are some interrelations between a number of the possible resident
; commands. Some are so close (LIST and TYPE) that a single equate controls
; both functions. Others like DIR and ERA share code (both display file
; listings). It is efficient to select or deselect them together.
; If you are using an SLR or compatible assembler, you will be prompted
; at assembly time for command selections. Otherwise, select commands to
; be included by setting each SELECT macro below to yes or no.
select CLEDON no 'CLED - command line editor shell? '
select CLSON yes 'CLS - clear screen? '
select RESON yes 'R - reset disk system? '
select SPACEON yes 'SP - show space remaining on disk? '
if RCPTYPE='F' ; Assemble in floppy order
select DIRON yes 'D - disk directory? '
select ERAON yes 'ERA - erase files? '
select ECHOON yes 'ECHO - send text to screen or printer? '
select RENON yes 'REN - rename files? '
select CPON yes 'CP - copy file? '
select LTON yes 'TYPE - display file on console? '
select POKEON yes 'POKE - set memory? '
select PEEKON yes 'PEEK - view memory? '
else ; Assemble in fixed-disk order
select ECHOON yes 'ECHO - send text to screen or printer? '
select POKEON yes 'POKE - set memory? '
select PEEKON yes 'PEEK - view memory? '
select QUIETON yes 'Q - set or clear quiet status? '
select DIRON yes 'D - disk directory? '
select ERAON yes 'ERA - erase files? '
select RENON yes 'REN - rename files? '
select CPON yes 'CP - copy file? '
select LTON yes 'TYPE - display file on console? '
endif ; RCPTYPE='F'
if LTON
select LISTON no 'LIST - list to printer? '
else ; allowed only if TYPE is enabled
LISTON equ no
endif
if RCPTYPE='F' ; Assemble in floppy order
select QUIETON yes 'Q - set or clear quiet status? '
endif
select PROTON no 'PROT - set file attributes? '
select NOTEON no 'NOTE - command-line comment? '
select REGON no 'REG - set and display user registers? '
select WHLON no 'WHL - set or clear wheel status? '
select PORTON no 'PORT - view and set I/O ports? '
;=============================================================================
;
; W H E E L P R O T E C T I O N
;
;=============================================================================
; To prevent unauthorized users from performing certain dangerous or sensitive
; operations on the computer, ZCPR34 provides the capability of disabling the
; operation of certain commands when the wheel byte is off. In ZCPR30, an
; attempt to use one of these wheel-protected commands when the wheel byte was
; off resulted in an error message. In ZCPR34 things work differently. In the
; same situation, the command simply disappears. In this way a transient
; program or extended command processor function can take over and deal with
; the attempt to use the command in a much more flexible way.
;
; Wheel-protected commands in ZCPR30 had extra code to intercept the function
; and disable it. In ZCPR34, wheel protection is enabled and disabled in a
; different way. To wheel-protect a command the high bit of the first
; character in the command name is set. The command table scanner in ZCPR34
; will not recognize these commands when the wheel byte is off. Since the same
; command scanner is used to scan the commands in the RCP and FCP (flow control
; package), commands there can be wheel protected in the same way. For skilled
; computer operators it is very easy to use a debugger, file patcher, or disk
; utility to enable and disable wheel protection without having to reassemble
; the CPR, RCP, or FCP.
;
; Because of the way the command scanner works, once wheel protection is
; implemented in the CCP, there is no further code penalty in protecting RCP
; commands. Therefore, we recommend protecting all possibly sensitive
; commands or none.
wcled equ no ; CLED
wcp equ yes ; CP
wdir equ no ; DIR
wera equ yes ; ERA
wlist equ yes ; LIST
wpeek equ yes ; PEEK
wpoke equ yes ; POKE
wport equ yes ; PORT
wprot equ yes ; PROT
wquiet equ no ; QUIET
wreg equ yes ; REG
wren equ yes ; REN
wspop equ yes ; SPOP
wtype equ yes ; TYPE
whrc equ no ; H
wheel defl wcp or wdir or wera or wlist or wpeek or wpoke or wport
wheel defl wheel or wprot or wreg or wren or wtype or whrc
;=============================================================================
;
; C O M M A N D O P T I O N S
;
;=============================================================================
; Options affecting several commands
; DSORT includes code to sort file entries for the D, TYPE, LIST, ERA,
; and PROT commands.
dsort equ yes
; LEFTRIGHT affects the COPY and RENAME commands. If yes, add code to allow
; CP and REN operations work from left to right, and CP to accept a
; single filespec as its source.
; Examples:
; B0>ren b1:old.nam new.nam Renames B1:old.nam to B1:new.nam
; B0>cp a15:that.fil Copies A15:that.fil to B0:
; B0>cp source.fil dest.fil Copies source.fil to dest.fil
leftright equ yes
; If LEFTRIGHT is yes, setting TESTEQ to yes also allows CP and REN commands
; to be processed from right to left if they contain an equal sign ("=").
; Costs 11 bytes.
; Example:
; B0>cp dest.fil=source.fil Copies source.fil to dest.fil
testeq equ yes
;-----------------------------------------------------------------------------
; 'CLS' command
; This command clears the console screen. It can either use a fixed string
; (for shorter code if the same terminal is always used) or use the TCAP
; entry for automatic adaptation to any terminal.
clstcap equ true ; Use TCAP for clear-screen string
; If CLSTCAP is not enabled, then the string below must be provided and
; it must end with a character with the high bit set
if not clstcap
clsstr macro
db 'Z'-'@'+80h ; Control-Z to clear screen
endm
endif ;not clstcap
typecls equ true ; Clear between screens when typing files
;-----------------------------------------------------------------------------
; 'CP' command
; This command copies a single file. The destination file can have a different
; name from the source file. Set the size of the memory buffer in K below (do
; not change the second definition). The copy buffer is placed at the top of
; the TPA, where it will generally not interfere with subsequent use of the GO
; command to rerun a program loaded in the TPA.
cpblocks defl 16 ; Size of copy buffer in K
cpblocks defl cpblocks * 8 ; Convert to number of records
; If you will be using a BDOS or RSX which supports new functions 102 (Get
; Stamp) and 103 (Set Stamp), set STPCALL to true, and datestamps of files
; will be preserved across copies. The "last access" stamps of both copies
; are set to the time the copy took place if access stamping is enabled.
stpcall equ true ; Copy file stamps with functions 102/3
;-----------------------------------------------------------------------------
; 'DIR' command
; This command displays a sorted listing of the files in a directory. The
; file name buffer is allocated at the top of the TPA so as not to modify
; any program loaded in low memory. Consequently, the size of the buffer
; must be set in advance.
maxdirs equ 256 ; Maximum number of names in directory buffer
nosys equ yes ; suppress 'A' and 'S' options if wheel off
slashchk equ yes ; allow "DIR /S" or "DIR /A" formats (costs
; about 12 bytes)
allflag equ 'A' ; Option character for showing
; all file (both SYS and DIR)
sysflag equ 'S' ; Option character for showing
; SYS files only
sortnt equ yes ; Sort file by name then type
wide equ yes ; Make display for 80-column screen
fence equ '|' ; Character to use as fence between columns
; ..if WIDE is false.
;-----------------------------------------------------------------------------
; 'ECHO' command
; This command sends characters to the console or list device. If ECHOLST is
; enabled, then code is included for sending characters to the LST device.
; Characters normally go the the console device and are normally upper or lower
; case depending on the setting of UPCASE. The command line can have special
; command sequences to toggle the case of the output and to change the
; destination between the console and printer. Any other character following
; the command character will be sent as is. For the normal setting of the
; equates below (upcase/yes, cmdchar/%, prtchar/P, crtchar/C, lcasech/>,
; and ucasech/<) an example command line would be:
; A0:ROOT>ECHO T%>HIS IS A TEST^M^J^IDONE%PONE, TWO, %<THREE
; The following text would be echoed to the console (inlcuding carriage return,
; linefeed, and tab characters, '|' indicates the left margin):
; |This is a test
; | done
; The string "one, two, THREE" would be sent to the printer.
echolst equ yes ; Allow ECHO to LST device
upcase equ yes ; Initial case of output
cmdchar equ '%' ; Character to flag case change
prtchar equ 'P' ; Character to start sending output to
; the printer (must be upper case)
crtchar equ 'C' ; Character to start sending output to
; the CRT (must be upper case)
ucasechar equ '<' ; Character after CASECHAR that toggles
; subsequent output to upper case
lcasechar equ '>' ; Character after CASECHAR that toggles
; subsequent output to lower case
; ----------------------------------------------------------------------------
; 'H' command
; This command displays a list of the resident commands implemented in the
; system. FCP, CPR, and RCP commands can be displayed. The basic command is
; not optional; it is always included.
listcpr equ yes ; Include list of CPR-resident commands in
; display (highly recommended)
listfcp equ yes ; Include list of FCP-resident commands in
; display (recommended if there is room)
noshow equ yes ; Suppress listing commands that are wheel-
; restricted unless wheel byte is set (i.e.,
; don't show commands that won't run)
cmdsline equ 5 ; Number of commands on each line of display
cmdspace equ 8 ; Space in display for each command name
;-----------------------------------------------------------------------------
; 'LIST' and 'TYPE' commands
pgdflt equ yes ; Default to paging of console output
pgdflg equ 'P' ; Character to toggle paging status
;----------------------------------------
; 'PEEK' command
peekhdr equ yes ; Label columns in PEEK display
peekbdr equ yes ; Include line of hyphens under labels
peekchk equ yes ; If yes, the ending address will be tested to
; prevent overflow past FFFF (costs 5 bytes)
peeklen equ 127 ; Display 1 record (128 bytes) as default.
; PEEK displays in increments of 16 bytes.
; You may set PEEKLEN for 0 to 65525.
;----------------------------------------
; 'S' command
; Print disk space with other commands (recommended)
dirsp equ true ; Show space after DIR
erasp equ true ; Show space after ERA
cpsp equ true ; Show space after CP
resetsp equ true ; Show space after R
;----------------------------------------
; 'WHL' command
whlquiet equ false ; If true, don't report wheel state with
; .."WHL password" command (costs 1 byte)
wpass macro
db 'SYSTEM '
endm
;----------------------------------------
; 'CLED' command
;
; Command line editing takes place in the line buffer. It does not take up
; room in the RCP. The editor will handle a 255 byte line. Although that
; is larger than the maximum command line size, it allows you to edit a long
; line without deleting something first. The history is kept inside the RCP,
; so its size will depend upon how many other RCP commands are enabled.
; HISTSIZE should be at least as large as the multiple command line buffer
; (204 bytes).
lbufwid equ 255 ; Line buffer size, byte
histsize equ 204 ; History buffer size, word
; CLERA controls whether to null the internal history when CLED is exited, or
; to leave it for the next run. Secure systems will want to set it to YES.
clera equ no ; Erase history on terminating shell
; CLMIN sets the cutoff for discarding short lines from history recording.
; A setting of 3 would discard a command such as DIR.
clmin equ 5 ; Discard lines which do not exceed this
clins equ yes ; Initial insert state ON
clsav equ yes ; Initial history recording ON
; The appearance of the command line prompt may include the system time if a
; DateStamper or ZS/ZDDOS clock is implemented. The DU:DIR separator character
; can be changed to indicate that CLED is running.
dudir_sep equ '/' ; DU:DIR separator char
puser0 equ no ; Print user #0 in prompt
systime equ yes ; Include system time in prompt
if systime
civtim equ yes ; Yes for 12-hr civil time vs. 24-hr military
timesep equ '.' ; Separator between hours and minutes
endif
; The editor must use EREOL. The VLIB routine to send the EREOL sequence
; to the terminal needs to test for a video delay and the presence of the "/"
; quote character. Most terminals can just print the TCAP sequence as is. If
; that doesn't work, set ERLQUICK to NO. If you are using only one terminal,
; it will be most efficient to set ERLTCAP to NO and use the CLR_EOL macro.
erltcap equ yes ; Use TCAP routine vs macro
if erltcap
erlquick equ yes ; Use simplified TCAP routine
else
clr_eol macro ; Define terminal specific string
dc 1bh,'T' ; ...set high bit on last character
endm
endif ;erltcap
;-----------------------------------------------------------------------------
; Command names
; The CTABLE macro, which constructs the command dispatch table, includes a
; line for each command, the first parameter of which is the name of the
; command. These names may be changed if you wish. But make sure that you
; do not use a name that is longer than the maximum allowed length. If you
; do, the name will be truncated and a nonfatal error will occur during
; assembly. DO NOT CHANGE ANY PARAMETER OTHER THAN THE COMMAND NAME. Lower
; case letters will be converted to upper case. The macro COMMAND is defined
; in Z34MAC.LIB.
cmdsize equ 4 ; Length of each command name
cmdtbl macro
command CLED, cledon, wcled, cled
command CLS, clson, false, cls
command CP, cpon, wcp, copy
command D, diron, wdir, dir
command ECHO, echoon, false, echo
command ERA, eraon, wera, era
command H, true, whrc, clist
command LIST, liston, wlist, list
command NOTE, noteon, false, note
command P, peekon, wpeek, peek
command POKE, pokeon, wpoke, poke
command PORT, porton, wport, port
command PROT, proton, wprot, att
command Q, quieton,wquiet, quset
command R, reson, false, reset
command REG, regon, wreg, register
command REN, renon, wren, ren
command SP, spaceon,false, space
command SPOP, cledon, wspop, shpop
command TYPE, lton, wtype, type
command WHL, whlon, false, whl
endm
; END Z34RCP.LIB