diff --git a/Doc/NZCOM Manual.pdf b/Doc/NZCOM Manual.pdf new file mode 100644 index 00000000..59a62a08 Binary files /dev/null and b/Doc/NZCOM Manual.pdf differ diff --git a/Source/BPBIOS/Build.cmd b/Source/BPBIOS/Build.cmd index fdc9df0f..76a44e01 100644 --- a/Source/BPBIOS/Build.cmd +++ b/Source/BPBIOS/Build.cmd @@ -3,6 +3,8 @@ setlocal setlocal & cd ZCPR33 && call Build || exit /b 1 & endlocal +setlocal & cd Z34RCP11 && call Build || exit /b 1 & endlocal +setlocal & cd NZFCP13 && call Build || exit /b 1 & endlocal set PATH=%PATH%;..\..\Tools\zx;..\..\Tools\cpmtools; @@ -26,22 +28,22 @@ call :makebp 41nbnk rem pause -cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:ws*.* - -cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.img -cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.img 0: - -cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.rel -cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.rel 0: - -rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.dat -rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.dat 0: - -cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.zex -cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.zex 0: - -cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:myterm.z3t -cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img myterm.z3t 0:myterm.z3t +rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:ws*.* +rem +rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.img +rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.img 0: +rem +rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.rel +rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.rel 0: +rem +rem rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.dat +rem rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.dat 0: +rem +rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.zex +rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.zex 0: +rem +rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:myterm.z3t +rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img myterm.z3t 0:myterm.z3t goto :eof diff --git a/Source/BPBIOS/Clean.cmd b/Source/BPBIOS/Clean.cmd index 62c3210f..5bcf9d9e 100644 --- a/Source/BPBIOS/Clean.cmd +++ b/Source/BPBIOS/Clean.cmd @@ -10,3 +10,5 @@ if exist zcpr33*.rel del zcpr33*.rel if exist *.bak del *.bak setlocal & cd ZCPR33 && call Clean.cmd & endlocal +setlocal & cd Z34RCP11 && call Clean.cmd & endlocal +setlocal & cd NZFCP13 && call Clean.cmd & endlocal diff --git a/Source/BPBIOS/NZFCP13/Build.cmd b/Source/BPBIOS/NZFCP13/Build.cmd new file mode 100644 index 00000000..2c53cfd9 --- /dev/null +++ b/Source/BPBIOS/NZFCP13/Build.cmd @@ -0,0 +1,11 @@ +@echo off +setlocal + +set PATH=%PATH%;..\..\..\Tools\zx;..\..\..\Tools\cpmtools; + +set ZXBINDIR=../../../tools/cpm/bin/ +set ZXLIBDIR=../../../tools/cpm/lib/ +set ZXINCDIR=../../../tools/cpm/include/ + +zx Z80ASM -nzfcp13/MF +rem zx ZMAC -nzfcp13.z80 -/P diff --git a/Source/BPBIOS/NZFCP13/Clean.cmd b/Source/BPBIOS/NZFCP13/Clean.cmd new file mode 100644 index 00000000..a088f4e8 --- /dev/null +++ b/Source/BPBIOS/NZFCP13/Clean.cmd @@ -0,0 +1,7 @@ +@echo off +setlocal + +if exist *.prn del *.prn +if exist *.lst del *.lst +if exist *.err del *.err +if exist *.rel del *.rel diff --git a/Source/BPBIOS/NZFCP13/fcp-4.zrl b/Source/BPBIOS/NZFCP13/fcp-4.zrl new file mode 100644 index 00000000..a6f2c9a2 Binary files /dev/null and b/Source/BPBIOS/NZFCP13/fcp-4.zrl differ diff --git a/Source/BPBIOS/NZFCP13/fcp-4t.zrl b/Source/BPBIOS/NZFCP13/fcp-4t.zrl new file mode 100644 index 00000000..8d3cb48c Binary files /dev/null and b/Source/BPBIOS/NZFCP13/fcp-4t.zrl differ diff --git a/Source/BPBIOS/NZFCP13/fcp-5.zrl b/Source/BPBIOS/NZFCP13/fcp-5.zrl new file mode 100644 index 00000000..a2456212 Binary files /dev/null and b/Source/BPBIOS/NZFCP13/fcp-5.zrl differ diff --git a/Source/BPBIOS/NZFCP13/fcp-5t.zrl b/Source/BPBIOS/NZFCP13/fcp-5t.zrl new file mode 100644 index 00000000..eb94964c Binary files /dev/null and b/Source/BPBIOS/NZFCP13/fcp-5t.zrl differ diff --git a/Source/BPBIOS/NZFCP13/fcp-6.zrl b/Source/BPBIOS/NZFCP13/fcp-6.zrl new file mode 100644 index 00000000..6aa1aea9 Binary files /dev/null and b/Source/BPBIOS/NZFCP13/fcp-6.zrl differ diff --git a/Source/BPBIOS/NZFCP13/fcp-6t.zrl b/Source/BPBIOS/NZFCP13/fcp-6t.zrl new file mode 100644 index 00000000..b75fbfb7 Binary files /dev/null and b/Source/BPBIOS/NZFCP13/fcp-6t.zrl differ diff --git a/Source/BPBIOS/NZFCP13/fcp-7t.zrl b/Source/BPBIOS/NZFCP13/fcp-7t.zrl new file mode 100644 index 00000000..8a12be09 Binary files /dev/null and b/Source/BPBIOS/NZFCP13/fcp-7t.zrl differ diff --git a/Source/BPBIOS/NZFCP13/nzfcp.doc b/Source/BPBIOS/NZFCP13/nzfcp.doc new file mode 100644 index 00000000..1eb1b0ab --- /dev/null +++ b/Source/BPBIOS/NZFCP13/nzfcp.doc @@ -0,0 +1,89 @@ + Z-Relocatable Flow Control Packages + 11 October 89 by Carson Wilson + +The seven pre-compiled Flow Control Packages (FCP's) in this library may be +loaded directly to Z System with NZ-COM, Z3PLUS, or JetLDR, provided +sufficient space has been allocated to the FCP segment. The FCP's come in two +flavors. Files named FCP-nT.ZRL implement extended flow control processing +when needed using a program named IF.COM at the root of your path, or at +directory A0 if there is no path. Files named simply FCP-n.ZRL rely +exclusively on memory-based processing. The "n" in the filename indicates the +total number of records required by each package. The standard number of +records for both NZ-COM and Z3PLUS is currently 5, so if you wish to load a +larger FCP you must reconfigure your system with MKZCM or by editing your .Z3P +file. For general help with flow control commands, see the file IF.HLP, or +section 3.2.2 of your NZ-COM or Z3PLUS manual. + +While IF.COM allows options not available in memory-resident flow-control +processing, fully resident versions free the user from the requirement that +IF.COM be present during flow control processing. Resident processing is also +somewhat faster due to the need to load IF.COM from disk for each flow control +command. Finally, the ability to locate and load the transient IF.COM +requires considerable code space in the resident code itself. Generally, +IF.COM is best used on fixed-disk systems, while resident processing is more +suited to floppy-based systems. + +The options included in fully resident versions were selected somewhat +differently than those of those using IF.COM. Criteria, in order of +precedence, were as follows: + +Transient Versions Resident Versions +------------------ ----------------- +1. Is the feature available in 1. How useful is the feature? + IF.COM? 2. How much memory does the feature +2. Does the feature require disk require? + access? +3. How useful is the feature? +4. How much memory does the feature + require? + +The tables below summarize the size and features of each flavor of FCP. Each +package includes only the features appearing above it. For example, +FCP-5T.ZRL (the default FCP for both NZ-COM and Z3PLUS) contains only ZIF, +IFQ, OR, AND, negation, ERROR, and NULL. Size is expressed as records plus +remaining bytes required by the FCP. As FCP space is allocated in record +units only, I have attempted to include only combinations which leave as +little remaining space possible. Sizes without corresponding filenames are +included for reference purposes only. + +FEATURES OF TRANSIENT (IF.COM) FCPS SIZE(RECS+BYTES) FILE NAME +----------------------------------------------------------------------------- +ZIF - unconditionally clear IF states? +IFQ - show current if status? 3+124 FCP-4T.ZRL +OR - set state at current level? 4+25 +AND - reset state at current level? +Allow negation of conditions? +ERROR - test program error flag? +NULL - test for no file name? 4+84 FCP-5T.ZRL +REG - test register values? 5+16 +AMBIG - test for "?" in file spec? +COMPR - test for compressed filespec? += - test tokens for equality? 5+92 FCP-6T.ZRL +INPUT - test user input? 6+25 +Allow "IF T" and "IF F" forms? +WHEEL - test wheel byte? +TCAP - test whether TCAP loaded? +EXIST - test for file existence? 6+106 FCP-7T.ZRL +EMPTY - test files for contents? 7+10 + + +FEATURES OF RESIDENT FCPS SIZE(RECS+BYTES) FILE NAME +----------------------------------------------------------------------------- +ZIF - unconditionally clear IF states? +IFQ - show current if status? +OR - set state at current level? +AND - reset state at current level? +Allow negation of conditions? +NULL - test for no file name? +INPUT - test user input? += - test tokens for equality? +ERROR - test program error flag? +Allow "IF T" and "IF F" forms? +EXIST - test for file existence? 3+123 FCP-4.ZRL +AMBIG - test for "?" in file spec? +COMPR - test for compressed filespec? +REG - test register values? +WHEEL - test wheel byte? +TCAP - test whether TCAP loaded? 4+113 FCP-5.ZRL +EMPTY - test files for contents? 5+17 FCP-6.ZRL + \ No newline at end of file diff --git a/Source/BPBIOS/NZFCP13/nzfcp.lib b/Source/BPBIOS/NZFCP13/nzfcp.lib new file mode 100644 index 00000000..db55f33f --- /dev/null +++ b/Source/BPBIOS/NZFCP13/nzfcp.lib @@ -0,0 +1,161 @@ +; Module: NZFCP.LIB +; Author: Carson Wilson +; Version: 1.3 +; Date: 9 Oct 89 +; Changes: Prompts for options if SLR true. + +; This module is a set of configuration options for the flow control package +; code in NZFCP.Z80. The options are not fully commented here; see +; "ZCPR3, The Manual" for a detailed discussion of most of them. + + +; * * * * * * N O T I C E * * * * * * +; +; The main code in Z33FCP.Z80 has been written with relative jump instructions +; for minimum code size. If the options below are changed, then some of the +; jumps may become out-of-range. You will then have to change the code based +; on the error messages you get from your assembler. I cannot think of any +; way to handle the jumps automatically (macros fail because the jump distances +; cannot be resolved fully even in two passes of the assembler). If you want +; to play things really safe, you can do a global search and replace to change +; all occurrences of the JR instruction to JP (but note that this change is +; irreversible). I prefer to live with this nuisance so that I can get the +; most out of the code. +; +; Another possible way to clear up a problem with a relative jump that is out +; of range is to take the block of code with the labels IFCTRUE and IFCFALSE +; and move it up or down in the code. It is placed somewhere in the middle of +; the resident options, so that the options can reach those entry points with +; a relative jump. You should try to place that code near the middle of the +; options which you have enabled. +; +; Jay Sage (May 17, 1987) + +;============================================================================= +; +; M A C R O S +; +;============================================================================= + +; SLR assemblers allow selection of options during assembly. + +SLR equ no + + if SLR + +y equ yes +n equ no + +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 + +; ------------------------------------------------------------------------- + +; 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 ; Maximum length of command names + +; Command table name, enable, wheel, jump_addr + ; [ DO NOT CHANGE THESE PARAMETERS ] +ctable macro +ifcmd: command if, yes, no, ifstart + command and, andopt, no, andstart + command or, oropt, no, orstart + command else, yes, no, ifelse + command fi, yes, no, ifend + command ifq, ifqopt, no, ifstat0 + command xif, yes, no, ifexit + command zif, zifopt, no, ifzero + endm + +;----------------------------------------------------------------------------- + +; General configuration options + +NOISE equ no ; Don't display if-state messages + +select COMIF no 'Enable transient IF processing? ' + +PATHROOT equ yes ; Find transient IF in root of path + +ifdrv equ 'A' ; Drive to use if PATHROOT is off or + ; ..if the path is empty +ifusr equ 0 ; User to use if PATHROOT is off or + ; ..if the path is empty + +; --------------------------------------------------------------------- + +; Command inclusion options + +select ZIFOPT yes 'ZIF - unconditionally clear IF states? ' +select IFQOPT yes 'IFQ - show current if status? ' +select OROPT yes 'OR - set state at current level? ' +select ANDOPT yes 'AND - reset state at current level? ' + +;----------------------------------------------------------------------------- + +; If Condition Options + + if COMIF ; Different precedence if transient IF available. +select IFONEG yes 'Allow negation of conditions? ' +negchar equ '~' ; Character to use if negation allowed +select IFOERROR yes 'ERROR - test program error flag? ' +select IFONULL yes 'NULL - test for no file name? ' +select IFOREG yes 'REG - test register values? ' +select IFAMBIG yes 'AMBIG - test for "?" in file spec? ' +select IFCOMPR yes 'COMPR - test for compressed filespec? ' +select IFOEQ yes '= - test tokens for equality? ' +select IFOINPUT yes 'INPUT - test user input? ' +XEQOPT equ yes ; Test only first token for equal sign +select IFOTRUE yes 'Allow "IF T" and "IF F" forms? ' +select IFOWHEEL no 'WHEEL - test wheel byte? ' +select IFOTCAP no 'TCAP - test whether TCAP loaded? ' +select IFOEXIST yes 'EXIST - test for file existence? ' +select IFOEMPTY yes 'EMPTY - test files for contents? ' + else +select IFONEG yes 'Allow negation of conditions? ' +negchar equ '~' ; Character to use if negation allowed +select IFONULL yes 'NULL - test for no file name? ' +select IFOINPUT yes 'INPUT - test user input? ' +select IFOEQ yes '= - test tokens for equality? ' +XEQOPT equ yes ; Test only first token for equal sign +select IFOERROR yes 'ERROR - test program error flag? ' +select IFOTRUE yes 'Allow "IF T" and "IF F" forms? ' +select IFOEXIST yes 'EXIST - test for file existence? ' +select IFAMBIG no 'AMBIG - test for "?" in file spec? ' +select IFCOMPR no 'COMPR - test for compressed filespec? ' +select IFOREG no 'REG - test register values? ' +select IFOWHEEL no 'WHEEL - test wheel byte? ' +select IFOTCAP no 'TCAP - test whether TCAP loaded? ' +select IFOEMPTY no 'EMPTY - test files for contents? ' + endif ; COMIF + +; Miscellaneous configuration information + +curusr equ z3msg+2eh ; Current logged user address +curdr equ z3msg+2fh ; Current logged drive address +curint equ '$' ; Path symbol for current drive/user + +; END of NZFCP.LIB + \ No newline at end of file diff --git a/Source/BPBIOS/NZFCP13/nzfcp.lib.sav b/Source/BPBIOS/NZFCP13/nzfcp.lib.sav new file mode 100644 index 00000000..18f557f8 --- /dev/null +++ b/Source/BPBIOS/NZFCP13/nzfcp.lib.sav @@ -0,0 +1,161 @@ +; Module: NZFCP.LIB +; Author: Carson Wilson +; Version: 1.3 +; Date: 9 Oct 89 +; Changes: Prompts for options if SLR true. + +; This module is a set of configuration options for the flow control package +; code in NZFCP.Z80. The options are not fully commented here; see +; "ZCPR3, The Manual" for a detailed discussion of most of them. + + +; * * * * * * N O T I C E * * * * * * +; +; The main code in Z33FCP.Z80 has been written with relative jump instructions +; for minimum code size. If the options below are changed, then some of the +; jumps may become out-of-range. You will then have to change the code based +; on the error messages you get from your assembler. I cannot think of any +; way to handle the jumps automatically (macros fail because the jump distances +; cannot be resolved fully even in two passes of the assembler). If you want +; to play things really safe, you can do a global search and replace to change +; all occurrences of the JR instruction to JP (but note that this change is +; irreversible). I prefer to live with this nuisance so that I can get the +; most out of the code. +; +; Another possible way to clear up a problem with a relative jump that is out +; of range is to take the block of code with the labels IFCTRUE and IFCFALSE +; and move it up or down in the code. It is placed somewhere in the middle of +; the resident options, so that the options can reach those entry points with +; a relative jump. You should try to place that code near the middle of the +; options which you have enabled. +; +; Jay Sage (May 17, 1987) + +;============================================================================= +; +; M A C R O S +; +;============================================================================= + +; SLR assemblers allow selection of options during assembly. + +SLR equ yes + + if SLR + +y equ yes +n equ no + +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 + +; ------------------------------------------------------------------------- + +; 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 ; Maximum length of command names + +; Command table name, enable, wheel, jump_addr + ; [ DO NOT CHANGE THESE PARAMETERS ] +ctable macro +ifcmd: command if, yes, no, ifstart + command and, andopt, no, andstart + command or, oropt, no, orstart + command else, yes, no, ifelse + command fi, yes, no, ifend + command ifq, ifqopt, no, ifstat0 + command xif, yes, no, ifexit + command zif, zifopt, no, ifzero + endm + +;----------------------------------------------------------------------------- + +; General configuration options + +NOISE equ no ; Don't display if-state messages + +select COMIF no 'Enable transient IF processing? ' + +PATHROOT equ yes ; Find transient IF in root of path + +ifdrv equ 'A' ; Drive to use if PATHROOT is off or + ; ..if the path is empty +ifusr equ 0 ; User to use if PATHROOT is off or + ; ..if the path is empty + +; --------------------------------------------------------------------- + +; Command inclusion options + +select ZIFOPT yes 'ZIF - unconditionally clear IF states? ' +select IFQOPT yes 'IFQ - show current if status? ' +select OROPT yes 'OR - set state at current level? ' +select ANDOPT yes 'AND - reset state at current level? ' + +;----------------------------------------------------------------------------- + +; If Condition Options + + if COMIF ; Different precedence if transient IF available. +select IFONEG yes 'Allow negation of conditions? ' +negchar equ '~' ; Character to use if negation allowed +select IFOERROR yes 'ERROR - test program error flag? ' +select IFONULL yes 'NULL - test for no file name? ' +select IFOREG yes 'REG - test register values? ' +select IFAMBIG yes 'AMBIG - test for "?" in file spec? ' +select IFCOMPR yes 'COMPR - test for compressed filespec? ' +select IFOEQ yes '= - test tokens for equality? ' +select IFOINPUT yes 'INPUT - test user input? ' +XEQOPT equ yes ; Test only first token for equal sign +select IFOTRUE yes 'Allow "IF T" and "IF F" forms? ' +select IFOWHEEL no 'WHEEL - test wheel byte? ' +select IFOTCAP no 'TCAP - test whether TCAP loaded? ' +select IFOEXIST yes 'EXIST - test for file existence? ' +select IFOEMPTY yes 'EMPTY - test files for contents? ' + else +select IFONEG yes 'Allow negation of conditions? ' +negchar equ '~' ; Character to use if negation allowed +select IFONULL yes 'NULL - test for no file name? ' +select IFOINPUT yes 'INPUT - test user input? ' +select IFOEQ yes '= - test tokens for equality? ' +XEQOPT equ yes ; Test only first token for equal sign +select IFOERROR yes 'ERROR - test program error flag? ' +select IFOTRUE yes 'Allow "IF T" and "IF F" forms? ' +select IFOEXIST yes 'EXIST - test for file existence? ' +select IFAMBIG yes 'AMBIG - test for "?" in file spec? ' +select IFCOMPR yes 'COMPR - test for compressed filespec? ' +select IFOREG yes 'REG - test register values? ' +select IFOWHEEL no 'WHEEL - test wheel byte? ' +select IFOTCAP no 'TCAP - test whether TCAP loaded? ' +select IFOEMPTY yes 'EMPTY - test files for contents? ' + endif ; COMIF + +; Miscellaneous configuration information + +curusr equ z3msg+2eh ; Current logged user address +curdr equ z3msg+2fh ; Current logged drive address +curint equ '$' ; Path symbol for current drive/user + +; END of NZFCP.LIB + \ No newline at end of file diff --git a/Source/BPBIOS/NZFCP13/nzfcp13.for b/Source/BPBIOS/NZFCP13/nzfcp13.for new file mode 100644 index 00000000..40fb0c2c --- /dev/null +++ b/Source/BPBIOS/NZFCP13/nzfcp13.for @@ -0,0 +1,9 @@ +Source code plus the compiled Flow Control Packages (FCP's) +distributed in FCP.LBR as part of the Z System. The precompiled +modules are in Z-Relocatable form, and must be loaded with JetLDR, +NZCOM, or Z3PLUS. Now features interactive assembly of code +a-la-Z34RCP11 under the SLR or ZMAC assemblers. Macro now reports +length of resulting FCP in records and bytes following assembly. +JetLDR signons also automatically generated. 9/15/90 Carson Wilson + + \ No newline at end of file diff --git a/Source/BPBIOS/NZFCP13/nzfcp13.z80 b/Source/BPBIOS/NZFCP13/nzfcp13.z80 new file mode 100644 index 00000000..fe700554 --- /dev/null +++ b/Source/BPBIOS/NZFCP13/nzfcp13.z80 @@ -0,0 +1,1424 @@ + +; Program: NZFCP +; Date: October 9, 1989 +; Author: Carson Wilson +; Version: 1.3 +; Changes: Updated & improved JetLDR signon. +; Changed four JR's to JP's. + +; Date: August 21, 1988 +; Author: Carson Wilson +; Version: 1.2 + +; Derived from: + +; Date: April 1988 +; Name changed and code modified for NZ-COM. + +; Derived from: + +; PROGRAM: Z34FCP +; AUTHOR: Jay Sage +; VERSION: 1.0 +; DATE: May 25, 1987 +; DERIVATION: FCP10 by Jay Sage (ZSIG) + +; ZCPR34 is copyright 1987 by Jay P. Sage. All rights reserved. End-user +; distribution and duplication permitted for non-commercial purposes only. +; Any commercial use of ZCPR34, defined as any situation where the duplicator +; recieves revenue by duplicating or distributing ZCPR34 by itself or in +; conjunction with any hardware or software product, is expressly prohibited +; unless authorized in writing by Jay P. Sage. + +;============================================================================= +; +; R E V I S I O N H I S T O R Y +; +;============================================================================= +; +; 21 Aug 88 Added JetLDR signon description. +; IF IN now prints ' (Y/N)? ', and accepts only Y or y or +; N or n. +; Added macro code to show FCP length following assembly. +; +; Carson Wilson. +; +; 6 April 88 Handles latest Type 4 IF.COM +; 1.2 Changed command tail loader to accept :IF. Joe Wright +; +; 12/31/87 Modified for use with Z34CMN.LIB for NZ-COM. Joe Wright. +; 1.1 +; +; 05/25/87 Created ZCPR33 version from the code I released through ZSIG. +; 1.0 This code differs only in the more efficient way in which it +; determines if it was invoked with a directory prefix that +; signals that the transient IF.COM should be used to process +; the IF command. This permits the user to force the use of a +; more powerful option processor in the transient IF.COM than in +; the resident code. Option bytes were added after the end of +; the resident option dispatch table so that SHOW can report +; configuration options to the user. +; +; FCP10 notes +; +; The transient processor can now be loaded at an address other +; than 100h so as not to interfere with code loaded in the TPA. +; Then the GO command can normally be used even after IF.COM is +; used to process the flow test. If the LOADCHK equate +; is true then the FCP will verify that the transient +; processor has been loaded to the page in memory for which +; it was assembled. If loaded to the wrong page, it will +; be reloaded to the correct one. +; +; The test for the form ARG1=ARG2 was tightened up so as not to +; be confused by an equal sign in some later part of the command +; tail (e.g., "IF REG 1 = 2"). Now only the first token +; (contiguous string of characters) is checked. This extra code +; is under the control of the XEQOPT equate. The only option +; that is still a problem is the COMIF form '~='. Since the '=' +; is in the first token, this 'not equal' condition cannot be +; distinguished from an equality test against the character '~'. +; The solution is to turn off equality testing in the resident FCP +; or to use the alternative COMIF options 'NE' or '~EQ' for this +; test. +; +; Added optional commands AND and OR. These work like IF except +; that they affect the current IF level rather than going one +; level deeper. +; +; Added optional command ZIF to zero out all IF states no matter +; whether current state is true or false (XIF only works if state +; is true. +; +; Added new optional command IFQ (if-query) and enhanced the +; IFSTAT code that is invoked when the NOISE equate is true. +; In both cases, the entire tree of IF states is now shown, +; starting with the current level. For example, IFQ might result +; in the display "IF FTT" (we are at third IF level and it is +; false; the second and first IF levels are true). If the +; current IF level is 0, then the display is "IF None". +; +; Added two new resident options: AMBIGUOUS (AM) returns true if +; the file specification in the second token has a '?' (or '*') +; in it; COMPRESSED (CO) returns true if the file specificaton in +; the second token has a 'Z' or a 'Q' in the second character of +; the file type. +; +; Howard Goldstein contributed significantly to the development +; of this code. Bridger Mitchell also offered helpful +; suggestions. +; +; Jay Sage +; +; Notes from earlier SYSFCP revisions +; +; 09/12/85 Fixed bug in my code used when IF.COM is found in a specified +; drive/user area. The values of CDISK and CUSER were not being +; set, and as a result the user was not returned to the correct +; directory. The EXIST and EMPTY tests did not work correctly +; unless a DIR: or DU: was given explicitly with each file name. +; Jay Sage + +; 08/29/85 Reorganized code so that COMIF code handles only those +; options not in the table of local IF functions. Also changed +; code to allow searching for IF.COM in a specified directory +; instead of using the ROOT of the path. Also renamed macros +; to make code ZAS compatible. +; Jay Sage + +; 07/21/85 Corrected reversed sensing of program error flag in the +; IF ERROR test. +; Jay Sage + +; 01/02/85 Revised to correct a bug in the IF EMPTY test. First, the +; current record byte was not being set to zero before trying +; to read from the file. Secondly, the test for error was not +; testing for FF but for 00. My BDOS does not return 0 for +; success. It seems to return 00, 01, 02, or 03. This made the +; file appear to be empty. +; Jay Sage + + +;============================================================================= +; +; M A C R O S A N D E Q U A T E S +; +;============================================================================= + + name ('FCP') + +; External macro references + + maclib Z34CMN.LIB ; Source of system addresses + maclib NZFCP.LIB ; Source of configuration options + maclib Z34MAC.LIB ; Z34 macros + +; Equates section + +version equ 13 + +lf equ 0ah +cr equ 0dh +bell equ 07h + +base equ 0 +wboot equ base+0000h ; CP/M warm boot address +udflag equ base+0004h ; User num in high nybble, disk in low +bdos equ base+0005h ; BDOS function call entry point +tfcb equ base+005ch ; Default FCB buffer +fcb1 equ tfcb ; 1st and 2nd FCBs +fcb2 equ tfcb+16 +tbuff equ base+0080h ; Default disk I/O buffer +tpa equ base+0100h ; Base of TPA + + +;============================================================================= +; +; J e t L D R S I G N - O N +; +;============================================================================= + +; This prints an extended ID message upon loading with JetLDR. +; These are NOT the command names. + + COM /_ID_/ + + db 'Copyright 1989 ZSA',cr,lf + db 'Commands:',cr,lf + db ' IF ELSE FI XIF ' + + if andopt + db 'AND ' + endif + if oropt + db 'OR ' + endif + if ifqopt + db 'IFQ ' + endif + if zifopt + db 'ZIF ' + endif + + db cr,lf,'Options' + if ifoneg + db ' (use "',negchar,'" to negate)' + endif + if noise + db '; (noise)' + endif + db ':',cr,lf + + if ifotrue + db ' T F ' + endif + if ifambig + db 'AMbig ' + endif + if ifcompr + db 'COmpr ' + endif + if ifoempty + db 'EMpty ' + endif + if ifoeq + db 'x=y ' + endif + if ifoerror + db 'ERror ' + endif + if ifoexist + db 'EXist ' + endif + if ifoinput + db 'INput ' + endif + if ifonull + db 'NUll ' + endif + if iforeg + db 'REgs ' + endif + if ifotcap + db 'TCap ' + endif + if ifowheel + db 'WHeel ' + endif + + if comif + db cr,lf,' Use ' + if pathroot + db 'root:' + endif + db 'IF.COM' + endif + + db 0 ; End of JetLDR sign-on message + + CSEG + +;============================================================================= + +; Start of code + +start: + db 'Z3FCP' ; Flag for Package Loader + +;============================================================================= +; +; C O M M A N D T A B L E +; +;============================================================================= + +; The command name table is structured as follows: +; +; The first byte is the number of characters in each command name. +; Next come records consisting of command names followed by entry +; point addresses for the code to process the command. Finally, +; there is a null to indicate the end of the dispatch table. + + db cmdsize ; Size of text entries +ctab: ctable ; Macro defined in NZFCP.LIB + db 0 + +;============================================================================= +; +; I F C O N D I T I O N O P T I O N S +; +;============================================================================= + +condtab: + + if ifotrue + db 'T ' ; TRUE + dw ifctrue + db 'F ' ; FALSE + dw ifcfalse + endif ; ifotrue + + if ifambig ; Ambiguous file spec + db 'AM' + dw ifcambig + endif ; ifambig + + if ifcompr ; Squeezed or crunched + db 'CO' + dw ifccompr + endif ; ifcompr + + if ifoempty + db 'EM' ; File empty + dw ifcempty + endif ; ifoempty + + if ifoerror + db 'ER' ; Error message + dw ifcerror + endif ; ifoerror + + if ifoexist + db 'EX' ; File exists + dw ifcex + endif ; ifoexist + + if ifoinput + db 'IN' ; User input + dw ifcinput + endif ; ifoinput + + if ifonull + db 'NU' + dw ifcnull + endif ; ifonull + + if ifotcap ; Z3 TCAP available + db 'TC' + dw ifctcap + endif ; ifotcap + + if ifowheel ; Wheel Byte + db 'WH' + dw ifcwheel + endif ; ifowheel + + db 0 + +; Option bytes: these option bytes can be used to convey information to +; programs such as SHOW. The first one is used to reduce the chance of +; misinterpreting data from an earlier version of the FCP that does not +; have the option bytes. The next byte tells if COMIF has been activated +; and if the root of the path will be used as the directory in which to look +; for IF.COM. If PATHROOT is not selected (or if the path is empty), then +; the specified drive/user will be used. The overflow bit in case the user +; number is greater than 15 is kept in bit 2 of the second option byte. The +; combined user/drive value is kept in the third option byte. + +highuser defl ifusr gt 15 + +opt0: db 34h ; ZCPR34 version ID +opt1: optflag highuser,pathroot,comif +opt2: db ( ifusr and 0fh ) shl 4 + ( ifdrv - 'A' ) ; user/drive flag + +;============================================================================= +; +; C O M M A N D P R O C E S S I N G C O D E +; +;============================================================================= + +; Command: ZIF +; +; This command zeros out the IF system no matter what the current +; level IF state is. + + if zifopt + +ifzero: + if noise + call nl ; Print new line + endif ; noise + + jr ifexit1 + + endif ; zifopt + +;----------------------------------------------------------------------------- + +; Command: XIF +; +; If current IF state is true, XIF terminates all IFs, restoring a basic +; TRUE state. + +ifexit: + if noise + call nl ; Print new line + endif ; noise + + call iftest ; See if current IF is running and FALSE + + if noise + jr z,ifstat ; Abort with status message if so + else ; not noise + ret z ; Or just return if false + endif ; noise + +ifexit1: + ld hl,z3msg+1 ; Pt to IF flag + ld (hl),0 ; Zero IF flag + jr ifendmsg ; Print message + +;----------------------------------------------------------------------------- + +; Command: FI +; +; FI decrements to the previous IF level. It does this by shifting the +; current-if-bit in the first 'if' message in the Z3MSG buffer right one +; position. + +ifend: + if noise + call nl ; Print new line + endif ; noise + +; ld hl,z3msg+1 ; Point to IF flag +; ld a,(hl) ; Get it +; or a ; No IF active? + + call msgbf1 + dec hl ; Save a byte over the three lines above + + jr z,ifnderr + +ifendmsg: + if noise + call print + dc 'To ' ; Prefix to status display + endif ; noise + + srl (hl) ; Adjust active bit + + if noise + jr nz,ifstat ; Print status if IF still active + endif ; noise + +ifnderr: + if noise + + call print ; Print message + dc 'No ' + jp prif + + else ; not noise + + ret + + endif ; noise + +;----------------------------------------------------------------------------- + +; Command: ELSE +; +; ELSE complements the Active Bit for the Current IF provided the +; previous IF state was true. If the previous state was false, the +; command is flushed. +; +; This is accomplished according to the following algorithm. If the +; current IF is 0 (no IF) or 1 (one IF), then take the previous state +; to be true and perform the toggle. Otherwise, test the previous +; IF level condition and toggle only if it is true. + +ifelse: + if noise and (not ifqopt) + call nl ; Print new line + endif ; noise and (not ifqopt) + + call msgbf1 ; Get current if + ld b,a ; Save in B + srl a ; Back up if pointer bit to previous IF level + jr z,iftog ; If no previous IF level, go to toggle code + and (hl) ; Determine state of previous IF level + + if noise + if ifqopt + jr z,ifstat0 ; Print status on new line + else + jr z,ifstat ; If false, just print status + endif ; Ifqopt + else ; not noise + ret z ; Or simply return + endif ; noise + +iftog: + ld a,(hl) ; Get if-status message byte + xor b ; Flip current state + ld (hl),a ; Put result back in message byte + ; ..and fall thru to print status + + if not noise + ret + endif + +;----------------------------------------------------------------------------- + +; Indicate if current IF is True or False + +ifstat0: + call nl +ifstat: + call prif ; Print 'IF ' + call msgbf1 ; Get current if byte and set flags + ld b,a ; Get it into B + jr nz,ifstat1 ; Nz means if active + + call print + dc 'None' + ret + +ifstat1: + ld a,(hl) ; Get if-status message byte + and b ; Mask in currently active IF level status + ld c,'F' ; Load with false indicator + jr z,ifstat2 ; If current IF is false, jump + ld c,'T' ; Else, load with true indicator +ifstat2: + ld a,c + call conout + + srl b ; Drop one IF level + jr nz,ifstat1 ; Loop through all IF states + ret + +;------------------------- + +; Output CRLF + +nl: call print + dc cr,lf + ret + +;----------------------------------------------------------------------------- + +; Command: OR + +; This command performs a logical or operation by updating the +; if state without going to a new level. If there are active +; IFs and the current state is true, we do nothing. Else we back +; up one level and fall through to normal IF processing. + + if oropt + +orstart: + call msgbf1 ; Get if active byte + jr z,backup ; Treat like if if no IFs active + and (hl) ; Check current state + jr z,backup ; Current STATE false so go proecess + + if noise + jr ifstat0 ; Else return and show status + else + ret ; Or just return + + endif ; Noise + endif ; Oropt + +;----------------------------------------------------------------------------- + +; Command: AND + +; This command performs a logical and operation by updating the +; if state without going to a new level. If there are active +; IFs and the current state is false, we do nothing. Else we back +; up one level and fall through to normal IF processing. + + if andopt + +andstart: + call iftest ; Test for IF running and false + if noise + jr z,ifstat0 ; Condition met, show status & return + else + ret z ; Condition met, return + endif ; Noise + endif ; Andopt + +; Common stuff for and and or + + if andopt or oropt + +backup: + dec hl ; Pt to flag byte + srl (hl) ; Drop back one level +; +; Poke "IF" into external fcb for transient +; + if comif +pokefcb: + ld de,extfcb+1 ; Pt to external fcb + ld hl,ifcmd ; Pointer to IF command in table + ld bc,cmdsize ; Length + ldir ; Move it in + + endif ; comif + +; Fall through to IF PROCESSING + endif ;Andopt or oropt + +;----------------------------------------------------------------------------- + +; FCP Command: IF +; +; If current IF state is false, then advance to next level and set it +; to false also. If current IF state is true, then test condition and +; set the next level accordingly. + +ifstart: + if not ifqopt + + ld a,(extfcb) ; NZ if explicit + ld hl,tbuff + or (hl) + jp z,ifstat0 ; Report IF status + + endif ; not ifqopt + +ifstrt: + if noise + call nl ; Print new line + endif ; noise + + call iftest ; See if current IF is running and FALSE + jP z,ifcf ; Yes, do the right thing + +; Test for presence of colon in command. If colon present, then go directly +; to COMIF processing. + + if comif + ld a,(extfcb) ; Check drive byte of external FCB + or a ; If it is zero, no colon was present + jp nz,runcomif ; If colon, go to comif processing + ; Else fall through to resident processing + endif ; comif + +;----------------------------------------------------------------------------- +; +; R E S I D E N T C O M M A N D P R O C E S S I N G +; +;----------------------------------------------------------------------------- + +resident: + +; Test for Equality if Equal Sign in Token + + if ifoeq + + ld hl,tbuff+1 + + if xeqopt ; Extended equal testing + +skipsp: ; Skip over any space to first token + ld a,(hl) + or a ; Check for end of tail + jr z,ifck0 ; If so , go on + cp ' '+1 ; Test for space or control character + jr nc,tsteq ; If not, we are at first token + inc hl ; Otherwise advance to next character + jr skipsp ; ..and continue testing + + endif ; xeqopt + +tsteq: + ld a,(hl) ; Get character from command tail + inc hl ; Point to next one + or a ; EOL? + jr z,ifck0 ; Continue if so + + if xeqopt + cp ' '+1 ; End of token? + jr c,ifck0 ; If so, go on + endif ; xeqopt + + cp '=' ; Found '=' ? + jr nz,tsteq ; If not, continue scan + + ld hl,fcb1+1 ; Else, get ready to compare FCBs + ld de,fcb2+1 + ld b,11 ; 11 bytes +eqtest: + ld a,(de) ; Compare + cp (hl) + jr nz,ifcf + inc hl ; Pt to next + inc de + djnz eqtest + jr ifct + + endif ; ifoeq + + +ifck0: + ld de,fcb1+1 ; Point to first character in FCB1 + + if ifoneg + ld a,(de) ; Get it + ld (negflag),a ; Set negate flag + cp negchar ; Is it a negate? + jr nz,ifck1 ; If not, go on + inc de ; Else point to character after negchar +ifck1: + endif ; ifoneg + + if iforeg ; REGISTERS + call regtest ; Test for register value + jr nz,runreg + endif ; iforeg + + call condtest ; Test of condition match + jr nz,runcond ; If found, process condition + + if comif + jp runcomif ; If function not found in table, use transient + else + + call print ; Beep to indicate error + dc bell + + if noise + jp ifstat ; No condition, display current condition + else ; no noise + ret + endif ; noise + endif ; comif + +;----------------------------------------------------------------------------- +; +; Process register - register value is in A +; +;----------------------------------------------------------------------------- + + if iforeg +runreg: + push af ; Save value + call getnum ; Extract value in FCB2 as a number + pop af ; Get value + cp b ; Compare against extracted value + jr jrtrue ; True if match; false if not + endif ; iforeg + +;----------------------------------------------------------------------------- +; +; Process conditional test - address of conditional routine is in HL +; +;----------------------------------------------------------------------------- + +runcond: + jp (hl) ; "call" routine pted to by HL + +;============================================================================= +; +; R E S I D E N T C O N D I T I O N O P T I O N S +; +;============================================================================= + +; Condition: AMBIGUOUS + + if ifambig + +ifcambig: + ld hl,fcb2+1 ; Scan FCB2 for a '?' character + ld bc,11 ; Characters to scan + ld a,'?' ; Reference character + cpir + jr jrtrue ; True if '?' found; false if not + + endif ; ifambig + +;----------------------------------------------------------------------------- + +; Condition: COMPRESSED + + if ifcompr + +ifccompr: + ld a,(fcb2+10) ; Get middle character of file type + cp 'Z' ; Crunched + jr z,ifctrue + cp 'Q' ; Squeezed + jr jrtrue + + endif ; ifcompr + +;----------------------------------------------------------------------------- + +; Condition: TRUE +; IFCTRUE enables an active IF +; Condition: FALSE +; IFCFALSE enables an inactive IF + + if ifoempty or ifoerror or ifoexist or ifowheel +jrfalse: + jr z,ifcfalse + endif ; Ifoempty or ifoerror or ifoexist or ifowheel + +ifctrue: + + if ifoneg + call negtest ; Test for negate + jr z,ifcf + endif ; ifoneg + +ifct: + ld b,0ffh ; Active + jp ifset + + if iforeg or ifambig or ifcompr or ifoinput or ifonull +jrtrue: + jr z,ifctrue + endif ; Iforeg or ifambig or ifcompr or ifoinput or ifonull + +ifcfalse: + + if ifoneg + call negtest ; Test for negate + jr z,ifct + endif ; ifoneg + +ifcf: + ld b,0 ; Inactive + jp ifset + +;----------------------------------------------------------------------------- + +; Condition: EMPTY filename.typ + + if ifoempty +ifcempty: + call tlog ; Log into FCB2's DU + ld de,fcb2 ; Pt to fcb2 + ld c,15 ; Open file + push de ; Save fcb ptr + call bdos + pop de + inc a ; Not found? + jr z,ifctrue + ld c,20 ; Try to read a record + xor a ; set cr value to zero + ld (fcb2+32),a ; to attempt to read first record + call bdos + or a ; 0=OK + jr jrfalse ; true if no read + endif ; ifoempty + +;----------------------------------------------------------------------------- + +; Condition: ERROR + + if ifoerror +ifcerror: + ld a,(z3msg+6) ; Get error byte + or a ; 0=FALSE (no error registered) + jr jrfalse + endif ; ifoerror + +;----------------------------------------------------------------------------- + +; Condition: EXIST filename.typ + + if ifoexist +ifcex: + call tlog ; Log into DU + ld de,fcb2 ; Pt to fcb + ld c,17 ; Search for first + call bdos + inc a ; Set zero if error + jr jrfalse + endif ; Ifoexist + +;----------------------------------------------------------------------------- + +; Condition: INPUT (from user) + +; Modified to say " (Y/N)? ", and accept ONLY Y or y or N or n +; Carson Wilson 3/1/88 + + if ifoinput +ifcinput: + call print + dc ' (Y/N)? ' +ifcinp1: + ld hl,z3msg+7 ; Pt to ZEX message byte + ld (hl),10b ; Suspend ZEX input + push hl ; Save ptr to ZEX message byte +ifcinp2: + ld e,0ffh + ld c,6 ; Direct input from console + call bdos + or a ; Any input yet? + jr z,ifcinp2 ; Nope, try again + + pop hl ; Get ptr to ZEX message byte + ld (hl),0 ; Return ZEX to normal processing + and 5fh ; Mask and capitalize user input + cp 'Y' + jr nz,testN ; No, check if 'N' + call conout ; Display 'Y' + jr ifctrue ; Process as true +testN: + cp 'N' + jr nz,notN ; Not 'N' or 'n' + call conout ; Display 'N' + jr ifcfalse ; Process as false +notN: + ld a,bell ; Protest! + call conout + jr ifcinp1 ; Force either Y or y or N or n + + endif ; ifoinput + +;----------------------------------------------------------------------------- + +; Condition: NULL (2nd file name) + + if ifonull +ifcnull: + ld a,(fcb2+1) ; Get first char of 2nd file name + cp ' ' ; Space = null + jr jrtrue + endif ; ifonull + +;----------------------------------------------------------------------------- + +; Condition: TCAP + + if ifotcap +ifctcap: + ld a,(z3env+80h) ; Get first char of Z3 TCAP Entry + cp ' '+1 ; Space or less = none + jP c,ifcfalse + jP ifctrue + endif ; ifotcap + +;----------------------------------------------------------------------------- + +; Condition: WHEEL + + if ifowheel +ifcwheel: + ld hl,(z3env+29h) ; Get address of wheel byte + ld a,(hl) ; Get byte + or a ; Test for true + jP jrfalse ; False if 0 + endif ; ifowheel + +;============================================================================= +; +; S U P P O R T R O U T I N E S +; +;============================================================================= + +; Convert chars in FCB2 into a number in B + + if iforeg +getnum: + ld b,0 ; Set number + ld hl,fcb2+1 ; Pt to first char +getn1: + ld a,(hl) ; Get char + inc hl ; Pt to next + sub '0' ; Convert to binary + ret c ; Done if error + cp 10 ; Range? + ret nc ; Done if out of range + ld c,a ; Value in C + ld a,b ; A=old value + add a,a ; *2 + add a,a ; *4 + add a,b ; *5 + add a,a ; *10 + add a,c ; Add in new digit value + ld b,a ; Result in B + jr getn1 ; Continue processing + endif ; iforeg + +;----------------------------------------------------------------------------- + +; Log into DU in FCB2 + + if ifoexist or ifoempty + +tlog: + ld a,(fcb2) ; Get disk + or a ; Current? + jr nz,tlog1 + ld c,25 ; Get disk + call bdos + inc a ; Increment for following decrement +tlog1: + dec a ; A=0 + ld e,a ; Disk in E + ld c,14 + call bdos + ld a,(fcb2+13) ; Pt to user + ld e,a + ld c,32 ; Set user + jp bdos + + endif ; ifoexist or ifoempty + +;----------------------------------------------------------------------------- + +; Test of Negate Flag = negchar + + if ifoneg +negtest: +negflag equ $+1 ; Pointer for in-the-code modification + ld a,0 ; 2nd byte is filled in + cp negchar ; Test for No + ret + endif ; ifoneg + +;----------------------------------------------------------------------------- + +; Test FCB1 against a single digit (0-9) +; Return with register value in A and NZ if so + + if iforeg +regtest: + ld a,(de) ; Get digit + sub '0' + jr c,zret ; Z flag for no digit + cp 10 ; Range? + jr nc,zret ; Z flag for no digit + ld hl,z3msg+30h ; Pt to registers + add a,l ; Pt to register + ld l,a + ld a,h ; Add in H + adc 0 + ld h,a + xor a ; Set NZ + dec a + ld a,(hl) ; Get register value + ret +zret: + xor a ; Set Z + ret + endif ; iforeg + +;----------------------------------------------------------------------------- + +; Test to see if a current IF is running and if it is FALSE +; If so, return with Zero Flag Set (Z) +; If not, return with Zero Flag Clear (NZ) +; Affect only HL and PSW + +iftest: + call msgbf1 ; Test for active IF + jr z,ifok ; No active IF + and (hl) ; Check active flag + ret z ; Return Z since IF running and FALSE +ifok: + or 255 ; Return NZ for OK + ret + +msgbf1: + ld hl,z3msg+1 ; Get IF active flag + ld a,(hl) + inc hl ; Pt to If status byte + or a ; Set z if no IF active + ret + +;----------------------------------------------------------------------------- + +; Test FCB1 against condition table (must have 2-char entries) +; Return with routine address in HL if match and NZ flag + +condtest: + ld hl,condtab ; Pt to table +condt1: + ld a,(hl) ; End of table? + or a + ret z + ld a,(de) ; Get char + cp (hl) ; Comppare entries + inc hl ; Pt to next + inc de + jr nz,condt2 + ld a,(de) ; Get 2nd char + cp (hl) ; Compare + jr nz,condt2 + inc hl ; Pt to address + ld a,(hl) ; Get address in HL + inc hl + ld h,(hl) + ld l,a ; HL = address + jr ifok ; Set NZ for OK +condt2: + inc hl ; Pt to next entry + inc hl ; Skip over addr + inc hl + dec de ; Pt to 1st char of condition + jr condt1 + +;----------------------------------------------------------------------------- + +; Turn on next IF level +; B register is 0 if level is inactive, 0FFH if level is active + +ifset: +; ld hl,z3msg+1 ; Get IF flag +; ld a,(hl) +; or a ; If no if at all, start 1st one + + call msgbf1 + dec hl + + jr z,ifset1 +ifset0: + add a,a ; Advance to next level + jr c,iferr ; Check for overflow (8 IFs max) + ld (hl),a ; Set IF byte + jr ifset2 +ifset1: + inc a ; A=1 + ld (hl),a ; Set 1st IF +ifset2: + ld d,a ; Get IF byte + and b ; Set interested bit + ld b,a + inc hl ; Pt to active flag + ld a,d ; Complement IF byte + cpl + and (hl) ; Mask in only uninterested bits + or b ; Mask in interested bit + ld (hl),a ; Save result + + if noise + jp ifstat ; Print status and exit + else + ret ; Or just exit + endif ; noise + +iferr: + call print ; Beep to indicate overflow + dc bell + ret + +;============================================================================= +; +; T R A N S I E N T I F P R O C E S S I N G +; +;============================================================================= + + + if comif + +runcomif: + +; First we have to find IF.COM + + ld bc,100h*(ifdrv-'A')+ifusr ; Values to use if null path + + if pathroot + + ld hl,(expath) ; Point to symbolic path (indirect) +fndroot: + ld a,(hl) ; Check for end of path + or a + jr z,froot2 ; If end, branch + +; Process Next Path Element + + cp curint ; Current disk/user symbol? + jr nz,froot0 ; If not, branch + ld a,(curdr) ; Get current disk + inc a ; Compensate for following decrement +froot0: + dec a ; Shift to range 0..15 + ld b,a ; Set disk + inc hl ; Point to user in path + ld a,(hl) ; Get user + cp curint ; Current drive/user symbol? + jr nz,froot1 ; If not, branch + ld a,(curusr) ; Get current user +froot1: + ld c,a ; Set user + inc hl ; Point to next element in symbolic path + jr fndroot + +; Done with Search - BC Contains ROOT DU (or specified DU if path is empty) + + endif ; pathroot + +froot2: + call logbc ; Log into IF.COM's directory + +; Try to Open File IF.COM + + ld de,extfcb ; Point to command FCB + xor a + ld (de),a ; Force current drive + ld c,15 ; Open file + call bdos + inc a + jr nz,ifload ; Branch if file found + +; IF.COM not found - process as IF F + +ifnotfnd: + call iferr ; Ring bell + call reset ; Return home + jp ifcf + +; Load File IF.COM + +ifload: + call defdma ; First record to tbuff + call readcmd ; Read 1st record from IF.COM + jr nz,ifnotfnd ; If eof, treat as if file not found + + ld (extfcb+32),a ; Start from scratch (record 0) + ld a,(tbuff+8) + cp 3 + jr c,ifnotfnd ; Only Types 3 and 4 are acceptable + + call loadif ; Load IF.COM and set IFADR appropriately +; +; Build the command tail at tbuff +; + ld de,tbuff ; Point DE to tbuff + push de ; Save it for later + ld hl,(z3msg+4) ; Points into MCL buffer +; +; Advance HL to first 'space' after IF or .IF or :IF +; +advsp: inc hl + ld a,(hl) + cp ' '+1 ; Carry if space or null + jr nc,advsp + + ld c,0 ; Clear a counter + +putt: inc de ; Advance tbuff pointer + ld a,(hl) ; From MCL + ld (de),a ; To tbuff + inc hl ; Advance MCL pointer + or a ; Check for null + jr z,putx ; End of command line + cp ';' ; Command separator + jr z,putx ; End of command + inc c ; Count it up + jr putt ; Next.. + +putx: xor a ; Get a null + ld (de),a ; Terminate the line in tbuff + pop hl ; Beginning of tbuff + ld (hl),c ; Character count +; +; Pick up the execution address for Type 3 or 4 +; + ld hl,(ifadr) ; Load address + ld a,(hl) ; First byte at load address + cp 0c7h ; Test for RST 0 + jr nz,runif ; Nope, execute it + ld (hl),0c3h ; Plug in a JP +; +; Arrive here to execute IF.COM +; +runif: ld hl,z3env ; Pass environment in HL + db 0c3h ; JP instruction +ifadr: dw 0 ; Load/Execution address of IF.COM + +; +; Load IF.COM +; +loadif: + ld hl,(tbuff+11) ; Type 3 load address + jr z,loada ; Load as Type 3 +; +; Assume Type 4 (or higher) +; + ld hl,extfcb+32 ; Point to CR of extfcb + ld (hl),2 ; Set up for record 2 + push hl ; Save the pointer + call readcmd ; Get it into tbuff + pop hl + jp nz,ifnotfnd ; Too short + ld (hl),a ; Record 0 again + ld hl,(tbuff+11) ; Size word + push hl ; Save it + call readcmd ; Read record 0 again + pop bc ; Size + ld de,(ccp) ; CCP start + ld hl,z3env + dec a ; Phony fullget flag + call tbuff+9 ; Call Type 4 loader + push hl ; Save load address + call readcmd ; Read record 1 to tbuff (point to record 2) + pop hl ; Load address +; +loada: ld (ifadr),hl ; Save it +; +; Load IF.COM to (HL) until end of file, reset DMA and DU and return +; +load: push hl ; Save loading address + call setdma ; According to HL + call readcmd ; Read a record from file + pop hl ; Get current loading address back + jr nz,reset ; End of file + ld de,128 ; Advance it by one record + add hl,de + jr load ; Back to read some more + +; Reset DMA and Current DU + +reset: call defdma + ld bc,(curusr) ; Return home + +; Log Into DU in BC + +logbc: ld e,b ; Set disk + push bc + ld c,14 ; Select disk + call bdos + pop bc + ld e,c ; Set user + ld c,32 ; Select user + jp bdos + + +; Set default DMA address + +defdma: ld hl,tbuff + +; Set DMA to address according to HL + +setdma: push hl ; Save it + ex de,hl ; To DE + ld c,26 ; Set DMA command + call bdos ; Do it + pop hl ; DMA address + ret + +; Read a record from file in EXTFCB + +readcmd: + ld de,extfcb + ld c,20 + call bdos + or a ; Set NZ if error (end of file) + ret + + endif ; comif + +;============================================================================= +; +; U T I L I T Y S U B R O U T I N E S +; +;============================================================================= + +; Print "IF " + +prif: + call print + dc 'IF ' + ret + +;----------------------------------------------------------------------------- + +; Print String (terminated in 0 or MSB Set) at Return Address + +print: + ex (sp),hl ; Get address + call print1 + ex (sp),hl ; Put address + ret + +; Print String (terminated by MSB Set) pted to by HL + +print1: + ld a,(hl) ; Done? + inc hl ; Pt to next + call conout ; Print char + or a ; Set msb flag (m) + ret m ; Msb terminator + jr print1 + +;----------------------------------------------------------------------------- + +; Console Output Routine + +conout: + push hl ; Save regs + push de + push bc + push af + and 7fh ; Clear msb + ld e,a ; Char in E + ld c,2 ; Output + call bdos + pop af ; Get regs + pop bc + pop de + pop hl + ret + +;============================================================================= +; +; Display current length in records +; +prtval macro m1,v1,m2,v2,m3 + .radix 10 + .printx m1 v1 m2 v2 m3 + endm + +length equ $ - start +recs equ length / 128 +bytes equ length mod 128 + + .printx + prtval ,%recs,,%bytes, + .printx + + end + +; End of NZFCP.Z80 + \ No newline at end of file diff --git a/Source/BPBIOS/NZFCP13/z34cmn.lib b/Source/BPBIOS/NZFCP13/z34cmn.lib new file mode 100644 index 00000000..ad8c8cec --- /dev/null +++ b/Source/BPBIOS/NZFCP13/z34cmn.lib @@ -0,0 +1,105 @@ +; +; Library: Z34CMN.LIB +; Author: Carson Wilson +; Version: 1.2 +; Date: 16 June 1988 +; Changes: Renamed CRT0 to LINS for NZCOM compatibility. +; Added CUSR " " " + +; Author: Carson Wilson +; Version: 1.1 +; Date: 12 June 1988 +; Changes: Added CDRV for various Z34RCP commands. +; Added CRT0 for Z34RCP TYPE command. +; Added Z3TCAP and CLRSCR for Z34RCP CLS command. +; Added QUIET for ZCPR34 time in prompt. +; Added RSDMSG for ZCPR34 time in prompt. + +; Library: Z34CMN.LIB +; Author: Joe Wright +; Date: 23 March 1988 + +; As a replacement for Z3BASE.LIB, some usual equates. + +base equ 0 ; Base Page + +false equ 0 +true equ not false + +no equ false +yes equ true + +off equ false +on equ true + +; Named COMMON declarations start here. For compatibility, these +; are the same names used by Bridger Mitchell's JetLDR. + + common /_ENV_/ +z3env: ; Z3 Environment descriptor +z3envs equ yes ; There is one + +expath equ z3env+9 ; Address of External Path +expaths equ 10 ; Maximum 10 elements for MPATH + +rcp equ z3env+0ch ; Address of RCP +rcps equ yes ; Used as existence test, not size + +fcp equ z3env+12h ; Address of FCB +fcps equ yes ; Used as existence test, not size + +z3ndir equ z3env+15h ; Address of NDR +z3ndirs equ yes ; Used as existence test, not size + +quiet equ z3env+28h ; Quiet flag address + +z3whl equ z3env+29h ; Wheel byte address +z3whls equ yes ; There is a wheel + +lins equ z3env+33h ; CRT text lines address + +ccp equ z3env+3fh ; CCP entry +ccps equ z3env+41h ; Size + +dos equ z3env+42h ; DOS entry (+6) +doss equ z3env+44h ; Size + +bio equ z3env+45h ; BIO entry + +z3tcap equ z3env+80h ; TCAP address + +clrscr equ z3env+97h ; Clear screen string address + + common /_SSTK_/ +shstk: ; Top of Shell stack +shstks equ yes ; There is a shell stack + + common /_MSG_/ +z3msg: ; Message buffer +z3msgs equ yes ; There is one + +cusr equ z3msg+2eh ; Current user +cdrv equ z3msg+2fh ; Current drive + +rsdmsg equ z3msg+3ah ; Reserved bytes + + common /_FCB_/ +extfcb: ; External file control block +extfcbs equ yes ; There is one + + common /_MCL_/ +z3cl: ; Multiple command line +z3cls equ yes ; There is one + + common /_XSTK_/ +extstk: ; External stack +extstks equ yes ; There is one + + common /_BIOS_/ +bios: + + cseg ; Select Code Segment + +; End of Z34CMN.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/NZFCP13/z34mac.lib b/Source/BPBIOS/NZFCP13/z34mac.lib new file mode 100644 index 00000000..8ab3ffbe --- /dev/null +++ b/Source/BPBIOS/NZFCP13/z34mac.lib @@ -0,0 +1,122 @@ + +; Z33MAC.LIB : Macros for use with ZCPR33 + +; General purpose macros + +putreg macro + push hl ; Save registers in order + push de + push bc + endm + +getreg macro + pop bc ; Restore registers in order + pop de + pop hl + endm + +swap macro + rrca ; Exchange nibbles + rrca + rrca + rrca + endm + +;---------------------------------------- + +; Macro for forming option bytes + +; This macro generates a byte with bits corresponding to up to 8 option +; flags. The bits are filled in the order of the parameters and are right +; justified in the byte. + +optflag macro f1,f2,f3,f4,f5,f6,f7,f8 + +flag defl 0 ;; initial value + + irp temp, + + if not nul temp +flag defl flag shl 1 + if temp +flag defl flag or 1 + endif ;;temp + endif ;;not nul temp + + endm ;; irp + + defb low flag + + endm ;; optflag + +;----------------------------------------------------------------------------- + +; Command table entry definition macro + +; Macro to form an entry for one command in the table. The first parameter is +; the name to be used for the command (no quotes); the second parameter is the +; flag that indicates whether or not the command is to be enabled; the third +; parameter is the wheel control flag; and the last parameter is the jump +; address to the code that carries out the command. The command names are +; automatically padded out to the correct length (they will be truncated and +; an error message will result if a command name is too long). The characters +; in the command name are automatically converted to upper case. + +command macro cmdname,enableflag,wheelflag,address + + if enableflag ;; Generate command only if enabled + +whlmask defl wheelflag ;; Initialize variables +count defl cmdsize ;; Initialize to size of each command name + + irpc char,cmdname ;; Repeat over letters in command name + +count defl count - 1 ;; Count down characters in name + + if [ count lt cmdsize ] + + ;; If character is lower case, convert to upper case + + if [ '&char' ge 'a' ] and [ '&char' le 'z' ] + + if whlmask + defb [ '&char' and 5fh ] + 80h + else ;;not whlmask + defb [ '&char' and 5fh ] + endif ;;whlmask + + else ;;not lower case + + if whlmask + defb '&char' + 80h ;; If controlled by wheel, set high bit + else ;;not whlmask + defb '&char' ;; If not restricted, leave high bit clear + endif ;;whlmask + + endif ;;lower case + + endif ;;[ count lt cmdsize ] + +whlmask defl false ;; Turn off high-bit setting after first char + + endm ;irpc + + ;; Pad command name with blanks + + if [ count gt cmdsize ] ;; If we underflowed + *** Command name "&cmdname" is too long / truncated *** + else + rept count + defb ' ' + endm + endif ;[ count gt cmdsize ] + + dw address ;; Dispatch address for command + + endif ;enable + + endm ;command + +; End Z33MAC.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/WW.Z3T b/Source/BPBIOS/WW.Z3T new file mode 100644 index 00000000..004cc957 Binary files /dev/null and b/Source/BPBIOS/WW.Z3T differ diff --git a/Source/BPBIOS/Z34RCP11/Build.cmd b/Source/BPBIOS/Z34RCP11/Build.cmd new file mode 100644 index 00000000..1323b95f --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/Build.cmd @@ -0,0 +1,11 @@ +@echo off +setlocal + +set PATH=%PATH%;..\..\..\Tools\zx;..\..\..\Tools\cpmtools; + +set ZXBINDIR=../../../tools/cpm/bin/ +set ZXLIBDIR=../../../tools/cpm/lib/ +set ZXINCDIR=../../../tools/cpm/include/ + +rem zx Z80ASM -z34rcp11/MF +zx ZMAC -z34rcp11.z80 -/P diff --git a/Source/BPBIOS/Z34RCP11/Clean.cmd b/Source/BPBIOS/Z34RCP11/Clean.cmd new file mode 100644 index 00000000..a088f4e8 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/Clean.cmd @@ -0,0 +1,7 @@ +@echo off +setlocal + +if exist *.prn del *.prn +if exist *.lst del *.lst +if exist *.err del *.err +if exist *.rel del *.rel diff --git a/Source/BPBIOS/Z34RCP11/cledinst.com b/Source/BPBIOS/Z34RCP11/cledinst.com new file mode 100644 index 00000000..c26a3cf0 Binary files /dev/null and b/Source/BPBIOS/Z34RCP11/cledinst.com differ diff --git a/Source/BPBIOS/Z34RCP11/cledsave.com b/Source/BPBIOS/Z34RCP11/cledsave.com new file mode 100644 index 00000000..dde04bc1 Binary files /dev/null and b/Source/BPBIOS/Z34RCP11/cledsave.com differ diff --git a/Source/BPBIOS/Z34RCP11/nzrcp.z80 b/Source/BPBIOS/Z34RCP11/nzrcp.z80 new file mode 100644 index 00000000..52b844e3 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/nzrcp.z80 @@ -0,0 +1,3010 @@ + +; New Name: NZRCP.Z80 Joe Wright July 1987 + +; Program: Z34RCP +; Version: 1.0 +; Description: Resident Command Package (RCP) for ZCPR34 +; Author: Jay Sage +; Date: March 1, 1987 +; Derivation: SYSRCP (Richard Conn) and many other contributions + +; ZCPR34 is copyright 1987 by Jay P. Sage. All rights reserved. End-user +; distribution and duplication permitted for non-commercial purposes only. +; Any commercial use of ZCPR34, defined as any situation where the duplicator +; recieves revenue by duplicating or distributing ZCPR34 by itself or in +; conjunction with any hardware or software product, is expressly prohibited +; unless authorized in writing by Jay P. Sage. + +version equ 2 +subver equ 4 + +; Vers 2.4 - Add whlchk subroutine for indirect addressing of wheel byte. +; 4 Apr 88 - Fixed command list routines. +; Joe Wright - Inhibit SPOP if there is no shell. Allow shstks = 1. + +; Vers 2.3 - Reset command, after calling F37, jumps to 0. +; 22 Feb 88 + +; Vers 2.2 - Modified for use of Z34CMN.LIB and NZ-COM. +; 31 Dec 87 +; Joe Wright + + +; Vers 2.1 - R command uses ZRDOS function 37 to reset drives. +; 6 Sep 87 - WHL command changed, WHLQ disappears. +; Joe Wright - REG command expanded. Add REG E (program error byte) +; - SPOP command added. Pops the shell stack + +;============================================================================= +; +; D E F I N I T I O N S S E C T I O N +; +;============================================================================= + + name ('RCP') + + maclib z34cmn.lib ; Defines ZCPR system addresses + maclib z34defn.lib ; Defines offsets in Z34 command processor + maclib z34mac.lib ; Macros + maclib sysdef.lib ; Common logic, sys, ascii defines + maclib nzrcp.lib ; Defines command options + +;============================================================================= +; +; E N T R Y C O D E S E C T I O N +; +;============================================================================= + +start: + db 'Z3RCP' ; Package ID + + +;---------------------------------------- + +; Command table + + db cmdsize ; Length of each command name + cmdtbl ; Dispatch table from Z33RCP.LIB + db 0 ; Marks end of command jump table + + +;---------------------------------------- + +; Name of RCP + +; This block allows the 'H' command and/or the SHOW utility to display a name +; and version number for this RCP as well as the commands that are supported. + +rcpname: + idstring ; From macro in Z33RCP.LIB + +; Include only those code sections that are required. + +; include rcph ; 'H' help (command list) command + page + +; RCP-H.Z80 'H' Command + +;============================================================================= +; +; H E L P C O M M A N D +; +;============================================================================= + +; This command displays a list of all resident commands that are supported, +; including those in the CPR (command processor), RCP, and FCP. + +clist: + +; Print the CPR-resident command names + + if listcpr + + call print ; Print "CPR" + db lf + db 'CP','R'+80h +; + ld hl,(ccp) ; CCP location from Z3ENV + ld de,offcmd ; Offset to CPR command table + add hl,de + call cmdlist ; Display the list of commands + + endif ;listcpr + +; Print the FCP-resident command names + + if listfcp + + ld hl,(fcp) + ld a,h + or l + jr z,rcplist ; No FCP + + ld a,(hl) + or a + jr z,rcplist ; FCP removed + + call print ; Print header for FCP + db lf + db 'FC','P'+80h + ld de,5 + add hl,de ; Point to FCP command table + call cmdlist + + endif ;listfcp + +; Print the RCP-resident command names + +rcplist: + if listrcp + + call crlf ; Skip a line + ld hl,rcpname ; Print RCP name + call printhl + ld hl,start+5 ; Point to RCP command table + + else + + ret + + endif ;listrcp + + ; Fall through to CMDLIST + +;---------------------------------------- + +; Subroutine to display list of commands in a command table (code above +; falls through to this routine -- do not move it). The commands are +; displayed 5 per line with 8 character spaces allowed for each command +; (subject to equates below). + +cmdlist: + call crlf ; Start with new line + ld e,(hl) ; Get size of each command name into DE + ld d,0 + inc hl ; Point to name of first command + ld c,cmdsline ; Set names-per-line value + +cmdlist1: + ld a,(hl) ; Get first character of the command name + or a ; See if it is null + jr nz,cmdlist1a ; If not, continue + ld a,cmdsline ; See if we are already on a new line + cp c + call nz,crlf ; If not, skip a line + ret + +cmdlist1a: + if noshow ; Option to suppress wheel-limited cmds + rla ; Shift high bit of name into carry bit + jr nc,cmdlist2 ; If not restricted, go on + call whlchk ; Check wheel byte + jr nz,cmdlist2 ; If wheel set, continue as usual + add hl,de ; Otherwise skip this command + jr cmdlist5 + endif + +; Print leading spaces between names + +cmdlist2: + ld a,cmdspace ; Spacing between command names + sub e ; Less length of each command name + ld b,a + ld a,' ' +cmdlist3: + call conout + djnz cmdlist3 + +; Print name of command + + ld b,e ; Length of each name into B +cmdlist4: + ld a,(hl) ; Get command name character + call conout + inc hl ; Point to next + djnz cmdlist4 + + dec c ; Decrement count of names on this line + jr nz,cmdlist5 ; Branch if room for more names + call crlf ; Otherwise, end this line and + ld c,cmdsline ; ..reset count for another line of commands + +; Skip to next command name + +cmdlist5: + inc hl ; Skip jump vector + inc hl + jr cmdlist1 ; Back to process next name + +; End RCP-H.Z80 + +;============================================================================= +; +; P O P S H E L L S T A C K C O M M A N D +; +;============================================================================= + +; +; POP the Shell Stack +; + if spopon + +; Pop the shell stack + +spop: ld hl,(z3env+1eh) ; SHSTK (indirect) + ld a,h + or l + ret z ; No shell stack + + ex de,hl ; SHSTK to DE + ld hl,(z3env+20h) ; SHSTKS to L, SHSIZE to H + push hl ; Save SHSIZE + xor a ; Your basic null in A + ld b,l + dec b ; SHSTKS-1 in B + jr z,sp0a ; Clear one entry + + push de ; Save SHSTK + ld e,h ; SHSIZE to E + ld d,a ; Clear D + ld h,a ; Clear H.. + ld l,a ; ..and L +sp0: add hl,de ; Multiply SHSIZE*(SHSTKS-1) + djnz sp0 + ld b,h + ld c,l ; Length to BC + ex de,hl ; SHSIZE to HL + pop de ; Get SHSTK (destination) + add hl,de ; SHSTK+SHSIZE to HL (Source) + ldir + +sp0a: pop bc ; Get SHSIZE in B +sp1: ld (de),a ; Clear last entry + inc de + djnz sp1 + ret + endif ; SPOPON + + + if clson +; include rcpcls ; 'CLS' clear screen command + page + +; RCP-CLS.Z80 'CLS' Command + +;============================================================================= +; +; C L E A R S C R E E N C O M M A N D +; +;============================================================================= + +; Command: CLS +; Function: To clear the CRT screen +; Comments: The setting of the CLSTCAP equate determines whether this +; command uses the TCAP information or not. If not, it uses the +; clear-screen string passed in macro CLSSTR. That string should +; end with the high bit set. + +cls: + if clstcap ; If using TCAP for clear screen string + + ld a,(z3env+80h) ; Get beginning of tcap + cp ' '+1 ; See if blank or perhaps null + jr nc,cls1 ; If not, go to clear screen code + call print ; If blank, then give error message + db ' No TCA','P'+80h + ret + +cls1: ld hl,z3env+97h ; Point to beginning of clear screen string + jp printhl ; Display it + + else ; Not using tcap + + call print + clsstr ; String from Z33RCP.LIB + ret + + endif ;clstcap + +; End RCP-CLS.Z80 + + endif ;clson + + if reson +; include rcpr ; 'R' disk reset command + page + +; RCP-R.Z80 'R' command + +;============================================================================= +; +; D I S K R E S E T C O M M A N D +; +;============================================================================= + +; Command: RESET +; Function: Reset the disk system +; Comments: ZRDOS does not require a disk system reset when disks are +; changed, but directory programs will not show the correct +; size if this is not done. It is also good practice. Since +; no warm boot performed, the disk in drive A need not have the +; operating system on it. +; Ver 2.1 Now logs all drives off and forces fixed and ram disks to +; re-log. +reset: + if resmsg ; If displaying a reset message + call print ; Report action + dc ' Reset' + endif ;resmsg + + ld de,-1 ; All 16 drives + ld c,37 ; Disks reset ZRDOS function + call bdos + ld c,13 ; Reset disk system + jp bdos + +; End RCP-R.Z80 + + endif ;reson + + if tston +; include rcptst ; 'TST' error test command + page + +; RCP-TST.Z80 'TST' Command + +;============================================================================= +; +; E R R O R T E S T C O M M A N D +; +;============================================================================= + +; Command: TST +; Function: To set the message buffer program error flag based on +; error count reported by M80 or L80 +; Syntax: TST PN where PN is (at least) the first letter of M80 or L80 + +testerr: + +; Check for name of program to test + + ld a,(fcb1+1) ; Get first character in program name + + if testm80 + ld hl,m80f ; Preset for m80 test counts + ld de,m80w + cp 'M' + jr z,testcount + endif ; Testm80 + + if testf80 + ld hl,f80f + ld de,f80w + cp 'F' + jr z,testcount + endif ; Testf80 + +; If no match, give error message + + call print + db 'bad nam','e'+80h + +testcount: + ld a,(hl) ; Test first error count word + inc hl + or (hl) + ex de,hl ; Test second word + or (hl) + inc hl + or (hl) + ld hl,z3msg+6 ; Point to program error flag + ld (hl),0 ; Clear it + ret z ; If counts were zero, we are done + ld (hl),0ffh ; Else set the error flag + ret + +; End RCP-TST.Z80 + + endif ;tston + + if spaceon +; include rcpsp ; 'SP' space on disk command + page + +; RCP-SP.Z80 'SP' Command + +;============================================================================= +; +; D I S K S P A C E C O M M A N D +; +;============================================================================= + +; Command: SP +; Function: Shows space remaining on designated drive +; Syntax: SP [DIR:|DU:] +; Comments: This code can be called by several other RCP commands so that +; they can show the space remaining on the disk after their +; operation. + + if [erasp or cpsp or dirsp] +crspace: ; Used to call space after other subroutines + call crlf ; Start new line + endif ;[erasp or cpsp or dirsp] + +space: + ld a,(fcb1) ; Determine requested drive + or a ; If drive explicitly selected + jr nz,space1 ; ..then skip + + ld c,25 ; BDOS get current drive function + call bdos + inc a ; Shift to range 1..16 + +space1: + dec a ; Shift to range 0..15 + ld e,a ; Save in E for selecting disk below + add 'A' ; Convert to letter and + ld (seldrv),a ; save in message string below + ld c,14 ; BDOS select disk function + call bdos ; Not needed if no drive selected, but smallest + ; ..possible code size this way. + +; Here we extract the following disk parameter information from the disk +; parameter block (DPB): +; BLKSHF: block shift factor (1 byte) +; BLKMAX: max number of blocks on disk (2 bytes) + +dparams: + ld c,31 ; BDOS get disk parameters function + call bdos + inc hl ; Advance to block shift factor byte + inc hl + ld a,(hl) ; Get value and + ld (blkshf),a ; ..save it in code below + inc hl ; Advance to max block number word + inc hl + inc hl + ld e,(hl) ; Get value into HL + inc hl + ld d,(hl) + inc de ; Add 1 for max number of blocks + +; Compute amount of free space left on disk + +dfree: + ld c,27 ; BDOS get allocation vector function + push de ; Save BLKMAX value + call bdos ; Get allocation vector into HL + ld b,h ; Copy allocation vector to BC + ld c,l + pop hl ; Restore MAXBLK value to HL + ld de,0 ; Inititialize count of free blocks + +; At this point we have +; BC = allocation vector address +; DE = free block count +; HL = number of blocks on disk + +free1: + push bc ; Save allocation address + ld a,(bc) ; Get bit pattern of allocation byte + ld b,8 ; Set to process 8 blocks +free2: + rla ; Rotate allocated block bit into carry flag + jr c,free3 ; If set (bit=1), block is allocated + inc de ; If not set, block is not allocated, so + ; ..increment free block count +free3: + ld c,a ; Save remaining allocation bits in C + dec hl ; Count down number of blocks on disk + ld a,l ; See if we are down to zero + or h + jr z,free4 ; Branch if no more blocks to check + ld a,c ; Get back current allocation bit pattern + djnz free2 ; Loop through 8 bits + pop bc ; Get pointer to allocation vector + inc bc ; Point to next allocation byte + jr free1 ; Continue by processing next allocation byte + +free4: + pop bc ; Clean up stack + ex de,hl ; Free block count to HL +blkshf equ $+1 ; Pointer for in-the-code modification + ld a,0 ; Get block shift factor + sub 3 ; Convert to log base 2 of K per block + jr z,free6 ; Done if single density (1k per block) + +; Convert for blocks of more than 1K each + +free5: + add hl,hl + dec a + jr nz,free5 + +; At this point HL = amount of free space on disk in K + +free6: + call print + db ' Space on ' +seldrv: db 0 ; Modified above to contain drive letter + db ':',[' '+80h] + +; Display decimal value of HL + + ld b,0 ; Initialize count of digits already printed + ld de,10000 ; Divisor in DE + call decdsp ; Print digit (or space if leading '0') + ld de,1000 + call decdsp + call decdsp3 ; Display hundreds, tens, and units + ld a,'K' + jp conout ; Final return from space routine + +; End RCP-SP.Z80 + + endif ;spaceon + + if diron +; include rcpdir ; 'DIR' directory command + page + +; RCP-DIR.Z80 'DIR' Command + +;============================================================================= +; +; D I R E C T O R Y D I S P L A Y C O M M A N D +; +;============================================================================= + +; Command: DIR +; Function: Display a directory of the files on disk +; Syntax: DIR Displays the DIR files +; DIR S Displays the SYS files +; DIR A Display both DIR and SYS files +; DIR /S Equivalent to DIR *.* S +; DIR /A Equivalent to DIR *.* A + +dir: + call retsave ; Save return address and set stack + +; See if FCB should be made wild (all '?') + + ld hl,fcb1+1 ; Point to file name in FCP + ld a,(hl) ; Get first character of filename + + if slashchk ; Allow "DIR /S" and "DIR /A" formats + cp '/' ; If name does not start with '/' + jr nz,dir01 ; ..branch and process normally + inc hl ; Point to second character + ld a,(hl) ; Get option character after slash + ld (fcb2+1),a ; ..and put it into second FCB + dec hl ; Back to first character + ld a,' ' ; Simulate empty FCB + endif ;slashchk + +dir01: + ld b,11 ; Prepare to fill FCB name and type with '?' + cp ' ' ; See if no file spec given + ld a,'?' ; Get ready to fill with '?' + call z,fillp ; ..carry out fill + + if nosys ; Suppress-SYS-file-if-no-wheel option + call whlchk ; Check wheel byte + jr z,dirnly ; If wheel off, ignore options + endif + + ld a,(fcb2+1) ; Get first char of 2nd file name + ld b,1 ; Set for both dir and sys files + cp allflag ; SYS and DIR flag specifier? + jr z,dirpr ; Got system specifier + dec b ; B=0 for sys files only + cp sysflag ; SYS only? + jr z,dirpr + +dirnly: ld b,80h ; Must be dir-only selection + +; DIRECTORY PRINT ROUTINE; ON ENTRY, B REG IS SET AS FOLLOWS: +; 0 FOR ONLY SYSTEM FILES, 80H FOR ONLY DIR FILES, 1 FOR BOTH +; +dirpr: + ld a,b ; Get systst flag + call getdir ; Load and sort directory + jp z,prfnf ; Print no file message + ld e,width ; Count down to 0 +; +; ENTRY PRINT LOOP; ON ENTRY, HL PTS TO FILES SELECTED (TERMINATED BY 0) +; AND E IS ENTRY COUNTER +; +dir3: + ld a,(hl) ; Check for done + or a + if dirsp and spaceon + jp z,spaexit ; Show space when done + else + jp z,exit ; Exit if done + endif ; Dirsp and spaceon + ld a,e ; Get entry counter + or a ; Output if 4 entries printed in line + jr nz,dir3a ; Continue + call crlf ; New line + ld e,width ; Reset entry count + ld a,e ; Get entry count +dir3a cp width ; First entry? + jr z,dir4 + call print +; + if wide +; + db ' ' ; 2 spaces + db fence ; Then fence char + db ' '+80h ; Then 1 more space +; + else +; + db ' ' ; Space + db fence+80h ; Then fence char +; + endif ; Wide +; +dir4: + call prfn ; Print file name + call break ; Check for abort + dec e ; Decrement entry counter + jr dir3 + +; End RCP-DIR.Z80 + + endif ;diron + + if eraon +; include rcpera ; 'ERA' erase command + page + +; RCP-ERA.Z80 'ERA' Command + +;============================================================================= +; +; E R A S E C O M M A N D +; +;============================================================================= + +;Command: ERA +;Function: Erase files +;Forms: +; ERA Erase Specified files and print their names +; ERA I Erase Specified files and print their names, but ask +; for verification before Erase is done + +era: + call retsave + ld a,(fcb2+1) ; Get eraflg if it's there + ld (eraflg),a ; Save it as a flag + ld a,1 ; Dir files only + call getdir ; Load directory of files + jp z,prfnf ; Abort if no files +; +; MAIN ERASE LOOP +; +era1: + call break ; See if user wants to stop + push hl ; Save ptr to file + call prfn ; Print its name + ld (nxtfile),hl ; Save ptr to next file + pop hl ; Get ptr to this file + call rotest ; Test file pted to by hl for r/o + jr nz,era3 +eraflg equ $+1 ; Address of flag + ld a,0 ; 2nd byte is flag + cp 'I' ; Is it an inspect option? + jr nz,era2 ; Skip prompt if it is not + call eraq ; Erase? + jr nz,era3 ; Skip if not +era2: + ld de,fcb1+1 ; Copy into fcb1 + ld b,11 ; 11 bytes + call blkmov + call initfcb1 ; Init fcb + ld c,19 ; Delete file + call bdos +era3: + ld hl,(nxtfile) ; Hl pts to next file + ld a,(hl) ; Get char + or a ; Done? + if erasp and spaceon + jp z,spaexit + else + jp z,exit + endif ; Erasp and spaceon + call crlf ; New line + jr era1 + +; End RCP-ERA.Z80 + + endif ;eraon + + if lton +; include rcplt ; 'LIST' and 'TYPE' commands + page + +; RCP-LT.Z80 + +;============================================================================= +; +; L I S T A N D T Y P E C O M M A N D S +; +;============================================================================= + +;Command: LIST +;Function: Print out specified file on the LST: Device +;Forms: +; LIST Print file (NO Paging) +;Notes: +; The flags which apply to TYPE do not take effect with LIST + + if liston +list: +; +; CHECK FOR WHEEL APPROVAL IF OPTION ENABLED + + + call retsave + ld a,0ffh ; Turn on printer flag + jr type0 + endif ;liston + +;Command: TYPE +;Function: Print out specified file on the CON: Device +;Forms: +; TYPE Print file +; TYPE P Print file with paging flag +;Notes: +; The flag PGDFLG defines the letter which toggles the paging +; facility (P in the forms section above) +; The flag PGDFLT determines if TYPE is to page by default +; (PGDFLT=TRUE if TYPE pages by default); combined with +; PGDFLG, the following events occur -- +; If PGDFLT = TRUE, PGDFLG turns OFF paging +; If PGDFLT = FALSE, PGDFLG turns ON paging +; +type: +; +; CHECK FOR WHEEL APPROVAL IF OPTION ENABLED +; +; + call retsave + xor a ; Turn off printer flag +; +; ENTRY POINT FOR CPR LIST FUNCTION (LIST) +; +type0: + if liston + ld (prflg),a ; Set flag + endif ; Liston + + ld a,(fcb2+1) ; Get page flag + ld (pgflg),a ; Save it as a flag + ld a,1 ; Select dir files + call getdir ; Allow ambiguous files (HL points to buffer) + jp z,prfnf ; No files + jr typex2 + + ; Entry point for successive files +typex: + ld hl,(nxtfile) ; Get ptr to next file + ld a,(hl) ; Any files? + or a + jp z,exit + + if liston + ld a,(prflg) ; Check for list output + or a ; 0=type + jr z,typex1 + ld a,cr ; Bol on printer + call lcout + ld a,ff ; Form feed the printer + call lcout + jr typex2 + endif ; Liston + +typex1: +; LDA PAGCNT ; If we've just done so, + push hl + ld hl,(pagcnt) + ld a,(hl) + pop hl + cp nlines-2 ; Don't type another + call nz,pagebreak ; Page break message +typex2: + ld de,fcb1+1 ; Copy into fcb1 + ld b,11 ; 11 bytes + call blkmov + ld (nxtfile),hl ; Set ptr to next file + call initfcb1 ; Init fcb1 + ld c,15 ; Open file + call bdos + inc a ; Set error flag + jp z,prfnf ; Abort if error +; MVI A,NLINES-2 ; Set line count +; STA PAGCNT + ld hl,(pagcnt) + ld (hl),nlines-2 + ld a,cr ; New line + call lcout + ld a,lf + call lcout + ld bc,080h ; Set char position and tab count + ; (b=0=tab, c=080h=char position) +; +; MAIN LOOP FOR LOADING NEXT BLOCK +; +type2: + ld a,c ; Get char count + cp 80h + jr c,type3 +; PUSH H ; Read next block + push bc + ld de,fcb1 ; Pt to fcb + ld c,20 ; Read record + call bdos + or a ; Set flags + pop bc +; POP H + jr nz,typex ; End of file? + ld c,0 ; Set char count + ld hl,tbuff ; Pt to first char +; +; MAIN LOOP FOR PRINTING CHARS IN TBUFF +; +type3: + ld a,(hl) ; Get next char + and 7fh ; Mask out msb + cp 1ah ; End of file (^z)? + jr z,typex ; Next file if so +; +; OUTPUT CHAR TO CON: OR LST: DEVICE WITH TABULATION +; + cp cr ; Reset tab count? + jr z,type4 + cp lf ; Reset tab count? + jr z,type4 + cp tab ; Tab? + jr z,type5 +; +; OUTPUT CHAR AND INCREMENT CHAR COUNT +; + call lcout ; Output char + inc b ; Increment tab count + jr type6 +; +; OUTPUT OR AND RESET TAB COUNT +; +type4: + call lcout ; Output or + ld b,0 ; Reset tab counter + jr type6 +; +; TABULATE +; +type5: + ld a,' ' ; + call lcout + inc b ; Incr pos count + ld a,b + and 7 + jr nz,type5 +; +; CONTINUE PROCESSING +; +type6: + inc c ; Increment char count + inc hl ; Pt to next char + call break ; Check for abort + jp z,typex ; Skip + jr type2 +; +; SEND OUTPUT TO LST: OR CON:, AS PER THE FLAG +; RETURN WITH Z IF ABORT +; +lcout: + push hl ; Save regs + push bc + ld e,a ; Char in e + ld c,2 ; Output to con: + if liston +prflg equ $+1 ; Pointer for in-the-code modification + ld a,0 ; 2nd byte is the print flag + or a ; 0=type + jr z,lc1 + ld c,5 ; Output to lst: + endif ; Liston + +lc1: + push de ; Save char + call bdos ; Output char in e + pop de ; Get char + ld a,e + cp lf + jr nz,lc2 + if liston + ld a,(prflg) ; Output to lst:? + or a ; Nz = yes + jr nz,lc2 + endif ; Liston +; +; CHECK FOR PAGING +; +; LXI H,PAGCNT ; Count down + ld hl,(pagcnt) + dec (hl) + jr nz,lc2 ; Jump if not end of page + ld (hl),nlines-2 ; Refill counter +pgflg equ $+1 ; Pointer to in-the-code buffer + ld a,0 ; 2nd byte is the paging flag + cp pgdflg ; Page default override option wanted? +; + if pgdflt ; If paging is default +; + jr z,lc2 ; Pgdflg means no paging +; + else +; + jr nz,lc2 ; Pgdflg means page +; + endif ; Pgdflt +; + call pagebreak ; Print page break message + jp z,typex ; Z to skip +lc2: + pop bc ; Restore regs + pop hl + ret +; +; PRINT PAGE BREAK MESSAGE AND GET USER INPUT +; ABORT IF ^C, RZ IF ^X +; +pagebreak: + push hl ; Save hl + call print + db cr,lf,' Typing',' '+80h + ld hl,fcb1+1 ; Print file name + call prfn + call dash ; Print dash + call conin ; Get input + pop hl ; Restore hl + push af + call crlf ; New line + pop af + jp break1 +; +; End RCP-LT.Z80 + + endif ;lton + + if renon +; include rcpren ; 'REN' rename command + page + +; RCP-REN.Z80 + +;Section 5E +;Command: REN +;Function: To change the name of an existing file +;Forms: +; REN = Perform function +; +ren: +; +; CHECK FOR WHEEL APPROVAL IF OPTION ENABLED +; + + call retsave +; +; +; STEP 1: CHECK FOR FILE 2 BEING AMBIGUOUS +; + ld hl,fcb2+1 ; Can't be ambiguous + call ambchk1 +; +; STEP 2: LOG INTO USER AREA +; + call logusr ; Log into user area of fcb1 +; +; STEP 3: SEE IF OLD FILE IS R/O +; + ld hl,fcb1 ; Pt to 1st fcb + push hl + ld de,fcb2 ; Pt to 2nd file + push de ; Save ptr + ld a,(hl) ; Get 1st's drive + ld (de),a ; Stuff into second fcb + ld c,17 ; Look for file + call bdos + inc a + jp z,prfnf + call getsbit ; Get ptr to entry in tbuff + ex de,hl ; Hl pts to entry + inc hl ; Pt to fn + call rotest ; See if file is r/o + jp nz,exit +; +; STEP 4: SEE IF NEW FILE ALREADY EXISTS +; EXTEST PERFORMS A NUMBER OF CHECKS: +; 1) AMBIGUITY +; 2) R/O +; 3) IF FILE EXISTS AND NOT R/O, PERMISSION TO DELETE +; + call extest + jp z,exit ; R/o or no permission +; +; STEP 5: EXCHANGE FILE NAME FIELDS FOR RENAME +; + pop de ; Pt to old + pop hl ; Pt to new + push hl ; Save ptr + ld b,12 ; 12 bytes + call iswap1 +; +; STEP 6: RENAME THE FILE +; + pop de ; Get ptr to fcb + ld c,23 ; Rename + call bdos + inc a ; Set zero flag if error + jp z,prfnf ; Print no source file message + jp exit +; +; +; End RCP-REN.Z80 + + endif ;renon + + if proton +; include rcpprot ; 'PROT' file attribute setting command + page + +; RCP-PROT.Z80 + +;Section 5F +;Command: PROT +;Function: To set the attributes of a file (R/O and SYS) +; +;Form: +; PROT afn RSI +;If either R or S are omitted, the file is made R/W or DIR, resp; +;R and S may be in any order. If I is present, Inspection is enabled. + +att: + call retsave + xor a ; Set no inspect + ld (inspect),a + ld hl,0 ; Set r/o and sys attributes off + ld de,fcb2+1 ; Pt to attributes + ld b,3 ; 3 chars max +att1: + ld a,(de) ; Get char + inc de ; Pt to next + cp 'I' ; Inspect? + jr z,atti + cp 'R' ; Set r/o? + jr z,attr + cp 'S' ; Set sys? + jr z,atts +att2: + djnz att1 + jr att3 +atti: + ld (inspect),a ; Set flag + jr att2 +attr: + ld h,80h ; Set r/o bit + jr att2 +atts: + ld l,80h ; Set sys bit + jr att2 +att3: + ld (fatt),hl ; Save file attributes + ld a,1 ; Select dir and sys files + call getdir ; Load directory + jp z,prfnf ; No file error + jr att5 +att4: + ld hl,(nxtfile) ; Pt to next file + ld a,(hl) ; End of list? + or a + jp z,exit + call crlf ; New line +att5: + call break ; Check for possible abort + push hl ; Save ptr to current file + call prfn ; Print its name + ld (nxtfile),hl ; Save ptr to next file + call print + db ' Set to R','/'+80h + ld hl,(fatt) ; Get attributes + ld c,'W' ; Assume r/w + ld a,h ; Get r/o bit + or a + jr z,att6 + ld c,'O' ; Set r/o +att6: + ld a,c ; Get char + call conout + ld a,l ; Get sys flag + or a ; Set flag + jr z,att7 + call print + db ' and SY','S'+80h +att7: +inspect equ $+1 ; Ptr for in-the-code modification + ld a,0 ; Get inspect flag + or a ; Z=no + pop hl ; Get ptr to current file + jr z,att8 + call eraq1 ; Ask for y/n + jr nz,att4 ; Advance to next file if not y +att8: + ld de,fcb1+1 ; Copy into fcb1 + ld b,11 ; 11 bytes + call blkmov +fatt equ $+1 ; Ptr for in-the-code modification + ld hl,0 ; Get attributes + dec de ; Pt to sys byte + dec de + ld a,l ; Get sys flag + call attset ; Set attribute correctly + dec de ; Pt to r/o byte + ld a,h ; Get r/o flag + call attset + ld de,fcb1 ; Pt to fcb + ld c,30 ; Set attributes + call bdos + jr att4 +attset: + or a ; 0=clear attribute + jr z,attst1 + ld a,(de) ; Get byte + or 80h ; Set attribute + ld (de),a + ret +attst1: + ld a,(de) ; Get byte + and 7fh ; Clear attribute + ld (de),a + ret +; +; End RCP-PROT.Z80 + + endif ;proton + + if cpon +; include rcpcp ; 'CP' file copying command + +; RCP-CP.Z80 + +;============================================================================= +; +; F I L E C O P Y C O M M A N D +; +;============================================================================= + +; Command: CP +; Function: Copy a file from one place to another +; Syntax: CP destfile=srcfile +; CP srcfile +; Comments: Both file specifications can include a directory specification. +; If only one file name is given, then the current directory and +; the source file name are assumed for the destination. + +copy: + call retsave + +; If new is blank, make it the same name and type as old + + ld de,fcb1+1 ; Point to destination file name + ld a,(de) ; Get first character + cp ' ' ; If not blank (no name) + jr nz,copy0 ; ..then branch to copy + + ld hl,fcb2+1 ; Copy source name into destination FCB + ld b,11 ; Name and type are 11 bytes + call blkmov + +; See if destination is same as source, and abort if so + +copy0: + ld hl,fcb1 ; Set up pointers to two files + ld de,fcb2 + push hl + push de + inc hl ; Point to names of files + inc de + ld b,13 ; Compare 13 bytes (name, type, and user #) +copy1: + call comp + jr nz,copy2 ; If they differ, go on with copy + + ld c,25 ; Get-current-disk BDOS function + call bdos ; Get it in case no drive given explicitly + inc a ; Shift to range 1..16 + ld b,a ; ..and keep value in B + pop de ; Restore pointers to FCBs + pop hl + ld a,(de) ; Get drive of source file + ld c,a ; ..and save it in C + or a ; Is it default drive? + jr nz,copy1a ; Branch if drive made explicit + ld c,b ; Otherwise, copy default drive into C +copy1a: + ld a,(hl) ; Get drive of destination file + or a ; Is it default drive? + jr nz,copy1b ; Branch if drive made explicit + ld a,b ; Otherwise, get current drive +copy1b: + cp c ; Compare the two drives specified + jr nz,copy3 ; Branch if they are different + jr cperr ; Branch to error code if they are the same + +copy2: + pop de ; Clean up the stack + pop hl + +; Make note of the user numbers of the two files + +copy3: + ld a,(fcb1+13) ; Get destination user number + ld (usrdest),a + ld a,(fcb2+13) ; Get source user number + ld (usrsrc),a + +; Set up new FCB for source file and open the source + + call define ; Define buffer addresses dynamically + ld hl,(srcfcb) ; Get address to use for new source FCB + push hl + ex de,hl ; Copy file data to new FCB + ld b,12 + call blkmov + call logsrc ; Log in user number of source file + pop hl ; Initialize the source file FCB + call initfcb2 + ld c,15 ; Open file + call bdos + inc a ; Check for error + jp z,prfnf ; Branch if file not found + +; Make sure destination file does not already exist + + call logdest ; Log into destination s user area + call extest ; Test for existence of file + jp z,exit ; Branch if it exists + +; Create destination file + + ld de,fcb1 ; Point to destination FCB + ld c,22 ; BDOS make-file function + call bdos + inc a ; Test for error (no directory space) + jr nz,copy5 ; Branch if OK + +; Report file error + +cperr: + call print + db ' Copy','?'+80h + jp exit + +; Copy source to destination with buffering + +;++++++++++ this should be done by changing DMA address to save all the +; buffer swapping + +copy5: + call logsrc ; Log in source user area + ld b,0 ; Initialize counter + ld hl,(cbuff) ; Initialize buffer pointer + +copy5a: + push hl ; Save address and counter + push bc + ld hl,(srcfcb) ; Point to source file FCB + ex de,hl ; Put it in DE for BDOS call + ld c,20 ; BDOS read-sequential function + call bdos + pop bc ; Get counter and address + pop de + or a ; Read Ok? + jr nz,copy5b ; Branch if end of file + + push bc ; Save counter + ld hl,tbuff ; Copy from 80h to buffer + ld b,128 ; 128 bytes + call blkmov + ex de,hl ; HL points to next buffer address + pop bc ; Get counter back + inc b ; Increment it + ld a,b ; See if buffer full + cp cpblocks + jr nz,copy5a ; If not, go back for more + +copy5b: + ld a,b ; Get count of blocks loaded into buffer + or a ; Are there any? + jr z,copy6 ; Branch if not (we are done) + + push bc ; Save count + call logdest ; Log into destination user number +cbuff equ $+1 ; Pointer for in-the-code modification + ld hl,0 ; Point to beginning of copy buffer +copy5c: + ld de,tbuff ; Copy into tbuff + ld b,128 ; 128 bytes + call blkmov + push hl ; Save pointer to next block + ld de,fcb1 ; Point to destination file FCB + ld c,21 ; Write the block + call bdos + or a + jr nz,cperr ; Branch on error (disk full of write error) + pop hl ; Get back pointer to next block + pop bc ; Get count +; djnz copy5 ; Work through the blocks + dec b ; + jr z,copy5 ; + push bc ; Save count + jr copy5c ; Back for another bufferful + +; Close the destination file + +copy6: + call logdest ; Log into destination user number + ld de,fcb1 ; Point to destination FCB + ld c,16 ; Close file + call bdos + call print + db ' Don','e'+80h + + if cpsp and spaceon + jp spaexit ; Report space remaining on destination drive + else + jp exit + endif ;cpsp and spaceon + +; Log into user number of source file + +logsrc: +usrsrc equ $+1 ; Pointer for in-the-code modification + ld a,0 ; Get user number + jr setusrrel ; Local jump to save code + +; Log into user number of destination file + +logdest: +usrdest equ $+1 ; Pointer for in-the-code modification + ld a,0 ; Get user number +setusrrel: + jp setusr + +; End RCP-CP.Z80 + + endif ;cpon + + if peekon or pokeon or porton +; include rcpiom ; 'PEEK', 'POKE', 'PORT' commands + page + +; RCP-IOM.Z80 + +; Command: PEEK +; Function: Display memory contents +; +; Form: +; PEEK startadr 256 bytes displayed +; PEEK startadr endadr range of bytes displayed + + if peekon + +peek: + call retsave + + ld hl,tbuff+1 ; Find first number +nxtpeek equ $+1 ; Pointer for in-the-code modification + ld de,100h ; Default peek address if none + call sksp ; Skip to first token (if any) + call nz,hexnum ; Get start address if any + + push de ; Save starting address + ld bc,255 ; Compute default ending address + ex de,hl + add hl,bc + + if peekchk ; Check for overflow + jr nc,peek0 ; If no overflow past FFFF, go on + ld hl,0ffffh ; Else use FFFF as ending address +peek0: + endif ;peekchk + + ex de,hl ; End address in DE + call sksp ; Skip to next token (if any) + call nz,hexnum ; Get 2nd number in DE (else default) + +peek1: + pop hl ; HL is start address, DE is end address + + if peekhdr + + push hl ; Save starting address again + ld b,8 ; Output leading spaces +peek0a: + call print + db ' '+80h + djnz peek0a + + ld b,16 ; Display 16 column headers +peek0b: + ld a,l + and 03h + call z,spac + + call spac + call spac + ld a,l ; Get low byte of address + and 0fh ; Display low hex digit + call pah + inc hl + djnz peek0b + + if peekbdr + call crlf + ld b,8 +peek0c: + call print + db ' '+80h + djnz peek0c + ld b,16 +peek0d: + ld a,l + and 3 + call z,spac + inc l + call print + db ' -', '-'+80h + djnz peek0d + endif ;peekbdr + + pop hl ; Restore starting address + + endif ;peekhdr + + ld c,0ffh ; Use C as continue flag + call peek2 ; Do peek + ld (nxtpeek),hl ; Set continued peek address + jp exit + +peek2: + ld a,c ; Check continuation flag + or a ; + ret z ; + +; Print line header + +peek2a: + call crlf ; New line + ld a,h ; Print address + call pashc + ld a,l + call pahc + call dash ; Print leader + ld b,16 ; 16 bytes to display + push hl ; Save start address + + ; Print hex values for 16 bytes + +peek3: + ld a,l + and 03h + call z,spac + + ld a,(hl) ; Get next byte + call pashc ; Print with leading space + + ; Check for last address + ; If c is already 0, leave it that way. + ; Otherwise check for end address and if so + ; Set c to zero. + + ld a,c ; See if continue flag already cleared + or a + jr z,peek3a ; If so, skip test + ld a,h + sub a,d ; See if h = d + ld c,a + ld a,l + sub a,e ; See if l = e + or c ; Combine two tests + ld c,a + +peek3a: inc hl ; Pt to next + djnz peek3 + + ; Print ascii equivalents for 16 bytes + + pop hl ; Pt to first address again + ld b,16 ; 16 bytes + call print ; Space and fence + db ' ' + db fence+80h + push bc ; Save flag in c +peek4: + ld a,(hl) ; Get next byte + ld c,'.' ; Assume dot + and 7fh ; Mask it + cp ' ' ; Dot if less than space + jr c,peek5 + cp 7fh ; Don't print del + jr z,peek5 + ld c,a ; Char in c +peek5: + ld a,c ; Get char + call conout ; Send it + inc hl ; Pt to next + djnz peek4 + + call print ; Closing fence + db fence+80h + pop bc ; Get flag in c back + call break ; Allow abort + jr peek2 + + endif ; Peekon +; +; PRINT A AS 2 HEX CHARS +; PASHC - LEADING SPACE +; + if peekon or [pokeon and not pokeq] or porton +pashc: + push af ; Save a + call spac + pop af +pahc: + push af + rrca ; Exchange nybbles + rrca + rrca + rrca + call pah ; Print hex char + pop af +pah: + and 0fh ; Mask + add a,'0' ; Convert to ascii + cp '9'+1 ; Letter? + jr c,pah1 + add a,7 ; Adjust to letter +pah1: + jp conout +; + endif ; Peekon or [pokeon and not pokeq] or porton +; +;Section 5I +;Command: POKE +;Function: Place Values into Memory +; +;Form: +; POKE startadr val1 val2 ... +; + if pokeon +poke: + call retsave + ld hl,tbuff+1 ; Pt to first char + call sksp ; Skip to non-blank + jr z,noargs ; Arg error + call hexnum ; Convert to number + + if not pokeq + call print + db ' Pok','e'+80h + call adrat ; Print at message + endif + +; LOOP FOR STORING HEX VALUES SEQUENTIALLY VIA POKE + +poke1: + push de ; Save address + call sksp ; Skip to non-blank + jp z,exit ; Done + cp '"' ; Quoted text? + jr z,poke2 + call hexnum ; Get number + ld a,e ; Get low + pop de ; Get address + ld (de),a ; Store number + inc de ; Pt to next + jr poke1 +; +; STORE ASCII CHARS +; +poke2: + pop de ; Get next address + inc hl ; Pt to next char +poke3: + ld a,(hl) ; Get next char + or a ; Done? + jp z,exit + ld (de),a ; Put char + inc hl ; Pt to next + inc de + jr poke3 + + endif ; Pokeon +; +; No Argument Error +; + + if pokeon or porton + +noargs: + call print + db ' Arg','?'+80h + jp exit +; + endif ; Pokeon or porton + +; +;Section 5I+ +;Command: PORT +;Function: Display or Set I/O Port Data +; +;Form: +; PORT addr - read port and display value +; PORT addr value - output value to port +; + if porton +port: + call retsave + ld hl,tbuff+1 ; Find first number + call sksp ; Skip to first command-line token + jr z,noargs ; Abort if no port address given + call hexnum ; Get start address into de + push hl ; Save pointer to command tail + ld hl,portaddr ; Modify code + ld (hl),e ; Move specified port addr into place + dec hl ; Point to opcode position + ld (hl),0dbh ; Poke 'in' opcode + ex (sp),hl ; Get tail pointer back while saving this one + call print ; Print header + db ' Por','t'+80h + ld a,e + call pashc ; Print port address + call sksp ; Skip to possible second value + jr z,portin ; Proceed with port input + + call hexnum ; Get 2nd number in de + ex (sp),hl ; Get pointer to opcode back + ld (hl),0d3h ; Poke 'out' opcode + call print + db ': OU','T'+80h + ld a,e ; Get value to output + jr paddr + +portin: call print + db ': I','N'+80h + xor a ; Make sure high port address = 0 (for HD64180) +paddr: ld b,0 ; ..for both IN and OUT instructions +opcode: + db 0 ; Opcode for IN or OUT inserted by code above +portaddr: + db 0 ; Port address inserted by code above + call pashc + pop hl ; Clean up stack + jp exit + + endif ; Porton + +; End RCP-IOM.Z80 + + endif ;peekon or pokeon or porton + + if regon +; include rcpreg ; 'REG' register operation commands + page + +; RCP-REG.Z80 + +; +;Section 5J +;Command: REG +;Function: Manipulate Memory Registers +; +;Forms: +; REG D or REG <-- Display 10 Register Values +; REG Mreg <-- Decrement Register Value +; REG Preg <-- Increment Register Value +; REG Sreg value <-- Set Register Value +; +; Vers 2.1 Joe Wright +; +; REG reg <-- Display a single register value +; +; REG numbers now range from 0 to 31, although only the first ten are +; displayed with REG D. +; +; REG now treats the program error byte as register E. +; +register: + ld de,fcb1+2 ; Pt to first arg + ld a,(de) ; Get possible digit + call regptr ; Pt HL to potential register + dec de ; Point to command + ld a,(de) + cp 'S' ; Set? + jr z,rset + cp 'P' ; Plus? + jr z,rinc + cp 'M' ; Minus? + jr z,rdec + cp ' ' + jr z,rshow + cp 'D' + jr z,rshow + call regptr + jp regout + +; INCREMENT REGISTER VALUE +; HL PTS TO MEMORY REGISTER ON INPUT + +rinc: + inc (hl) ; Increment it + jr regout ; Print result + +; DECREMENT REGISTER VALUE +; HL PTS TO MEMORY REGISTER ON INPUT + +rdec: + dec (hl) ; Decrement value + jr regout ; Print result + +; Show first ten registers and Program Error byte +; +rshow: + call rshow10 + ld hl,z3msg+6 + jp regout + +rshow10: + xor a ; Select register 0 + ld b,a ; Counter set to 0 in B + call regp1 ; HL pts to register 0 +rshow1: + ld a,b ; Get counter value + cp 10 ; First ten registers + ret z ; Exit if done + push bc ; Save counter + push hl ; Save pointer + call regout ; Print register value + pop hl ; Get pointer + pop bc ; Get counter + inc b ; Increment counter + ld a,b ; Check for new line + and 3 + call z,crlf ; Newline after fourth display + inc hl ; Pt to next register + jr rshow1 + +; SET REGISTER VALUE +; HL PTS TO REGISTER ON INPUT + +rset: + ld de,fcb2+1 ; Pt to value + call de2bin ; Eval string at DE to binary in B + ld (hl),b ; Set value + +; Enter with HL pointing to the register. HL is maintained. +; +regout: + call print + db ' Reg',' '+80h + ld de,z3msg+30h ; Register 0 + sbc hl,de ; Register number in HL + ld a,l + cp 32 ; A numbered Register? + jr c,rego0 ; Yep + call print + db ' ','E'+80h + jr rego1 ; Report + +rego0: push hl + push de + ld b,0 ; Suppress zeros + call decdsp2 ; Report register number + pop de + pop hl + +rego1: add hl,de ; HL points to register again + call print + db ' =',' '+80h + ld l,(hl) + xor a + ld h,a + ld b,a ; Suppress leading zeros + jp decdsp3 ; Display value + +; Evaluate decimal string at DE to binary in B +; +de2bin: + ld b,0 ; Init value to zero +de2b: + ld a,(de) ; Get this digit + inc de ; Pt to next + sub '0' ; Convert to binary + ret c ; A space, finished + cp 10 ; Range? + ret nc ; Not decimal, finished + ld c,a ; Digit in c + ld a,b ; Multiply old by 10 + add a,a ; *2 + add a,a ; *4 + add a,b ; *5 + add a,a ; *10 + add a,c ; Add in new digit + ld b,a ; Result in b + jr de2b ; Again + +; SET HL TO POINT TO MEMORY REGISTER WHOSE INDEX IS PTED TO BY HL +; ON INPUT, A CONTAINS REGISTER CHAR +; ON OUTPUT, HL = ADDRESS OF MEMORY REGISTER (REG 0 ASSUMED IF ERROR) + +regptr: + ld hl,z3msg+6 ; The E register + cp 'E' + ret z + push de + call de2bin ; Get register number in B + pop de + ld a,b + cp 32 ; Range 0-31 + ld a,0 + jr nc,regp1 ; Out of range, use 0 + ld a,b ; Value in A +regp1: + ld hl,z3msg+30h ; Pt to memory registers + add a,l ; Pt to proper register + ld l,a + ret ; No chance of crossing page boundary +; +; End RCP-REG.Z80 + + endif ;regon + + if whlon or whlqon +; include rcpwhl ; 'WHL' and 'WHLQ' commands + page +; +;Section 5K +;Command: WHL/WHLQ +;Function: Set the Wheel Byte on or off +; +;If WHLQUIET equate is true, then RCP does not report wheel status with WHL +;command. +; +;Form: +; WHL -- turn Wheel Byte OFF +; WHL password -- turn Wheel Byte ON if password is correct +; WHLQ -- find out status of Wheel Byte +; +; Vers 2.1 Changes the function a little as follows: +; +; WHL -- Report Wheel Status (no WHLQ) +; WHL password -- Set Wheel ON if password is correct +; -- Set Wheel OFF if password incorrect +whl: + ld hl,fcb1+1 ; Pt to first char + ld a,(hl) ; Get it + + if not whlqon + cp ' ' + jr z,whlmsg ; Report wheel status if no password + endif + + ld de,whlpass + ld b,8 ; Check 8 chars + call comp ; Compare + jr nz,whloff ; Set wheel OFF if incorrect password + +; TURN ON WHEEL BYTE + + ld a,0ffh ; Turn on wheel byte + jr whlset + +; TURN OFF WHEEL BYTE + +whloff: + xor a ; Turn off wheel byte +whlset: + ld hl,(z3whl) ; Indirect from z3env + ld (hl),a +whlq: + if whlquiet + ret + endif + +; PRINT WHEEL BYTE MESSAGE + + if not whlquiet + +whlmsg: + call print + dc ' Wheel ' + call whlchk ; Check wheel byte + jr z,offm + call print + dc 'On' + ret +offm: + call print + dc 'Off' + ret + + endif ;[not whlquiet] or whlqon + + +; WHEEL PASSWORD DEFINED FROM SYSRCP.LIB FILE + + db 'Z'-'@' ; Leading ^z to block attempt to type rcp file +whlpass: + wpass ; Use macro +; +; End RCP-WHL.Z80 + + endif ;whlon + + if echoon +; include rcpecho ; 'ECHO' command + page + +; RCP-ECHO.Z80 + +;============================================================================= +; +; E C H O T E X T T O S C R E E N A N D P R I N T E R +; +;============================================================================= + +; Command: ECHO +; Function: Echo text to console or printer + +echo: + xor a ; Lower case flag setting + + if upcase ; If upper case default + dec a + endif ;upcase + + ld (casefl),a ; Store flag in code below + + ld hl,tbuff+1 ; Point to first character + call getchar ; Get first character (should be blank) + ; If none, exit from routine + + if echolst + call getchar ; Get first char after leading blank + ld b,a ; Save first char as list output flag + cp '$' ; Print flag? + jr z,echo2 ; If so, go on + dec hl ; Else backup one character + endif ; Echolst + +; LOOP TO ECHO CHARS + +echo2: call getchar + + if echolst + cp ff ; Form feed? + jr z,echo3 + endif ;echolst + + cp '^' + jr nz,echo2a ; Not control character prefix + call getchar ; Get next character + and 1fh ; Convert to control character + jr echo2d ; Echo it + +echo2a: cp cmdchar ; Case shift prefix? + jr nz,echo2d ; No, normal echo + call getchar ; Get next character + cp ucasechar ; Up-shift character? + jr z,echo2c ; Store non-zero value in case flag + +echo2b: cp lcasechar ; Lower-case character? + jr nz,echo2d ; No, echo the character as is + xor a ; Else, clear case flag +echo2c: ld (casefl),a + jr echo2 ; On to next character + +echo2d: + call echout ; Send char + jr echo2 + +; FORM FEED - SEND NEW LINE FOLLOWED BY FORM FEED IF PRINTER OUTPUT + + if echolst +echo3: + ld a,b ; Check for printer output + cp '$' + jr nz,echoff ; Send form feed normally if not printer + call echonl ; Send new line + ld a,ff ; Send form feed + jr echout + +; SEND FORM FEED CHAR TO CONSOLE + +echoff: + ld a,ff ; Get char + jr echo2d + endif ;echolst + +; END OF PRINT LOOP - CHECK FOR PRINTER TERMINATION + +echo4: + if not echolst + + ret + + else + + ld a,b ; Get list mode flag + cp '$' + ret nz ; Done if no printer output + +; OUTPUT A NEW LINE + +echonl: + ld a,cr ; Output new line on printer + call echout + ld a,lf ; Fall thru to echout + + endif ;not echolst + +; OUTPUT CHAR TO PRINTER OR CONSOLE + +echout: + ld c,a ; Char in c + + cp 'A' ; If less than 'a' + jr c,echouta ; Leave as is + cp 'Z'+1 ; If greater than 'z' + jr nc,echouta ; Leave as is + add 20h ; Else convert to lower case +echouta: + ld d,a ; Save lower case version in d +casefl equ $+1 ; Pointer for in-the-code modification + ld a,0 + or a + jr nz,echoutb ; If upper case selected, go on as is + ld c,d ; Else substitute lower case version +echoutb: + + push hl ; Save hl + push bc ; Save bc + ld de,0ch-3 ; Offset for console output + + if echolst + ld a,b ; Check for printer output + cp '$' + jr nz,echout1 + inc de ; Add 3 for printer offset + inc de + inc de + endif ;echolst + +; OUTPUT CHAR IN C WITH BIOS OFFSET IN DE + +echout1: + call biout ; Bios output + pop bc ; Restore bc,hl + pop hl + ret + +; Get a character from the command tail buffer + +getchar: + ld a,(hl) ; Get character + inc hl ; Point to next one + or a ; Check for end of string + ret nz ; If not end, return + pop hl ; Else, clean up stack + jr echo4 ; And exit from routine + +; OUTPUT CHAR IN C TO BIOS WITH OFFSET IN DE + +biout: + ld hl,(wboot+1) ; Get address of warm boot + add hl,de ; Pt to routine + jp (hl) ; Jump to it + +; End RCP-ECHO.Z80 + + endif ;echoon + +; include rcpsubs ; File of subroutines + page + +; RCPSUBS.Z80 Subroutines for Z33RCP.Z80 + + +;----------------------------------------------------------------------------- + +; Display decimal digit routines + +;-------------------- + +; Display hundreds, tens, and units digits (assumes flag in B has been set) + + if regon or spaceon + +decdsp3: + ld de,100 ; Display hundreds + call decdsp +decdsp2: + ld de,10 ; Display tens + call decdsp + ld a,l ; Get remaining units value + add '0' ; Convert to character + jr conout ; Print it and return + +;-------------------- + +; Routine to print any single digit + +; Actually, this routine displays the value of HL divided by DE and leaves the +; remainder in HL. In computing the character to display, it assumes that the +; result of the division will be a decimal digit. If the result is zero, the +; value in the B register, which is the number of digits already printed, is +; checked. If it is zero, a space is printed instead of a leading '0'. If it +; is not zero, the '0' is printed. Whenever any digit (not a space) is +; printed, the value in B is incremented. + +decdsp: + ld c,'0'-1 ; Initialize digit count + xor a ; Clear carry flag + +decdsp1: + inc c ; Pre-increment the digit + sbc hl,de ; Subtract DE from HL + jr nc,decdsp1 + + add hl,de ; Add back in to produce remainder + ld a,c ; Get decimal digit + cp '0' ; Check for leading 0 + jr nz,decdout ; If not 0, proceed to display it + ld a,b ; Digit printed already? + or a + ld a,' ' ; Possible space for calling routine to print +; ret z ; If no digit printed, return zero flag set + jr z,conout ; Print leading space +decdout: + inc b ; Indicate digit printed + ld a,c ; Else print real digit + ; Fall through to CONOUT + + endif ;regon or spaceon + +;----------------------------------------------------------------------------- + +; Console Output Routine + +conout: + putreg ; Save all register except AF + push af ; Save AF, too + and 7fh ; Mask out MSB + ld e,a ; Transfer character to E + ld c,2 ; BDOS conout function number + call bdos + pop af + getreg ; Restore registers +note: ; Use this RET for NOTE command + ret + + if peekon or [pokeon and not pokeq] or porton +spac: ld a,' ' + jr conout + endif ; peekon or [pokeon and not pokeq] or porton + + +;----------------------------------------------------------------------------- + +; String printing routines + +;-------------------- + +; Print string following call (terminated with null or character with the +; high bit set) + +print: + ex (sp),hl ; Get address + call printhl + ex (sp),hl ; Put address + ret + +;-------------------- + +; Print string pointed to by HL (terminated with null or character with the +; high bit set) + +printhl: + ld a,(hl) ; Get next character + inc hl ; Point to following one + or a ; See if null terminator + ret z ; If so, we are done + call conout ; Display the character + ret m ; We are done if MSB is set (negative number) + jr printhl ; Back for more + +;----------------------------------------------------------------------------- + +; OUTPUT NEW LINE TO CON: + +crlf: + call print + db cr,lf+80h + ret + +; CONSOLE INPUT + + if eraon or lton or proton or renon or cpon + +conin: + push hl ; Save regs + push de + push bc + ld c,1 ; Input + call bdos + pop bc ; Get regs + pop de + pop hl + and 7fh ; Mask msb + cp 61h + ret c + and 5fh ; To upper case + ret + + endif ; Eraon or lton or proton or renon or cpon +; +; SAVE RETURN ADDRESS +; +retsave: + pop de ; Get return address + pop hl ; Get return address to zcpr3 + ld (z3ret),hl ; Save it + push hl ; Put return address to zcpr3 back + push de ; Put return address back + ret + +; + if spaceon and [dirsp or cpsp or erasp] +spaexit: + call crspace ; Show space remaining + endif ; Spaceon and [dirsp or cpsp or erasp] +; +; EXIT TO ZCPR3 +; +exit: +z3ret equ $+1 ; Pointer to in-the-code modification + jp 0 ; Return address + +; +; PRINT A DASH +; + if lton or peekon +dash: + call print + db ' -',' '+80h + ret +; + endif ; Lton or peekon +; +; PRINT ADDRESS MESSAGE +; PRINT ADDRESS IN DE +; + if peekon or pokeon + if not pokeq +adrat: + call print + db ' at',' '+80h + ld a,d ; Print high + call pahc + ld a,e ; Print low + jp pahc + + endif ; Not pokeq + endif ; Peekon or pokeon + + if peekon or pokeon or porton +; +; EXTRACT HEXADECIMAL NUMBER FROM LINE PTED TO BY HL +; RETURN WITH VALUE IN DE AND HL PTING TO OFFENDING CHAR +; +hexnum: + ld de,0 ; De=accumulated value +hnum1: + ld a,(hl) ; Get char + cp ' '+1 ; Done? + ret c ; Return if space or less + inc hl ; Pt to next + sub '0' ; Convert to binary + jr c,numerr ; Return and done if error + cp 10 ; 0-9? + jr c,hnum2 + sub 7 ; A-f? + cp 10h ; Error? + jr nc,numerr +hnum2: + push hl ; Save pointer + ex de,hl + add hl,hl + add hl,hl + add hl,hl + add hl,hl ; DE x16 to HL + ld e,a + ld d,0 + add hl,de + ex de,hl ; DE = DE * 16 + A + pop hl ; Get the pointer + jr hnum1 ; Try again +; +; NUMBER ERROR +; +numerr: + call print + db ' Num','?'+80h + jp exit +; +; SKIP TO NEXT NON-BLANK +; +sksp: + ld a,(hl) ; Get char + inc hl ; Pt to next + cp ' ' ; Skip spaces + jr z,sksp + dec hl ; Pt to good char + or a ; Set eol flag + ret +; + endif ; Peekon or pokeon or porton + +;----------------------------------------------------------------------------- + +; Test File in FCB for unambiguity and existence, ask user to delete if so +; Return with Z flag set if R/O or no permission to delete +; + if renon or cpon +extest: + call ambchk ; Ambiguous file names not allowed + call searf ; Look for specified file + jr z,exok ; Ok if not found + call getsbit ; Position into dir + inc de ; Pt to file name + ex de,hl ; Hl pts to file name + push hl ; Save ptr to file name + call prfn ; Print file name + pop hl + call rotest ; Check for r/o + jr nz,exer + call eraq ; Erase? + jr nz,exer ; Restart as error if no + ld de,fcb1 ; Pt to fcb1 + ld c,19 ; Delete file + call bdos +exok: + xor a + dec a ; Nz = ok + ret +exer: + xor a ; Error flag - file is r/o or no permission + ret + +; +; CHECK FOR AMBIGUOUS FILE NAME IN FCB1 +; RETURN Z IF SO +; +ambchk: + ld hl,fcb1+1 ; Pt to fcb +; +; CHECK FOR AMBIGUOUS FILE NAME PTED TO BY HL +; +ambchk1: + push hl + ld b,11 ; 11 bytes +amb1: + ld a,(hl) ; Get char + and 7fh ; Mask + cp '?' + jr z,amb2 + inc hl ; Pt to next + djnz amb1 + dec b ; Set nz flag + pop de + ret +amb2: + pop hl ; Pt to file name + call prfn + call print + db ' is AF','N'+80h + jp exit +; + endif ; Renon or cpon +; +; TEST FILE PTED TO BY HL FOR R/O +; NZ IF R/O +; + if renon or cpon or eraon +; +rotest: + push hl ; Advance to r/o byte + ld bc,8 ; Pt to 9th byte + add hl,bc + ld a,(hl) ; Get it + and 80h ; Mask bit + push af + ld hl,romsg + call nz,printhl ; Print if nz + pop af ; Get flag + pop hl ; Get ptr + ret +romsg: + db ' is R/','O'+80h +; +; CHECK USER TO SEE IF HE APPROVES ERASE OF FILE +; RETURN WITH Z IF YES +; +eraq: + call print + db ' - Eras','e'+80h + endif ; Renon or cpon or eraon + + if renon or cpon or eraon or proton +eraq1: + call print + db ' (Y/N/Q)?',' '+80h + call conin ; Get response + cp 'Q' ; Quit command? + jp z,exit + cp 'Y' ; Key on yes + ret +; + endif ; Renon or cpon or eraon or proton +; +; INIT FCB1, RETURN WITH DE PTING TO FCB1 +; + if eraon or lton or cpon +initfcb1: + ld hl,fcb1 ; Pt to fcb +initfcb2: + push hl ; Save ptr + ld bc,12 ; Pt to first byte + add hl,bc + ld b,24 ; Zero 24 bytes + xor a ; Zero fill + call fillp ; Fill memory + pop de ; Pt to fcb + ret +; + endif ; Eraon or lton or cpon +; + if eraon or lton or cpon or diron + +fillp: + ld (hl),a ; Store byte + inc hl ; Pt to next + djnz fillp ; Count down + ret +; + endif ; Eraon or lton or cpon or diron + +; +; CHECK FOR USER INPUT; IF ^C, RETURN WITH Z +; + if diron or lton or eraon or proton or peekon + +break: + push hl ; Save regs + push de + push bc + ld c,11 ; Console status check + call bdos + or a + ld c,1 ; Get char if any + call nz,bdos + pop bc ; Restore regs + pop de + pop hl +break1: cp ctrlc ; Check for abort + jp z,exit ; Exit + cp ctrlx ; Skip? + ret + endif ; Diron or lton or eraon or proton or peekon + +; AFTER A SEARCH, RETURN NZ SET IF DESIRED TYPE OF FILE FOUND, Z IF NOT +; THIS ALGORITHM LOOKS AT THE SYSTEM BIT OF THE LOCATED FILE; THIS +; BIT IS SET TO 1 IF THE FILE IS A SYSTEM FILE AND 0 IF NOT A SYSTEM +; FILE. THE FOLLOWING EXCLUSIVE OR MASKS ARE APPLIED TO RETURN Z OR NZ +; AS REQUIRED BY THE CALLING PROGRAM: +; +; SYSTEM BYTE: X 0 0 0 0 0 0 0 (AFTER 80H MASK, X=1 IF SYS, 0 IF DIR) +; +; SYS-ONLY : 0 0 0 0 0 0 0 0 (XOR 0 = 0 if X=0, = 80H if X=1) +; DIR-ONLY : 1 0 0 0 0 0 0 0 (XOR 80H = 80h if X=0, = 0 if X=1) +; BOTH : 0 0 0 0 0 0 0 1 (XOR 1 = 81H or 1H, NZ in both cases) + + if diron or eraon or lton or proton or cpon or renon + +getsbit: + dec a ; Adjust to returned value + rrca ; Convert number to offset into tbuff + rrca + rrca + and 60h + ld de,tbuff ; Pt to buffer + add a,e ; Add entry offset to base addr + ld e,a ; Result in e + push de ; Save ptr in de + add 10 ; Add offset of 10 to pt to system byte + ld e,a ; Set address + ld a,(de) ; Get byte + pop de ; Get ptr in de + and 80h ; Look at only system bit +systst equ $+1 ; In-the-code variable + xor 0 ; If systst=0, sys only; if systst=80h, dir + ; Only; if systst=1, both sys and dir + ret ; Nz if ok, z if not ok +; +; +; COPY HL TO DE FOR B BYTES +; +blkmov: + ld a,(hl) ; Get + ld (de),a ; Put + inc hl ; Pt to next + inc de + djnz blkmov ; Loop + ret + +; +; PRINT FILE NOT FOUND MESSAGE +; +prfnf: + call print + db ' No File','s'+80h + jp exit + +; LOG INTO USER AREA CONTAINED IN FCB1 +; +logusr: + ld a,(fcb1+13) ; Get user number +setusr: + ld e,a + ld c,32 ; Use bdos fct + jp bdos + +; +; PRINT FILE NAME PTED TO BY HL +; +prfn: + call print ; Leading space + db ' '+80h + ld b,8 ; 8 chars + call prfn1 + call print + db '.'+80h ; Dot + ld b,3 ; 3 chars +prfn1: + ld a,(hl) ; Get char + inc hl ; Pt to next + call conout ; Print char + djnz prfn1 ; Count down + ret + +; +; SEARCH FOR FIRST +; +searf: + push bc ; Save counter + push hl ; Save hl + ld c,17 ; Search for first function +searf1: + ld de,fcb1 ; Pt to fcb + call bdos + inc a ; Set zero flag for error return + pop hl ; Get hl + pop bc ; Get counter + ret + + endif ; Diron or eraon or lton or proton or cpon or renon + +;----------------------------------------------------------------------------- + +; Define buffers as high as possible in TPA for the following groups +; of commands: +; COPY needs SRCFCB and CBUFF +; LIST/TYPE needs PAGCNT and DIRBUF +; ERA, PROT, and DIR commands. needs DIRBUF +; If DIRBUF is defined, its value is in HL on return from this code. The DE +; register pair is not changed by the code, but the BC pair is affected. + +dirbufon equ lton or diron or eraon or proton + + if dirbufon +dirbuf: ds 2 ; Address for directory buffer + endif ;dirbufon + + if cpon +srcfcb: ds 2 ; Address of source file FCB (CBUFF address + ; ..is in the code) + endif ;cpon + + if lton +pagcnt: ds 2 ; Address for page counter + endif ;lton + + + if cpon or lton or eraon or proton or diron + +define: + push de + ld hl,(bdos+1) ; Get bottom of BDOS + ex de,hl ; ..into DE + ld hl,(1) ; Get BIOS warmboot address into HL + ld bc,-[0e00h+800h+3] ; Offset to command processor address + add hl,bc + +; Now we have to compare and pick the lower address as the top of TPA + + push hl ; Save CPR address while comparing + xor a ; Clear the carry flag + sbc hl,de ; Compute (CPR-BDOS) + pop hl ; Restore CPR address + jr c,define1 ; Branch if BDOS address is higher (use CPR) + ex de,hl ; Otherwise use BDOS address +define1: + + if lton + dec hl ; Put PAGCNT in first free byte at top of TPA + ld (pagcnt),hl + endif ;lton + + if cpon + ld de,-36 ; Calculate place for SRCFCB for copy command + add hl,de + ld (srcfcb),hl + if dirbufon + push hl ; Save if needed below + endif ;dirbufon + ld de,-[cpblocks*128] ; CBUFF can use same space as DIRBUF + add hl,de + ld (cbuff),hl + if dirbufon + pop hl + endif ;dirbufon + endif ;cpon + + if dirbufon + ld de,-[maxdirs*11] ; Space for directory buffer + add hl,de + ld (dirbuf),hl + endif + + pop de + ret + + endif ;cpon or dirbufon + +;----------------------------------------------------------------------------- + +; +; SEARCH FOR NEXT +; + if diron or eraon or lton or proton + +searn: + push bc ; Save counter + push hl ; Save hl + ld c,18 ; Search for next function + jr searf1 + +; LOAD DIRECTORY AND SORT IT +; ON INPUT, A=SYSTST FLAG (0=SYS, 1=DIR, 80H=BOTH) +; DIRECTORY IS LOADED INTO BUFFER AT TOP OF TPA +; RETURN WITH ZERO SET IF NO MATCH AND HL PTS TO 1ST ENTRY IF MATCH + +direrr: + call print + db 'DIR Ovf','l'+80h + jp exit + +getdir: + ld (systst),a ; Set system test flag + call logusr ; Log into user area of fcb1 + +; LXI H,DIRBUF ; Pt to dir buffer + call define ; Define buffer addresses + ld (hl),0 ; Set empty + ld bc,0 ; Set counter + call searf ; Look for match + ret z ; Return if not found +; +; STEP 1: LOAD DIRECTORY +; +gd1: + push bc ; Save counter + call getsbit ; Check for system ok + pop bc + jr z,gd2 ; Not ok, so skip + push bc ; Save counter + inc de ; Pt to file name + ex de,hl ; Hl pts to file name, de pts to buffer + ld b,11 ; Copy 11 bytes + call blkmov ; Do copy + pop bc ; Get counter + inc bc ; Increment counter + ld hl,maxdirs-1 ; See if count equals or exceeds MAXDIRS + ld a,b ; Check high bytes + sub a,h + jr c,gd1a ; If carry set, we are OK + ld a,c ; Check low bytes + sub a,l + jr nc,direrr ; If no carry, jump to error message +gd1a: + ex de,hl ; Hl pts to next buffer location +gd2: + call searn ; Look for next + jr nz,gd1 + ld (hl),0 ; Store ending 0 +; LXI H,DIRBUF ; Pt to dir buffer + ld hl,(dirbuf) ; Pt to dir buffer + ld a,(hl) ; Check for empty + or a + ret z +; +; STEP 2: SORT DIRECTORY +; + if sorton + push hl ; Save ptr to dirbuf for return + call diralpha ; Sort + pop hl + endif + xor a ; Set nz flag for ok + dec a + ret + +; +; DIRALPHA -- ALPHABETIZES DIRECTORY IN DIRBUF; BC CONTAINS +; THE NUMBER OF FILES IN THE DIRECTORY +; +diralpha: +; +; SHELL SORT -- +; THIS SORT ROUTINE IS ADAPTED FROM "SOFTWARE TOOLS" +; BY KERNIGAN AND PLAUGHER, PAGE 106. COPYRIGHT, 1976, ADDISON-WESLEY. +; + ld h,b ; Hl=bc=file count + ld l,c + ld (n),hl ; Set "N" + ld (gap),hl ; Set initial gap to n for first division by 2 + +; FOR (GAP = N/2; GAP > 0; GAP = GAP/2) +srtl0: + or a ; Clear carry +gap equ $+1 ; Pointer for in-the-code modification + ld hl,0 ; Get previous gap + ld a,h ; Rotate right to divide by 2 + rra + ld h,a + ld a,l + rra + ld l,a + +; TEST FOR ZERO + or h + ret z ; Done with sort if gap = 0 + + ld (gap),hl ; Set value of gap + ld (ii),hl ; Set ii=gap for following loop + +; FOR (II = GAP + 1; II <= N; II = II + 1) +srtl1: +ii equ $+1 ; Pointer for in-the-code modification + ld hl,0 ; Add 1 to ii + inc hl + ld (ii),hl + +; TEST FOR II <= N + ex de,hl ; Ii is in de +n equ $+1 ; Pointer for in-the-code modification + ld hl,0 ; Number of items to sort + ld a,l ; Compare by subtraction + sub a,e + ld a,h + sbc a,d ; Carry set means ii > n + jr c,srtl0 ; Don't do for loop if ii > n + + ex de,hl ; Set jj = ii initially for first subtraction of gap + ld (jj),hl + +; FOR (JJ = II - GAP; JJ > 0; JJ = JJ - GAP) +srtl2: + ld hl,(gap) ; Get gap + ex de,hl ; In de +jj equ $+1 ; Pointer for in-the-code modification + ld hl,0 ; Get jj + ld a,l ; Compute jj - gap + sub a,e + ld l,a + ld a,h + sbc a,d + ld h,a + ld (jj),hl ; Jj = jj - gap + jr c,srtl1 ; If carry from subtractions, jj < 0 and abort + or l ; Jj=0? + + jr z,srtl1 ; If zero, jj=0 and abort + +; SET JG = JJ + GAP + ex de,hl ; Jj in de + ld hl,(gap) ; Get gap + add hl,de ; Jj + gap + ld (jg),hl ; Jg = jj + gap + +; IF (V(JJ) <= V(JG)) + call icompare ; J in de, jg in hl + +; ... THEN BREAK + jr c,srtl1 + +; ... ELSE EXCHANGE + ld hl,(jj) ; Swap jj, jg + ex de,hl +jg equ $+1 ; Pointer for in-the-code modification + ld hl,0 + call iswap ; Jj in de, jg in hl + +; END OF INNER-MOST FOR LOOP + jr srtl2 + +; +; SWAP (Exchange) the elements whose indexes are in HL and DE +; +iswap: + call ipos ; Compute position from index + ex de,hl + call ipos ; Compute 2nd element position from index + ld b,11 ; 11 bytes to flip + endif ; Diron or eraon or lton or proton + + if diron or eraon or lton or proton or renon +iswap1: + ld a,(de) ; Get bytes + ld c,(hl) + ld (hl),a ; Put bytes + ld a,c + ld (de),a + inc hl ; Pt to next + inc de + djnz iswap1 + ret + endif ; Diron or eraon or lton or proton or renon + + if diron or eraon or lton or proton +; +; ICOMPARE compares the entry pointed to by the pointer pointed to by HL +; with that pointed to by DE (1st level indirect addressing); on entry, +; HL and DE contain the numbers of the elements to compare (1, 2, ...); +; on exit, Carry Set means ((DE)) < ((HL)), Zero Set means ((HL)) = ((DE)), +; and Non-Zero and No-Carry means ((DE)) > ((HL)) +; +icompare: + call ipos ; Get position of first element + ex de,hl + call ipos ; Get position of 2nd element + ex de,hl +; +; COMPARE DIR ENTRY PTED TO BY HL WITH THAT PTED TO BY DE; +; NO NET EFFECT ON HL, DE; RET W/CARRY SET MEANS DE/>> to indicate state) + ^W - recall command lines from history stack + ^E - recall history in reverse direction + + +Installation: + + The installation program, CLEDINST, allows you to set up the editor +to your preference. The RCP can be installed directly in memory or in a disk +file -- RCPxxx.ZRL or a system configuration saved with SNAP or NZBLITZ. +CLEDINST also serves as a "help" utility by displaying the current command +bindings. Type "CLEDINST //" for help with CLEDINST.COM. + + +History Tool: + + CLEDSAVE writes the contents of the history stack to a text file on disk. +The file can be reloaded later (CLEDSAVE L), or composed in advance +with a text editor, then loaded. If the file is too large for the history +stack, as many commmand lines as fit are loaded. + + CLEDSAVE is useful as in a startup alias to load frequently used command +lines from an easily altered file. For example: + +Alias: START + +A15: +CLEDSYS <- load SNAP image of ENV,TCAP,RCP,FCP,NDR,QUIET,&PATH +CLEDSAVE CLED.VAR L <- load precomposed command lines into CLED +CLED <- turn the shell on +... <- rest of startup line runs before CLED gets control + +For help with CLEDSAVE.COM, type "CLEDSAVE //". + + You may also use SNAP or NZBLITZ to save the system segment image with +command lines already loaded (turn SAVE OFF first.) + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpcled.lib b/Source/BPBIOS/Z34RCP11/rcpcled.lib new file mode 100644 index 00000000..6c2879a7 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpcled.lib @@ -0,0 +1,1327 @@ + page + +; Library: RCPCLED for Z34RCP +; Author: Carson Wilson (modifications only) +; Version: 1.3b +; Date: October 8, 1989 +; Changes: Civilian time now prints "12" instead of "0" for midnight hour. +; Put Z3PLUS time display capability back in. +; Z3PLUS time display disabled if date = 01/01/78 (no clock). +; Added Rob Friefeld's fix to SAVE_LINE. +; +; Author: rdf +; Version: 1.3a +; Date: October 2, 1989 +; Changes: Changed order of installable highlight codes and history buffer +; addresses to simplify installing a ZRL file. Changed version +; number to guarantee compatibility with accessory programs. +; Option to print user number zero at prompt. +; Time string separator installable. + +; Author: Carson Wilson (modifications only) +; Version: 1.2 B +; Date: September 29, 1989 +; Changes: Made ">>" the prompt when previous commands are NOT being +; overwritten. +; Changed line edit commands to be closer to CP/M Plus. +; Shortened the clock read code (ZSDOS allows straight +; DateStamper calls). +; Uses DEFINE from RCPSUBS.LIB to save space. +; Does not print prompt user number if at user zero. +; Optional installable highlight codes for time in prompt. +; Time prompt shortened to "hh.mm" for easier reading. + +; Author: Rob Friefeld +; Version: 1.2 a +; Date: September 20, 1989 + +; Syntax: CLED [/] if "/", then run for one command line only +; e.g. from a shell like ZFILER + +; +; ===== D E F I N I T I O N S S E C T I O N ===================== +; + +clver equ 13 ; Version number (Install program compat.) +clrev equ 'b' ; Revision (Does not affect config.) + +del equ 7fh ; not in sysdef.lib + +; +;===== C O N F I G U R A T I O N A R E A ======================== +; + +; The installation program and buffer loader depend on the configuration +; of this data structure. It should not be changed. + +shname: db 'CLED',0 ; Name put on shell stack +versid: db clver ; CLED version +ddsep: db dudir_sep ; DU:DIR separator char +ins_flag: db clins ; Yes = insert mode +minsave: db clmin ; Discard line =< this +era_flag: db clera ; Erase stored line on exit +save_flag: db clsav ; Save command lines +tim_sep: db timesep ; Time string separator + +; --------------------------- + +; Command list for RCPCLED, Version 1.3 +; Set bit 7 to use a command with meta key + +cmd_list: + db 'Q' ; Meta key 1 + db 'H' ; Backspace + db 'S' ; Cursor left + db 'D' ; Cursor right + db 'A' ; Word left + db 'F' ; Word right + db 'B' ; Line end/ start + dc 'S' ; Line start + dc 'D' ; Line end + db 'G' ; Delete char + db DEL ; Delete left + db 'T' ; Delete word + db 'L' ; Delete word left + db 'X' ; Delete to SOL + db 'Y' ; Delete line + db 'K' ; Delete to EOL + db 'V' ; Toggle insert + db 'P' ; Enter control + db 'W' ; Recall line + db 'E' ; Recall reverse + db 'M' ; Execute line + db '[' ; ESC menu + +cmdlen equ $ - cmd_list + +; --------------------------- +; Highlight on/off codes for time display (installable) +; +stndout: db 0,0,0,0 ; Must terminate with hibit or binary 0 +stndend: db 0,0,0,0 ; Ditto + +; --------------------------- +; 4 bytes are used here for the information of the history save/load tool, +; CLEDSAVE + +histaddr: dw history ; Pointer to history buffer +histsz: dw histsize ; Buffer size + +; +;===== M A I N C O D E S E C T I O N ======================== +; +cled: + call define ; Set pointer to free mem + ld de,-lbufwid-1 + add hl,de + ld (line),hl ; Set line buffer location + xor a + ld (hl),a ; Zero line + ld hl,history ; History stack + ld (recall_ptr),hl ; Init position pointer to start + + ld a,(fcb+1) ; Check command line option + cp '/' + jr z,cledit ; Go right to editing + + ld a,(z3msg+3) ; QSHELL + dec a ; <> 1 on manual invocation + jr z,cledit ; Skip installation + +; +;===== S H E L L I N S T A L L A T I O N ========================= +; +sh_inst: + ld hl,shname + call shpush ; Z = OK + ret z + call print ; Complain about stack and cancel + dc cr,lf,'SH STK' ; Full or non-existent + ret + +; +;===== L I N E E D I T =========================================== +; + +; This is the main entry point for the shell +; 1 - Display prompt +; 2 - Get user input +; 3 - Reset shell bit +; 4 - Run command line + + +; Subtask 1 -- +cledit: + call prompt ; Display system prompt + +;---------------------------------------- +; Subtask 2 -- + +; The editor returns NZ if the shell pop command has been given. If not, it +; returns the character count of the command line in B. + + call EDIT + +;---------------------------------------- +; Subtask 3 -- + push af ; Save return code + xor a + ld (z3msg+3),a ; PUTCST + pop af + +;---------------------------------------- +; Subtask 4 -- + jp nz,shpop ; Quit shell + +; Here we load the MCL directly from the line buffer. On OVFL, loop to edit. + +loadcl: + ld a,(z3cl+2) ; MCL size + inc b ; B contains line count, include terminating 0 + cp b ; Compare to line size + jr nc,loadcl1 ; OK + +mclerr: + call print + dc cr,lf,'OVFL',cr,lf + jp cledit + +loadcl1: + ld de,z3cl+4 ; Set MCL pointer to start + ld (z3cl),de + + ld hl,(line) + ld c,b + ld b,0 + ldir ; Move line buff to MCL + ret ; Run it + + +; +;===== S U B R O U T I N E S ======================================= +; + +; Prompt -- PRINT a DU:DIR prompt. +; +prompt: + if systime + call print_time + endif + + ld bc,(cusr) ; GDEFDU + ld a,b ; Drive + add a,'A' ; Make it a letter + call conout ; Write it + ld a,c ; Get user + + if puser0 + call pusr ; Write it + else + or a + call nz,pusr ; Write it IF NONZERO + endif ;puser0 + + call dutdir ; Get the ndr + jr z,prompt1 + ld a,(ddsep) ; DU:DIR separator + call conout + ld b,8 ; Eight chars max +nameloop: + ld a,(hl) ; Get the first char + cp ' ' + call nz,conout ; Write it if not blank + inc hl + djnz nameloop + +prompt1: + call prompt2 + ld a,(save_flag) ; If save is OFF, prompt is >> + or a + ret nz +prompt2: + call print + dc '>' + ret + +; PUSR -- Convert user # in A to decimal and print +; +pusr: + ld hl,10 shl 8 + '0'-1 ; H=10, L='0'-1 + cp h ; User < 10 ? + jr c,pusr1 +pusr0: + inc l ; Advance character for user number tens digit + sub h + jr nc,pusr0 + add a,h + ld h,a ; Keep low digit of user number in H + ld a,l ; Display tens digit + call conout + ld a,h ; Ready to process units digit +pusr1: + jp decout ; Routine in RCPSUBS.LIB +; add '0' +;pusr2: +; jp conout + +; Console input without echo + +cin: + push hl + push de + push bc +cin1: ld c,dirconf ; DCIO + ld e,-1 + call bdos + or a + jr z,cin1 + pop bc + pop de + pop hl + ret + +; +;===== E D I T O R S E C T I O N ================================ +; + +; Date: October 2, 1989 + +; Entry is EDIT +; Return Z = Execute command line, NZ = Quit shell, B = char count of line + +; Initialize to on-line environment. +; While editing, HL -> current position in LINE, B = char count, +; C = cursor position (0 .. count), DE = scratch + +edit: + ld hl,(line) ; Init to start of line + xor a + ld b,a ; Line count = 0 + ld c,a ; Cursor pos = 0 + + push hl ; There may already be a line here + dec b ; Accumulate possible char count in B +edit1: + inc b + cp (hl) ; A = 0 + inc hl + jr nz,edit1 ; Loop until 0 terminator +edit2: + pop hl ; Point to line again + call zline ; Zero the remainder of LINE buffer + call ptail ; Print the line from cursor position + +;-------------------------------------------------------------------- + +; EDIT COMMAND LOOP + +; Get a char. If it is text, enter it. If it is a control, scan the +; CMD_LIST for a match. If found, compute offset into jump table and go. +; A "shifted" key (high bit set in table) is matched after the "meta-key" +; has been entered. + +ecmd: + exx ; Main regs must be preserved + ld hl,ecmd ; Save address so a return comes back here + push hl + +no_match: + call cin ; Next key... + cp 'C'-'@' ; Warm boot? + jp z,0000h + + ld hl,meta_flag ; Shift flag + or (hl) ; Mask in possible high bit + ld (hl),0 ; Reset flag + exx ; Recover main regs + + cp 20h ; Test key + jr c,control_key ; Not text + cp del ; This control char > text chars + jp c,enter ; Input text + +control_key: + call menuinp ; Convert control char to cap + + exx ; Must preserve main regs + ld hl,cmd_list ; Scan command list + ld bc,cmdlen + cpir + jr nz,no_match + ld hl,cmd_vector + ld a,cmdlen-1 ; Point to address in vector table + sub c + add a,a + ld c,a + add hl,bc + ld c,(hl) + inc hl + ld b,(hl) + ld (cjump),bc ; Address to jump to + exx ; Restore regs! + +cjump equ $+1 + jp 0 + + +; Convert a control key entry to cap char + +menuinp: + push af + and 80h ; Keep high bit + ld e,a + pop af + and 7fh + call ucase + or e ; Restore high bit + ret + +; Mark meta-key flag + +meta_key1: + ld a,10000000b + ld (meta_flag),a + ret + +meta_flag: db 0 ; Initial value 0 = no shift + + +; Jump table for commands + +cmd_vector: + dw meta_key1 ; Shift key + dw bsp ; Backspace + dw bsp ; Cursor left + dw fsp ; Cursor right + dw bwrd ; Left word + dw fwrd ; Right word + dw linend ; To EOL + dw linbeg ; To SOL + dw linend1 ; To EOL/SOL + dw delete ; Delete char + dw delft ; Delete char left + dw delwrd ; Delete word right + dw delwlft ; Delete word left + dw delsol ; Delete to start of line + dw dline ; Delete line + dw deleol ; Delete to end of line + dw instog ; Toggle insert + dw ctl_entry ; Enter control char + dw recall_back ; Scroll back in history + dw recall_fwrd ; Scroll ahead in history + dw eds$ex ; Execute line + dw esc_menu ; Submenu + +;-------------------------------------------------------------------- + +; ON-LINE ROUTINES, EDITING CURRENT LINE IN LINE BUFFER + +; WHILE ON LINE: +; B = CHAR COUNT (0..lbufwid) C = CURSOR POSITION (0..lbufwid) +; HL = MEM POSITION + + +; Backspace +; Return Z = backspace not done, NZ = all OK + +bsp: + xor a + cp c ; Cursor pos + ret z ; At start + dec hl ; Back up in mem + dec c ; Cursor pos back +bspace: + ld a,bs ; Back up on screen + or a ; Must ret nz + jp conout + + +; Forward space +; Return Z = not done + +fsp: + ld a,(hl) + or a + ret z ; At EOL + inc hl + inc c + jp pctl ; Screen advance by reprinting char + + +; Back word + +bwrd: + call bsp ; Backspace + ret z ; Nowhere to go + ld a,(hl) + cp ' ' + jr z,bwrd ; Backspace over blanks + dec hl ; Now backspace until next wordsep + call wrdsep ; Look at char before this position + inc hl + jr nz,bwrd + ret + +; Forward word + +fwrd: + call wrdsep ; Are we on a word separator? + jr z,fwrd1 ; Yes + call fsp ; No, advance until we find one + jr fwrd + +fwrd1: call fsp ; Word sep found, advance 1 more space + ld a,(hl) ; Are we on a blank? + cp ' ' + jr z,fwrd1 ; Don't quit on a blank + ret + + +; Delete char left + +delft: + call bsp ; Backspace and fall through to delete + + +; Delete char + +delete: + call delmem ; In memory + jp ptail ; Refresh screen from cursor position + +; Delete to start of line + +delsol: + ld a,c ; Get cursor pos + or a + ret z ; Already at start + cp b + jr z,dline ; At end, so delete entire line (quicker) + ld e,a ; Cursor pos = # chars to delete + call linbeg ; Go to start +delcmd1: + call delmem ; Delete first char in memory + dec e ; Loop counter + jr nz,delcmd1 + jp ptail ; Now update screen + + +; Delete word left + +delwlft: + call bwrd ; Back a word and fall thru ... + + +; Delete word right + +delwrd: + call wrdsep ; On a word sep? + jr z,delete ; Yes, kill it + ld a,b ; Compare line count to cursor pos + cp c + jr z,delete ; On last char of line +delwrd1: + call delmem ; Delete in mem, let screen catch up later + jr delwrd ; Go until word sep found + + +; Delete line + +dline: + call linbeg ; Position at line start and fall thru ... + +; Delete to eoln + +deleol: + call ereol ; Clear on screen + ld b,c ; Char count = current position + jp zline ; Zero line tail in mem + +; Insert/overwrite toggle + +instog: + ld a,(ins_flag) ; Flag 0 -> owrt + cpl + ld (ins_flag),a + ret + +; Enter a control + +ctl_entry: + call cin + and 1fh ; Fall thru to normal char entry + +; Enter a char + +enter: + ex af,af' ; Save char + ld a,b ; At eoln? + cp c + jr z,ovrwrt ; Yes, no need for insert mode + ld a,(ins_flag) ; Which mode are we in? + or a ; 0 = overwrite, nz = insert + jr nz,insert + + +; Enter char in overwrite mode + +ovrwrt: + ld a,b ; Char count + cp lbufwid-2 ; Line full? + jr c,ovr1 ; No + cp c ; At EOLN? + ret z ; Accept no more chars + +ovr1: ex af,af' ; Recover char + ld (hl),a ; Put char in place + call fsp ; Advance by printing it + ld a,b ; Char count -> a + cp c + ret nc ; No need to incr char count inside line + inc b ; Else add to count + ret + +; Enter char in insert mode + +insert: + ld a,b ; Line full? + cp lbufwid-2 + ret nc + +insrt: + ld a,b ; At eoln? + sub c ; A = # chars to eoln + jr z,ovr1 ; Yes, really want overwrite + call insmem ; Push chars down to make room + ex af,af' ; Recover new char + ld (hl),a ; Place char in line + call ptail ; Reprint entire line from here + inc b ; Inc char count + jp fsp ; Advance cursor + + +; Line end/start toggle + +linend: ; Go to eoln or, if there, to start of line + ld a,b + cp c + jr z,linbeg + +linend1: + call fsp ; Print ahead until EOL + jr nz,linend1 + ret + +linbeg: + call bsp ; Backspace until start + jr nz,linbeg + ret + + +; Compare current char to list of word separators + +wrdsep: + push hl + push bc + ld bc,wrdseplen + ld a,(hl) + ld hl,wrdseps + cpir + pop bc + pop hl + ret + +wrdseps: + db 0,' ,;:.' ; Punctuation word separators +wrdseplen equ $ - wrdseps + + +; Delete current char from line + +delmem: + ld (hl),0 ; Terminal 0 or char to be deleted + ld a,b + sub c ; A = (count-position) = chars from end + ret z ; At eoln, no char + dec b + ret z ; Single char line + dec a + ret z ; On last char, just deleted it +delmem1: + inc a ; To move terminal 0 in + push hl + push de + push bc + ld d,h ; Dest is current pos + ld e,l + inc hl ; Source, terminal 0 + ld c,a ; Count, line tail + ld b,0 + ldir ; Block move + pop bc + pop de + pop hl + ret + +; Insert a char in line + +insmem: + push bc ; Make room for char in line + push de + ld c,a ; Bc = # chars to move + ld b,0 + add hl,bc ; Dest is new eoln + ld d,h ; Now in DE + ld e,l + dec hl ; Source is current eoln + lddr ; Tail move + pop de + pop bc ; Recover char count, crs pos info + inc hl ; Hl to next char + ret + + +; Print line tail from cursor position, return to position + +ptail: + push hl ; Save mem pos + push bc ; Save screen pos + call linend1 ; Print ahead to end of line + call ereol ; Clean off danglers +ptail1: + ld a,c ; End of line cursor pos + pop bc + pop hl + sub c ; Current cursor pos + ret z ; At end of line already + ld e,a ; Loop counter +ptail2: + call bspace ; Else back up to where we were + dec e + jr nz,ptail2 + ret + + +; Print a char, turn a control char into a cap char + +pctl: + push af + cp 20h + jr nc,pctl1 + add '@' +pctl1: call conout + pop af + ret + + +; Convert char or control key to upper case + +ucase: + cp ' ' + jr nc,notctl + add '@' +notctl: cp 'a' + ret c ; Not a lowercase + cp 'z'+1 + ret nc ; Not a lowercase + sub ' ' ; Yes, a lowercase + ret + + +; Zero line tail + +zline: + push hl + push bc + ld hl,(line) ; HL -> start of line + ld c,b ; BC = char count + ld b,0 + add hl,bc ; HL -> EOLN + ld a,lbufwid + sub c + dec a + jr z,zline0 + ld b,a ; # of 0's + xor a +zline1: + ld (hl),a + inc hl + djnz zline1 +zline0: + pop bc + pop hl + ret + + +; ESC key pressed - get submenu command + +esc_menu: + call cin + call ucase + cp 'Q' ; Quit + jr z,edquit + cp 'S' ; Toggle Save + ret nz ; Loop if none of these + +; Toggle recording state +; - Alter line prompt to > if save ON, >> if save OFF + +save_tog: + ld a,(save_flag) ; Flip flag byte + cpl + ld (save_flag),a + call crlf + call prompt ; Print new prompt string + pop af ; Lift ecmd from stack + jp edit ; Restart + + +; Exit editor + +eds$ex: + pop af ; Lift ECMD from stack + ld a,(save_flag) ; Are we recording? + or a + ret z ; Nope + + ld a,(minsave) ; Is line worth keeping? + cp b + push bc + call c,save_line + pop bc + +edn$ex: + xor a ; Return Z + ret + + +; Exit and pop shell + +edquit: + pop af ; Lift ECMD from stack + xor a ; Return NZ + dec a + ret + + +; --------------------------- + +; HISTORY STACK ROUTINES for RCPCLED, Version 1.2 + +;Each command line is pushed onto the history stack before execution. As the +;older ones overflow, they are eliminated. The last character of each line +;has the high bit set. The buffer terminates with a 0. +;The history stack is internal to the RCP, but could be implemented in an RSX + +; Save new line to stack +; - This routine called only on exit, so on-line regs not preserved. +; - Push contents down by size of current line +; - Move line buffer to start of stack +; - Terminate line with high bit set +; - Terminate history with 0 after last complete line +; - If current line is too big for buffer size chosen, do nothing + +save_line: + ld c,b ; Line size from b to bc + xor a + ld b,a + push bc + ld hl,HISTSIZE + sbc hl,bc ; Buffer size - line length + jr z,savel_err ; Not enough room + jr c,savel_err ; Definitely not enough room! + push hl + ld hl,hbuf_top + push hl + sbc hl,bc ; hl -> bufftop - line size + pop de ; de -> bufftop + pop bc ; bc = buffsize - line size + lddr ; tail move + + pop bc ; Recover line size in bc + ex de,hl + inc de ; de -> buffstart + ld hl,(line) ; Move in line + ldir + dec de + ex de,hl + set 7,(hl) ; Tag line terminus + + ld hl,hbuf_top ; Terminate history after last complete line +savel1: + dec hl ; Back up to EOLN + bit 7,(hl) + jr z,savel1 ; Loop until hi-bit encountered + inc hl + ld (hl),0 + ret + +savel_err: + pop af ; Lift BC push + ret + +; Recall command history, newest -> oldest +; - recall_ptr is init to start of buffer on each CLED invocation +; - return with pointer updated to next line + +recall_back: + call check_recall ; Is there anything in buffer? + ret nc ; No + +; Transfer from recall pointer to line buffer +; - enter hl @ recall_ptr +; - return ptr -> start of next command if no OVFL + +rc_back1: + ld de,(line) ; Destination for move +rc_back1a: + ld a,(hl) + or a + jr z,recall_quit ; Buff end + ldi + bit 7,a + jr z,rc_back1a + + ld (recall_ptr),hl ; Update ptr now + ex de,hl ; Point to end of line in line buffer + ld (hl),0 ; Terminate it + dec hl + res 7,(hl) ; Fix high bit from storage + + pop af ; Lift ecmd from stack + jp edit ; Restart on this line + +recall_quit0: + pop af ; Lift subroutine call from stack +recall_quit: + exx ; Recover main regs + ret ; Back to editing + + +; Recall command history, oldest -> newest + +recall_fwrd: + call check_recall ; Anything in buffer? + ret nc ; No + call rc_fwrd1 ; Move to previous line + call rc_fwrd1 ; Don't repeat line on direction rev + jr rc_back1 ; Now same code as recall_back + +rc_fwrd1: + dec hl ; Initially, HL -> next line to recall + ld de,history ; Underflow address +rc_fwrd1a: + push hl ; Compute position relative to top + xor a + sbc hl,de + pop hl + ret z ; Quit when start of buff reached + jr c,recall_quit0 ; Underflow + dec hl ; Going backwards in buffer + bit 7,(hl) + jr z,rc_fwrd1a + inc hl ; Point to char past command terminator + ret + + +; Check to see if anything in recall buffer yet +; - Ret NC = no, main regs preserved +; - Else switch main regs to alt, ret HL @ recall buffer line + +check_recall: + ld a,(history) ; Is anything in buffer yet? + or a + ret z ; Nope + call linbeg + exx + ld hl,(recall_ptr) + scf + ret + +; --------------------------- + +; Routine: EREOL function for Z34RCP +; Author: Rob Friefeld +; Version: 1.0 +; Date: September 19, 1989 +; +; Entry: EREOL +; Function: To clear to end of line +; Comments: The setting of the ERLTCAP equate determines whether this +; command uses the TCAP information or not. If not, it uses the +; ereol string passed in macro CLR_EOL. That string should +; end with the high bit set. The setting of the ERLQUICK equate +; determines whether to simply output the TCAP string for this +; function or to interpret it as does Rick Conn's VLIB version. +; Uses RCPSUBS.LIB routines CONOUT and PRINTHL. + + +; ------------------------------------------------------------------- + + if [not erltcap] +; Erase to end of line. Return NZ. + +ereol: call print + clr_eol +; or -1 ; For VLIB compatibility + ret + + + else + if erlquick + +; --------------------------- + +; This version just prints the EREOL string: no delay, no interpretation. + +ereol: + push hl + ld hl,z3tcap+17h ; CLS string + xor a ; Skip to EREOL string +ereol1: cp (hl) ; Skip once + inc hl + jr nz,ereol1 +ereol2: cp (hl) ; Skip twice + inc hl + jr nz,ereol2 + call printhl ; Print it + pop hl + ret + +; --------------------------- + +; This is a disassembly of EREOL from VLIB + else + +ereol: + push bc + push de + push hl + ld hl,z3tcap+16h ; Point to ereol delay + ld d,(hl) + inc hl + call vidskp + call vidskp + call vidout + pop hl + pop de + pop bc + xor a + dec a + ret + +vidskp: + ld a,(hl) + inc hl + or a + ret z + cp '\' + jr nz,vidskp + inc hl + jr vidskp + +vidout: + ld a,(hl) + or a + jr z,vid2 + inc hl + cp '\' + jr nz,vid1 + ld a,(hl) +vid1: + call conout + jr vidout + +vid2: + ld a,d + or a + ret z + ld c,a + ld hl,z3env+2bh ; Processor speed + ld a,(hl) + or a + jr nz,vidl1 + ld a,4 +vidl1: + ld b,a + push bc + call vdelay + pop bc + dec c + jr nz,vidl2 + ret +vdelay: + call vdel1 + djnz vdelay + ret +vdel1: + ld c,20 +vdel1a: + ex (sp),hl + ex (sp),hl + dec c + jr nz,vdel1a + ret + + endif ;erlquick + endif ;not erltcap + +; +;===== Z 3 L I B R O U T I N E S ================================ +; + +; Disassembly of Z3LIB routines DUTDIR, SHPUSH, SHPOP +; For use with CLED RCP segment ONLY +; Does not save regs as does Z3LIB, and has less env error checking +; rdf 10/2/89 + +DUTDIR: + ld a,z3ndirs ; No NDR + or a + ret z + + ld hl,(z3ndir) + inc b +dutdir1: + ld a,(hl) + or a + jr nz,dutdir2 + dec b + xor a + ret +dutdir2: + cp b + inc hl + jr nz,dutdir3 + ld a,(hl) + cp c + jr nz,dutdir3 + inc hl + dec b + xor a + dec a + ret +dutdir3: + push bc + ld bc,11h + add hl,bc + pop bc + jr dutdir1 + + +shpop: + +; *** +;Special function for RCPCLED -- null saved command line + ld a,(era_flag) ; Erase? + or a + jr z,eflag1 ; Z = NO + xor a + ld (history),a +eflag1: +; *** + +;shpop: + call getsh ; HL -> stack, DE = size, B = entries + ret z ; No stack + ld c,e ; Entry size + ld a,(hl) + or a + ret z ; Empty + ex de,hl + add hl,de ; HL -> next entry, DE -> first entry + xor a +shpop1: + ld (de),a ; Zero entry + dec b + ret z ; Successful exit, no more entries + push bc ; Pop next entry + ld b,0 + ldir + pop bc + jr shpop1 + + +shpush: + push hl ; Save string pointer + call getsh + jr z,shpush_err1 ; No stack + +shpush3: + ld a,(hl) ; Look for free entry + or a + jr z,shpush4 + add hl,de + djnz shpush3 + jr shpush_err2 ; Stack full +shpush4: + call getsh ; Point to top of stack + push bc +shpush5: + dec b + jr z,shpush6 + add hl,de + jr shpush5 +shpush6: + pop bc + ld c,e + dec hl + ex de,hl + add hl,de ; HL -> (entry-1) + size, DE -> (entry-1) + ex de,hl +shpush7: + ld a,b + cp 1 + jr z,shpush8 + dec b + push bc + ld b,0 + lddr + pop bc + jr shpush7 +shpush8: + call getsh + pop de + ex de,hl +shpush9: + ld a,(hl) + ldi + or a + jr nz,shpush9 + +shpushx: + ret + +shpush_err1: +; ld a,1 ; No stack +; jr shpush_err + +shpush_err2: + ld a,2 ; Stack full +shpush_err: + pop hl + or a + ret + + +; Get shell stack entry +; Return HL -> top of stack +; DE = entry size +; C = unchanged +; B = # entries +; A = # entries +; Z = no entries +getsh: +getsh2: + ld hl,(z3env+1eh) ; Stack + ld a,(z3env+20h) ; # entries + ld b,a + ld de,(z3env+21h) ; Entry size in E + ld d,0 + or a + ret + +; +;===== C L O C K R E A D I N G ================================== +; + + if systime + +; Print system time from DateStamper, ZS/ZDDOS/Z3PLUS clock + +; Entry point +; Print the string with leading '0' suppression +; Format: "h.mm " or "hh.mm " + +print_time: + +; 1. Test for DateStamper/ZSDOS/Z3PLUS and read clock if present + + ld c,12 ; Return version + ld e,'D' ; DateStamper test + call bdos + ld a,l ; Version # + cp 30h ; Z3PLUS? + jr nc,time1 ; Yes + ld a,h + cp 'D' + ret nz ; No clock + +; 2. Get time + + ld hl,time2 + push hl ; Return address on stack + push de ; Clock address on stack + ld hl,dtbuf ; Point to buffer + ret ; Call clock, return to time2 +time1: ; Z3PLUS entry point + ld c,105 ; CP/M Plus get time + ld de,dtbuf+1 + push de + call bdos + pop hl + ld a,(hl) + inc hl + ld b,(hl) + dec a + or b + ret z ; No clock if date = 0001 +time2: + +; 3. Turn highlight on, if present + + ld hl,stndout + call printhl + + ld hl,dtbuf+3 ; Point to hours + +; 4. Convert military time to civilian, if selected + + if civtim + ld a,(hl) ; Hours + or a ; Midnight? + jr nz,time3 ; No + ld a,24h ; Yes, say "12" +time3: sub 13h ; Time past 12:59 pm? + jr c,time4 ; No, don't change + daa ; Decimal adjust + inc a ; Yes, xlate to 12-hour + daa + ld (hl),a ; ..and patch in. + endif ; civtim + +; 5. Display time + +time4: + xor a + call pmbcd ; Print hours as 1 or 2 digits + ld a,(tim_sep) ; Print separator between hours, minutes + call conout + inc hl ; Point to minutes + ld a,80h ; Say print leading 0 + call pmbcd ; Print minutes as 2 digits + +; 2. Turn highlight off, if present + + ld hl,stndend + call printhl + jp spac ; Space before rest of prompt + +; +;===== D A T A ==================================================== +; + +; Buffer for date/time for read/write system clock + +dtbuf: ds 6 + + endif ;systime + + +line ds 2 ; Pointer to line buffer +recall_ptr ds 2 ; History position pointer +history ds HISTSIZE,0 ; History buffer +hbuf_top: equ $-1 + +; End RCPCLED.LIB + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpcls.lib b/Source/BPBIOS/Z34RCP11/rcpcls.lib new file mode 100644 index 00000000..e6264137 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpcls.lib @@ -0,0 +1,35 @@ + page + +; Library: RCPCLS for Z34RCP +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: CLS +; Function: To clear the CRT screen +; Comments: The setting of the CLSTCAP equate determines whether this +; command uses the TCAP information or not. If not, it uses the +; clear-screen string passed in macro CLSSTR. That string should +; end with the high bit set. + +cls: + if clstcap ; If using TCAP for clear screen string + ld a,(z3tcap) ; TCAP address from Z34CMN.LIB + cp ' '+1 ; See if blank + jr nc,cls1 ; If not, go to clear screen code + jp crlf ; If blank, just do CRLF +cls1: + ld hl,clrscr ; Address from Z34CMN.LIB + jp printhl ; Display it + + else ; Not using tcap + + call print + clsstr ; String from Z34RCP.LIB + ret + + endif ;clstcap + +; End RCPCLS.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpcmd.lib b/Source/BPBIOS/Z34RCP11/rcpcmd.lib new file mode 100644 index 00000000..58a54e78 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpcmd.lib @@ -0,0 +1,56 @@ + page + +; Library: RCPCMD for Z34RCP +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; Description: Command Table and Custom Commands for Z34-RCP + +; This is the customization file for the ZCPR Version 3.4 resident command +; package. Use it to add your own custom commands to the RCP. + +; Give each of your custom commands a unique label and command name. Then +; add the command name(s) to the macro CUSTTBL, below, and append the code +; for the commands to the end of this file. + +; CUSTTBL - Custom commands table. +; +; Add one line to CUSTTBL for each of your custom commands. Each line +; must be of the form: +; +; COMMAND name, TRUE, wheel, label +; +; Where COMMAND and TRUE appear as-is, and "name", "wheel", and "label" +; are created by the user. "Name" is a name of four characters or less used +; to invoke the command, in upper case. "Wheel" is "true" to protect the +; command from non-wheel users, "false" otherwise. "Label" marks the +; beginning of the custom code. For example, to create a wheel- +; protected command named "DIR" which calls the code at label "directory", +; CUSTTBL appears as follows: +; +;custtbl macro +; command DIR, true, true, directory +; endm + +custtbl macro +;; command ____, true, ____, _______ ; Template for custom commands + endm + +; ------------------------------ + +; RCP command dispatch table + + db cmdsize ; Length of each command name + cmdtbl ; Dispatch table from Z34RCP.LIB + custtbl ; Optional custom commands + db 0 ; Marks end of command jump table + +; -------------------------------------------------- + +; Insert label(s) and code for custom RCP commands here: + +; + +; END RCPCMD.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpcp.lib b/Source/BPBIOS/Z34RCP11/rcpcp.lib new file mode 100644 index 00000000..6ec69f48 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpcp.lib @@ -0,0 +1,245 @@ + page + +; Library: RCPCP for Z34RCP +; Author: Carson Wilson +; Version: 1.3 +; Date: August 11, 1989 +; Changes: Responds dynamically to QUIET flag, eliminating "noise." + +; Version: 1.2 +; Date: December 30, 1988 +; Changes: Now works properly with CP/M Plus. +; Moved SETDMA to common routines. + +; Author: Carson Wilson +; Version: 1.1 +; Date: August 4, 1988 +; Changes: Now initializes FCB1 before calling SetFStp, allowing +; stamp setting of multiple-extent files. +; +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: CP +; Function: Copy a file from one place to another +; Syntax: If FCBSWAP false: +; CP destfile=srcfile, CP =srcfile +; If FCBSWAP true: +; CP srcfile destfile, CP srcfile +; If TESTEQ and FCBSWAP true: +; Both of the above forms work +; +; Comments: Both file specifications can include a directory specification. +; If only one file name is given, then the current directory and +; the source file name are assumed for the destination. + +; +; New ZSDOS/DosDisk BDOS standard functions: +; +GetFStp equ 102 ; Get file stamp function +SetFStp equ 103 ; Set file stamp function + +copy: + call retsave + call dirchek ; Test bad directory + + if leftright + call fcbswap ; Exchange fcb1 with fcb2 + endif + +; If new is blank, make it the same name and type as old + + ld de,fcb1+1 ; Point to destination file name + ld a,(de) ; Get first character + cp ' ' ; If not blank (no name) + jr nz,copy0 ; ..then branch to copy + ld hl,fcb2+1 ; Copy source name into destination FCB + ld b,11 ; Name and type are 11 bytes + call blkmov + +; See if destination is same as source, and abort if so + +copy0: + ld hl,fcb1 ; Set up pointers to two files + ld de,fcb2 + push hl + push de + inc hl ; Point to names of files + inc de + ld b,13 ; Compare 13 bytes (name, type, and user #) +copy1: call comp + jr nz,copy2 ; If they differ, go on with copy + ld a,(cdrv) ; ZCPR current drive + inc a ; Shift to range 1..16 + ld b,a ; ..and keep value in B + pop de ; Restore pointers to FCBs + pop hl + ld a,(de) ; Get drive of source file + ld c,a ; ..and save it in C + or a ; Is it default drive? + jr nz,copy1a ; Branch if drive made explicit + ld c,b ; Otherwise, copy default drive into C +copy1a: ld a,(hl) ; Get drive of destination file + or a ; Is it default drive? + jr nz,copy1b ; Branch if drive made explicit + ld a,b ; Otherwise, get current drive +copy1b: cp c ; Compare the two drives specified + jr nz,copy3 ; Branch if they are different + jp duperr ; Tell EH duplicate filespecs +copy2: + pop de ; Clean up the stack + pop hl + +; Make note of the user numbers of the two files + +copy3: + ld a,(fcb1+13) ; Get destination user number + ld (usrdest),a + ld a,(fcb2+13) ; Get source user number + ld (usrsrc),a + +; Set up new FCB for source file and open the source + + call define ; Define buffer addresses dynamically +srcfcb equ $+1 + ld hl,0 ; Get address to use for new source FCB + push hl + ex de,hl ; Copy file data to new FCB + ld b,12 + call blkmov + call logsrc ; Log in user number of source file + pop hl ; Initialize the source file FCB + call initfcb2 + ld c,15 ; Open source file + call bdos + inc a ; Check for error + jp z,noflerr ; File not found error handler + + if StpCall + call cpmver + jr nc,copy4 ; Don't do this if CP/M Plus +stpbuf equ $+1 + ld de,0 + call setdma ; Set DMA to date buffer + ld de,(srcfcb) + ld c,GetFStp ; Get stamp (if any) to DMA + call bdos + ld (gotstp),a ; Store result + ld de,tbuff ; Restore DMA + call setdma ; ..for search +copy4: + endif ; StpCall + +; Make sure destination file does not already exist + + call logdest ; Log into destination user area + call extest ; Test for existence of file in fcb1 + jp z,exit ; Branch if it exists and user says no + +; Create destination file + + ld de,fcb1 ; Point to destination FCB + ld c,22 ; BDOS make-file function + call bdos + inc a ; Test for error (no directory space) + jp z,fulerr ; Invoke EH if not OK + +; Copy source to destination + +copy5: call logsrc ; Log in source user area + ld b,0 ; Initialize counter + ld de,(cbuff) ; Initialize buffer pointer +copy5a: push de ; Save address and counter + push bc + call setdma ; Set DMA to cbuff+(b*128) + ld de,(srcfcb) ; Point to source file FCB + ld c,20 ; BDOS read-sequential function + call bdos + pop bc ; Get counter and address + pop de + or a ; Read Ok? + jr nz,copy5b ; Branch if end of file + ld hl,128 ; Point DE to next buffer address + add hl,de + ex de,hl + inc b ; Increment counter + ld a,b ; See if buffer full + cp cpblocks + jr nz,copy5a ; If not, go back for more +copy5b: ld a,b ; Get count of blocks loaded into buffer + or a ; Are there any? + jr z,copy6 ; Branch if not (we are done) + push bc ; Save count + call logdest ; Log into destination user number +cbuff equ $+1 ; Pointer for in-the-code modification + ld de,0 ; Point to beginning of copy buffer +copy5c: push de ; Save buffer address + call setdma ; Set dma to buffer + ld de,fcb1 ; Point to destination file FCB + ld c,21 ; Sequential write the block + call bdos + or a ; Get result + jp nz,fulerr ; Invoke EH (disk full or write error) + pop de ; Get buffer address & balance stack + pop bc ; Get count + dec b ; Buffer empty? + jr z,copy5 ; Yes. Back for refill + push bc ; No. Save count + ld hl,128 + add hl,de + ex de,hl ; DE points to next buffer address + jr copy5c ; Back for another sector to write + +; Close the destination file + +copy6: call logdest ; Log into destination user number + ld de,fcb1 ; Point to destination FCB + ld c,16 ; Close file + call bdos + inc a ; 0ffh --> 0 if error + jp z,fulerr ; Invoke EH + + if StpCall +gotstp equ $+1 + ld a,0 ; File had stamp? + dec a ; 1 --> 0 = yes + jr nz,noset ; No + ld de,(stpbuf) ; Point to buffer + call setdma ; Set DMA + call initfcb1 ; Init. for SetFStp, point to dest. + ld c,SetFStp ; Set file's stamp + call bdos ; CCP restores DMA +noset: + endif ; StpCall + + ld a,(quiet) + or a + jr nz,qcpdone + call print + db ' Don','e'+80h +qcpdone: + if cpsp and spaceon + jp spaexit ; Report space remaining on destination drive + else + jp exit + endif ;cpsp and spaceon + +; Log into user number of source file + +logsrc: +usrsrc equ $+1 ; Pointer for in-the-code modification + ld a,0 ; Get user number + jr setusrrel ; Local jump to save code + +; Log into user number of destination file + +logdest: +usrdest equ $+1 ; Pointer for in-the-code modification + ld a,0 ; Get user number +setusrrel: + jp setusr + +; End RCPCP.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpdir.lib b/Source/BPBIOS/Z34RCP11/rcpdir.lib new file mode 100644 index 00000000..76c08bc3 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpdir.lib @@ -0,0 +1,137 @@ + page + +; Library: RCPDIR for Z34RCP +; Author: Carson Wilson +; Version: 1.0 +; Date: August 6, 1989 +; Changes: Now allows "DIR [dir:].aft" as well as "DIR [dir:]*.aft" +; to show all files of a given file extentsion, +; e.g., "d .?80" gives all .Z80 and .180 files. +; +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: DIR +; Function: Display a directory of the files on disk +; Syntax: DIR [dir:afn] Displays the DIR files +; DIR [dir:afn] S Displays the SYS files +; DIR [dir:afn] A Display both DIR and SYS files +; +; If slashchk is true: +; +; DIR [dir:]/S Equivalent to DIR [dir:]*.* S +; DIR [dir:]/A Equivalent to DIR [dir:]*.* A + +dir: + call retsave ; Save return address and set stack + +; See if FCB should be made wild (all '?') + + ld hl,fcb1+1 ; Point to file name in FCP + ld a,(hl) ; Get first character of filename + + if slashchk ; Allow "DIR /S" and "DIR /A" formats + cp '/' ; If name does not start with '/' + jr nz,dir01 ; ..branch and process normally + inc hl ; Point to second character + ld a,(hl) ; Get option character after slash + ld (fcb2+1),a ; ..and put it into second FCB + dec hl ; Back to first character + ld a,' ' ; Simulate empty FCB + endif ;slashchk + +dir01: + cp ' ' ; See if no file spec given + jr nz,dir02 ; Spec given + + ld b,8 ; Wildcard name + ld a,(fcb1+9) + cp ' ' ; Wildcard type? + jr nz,dir01a ; No + ld b,11 ; Yes. Fill name and type. +dir01a: ld a,'?' ; Get ready to fill with '?' + call fillp ; ..carry out fill +dir02: + if nosys ; Suppress-SYS-file-if-no-wheel option + call getwhl ; Get wheel status + jr z,dirnly ; If wheel off, ignore options + endif + + ld a,(fcb2+1) ; Get first char of 2nd file name + ld b,1 ; Set for both dir and sys files + cp allflag ; SYS and DIR flag specifier? + jr z,dirpr ; Got system specifier + dec b ; B=0 for sys files only + cp sysflag ; SYS only? + jr z,dirpr + +dirnly: ld b,80h ; Must be dir-only selection + +; DIRECTORY PRINT ROUTINE +; On entry, B reg is set as follows: +; 0 for only system files, 80h for only dir files, 1 for both +; +dirpr: + ld a,b ; Get systst flag + call getdir ; Load and sort directory + jp z,prfnf ; Print no file message + if wide + ld e,5 + else + ld e,4 ; Count down to 0 + endif ; wide +; +; ENTRY PRINT LOOP +; On entry, HL pts to files selected (terminated by 0) +; and E is entry counter +; +dir3: + ld a,(hl) ; Check for done + or a + if dirsp and spaceon + jp z,spaexit ; Show space when done + else + jp z,exit ; Exit if done + endif ; Dirsp and spaceon + ld a,e ; Get entry counter + or a ; Output CRLF if 4 or 5 entries printed in line + jr nz,dir3a ; Continue + call crlf ; New line + if wide + ld e,5 + else + ld e,4 ; Reset entry count + endif ; wide + + ld a,e ; Get entry count +dir3a: + if wide + cp 5 + else + cp 4 ; First entry? + endif ; wide + + jr z,dir4 + call print +; + if wide +; + db ' ' ; 2 spaces + db ' '+80h ; Then 1 more space +; + else +; + db ' ' ; Space + db fence+80h ; Then fence char +; + endif ; Wide +; +dir4: + call prfn ; Print file name + call break ; Check for abort + dec e ; Decrement entry counter + jr dir3 + +; End RCPDIR.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpecho.lib b/Source/BPBIOS/Z34RCP11/rcpecho.lib new file mode 100644 index 00000000..ffe56183 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpecho.lib @@ -0,0 +1,162 @@ + page + +; Library: RCPECHO for Z34RCP +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: ECHO +; Function: Echo text to console or printer + +echo: + xor a ; Lower case/printer off flag setting + ld (crtfl),a ; Printer off by default + + if upcase ; If upper case default + dec a + endif ;upcase + + ld (casefl),a ; Store flag in code below + ld hl,tbuff+1 ; Point to first character + call getchar ; Get first character (should be blank) + ; If none, exit from routine + +; Loop to echo chars + +echo2: call getchar + + if echolst + cp ff ; Form feed? + jr z,echo3 + endif ;echolst + + cp '^' + jr nz,echo2a ; Not control character prefix + call getchar ; Get next character + and 1fh ; Convert to control character + jr echo2e ; Echo it +echo2a: + cp cmdchar ; Case shift prefix? + jr nz,echo2e ; No, normal echo + call getchar ; Get next character + + if echolst + cp prtchar ; Turn printer on? + jr z,echo2b ; Store non-zero in crt flag + cp crtchar ; Turn printer off? + jr nz,echo2c ; No, test for shift characters + xor a ; Yes, clear crt flag +echo2b: ld (crtfl),a + jr echo2 ; On to next character +echo2c: + endif ; echolst + + cp ucasechar ; Up-shift character? + jr z,echo2d ; Store non-zero value in case flag + cp lcasechar ; Lower-case character? + jr nz,echo2e ; No, echo the character as is + xor a ; Else, clear case flag +echo2d: ld (casefl),a + jr echo2 ; On to next character +echo2e: + call echout ; Send char + jr echo2 + +; Form feed - send new line followed by form feed if printer output + + if echolst +echo3: + ld a,(crtfl) ; Check for printer output + or a ; Non-zero? + jr z,echoff ; No, send form feed normally + call echonl ; Send new line + ld a,ff ; Send form feed + jr echout + +; Send form feed char to console + +echoff: + ld a,ff ; Get char + jr echo2e + endif ;echolst + +; End of print loop - check for printer termination + +echo4: + if not echolst + ret + + else + ld a,(crtfl) ; Get list mode flag + or a + ret z ; Done if no printer output + +; Output a new line + +echonl: + ld a,cr ; Output new line on printer + call echout + ld a,lf ; Fall thru to echout + endif ; not echolst + +; Output char to printer or console + +echout: + ld c,a ; Char in c + cp 'A' ; If less than 'A' + jr c,echouta ; Leave as is + cp 'Z'+1 ; If greater than 'Z' + jr nc,echouta ; Leave as is + add 20h ; Else convert to lower case +echouta: + ld d,a ; Save lower case version in d +casefl equ $+1 ; Pointer for in-the-code modification + ld a,0 + or a ; Upper case? + jr nz,echoutb ; If upper case selected, go on as is + ld c,d ; Else substitute lower case version +echoutb: + + push hl ; Save hl + push bc ; Save bc + ld de,0ch-3 ; Offset for BIOS console output + + if echolst + +crtfl equ $+1 + ld a,0 + or a ; Printer? + jr z,echout1 ; No + inc de ; Offset for BIOS printer output + inc de + inc de + endif ;echolst + +; Output char in C with BIOS offset in DE + +echout1: + call biout ; Bios output + pop bc ; Restore bc,hl + pop hl + ret + +; Get a character from the command tail buffer + +getchar: + ld a,(hl) ; Get character + inc hl ; Point to next one + or a ; Check for end of string + ret nz ; If not end, return + pop hl ; Else, clean up stack + jr echo4 ; And exit from routine + +; Output char in C to BIOS with offset in DE + +biout: + ld hl,(wboot+1) ; Get address of warm boot + add hl,de ; Pt to routine + jp (hl) ; Jump to it + +; End RCPECHO.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpera.lib b/Source/BPBIOS/Z34RCP11/rcpera.lib new file mode 100644 index 00000000..776becb8 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpera.lib @@ -0,0 +1,76 @@ + page + +; Library: RCPERA for Z34RCP +; Author: Carson Wilson +; Version: 1.2 +; Date: Sept. 15, 1989 +; Changes: Chains to error handler with flag set to invoke transient ERA +; if a read only file is encountered. Propose error code +; 17 decimal for "file read only" error. +; +; Version: 1.1 +; Date: August 12, 1989 +; Changes: Now responds dynamically to QUIET flag, eliminating "noise". +; NOTE: if QUIET is active, using the inspect option or trying +; to erase R/O files will give meaningless messages. Use +; the PROT command to set R/O files to R/W first in order to +; erase them quietly. +; +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: ERA +; Function: Erase files +; Forms: +; ERA Erase Specified files and print their names +; ERA o Erase Specified files and print their names, but ask +; for verification before Erase is done + +era: + call retsave + ld a,(fcb2+1) ; Get eraflg if it's there + ld (eraflg),a ; Save it as a flag + ld a,1 ; Dir files only + call getdir ; Load directory of files + jp z,prfnf ; Abort if no files +; +; Main erase loop +; +era1: call break ; See if user wants to stop + call qplug ; Turn of output if quiet + push hl ; Save ptr to file + call prfn ; Print its name + ld (nxtfile),hl ; Save ptr to next file + pop hl ; Get ptr to this file + call unplug ; Turn output on + call rotest ; Test file pted to by hl for r/o + ld a,17 ; Proposed file R/O error code + ld b,00010000b ; EH flag to invoke transient + jp nz,errex1 ; Chain to transient if R/O +eraflg equ $+1 ; Address of flag + ld a,0 ; 2nd byte is flag + cp ' ' ; Is it an inspect option? + jr z,era2 ; Skip prompt if it is not + call eraq ; Erase? + jr nz,era3 ; Skip if not +era2: ld de,fcb1+1 ; Copy into fcb1 + ld b,11 ; 11 bytes + call blkmov + call initfcb1 ; Init fcb + ld c,19 ; Delete file + call bdos +era3: ld hl,(nxtfile) ; Hl pts to next file + ld a,(hl) ; Get char + or a ; Done? + if erasp and spaceon + jp z,spaexit + else + jp z,exit + endif ; Erasp and spaceon + call crlf ; New line + jr era1 + +; End RCPERA.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcph.lib b/Source/BPBIOS/Z34RCP11/rcph.lib new file mode 100644 index 00000000..34cae928 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcph.lib @@ -0,0 +1,119 @@ + page + +; Library: RCPH for Z34RCP +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: HELP +; Function: This command displays a list of all resident commands that +; are supported, including those in the CPR (command processor), +; RCP, and FCP. +; +; Syntax: H + +clist: + +; Print the FCP-resident command names + + if listfcp + call print ; Print header for FCP + db lf + db 'FC','P'+80h + ld hl,(fcp) ; Get FCP address dynamically from ENV + ld a,h ; See if still there + or l + jr z,nofcp ; FCP has been removed + ld bc,5 ; Calculate address of FCP command table + add hl,bc + call cmdlist ; Display list of commands +nofcp: + endif ;listfcp + +; Print the CPR-resident command names + + if listcpr + call print ; Print "CPR" + db cr,lf ; Need CR if no FCP + db 'CP','R'+80h + ld hl,(ccp) ; Get CCP address from ENV + ld bc,offcmd ; Point to command table in CPR + add hl,bc + call cmdlist ; Display the list of commands + endif ;listcpr + +; Print the RCP-resident command names + + call crlf ; Skip a line + ld hl,rcpname ; Print RCP name + call printhl + ld hl,RCPbegin+5 ; Point to RCP command table + ; Fall through to CMDLIST + +;---------------------------------------- + +; Subroutine to display list of commands in a command table (code above +; falls through to this routine -- do not move it). The commands are +; displayed 5 per line with 8 character spaces allowed for each command +; (subject to equates below). + +cmdlist: + call crlf ; Start with new line + ld e,(hl) ; Get size of each command name into DE + ld d,0 + inc hl ; Point to name of first command + ld c,cmdsline ; Set names-per-line value +cmdlist1: + ld a,(hl) ; Get first character of the command name + or a ; See if it is null + jr nz,cmdlist1a ; If not, continue + ld a,cmdsline ; See if we are already on a new line + cp c + call nz,crlf ; If not, skip a line + ret + +cmdlist1a: + if noshow ; Option to suppress wheel-limited cmds + rla ; Shift high bit of name into carry bit + jr nc,cmdlist2 ; If not restricted, go on + call getwhl ; Otherwise, check wheel byte + or a + jr nz,cmdlist2 ; If wheel set, continue as usual + add hl,de ; Otherwise skip this command + jr cmdlist5 + endif + +; Print leading spaces between names + +cmdlist2: + ld a,cmdspace ; Spacing between command names + sub e ; Less length of each command name + ld b,a +cmdlist3: + call spac + djnz cmdlist3 + +; Print name of command + + ld b,e ; Length of each name into B +cmdlist4: + ld a,(hl) ; Get command name character + call conout + inc hl ; Point to next + djnz cmdlist4 + + dec c ; Decrement count of names on this line + jr nz,cmdlist5 ; Branch if room for more names + call crlf ; Otherwise, end this line and + ld c,cmdsline ; ..reset count for another line of commands + +; Skip to next command name + +cmdlist5: + inc hl ; Skip jump vector + inc hl + jr cmdlist1 ; Back to process next name + +; End RCPH.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpid.lib b/Source/BPBIOS/Z34RCP11/rcpid.lib new file mode 100644 index 00000000..dfbacaf2 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpid.lib @@ -0,0 +1,64 @@ + page + +; Library: RCPID for Z34RCP +; Author: Carson Wilson +; Version: 1.0 +; Date: September 29, 1989 +; Changes: ID appended with 'C' if CLED is present +; +; Author: Carson Wilson +; Version: 1.0 +; Date: September 14, 1988 +; +; Function: Build the name of the RCP and append it at the end of the +; file at label RCPID. This serves two purposes: first it +; allows the 'H' command to describe which RCP is active, +; second, the string identifies the actual end of the RCP +; in memory. +; +; ------------------------------------------------------------------------ + +; Macros to build RCP ID for Help command + +; Under SLR and compatible assemblers, the RCP name reflects the +; RCP size, e.g., "RCP-21F" means the RCP occupies 21 records. + + if SLR +rcpid macro +rcplen defl RCPend - RCPbegin +fulrecs equ rcplen / 128 ; Full records +lastr equ [rcplen mod 128 + 127]/128 ; Last record, if any +ttlrecs equ fulrecs + lastr + + db 'RCP-' + db ttlrecs / 10 + '0' ; Tens of records + db ttlrecs mod 10 + '0' ; Ones + db rcptype ; 'F', 'H', etc. from RCP.LIB + if cledon + db 'C' ; Distinguish CLED versions + endif + db 0 ; ID string terminator + endm + + else ; Non-SLR +rcpid macro + db 'RCP-' + db rcptype + db 0 + endm + endif ; SLR + +; ----------------------------------------------------------------------- + +; Name of RCP + +; This block allows the 'H' command and/or the SHOW utility to display a name +; and version number for this RCP as well as the commands that are supported. +; It also generates a unique string marking the end of the RCP module. + +rcpname: + rcpid + +; End of RCPID.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpiom.lib b/Source/BPBIOS/Z34RCP11/rcpiom.lib new file mode 100644 index 00000000..d85e553d --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpiom.lib @@ -0,0 +1,296 @@ + page + +; Library: RCPIOM for Z34RCP +; Author: Carson Wilson +; Version: 1.1 +; Date: August 12, 1989 +; Changes: POKE and PORT now respond dynamically to QUIET flag, +; eliminating "noise." + +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Commands: PEEK, POKE, and PORT + +; ------------------------------------------------------------------ +; +; Command: PEEK +; Function: Display memory contents +; +; Form: +; PEEK startadr 128 bytes displayed +; PEEK startadr endadr Range of bytes displayed + + if peekon +peek: + call retsave + ld hl,tbuff+1 ; Find first number +nxtpeek equ $+1 ; Pointer for in-the-code modification + ld de,100h ; Default peek address if none + call sksp ; Skip to first token (if any) + call nz,hexnum ; Get start address if any + push de ; Save starting address + ld bc,peeklen ; Compute default ending address + ex de,hl + add hl,bc + + if peekchk ; Check for overflow + jr nc,peek0 ; If no overflow past FFFF, go on + ld hl,0ffffh ; Else use FFFF as ending address +peek0: + endif ;peekchk + + ex de,hl ; End address in DE + call sksp ; Skip to next token (if any) + call nz,hexnum ; Get 2nd number in DE (else default) +peek1: pop hl ; HL is start address, DE is end address + + if peekhdr + push hl ; Save starting address again + ld b,8 ; Output leading spaces +peek0a: call spac + djnz peek0a + ld b,16 ; Display 16 column headers +peek0b: ld a,l ; Get low byte of address + and 0fh ; Display low hex digit + call pashc + inc hl + djnz peek0b +; +; Display header for ASCII area +; + call print + db ' ',' '+80H ; Space over to ASCII area + pop hl ; Get address + push hl + ld b,16 ; Display 16 chars. ASCII header +peek0b1:ld a,l ; Get byte + and 0fh ; Mask + call pah ; Print ASCII char. + inc hl ; Next byte + djnz peek0b1 + + if peekbdr + call crlf + ld b,8 +peek0c: call spac ; Print leading spaces + djnz peek0c + ld b,16 +peek0d: call print + db ' -','-'+80h + djnz peek0d + +; Print border at ASCII area + + call print + db ' ',' '+80h ; Space to ASCII border + ld b,16 ; 16 dashes +peek0e: call print + db '-'+80h + djnz peek0e + endif ;peekbdr + + pop hl ; Restore starting address + endif ;peekhdr + + ld c,0ffh ; Use C as continue flag + call peek2 ; Do peek + ld (nxtpeek),hl ; Set continued peek address + jp exit +peek2: + ld a,c ; Check continuation flag + or a + ret z + +; Print line header + +peek2a: call crlf ; New line + ld a,h ; Print address + call pashc + ld a,l + call pahc + call dash ; Print leader + ld b,16 ; 16 bytes to display + push hl ; Save start address + +; Print hex values for 16 bytes + +peek3: ld a,(hl) ; Get next byte + call pashc ; Print with leading space + +; Check for last address. If C is already 0, leave it that way. +; Otherwise check for end address and if so set C to zero. + + ld a,c ; See if continue flag already cleared + or a + jr z,peek3a ; If so, skip test + ld a,h + sub a,d ; See if h = d + ld c,a + ld a,l + sub a,e ; See if l = e + or c ; Combine two tests + ld c,a +peek3a: inc hl ; Pt to next + djnz peek3 + +; Print ASCII equivalents for 16 bytes + + pop hl ; Pt to first address again + ld b,16 ; 16 bytes + call print ; Space and fence + db ' ' + db fence+80h + push bc ; Save flag in c +peek4: ld a,(hl) ; Get next byte + ld c,'.' ; Assume dot + and 7fh ; Mask it + cp ' ' ; Dot if less than space + jr c,peek5 + cp 7fh ; Don't print del + jr z,peek5 + ld c,a ; Char in c +peek5: ld a,c ; Get char + call conout ; Send it + inc hl ; Pt to next + djnz peek4 + call print ; Closing fence + db fence+80h + pop bc ; Get flag in c back + call break ; Allow abort + jr peek2 + endif ; Peekon + +; PAHC - Print A as 2 hex chars +; PASHC - With leading space + + if peekon or pokeon or porton +pashc: + push af ; Save A + call spac + pop af +pahc: push bc ; Save bc + ld c,a ; Byte in c + rrca ; Exchange nybbles + rrca + rrca + rrca + call pah ; Print hex char + ld a,c ; Get low + pop bc ; Restore bc and fall thru to pah +pah: and 0fh ; Mask + add '0' ; Convert to ascii + cp '9'+1 ; Letter? + jr c,pah1 + add 7 ; Adjust to letter +pah1: jp conout + endif ; Peekon or pokeon or porton + +; -------------------------------------------------------------------- +; +; Command: POKE +; Function: Place Values into Memory +; +; Form: +; POKE startadr val1 val2 ... +; + if pokeon +poke: + call retsave + ld hl,tbuff+1 ; Pt to first char + call sksp ; Skip to non-blank + jp z,numerr ; Numerical error + call hexnum ; Convert to number + call qplug ; Shut off output if quiet + call print + db ' Pok','e'+80h + call adrat ; Print at message (quiet sensitive) + call unplug ; Turn on output + +; Loop for storing hex values sequentially via POKE + +poke1: push de ; Save address + call sksp ; Skip to non-blank + jp z,exit ; Done + cp '"' ; Quoted text? + jr z,poke2 + call hexnum ; Get number + ld a,e ; Get low + pop de ; Get address + ld (de),a ; Store number + inc de ; Pt to next + jr poke1 + +; Store ASCII chars. + +poke2: pop de ; Get next address + inc hl ; Pt to next char +poke3: ld a,(hl) ; Get next char + or a ; Done? + jp z,exit + ld (de),a ; Put char + inc hl ; Pt to next + inc de + jr poke3 + + endif ; Pokeon + +; ------------------------------------------------------------------- +; +; Command: PORT +; Function: Display or Set I/O Port Data +; +; Forms: +; PORT addr - Read port and display value +; PORT addr value - Output value to port +; + if porton +port: + call retsave + ld hl,tbuff+1 ; Find first number + call sksp ; Skip to first command-line token + jp z,numerr ; Numerical error + call hexnum ; Get start address into de + push hl ; Save pointer to command tail + ld hl,portadl ; Modify code + ld (hl),e ; Move specified port addr into place + dec hl ; Point to opcode position + ld (hl),0dbh ; Poke 'in' opcode + dec hl + ld (hl),d ; Save MSB for port address + inc hl + ex (sp),hl ; Get tail pointer back while saving this one + call qplug ; Shut off output if quiet + call print ; Print header + db ' Por','t'+80h + ld a,e + call pashc ; Print port address + call sksp ; Skip to possible second value + jr z,portin ; Proceed with port input + call hexnum ; Get 2nd number in de + ex (sp),hl ; Get pointer to opcode back + ld (hl),0d3h ; Poke 'out' opcode + call print + db ': OU','T'+80h + ld a,e ; Get value to output + jr paddr +portin: + call print + db ': I','N'+80h + xor a ; Make sure high port address = 0 (for hd64180) +portadh equ $+1 +paddr: ld b,0 ; ..for both in and out instructions +opcode: + db 0 ; Opcode for in or out inserted by code above +portadl: + db 0 ; Port address inserted by code above + call pashc + call unplug ; Turn on output + pop hl ; Clean up stack + jp exit + + endif ; Porton + +; End RCPIOM.Z80 + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcplt.lib b/Source/BPBIOS/Z34RCP11/rcplt.lib new file mode 100644 index 00000000..98d6b0ba --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcplt.lib @@ -0,0 +1,256 @@ + page + +; Library: RCPLT for Z34RCP +; Author: Carson Wilson +; Version: 1.1 +; Date: August 26, 1989 +; Changes: Some WordStar characters caused garbage to appear on the +; screen. Now filters control characters other than CR, +; TAB, and LF. Thanks to Gene Pizzetta for this suggestion. +; +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Commands: LIST and TYPE + +; ---------------------------------------------------------------- +; +; Command: LIST +; Function: Print out specified file on the LST: Device +; Forms: +; LIST Do form feed +; LIST Print file(s) (NO Paging) +; Notes: +; The flags which apply to TYPE do not take effect with LIST +; The tab expansion code is required for LST: output. + + if liston +list: + ld a,(fcb1+1) ; Get filename or ' ' from command + ld (prflg),a ; List flag (A can't be 0) + cp ' ' ; Null command? + jp z,lstff ; Yes, do form feed and return + jr type0 ; No, send file to LST: + endif ;liston + +; -------------------------------------------------------------------- +; +; Command: TYPE +; Function: Print out specified file on the CON: Device +; Forms: +; TYPE Print file +; TYPE P Print file with paging flag +; Notes: +; The flag PGDFLG defines the letter which toggles the paging +; facility (P in the forms section above) +; The flag PGDFLT determines if TYPE is to page by default +; (PGDFLT=TRUE if TYPE pages by default); combined with +; PGDFLG, the following events occur -- +; If PGDFLT = TRUE, PGDFLG turns OFF paging +; If PGDFLT = FALSE, PGDFLG turns ON paging + +type: + if liston + xor a ; Turn off printer flag + ld (prflg),a ; Set flag + endif ; Liston + +; Entry point for list function (LIST) + +type0: call retsave ; Save return address + ld a,(fcb2+1) ; Get page flag from command + ld (pgflg),a ; Store it + ld a,1 ; Select dir files + call getdir ; Allow ambiguous files (HL points to buffer) + jp z,noflerr ; EH no files error + ld a,(lins) ; Set line count + ld (pagcnt),a + jr typex1 + +; Entry point for successive files + +typex0: pop hl ; Balance stack for skip + pop hl ; ..to next file command (^X) +typex: ld hl,(nxtfile) ; Get ptr to next file + ld a,(hl) ; Any files? + or a + jp z,exit + + if liston + ld a,(prflg) ; Check for lst: output + or a ; 0=type + jr z,typex1 + ld a,cr ; Bol on printer + call lcout + call lstff ; Form feed the printer +; fall thru + endif ; Liston + + ; Entry point for 1st file +typex1: ld de,fcb1+1 ; Copy into fcb1 + ld b,11 ; 11 bytes + call blkmov + ld (nxtfile),hl ; Set ptr to next file + call initfcb1 ; Init fcb1 + ld c,15 ; Open file + call bdos + inc a ; Set error flag + jp z,noflerr ; EH no files error + ld a,cr ; New line + call lcout + ld a,lf + call lcout + ld bc,080h ; Set char position and tab count + ; (b=0=tab, c=080h=char position) + +; Main loop for loading next block + +type2: ld a,c ; Get char count + cp 80h + jr c,type3 + call break + push bc ; Read next block + ld de,fcb1 ; Pt to fcb + ld c,20 ; Read record + call bdos + or a ; Set flags + pop bc + jr nz,typex ; End of file? + ld c,0 ; Set char count + ld hl,tbuff ; Pt to first char + +; Main loop for printing chars in tbuff + +type3: ld a,(hl) ; Get next char + and 7fh ; Mask out msb + cp 1ah ; End of file (^z)? + jr z,typex ; Next file if so + +; Output char to CON: or LST: device with tabulation + + cp cr ; Reset tab count? + jr z,type4 + cp lf ; Reset tab count? + jr z,type4 + cp tab ; Tab? + jr z,type5 + cp ' ' ; Skip other ctls. + jr c,type6 + +; Output char and increment char count + + call lcout ; Output char + inc b ; Increment tab count + jr type6 + +; Output or and reset tab count + +type4: call lcout ; Output or + ld b,0 ; Reset tab counter + jr type6 + +; Tabulate + +type5: ld a,' ' ; + call lcout + inc b ; Incr pos count + ld a,b + and 7 + jr nz,type5 + +; Continue processing + +type6: + inc c ; Increment char count + inc hl ; Pt to next char + jr type2 + +; Send a formfeed to LST:. Assumes PRFLG <> 0. + +lstff: + ld a,ff ; formfeed +; fall thru + +; Send output to LST: or CON:, as per the flag +; Return with Z if abort + +lcout: push hl ; Save regs + push bc + ld e,a ; Char in e + ld c,2 ; Output to con: + + if liston +prflg equ $+1 ; Pointer for in-the-code modification + ld a,0 ; 2nd byte is the print flag + or a ; 0=type + jr z,lc1 + ld c,5 ; Output to lst: + endif ; Liston + +lc1: push de ; Save char + call bdos ; Output char in e + pop de ; Get char + ld a,e + cp lf ; New line? + jr nz,lc2 ; No, return + call break ; Check for abort + jp z,typex0 ; Skip if ^X + + if liston + ld a,(prflg) ; Output to lst:? + or a ; Nz = yes + jr nz,lc2 + endif ; Liston + +; New line, so check for paging + + ld hl,pagcnt + dec (hl) + jr nz,lc2 ; Jump if not end of page + ld a,(lins) + ld (hl),a ; Reset counter +pgflg equ $+1 ; Pointer to in-the-code buffer + ld a,0 ; 2nd byte is the paging flag + cp pgdflg ; Page default override option wanted? + + if pgdflt ; If paging is default + jr z,lc2 ; Pgdflg means no paging + else + jr nz,lc2 ; Pgdflg means page + endif ; Pgdflt + + push hl ; Save hl + call print + db cr,lf,' Typing',' '+80h + ld hl,fcb1+1 ; Print file name + call prfn + call dash ; Print dash + call conin ; Get input + pop hl ; Restore hl + call break1 ; Set Z flag or abort + push af ; Save results + + if typecls and clson + call cls ; Clear between screens + else + call crlf + endif + + pop af ; Get results + jp z,typex0 ; Control-X, so skip to next file + cp ctrlz ; If Control-Z, + jr nz,lc2 + ld a,pgdflg ; Switch to non-default + ld (pgflg),a ; ..paging mode +lc2: pop bc ; Restore regs + pop hl + ret + +; Storage for line counter + +pagcnt: + ds 1 + +; End RCPLT.LIB + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpprot.lib b/Source/BPBIOS/Z34RCP11/rcpprot.lib new file mode 100644 index 00000000..4e8a5479 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpprot.lib @@ -0,0 +1,130 @@ + page + +; Library: RCPPROT for Z34RCP +; Author: Carson Wilson +; Version: 1.1 +; Date: August 12, 1989 +; Changes: Now responds dynamically to QUIET flag, eliminating "noise." + +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: PROT +; Function: To set the attributes of a file (R/O, SYS, and ARC) +; Form: PROT afn RSAI +; Comments: If R, S, or A are omitted, the file is made R/W, DIR, or +; modified, respectively. R, S, A, and I may be in any order. +; If I is present, Inspection is enabled. + +att: + call retsave + call dirchek ; Test bad directory + xor a ; Set no inspect + ld (inspect),a + ld hl,0 ; Set r/o and sys attributes off + ld c,0 ; Set Arc attribute off + ld de,fcb2+1 ; Pt to attributes + ld b,4 ; 4 chars max +att1: + ld a,(de) ; Get char + inc de ; Pt to next + cp 'I' ; Inspect? + jr z,atti + cp 'R' ; Set r/o? + jr z,attr + cp 'S' ; Set sys? + jr z,atts + cp 'A' + jr z,atta +att2: + djnz att1 + jr att3 +atti: + ld (inspect),a ; Set flag + jr att2 +attr: + ld h,a ; Save R/O flag + jr att2 +atts: + ld l,a ; Save SYS flag + jr att2 +atta: + ld c,a ; Save ARC + jr att2 +att3: + ld (fatt2),hl ; Save file attributes + ld a,c + ld (fatt1),a ; Save Arc attribute + ld a,1 ; Select dir and sys files + call getdir ; Load directory + jp z,noflerr ; Tell error handler no file + jr att5 +att4: + ld hl,(nxtfile) ; Pt to next file + ld a,(hl) ; End of list? + or a + jp z,exit + call crlf ; New line +att5: call break ; Check for possible abort + call qplug ; Turn off output if quiet + push hl ; Save ptr to current file + call prfn ; Print its name + ld (nxtfile),hl ; Save ptr to next file + call print + db ' Set to R','/'+80h + ld hl,(fatt2) ; Get attributes + ld c,'W' ; Assume r/w + ld a,h ; Get r/o bit + or a + jr z,att6 + ld c,'O' ; Set r/o +att6: ld a,c ; Get char + call conout + ld a,l ; Get sys flag + or a ; Set flag + jr z,att7 + call print + db ', SY','S'+80h +att7: ld a,(fatt1) + or a + jr z,att7a + call print + db ', AR','C'+80h +att7a: call unplug ; Turn output on +inspect equ $+1 ; Ptr for in-the-code modification + ld a,0 ; Get inspect flag + or a ; Z=no + pop hl ; Get ptr to current file + jr z,att8 + call eraq1 ; Ask for y/n + jr nz,att4 ; Advance to next file if not y +att8: ld de,fcb1+1 ; Copy into fcb1 + ld b,11 ; 11 bytes + call blkmov + ex de,hl + dec hl ; Pt to archive byte +fatt1 equ $+1 + ld a,0 + call attset + dec hl ; Pt to sys byte +fatt2 equ $+1 ; Ptr for in-the-code modification + ld de,0 ; Get attributes + ld a,e ; Get sys flag + call attset ; Set attribute correctly + dec hl ; Pt to r/o byte + ld a,d ; Get r/o flag + call attset + ld de,fcb1 ; Pt to fcb + ld c,30 ; Set attributes + call bdos + jp att4 +attset: + res 7,(hl) ; Clear attribute + or a + ret z ; 0=clear attribute + set 7,(hl) ; Set attribute + ret + +; End RCPPROT.LIB + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpquiet.lib b/Source/BPBIOS/Z34RCP11/rcpquiet.lib new file mode 100644 index 00000000..9269d241 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpquiet.lib @@ -0,0 +1,49 @@ + page + +; Library: RCPQUIET for Z34RCP +; Author: Carson Wilson +; Version: 1.1 +; Date: August 6, 1989 +; Changes: Now "Q R[eset]" and "Q S[et]" just reset and set quiet status +; without showing it, and Q alone (or with any other character, +; e.g., "Q ?") always just shows status. +; Forms: +; Q - Display quiet flag (always) +; Q s - Set quiet flag ON +; Q r - Set quiet flag OFF +; +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: Q +; Function: Set the Quiet flag on or off +; Comments: If QQUIET equate is true, then RCP does not report +; quiet status with the Q command. +; Forms: +; Q - Display quiet flag (if QQUIET false) +; Q s - Set quiet flag ON +; Q r - Set quiet flag OFF + +quset: + ld a,(fcb1+1) ; Get first char + ld b,1 ; Prepare to turn on + cp 'S' ; S-et quiet (ON) + jr z,quset1 + ld b,0 ; Prepare to turn off + cp 'R' ; R-eset quiet (OFF) + jr nz,qmsg ; Neither S nor R, so display +quset1: + ld a,b + ld (quiet),a + ret + +qmsg: +; Print Quiet Flag Message + + ld a,(quiet) + jp tella ; Say " On" or " Off" and return + +; End RCPQUIET.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpr.lib b/Source/BPBIOS/Z34RCP11/rcpr.lib new file mode 100644 index 00000000..e29a4f37 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpr.lib @@ -0,0 +1,108 @@ + page + +; Library: RCPR for Z34RCP +; Author: Carson Wilson +; Version: 1.5 +; Date: August 30, 1989 +; Changes: Minor bug fix as suggested by Howard Goldstein. +; +; Version: 1.4 +; Date: August 26, 1989 +; Changes: Now performs reset 37 for ALL drives under CP/M 2.2 or ZRDOS +; to ensure that fast fixed disks are reset under ZRDOS, then +; exits with reset 13 to compensate for bugs in ZRDOS/CP/M 2.2 +; reset 37. Still resets individual drives selectively under +; CP/M Plus and ZS/ZDDOS. + +; Version: 1.3 +; Date: August 11, 1989 +; Changes: Now responds dynamically to QUIET flag, eliminating "noise." +; Now performs reset 37 in ALL cases, reset 13 as well if not +; CP/M Plus or ZSDOS (per suggestion by Howard Goldstein). + +; Version: 1.2 +; Date: December 30, 1988 +; Changes: Now resets single drives under Z3PLUS. + +; Version: 1.1 +; Date: September 11, 1988 +; Changes: Fixed bug which failed to detect ZRDOS. ZRDOS' function +; 37, like CP/M's, is not reliable. + +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: RESET +; Function: Reset the disk system +; Forms: R [d: or dir:] - ZSDOS or CP/M Plus +; R - CP/M 2.2 or ZRDOS +; Comments: ZRDOS does not require a disk system reset when disks are +; changed, but directory programs will not show the correct +; size if this is not done. It is also good practice. Since +; no warm boot is performed, the disk in drive A need not have +; the operating system on it. +; +; Under ZSDOS or CP/M Plus, individual drives may be reset, and +; if RESETSP is true, space remaining is also given. If +; the fast hard disk reset capability is enabled under ZSDOS, +; any "fast" fixed disks are also reset at this time. +; +; NOTE: It is necessary to reset a legal directory or DU when there are +; protected directories. + +reset: ld a,(quiet) + or a ; Skip message if quiet + jr nz,QReset + call print ; Report action + db ' Rese','t'+80h +QReset: call cpmver ; CP/M Plus? + jr nc,reset0 ; Yes + ld c,48 + call bdos ; ZRDOS or CP/M? + ld a,h + or a + jr nz,reset0 ; No, assume bug-free F37 + ld de,0ffffh ; Yes, reset ALL drives, both ways + ld c,37 + call bdos + ld c,13 + jp bdos ; Yes, do regular reset + +; Reset individual drive(s) + +reset0: call dirchek ; Abort with error if illegal drivespec + ld a,(fcb1) ; Use default drive? + or a + jr nz,reset1 ; No, use drive from FCB1 + ld a,(cdrv) ; Yes, get ZCPR 3.3 current drive byte + inc a ; Shift range to 1..16 +reset1: ld hl,1 ; Map drive "A:" +reset2: dec a ; Done yet? + jr z,reset3 ; Yes + add hl,hl ; No, shift vector to next drive + jr reset2 + +; Check for fixed disks + +reset3: push hl ; Save current or specified vector + ld c,39 + call bdos ; ZSDOS return fixed disks in HL + pop de ; Restore vector + ld a,d + or h ; Add any fixed disks + ld d,a + ld a,e + or l + ld e,a + ld c,37 ; Reset individual drive(s) + + if spaceon and resetsp + call bdos + jp crspace ; Show space remaining (QUIET sensitive) + else + jp bdos ; Do reset and return + endif + +; End RCPR.LIB + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpreg.lib b/Source/BPBIOS/Z34RCP11/rcpreg.lib new file mode 100644 index 00000000..d73eee05 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpreg.lib @@ -0,0 +1,165 @@ + page + +; Library: RCPREG for Z34RCP +; Version: 1.1 +; Date: August 11, 1989 +; Changes: Register Set, Decrement, and Increment commands now respond +; dynamically to QUIET flag, eliminating "noise." + +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: REG +; Function: Manipulate Memory Registers +; +; Forms: +; REG D or REG <-- Display 10 Register Values +; REG Mreg <-- Decrement Register Value +; REG Preg <-- Increment Register Value +; REG Sreg value <-- Set Register Value +; +; Vers 2.1 Joe Wright +; +; REG reg <-- Display a single register value +; +; REG numbers now range from 0 to 31, although only the first ten are +; displayed with REG D. +; +; REG now treats the program error byte as register E. +; +register: + ld de,fcb1+2 ; Pt to first arg + ld a,(de) ; Get possible digit + call regptr ; Pt hl to potential register + dec de ; Point to command + ld a,(de) + cp 'S' ; Set? + jr z,rset + cp 'P' ; Plus? + jr z,rinc + cp 'M' ; Minus? + jr z,rdec + cp ' ' + jr z,rshow + cp 'D' + jr z,rshow + call regptr + jp regout + +; Increment register value +; HL pts to memory register on input + +rinc: inc (hl) ; Increment it + jr Qregout ; Print result + +; Decrement register value +; HL pts to memory register on input + +rdec: dec (hl) ; Decrement value + jr Qregout ; Print result + +; Show first ten registers and Program Error byte + +rshow: call rshow10 + ld hl,z3msg+6 + jp regout + +rshow10:xor a ; Select register 0 + ld b,a ; Counter set to 0 in b + call regp1 ; Hl pts to register 0 +rshow1: ld a,b ; Get counter value + cp 10 ; First ten registers + ret z ; Exit if done + push bc ; Save counter + push hl ; Save pointer + call regout ; Print register value + pop hl ; Get pointer + pop bc ; Get counter + inc b ; Increment counter + ld a,b ; Check for new line + and 3 + call z,crlf ; Newline after fourth display + inc hl ; Pt to next register + jr rshow1 + +; Set register value +; HL pts to register on input + +rset: + ld de,fcb2+1 ; Pt to value + call de2bin ; Eval string at de to binary in b + ld (hl),b ; Set value + +; Enter with HL pointing to the register. HL is maintained. +; +qregout:ld a,(quiet) + or a + ret nz +regout: call print + db ' Reg',' '+80h + ld de,z3msg+30h ; Register 0 + sbc hl,de ; Register number in hl + ld a,l + cp 32 ; A numbered register? + jr c,rego0 ; Yep + call print + db ' ','E'+80h + jr rego1 ; Report + +rego0: push hl + push de + ld b,0 ; Suppress zeros + call decdsp2 ; Report register number + pop de + pop hl +rego1: add hl,de ; Hl points to register again + call print + db ' =',' '+80h + ld l,(hl) + xor a + ld h,a + ld b,a ; Suppress leading zeros + jp decdsp3 ; Display value + +; Evaluate decimal string at DE to binary in B + +de2bin: ld b,0 ; Init value to zero +de2b: ld a,(de) ; Get this digit + inc de ; Pt to next + sub '0' ; Convert to binary + ret c ; A space, finished + cp 10 ; Range? + ret nc ; Not decimal, finished + ld c,a ; Digit in c + ld a,b ; Multiply old by 10 + add a,a ; *2 + add a,a ; *4 + add a,b ; *5 + add a,a ; *10 + add a,c ; Add in new digit + ld b,a ; Result in b + jr de2b ; Again + +; Set HL to point to memory register whose index is pted to by HL +; On input, A contains register char +; On output, HL = address of memory register (reg 0 assumed if error) + +regptr: ld hl,z3msg+6 ; The e register + cp 'E' + ret z + push de + call de2bin ; Get register number in b + pop de + ld a,b + cp 32 ; Range 0-31 + ld a,0 + jr nc,regp1 ; Out of range, use 0 + ld a,b ; Value in a +regp1: ld hl,z3msg+30h ; Pt to memory registers + add a,l ; Pt to proper register + ld l,a + ret ; No chance of crossing page boundary + +; End RCPREG.LIB + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpren.lib b/Source/BPBIOS/Z34RCP11/rcpren.lib new file mode 100644 index 00000000..6947bad2 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpren.lib @@ -0,0 +1,100 @@ + page + +; Library: RCPREN for Z34RCP +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: REN +; Function: To change the name of an existing file +; Forms: +; LEFTRIGHT false: +; REN = +; LEFTRIGHT true: +; REN +; LEFTRIGHT and TESTEQ both true: +; Either of the above forms may be used. + +ren: + call retsave + call dirchek ; Test bad dirspec + + if leftright + call fcbswap ; Exchange command line fcb's + endif +; +; STEP 1: See if old name is ambiguous +; + ld hl,fcb2+1 ; Can't be ambiguous + call ambchk1 +; +; STEP 2: Log into user area +; +; If dirspec given at old name, use it +; else use dirspec (or default) given at new name. + + ld hl,fcb1 ; Pt to new name + push hl + ld de,fcb2 ; Pt to old name + push de ; Save ptr + ld a,(de) ; Test if dirspec issued + or a ; ..at old name + jr z,ren1 ; No, use user at new name + ld (hl),a ; Stuff drive into new file + ld a,(fcb2+13) ; Yes, log to user area + call setusr ; ..of old name + jr ren2 +; +; Use dirspec at new name (none given at old name) +; +ren1: + ld a,(hl) ; Stuff drive of new name + ld (de),a ; ..into old name + call logusr ; Log to user at new name +ren2: +; +; STEP 3: See if old file is R/O +; + pop de ; Restore ptr to old FCB + push de ; Save it again + ld c,17 ; Look for old file + call bdos + inc a + jr z,rnxit + call getsbit ; Match found, get ptr to entry in tbuff + ex de,hl ; Hl pts to entry + inc hl ; Pt to fn + call rotest ; See if file is r/o + jr nz,rnxit1 ; Abort if so +; +; STEP 4: See if new file already exists +; EXTEST performs a number of checks: +; 1) Ambiguity +; 2) R/O +; 3) If file exists and not R/O, permission to delete +; + call extest + jr z,rnxit1 ; R/o or no permission +; +; STEP 5: Exchange file name fields for rename +; + pop de ; Pt to old + pop hl ; Pt to new + push hl ; Save ptr + ld b,12 ; 12 bytes + call iswap1 +; +; STEP 6: Rename the file +; + pop de ; Get ptr to FCB + ld c,23 ; Rename + call bdos + inc a ; Set zero flag if error +rnxit: + jp z,noflerr ; EH print no source file message +rnxit1: + jp exit + +; End RCPREN.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpsp.lib b/Source/BPBIOS/Z34RCP11/rcpsp.lib new file mode 100644 index 00000000..0fc5ecf6 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpsp.lib @@ -0,0 +1,163 @@ + page + +; Library: RCPSP for Z34RCP +; Author: Carson Wilson +; Version: 1.2 +; Date: August 11, 1989 +; Changes: CRSPACE does nothing if QUIET is true. +; +; Author: Carson Wilson +; Version: 1.1 +; Date: December 30, 1988 +; Changes: Calls CPMVER common routine. +; Sets DMA to TBUFF for CP/M Plus in case we chained to SP. + +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Command: SP +; Function: Shows space remaining on designated drive +; Syntax: SP [DIR:|DU:] +; Comments: This code can be called by several other RCP commands so that +; they can show the space remaining on the disk after their +; operation. + +; Now works with CP/M Plus. + + if [erasp or cpsp or dirsp] +crspace: ; Used to call space after other subroutines + ld a,(quiet) + or a ; Skip if we're being quiet + ret nz + call crlf ; Start new line + jr space0 ; Skip directory check + endif ;[erasp or cpsp or dirsp] +space: + call dirchek ; Abort to EH on bad dirspec +space0: ld a,(fcb1) ; Determine requested drive + or a ; If drive explicitly selected + jr nz,space1 ; ..then skip + ld a,(cdrv) ; Get current drive from ZCPR 3.4 + inc a ; Shift to range 1..16 + +space1: + dec a ; Shift to range 0..15 + ld e,a ; Save in E for selecting disk below + add a,'A' ; Convert to letter and + ld (seldrv),a ; save in message string below + ld c,14 ; BDOS select disk function + call bdos ; Not needed if no drive selected, but smallest + ; ..possible code size this way. + +; Here we extract the following disk parameter information from the disk +; parameter block (DPB): +; BLKSHF: block shift factor (1 byte) +; BLKMAX: max number of blocks on disk (2 bytes) + + call cpmver ; What BDOS is running? + jr nc,isplus + ld c,31 ; BDOS get disk parameters function + call bdos + inc hl ; Advance to block shift factor byte + inc hl + ld a,(hl) ; Get value and + ld (blkshf),a ; ..save it in code below + inc hl ; Advance to max block number word + inc hl + inc hl + ld e,(hl) ; Get value into HL + inc hl + ld d,(hl) + inc de ; Add 1 for max number of blocks + +; Compute amount of free space left on disk + +dfree: + ld c,27 ; BDOS get allocation vector function + push de ; Save BLKMAX value + call bdos ; Get allocation vector into HL + ld b,h ; Copy allocation vector to BC + ld c,l + pop hl ; Restore BLKMAX value to HL + ld de,0 ; Inititialize count of free blocks + +; At this point we have +; BC = allocation vector address +; DE = free block count +; HL = number of blocks on disk + +free1: push bc ; Save allocation address + ld a,(bc) ; Get bit pattern of allocation byte + ld b,8 ; Set to process 8 blocks +free2: rla ; Rotate allocated block bit into carry flag + jr c,free3 ; If set (bit=1), block is allocated + inc de ; If not set, block is not allocated, so + ; ..increment free block count +free3: ld c,a ; Save remaining allocation bits in C + dec hl ; Count down number of blocks on disk + ld a,l ; See if we are down to zero + or h + jr z,free4 ; Branch if no more blocks to check + ld a,c ; Get back current allocation bit pattern + djnz free2 ; Loop through 8 bits + pop bc ; Get pointer to allocation vector + inc bc ; Point to next allocation byte + jr free1 ; Continue by processing next allocation byte + +free4: pop bc ; Clean up stack + ex de,hl ; Free block count to HL +blkshf equ $+1 ; Pointer for in-the-code modification + ld a,0 ; Get block shift factor + sub 3 ; Convert to log base 2 of K per block + jr z,free6 ; Done if single density (1k per block) + +; Convert for blocks of more than 1K each + +free5: add hl,hl + dec a + jr nz,free5 + +; At this point HL = amount of free space on disk in K + +; Display decimal value of HL + +free6: ld b,0 ; Initialize count of digits already printed + ld de,10000 ; Divisor in DE + call decdsp ; Print digit (or space if leading '0') + ld de,1000 + call decdsp + call decdsp3 ; Display hundreds, tens, and units + + call print + db 'k free on ' +seldrv: db 0 ; Modified above to contain drive letter + db ':'+80h + ret + +; CP/M Plus free space calculation + +isplus: ld de,tbuff ; We may have chained to SP + call setdma + ld a,(seldrv) ; Get drive letter + sub 'A' ; Convert to BDOS call value + ld e,a + ld c,2eh ; Get free space call + call bdos + +; Convert 3 byte count of records to K + + ld b,3 ; Total amount to shift +c3fre1: ld hl,tbuff+2 ; Point to buffer start + rr (hl) + dec hl + rr (hl) + dec hl + rr (hl) + djnz c3fre1 + ld hl,(tbuff) ; Get free mod 65536k + jr free6 + +; End RCPSP.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/rcpsubs.lib b/Source/BPBIOS/Z34RCP11/rcpsubs.lib new file mode 100644 index 00000000..3879e9a2 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/rcpsubs.lib @@ -0,0 +1,1057 @@ + page + +; Library: RCPSUBS for Z34RCP +; Author: Carson Wilson +; Version: 1.4 +; Date: October 4, 1989 +; Changes: Added modifications by Rob Friefeld for CLED. +; +; Version: 1.3 +; Date: Sept. 8, 1989 +; Changes: Added ERREX1 routine. RCP now sets bit 4 of the command +; status flag on ambiguous file name errors. Intelligent +; error handlers can interpret this bit and chain to +; more sophisticated transient programs of the same name, +; much the same as CP/M Plus. +; +; Version: 1.2 +; Date: August 12, 1989 +; Changes: Added QPLUG and UNPLUG routines for QUIET operation. + +; Author: Carson Wilson +; Version: 1.1 +; Date: December 30, 1988 +; Changes: Added CPMVER routine to detect CP/M Plus. +; Expanded ZSDOS datestamp buffer to full 128 bytes. +; Now gets CCP address from Z34CMN.LIB instead of calculating +; it from BIOS address, since NZCOM allows nonstandard length +; CCP segments (suggested by Howard Goldstein). + +; Author: Carson Wilson +; Version: 1.0 +; Date: June 15, 1988 +; +; Subroutines for Z34RCP.Z80 + +; ---------------------------------------- + +; Routines to chain to Error Handler (EH) + +; 1. Error codes (from ZCPR34.LBR) + +; ZCPR34 uses the error byte at the beginning of the message buffer as a flag +; to show what kind of error occurred. Advanced error handlers will be able +; to help the user further by suggesting the possible cause of the error. + +ecbaddir equ 2 ; Bad directory specification -- logging of + ; ..user number beyond legal range, + ; ..nonexistent named directory +ecambig equ 8 ; Ambiguous file specification where not + ; ..allowed (SAVE, GET, REN) +ecbadnum equ 9 ; Bad numerical value -- not a number where + ; ..number expected, number out of range +ecnofile equ 10 ; File not found -- REN, TYPE, LIST could not + ; ..find a specified file +ecdiskfull equ 11 ; Disk directory or data area full + ; ..(DOS write error) +ectpafull equ 12 ; TPA overflow error +ecdupspec equ 16 ; Duplicate filespecs (COPY, RENAME) + +; 2. Error Routines + + if cpon or renon or lton or proton +NoFlErr: ; File missing + ld a,ecnofile ; File not found error + jr errexit ; Chain to error handler + endif ; cpon or renon or lton or proton + + if cpon +FulErr: ; Disk or directory full (BDOS write error) + ld a,ecdiskfull ; Disk or data area full + jr errexit ; Chain to error handler +DupErr: ; Duplicate file specs + ld a,ecdupspec ; Duplicate filespec error + jr errexit ; Chain to error handler + endif ; cpon +; +; Check for illegal directory specification under ZCPR 3.4. +; DirChek assumes that FCB's have not been altered since they were +; set by the CCP. Therefore DirChek is called before other BDOS calls. + + if cpon or lton or renon or diron or eraon or proton or reson or spaceon +DirChek: + ld a,(fcb1+15) ; Z34 sets these to non zero + ld hl,fcb2+15 ; ..if illegal dirspecs. found + or (hl) + ret z ; Return if OK + ld a,ecbaddir ; Bad dir. error code +; fall thru + endif +; +; Set error type, then set error, ECP, and external program bits of command +; status flag to tell CCP to go straight to EH. + +ErrExit: + ld b,0 +ErrEx1: ld ix,z3msg ; Point to message buffer + ld (ix+0),a ; First set error type in error byte + ld a,00001110b ; Tell CCP External, No ECP, Error, No shell + or b ; Add any specified bits + ld (ix+3),A ; Set bits in command status flag + jp exit ; Return to CCP + +; ------------------------------------------------------------- + +; Routine to get wheel byte - Returns wheel in A with flags set + +getwhl: + push hl + ld hl,(z3whl) ; Get wheel address from ENV + ld a,(hl) ; Read wheel byte + and a ; Set flags + pop hl + ret + +; ------------------------------ + + if systime ; Time in CLED prompt +; +; PMBCD - Print byte at (HL) to console as 1 or 2 BCD digits. +; +; Entry: A = 80h for leading zero's +; A = 0h for no leading zero's +; +pmbcd: + rld ; Get hi nibble (HL) to low nibble A + or a ; For HD64180 + call nz,decout ; Display if low or high of A not zero + rld ; Get low nibble (HL), from above +decout: + and 00001111b ; Mask high nibble + add a,'0' ; Convert to character + jr conout + endif ; systime + +; Display decimal digit routines + +; Display hundreds, tens, and units digits (assumes flag in B has been set) + + if regon or spaceon +decdsp3: + ld de,100 ; Display hundreds + call decdsp +decdsp2: + ld de,10 ; Display tens + call decdsp + ld a,l ; Get remaining units value +decdsp4: + add a,'0' ; Convert to character + jr conout ; Print it and return + +; --------------------------------- + +; Routine to print any single digit + +; Actually, this routine displays the value of HL divided by DE and leaves the +; remainder in HL. In computing the character to display, it assumes that the +; result of the division will be a decimal digit. If the result is zero, the +; value in the B register, which is the number of digits already printed, is +; checked. If it is zero, a space is printed instead of a leading '0'. If it +; is not zero, the '0' is printed. Whenever any digit (not a space) is +; printed, the value in B is incremented. + + +decdsp: + ld c,'0'-1 ; Initialize digit count + xor a ; Clear carry flag + +decdsp1: + inc c ; Pre-increment the digit + sbc hl,de ; Subtract DE from HL + jr nc,decdsp1 + + add hl,de ; Add back in to produce remainder + ld a,c ; Get decimal digit + cp '0' ; Check for leading 0 + jr nz,decdout ; If not 0, proceed to display it + ld a,b ; Digit printed already? + or a + jr z,spac ; Print leading space if not +decdout: + ld a,c ; Else print real digit + inc b ; Indicate digit printed + jr conout + endif ; regon or spaceon + +; ------------ + +; Print a dash + + if lton or peekon +dash: call print + db ' -',' '+80h + ret + endif ; Lton or peekon + +; ------------------------- + +; Shut off output in QUIET is set. Return Z if QUIET, NZ otherwise. +; Uses: AF + +qplug: + ld a,(quiet) + or a + ret z + ld a,0C9h ; "RET" +qplug1: ld (plug),a + ret + +; -------------------------- + +; Turn on output + +unplug: xor a + jr qplug1 + + +; ------------- + +; Print a space + +spac: ld a,' ' + +; fall thru + +; Console Output Routine + +conout: +plug: db 00h ; Goes to 0C9h to turn off output + putreg ; Save all registers except AF + push af ; Save AF, too + and 7fh ; Mask out MSB + ld e,a ; Transfer character to E + ld c,2 ; BDOS conout function number + call bdos + pop af + getreg ; Restore registers +note: ; Use this RET for NOTE command + ret + +; ------------------------ + +; String printing routines + +; Print string following call (terminated with null or character with the +; high bit set) + +print: + ex (sp),hl ; Get address + call printhl + ex (sp),hl ; Put address + ret + + if whlon or quieton +; +; Routine to say "On" if A is non-zero or "Off" if A is zero. +; Called by WHL and Q commands. + +onmsg: + dc ' On' +offmsg: + dc ' Off' +tella: + ld hl,offmsg ; Prepare to say Off + or a + jr z,printhl ; Say it if A=0 + ld hl,onmsg ; Say On + +; fall thru ; Display message and return + + endif ; whlon or quieton + +; Print string pointed to by HL (terminated with null or character with the +; high bit set) + +printhl: + ld a,(hl) ; Get next character + inc hl ; Point to following one + or a ; See if null terminator + ret z ; If so, we are done + call conout ; Display the character + ret m ; We are done if MSB is set (negative number) + jr printhl ; Back for more + +; ------------------------ + +; Output new line to CON: + +crlf: + call print + db cr,lf+80h + ret + +; Console input + + if eraon or lton or proton or renon or cpon +conin: + push hl ; Save regs + push de + push bc + ld c,1 ; Input + call bdos + pop bc ; Get regs + pop de + pop hl + and 7fh ; Mask msb + cp 61h + ret c + and 5fh ; To upper case + ret + endif ; Eraon or lton or proton or renon or cpon + +; ------------------- + +; Save return address + +retsave: + pop de ; Get return address + pop hl ; Get return address to zcpr3 + ld (z3ret),hl ; Save it + push hl ; Put return address to zcpr3 back + push de ; Put return address back + ret + +; ------------------------------- + +; Test file pted to by HL for R/O +; NZ if R/O + + if renon or cpon or eraon +rotest: + push hl ; Advance to r/o byte + ld bc,8 ; Pt to 9th byte + add hl,bc + ld a,(hl) ; Get it + and 80h ; Mask bit + push af + ld hl,romsg + call nz,printhl ; Print if nz + pop af ; Get flag + pop hl ; Get ptr + ret +romsg: + db ' is R/','O'+80h + +; ----------------------------------------------- + +; Check user to see if he approves erase of file +; Return with Z if yes + +eraq: + call print + db ' - Eras','e'+80h + endif ; Renon or cpon or eraon + + if renon or cpon or eraon or proton +eraq1: + call print + db ' (Y/N/Q)? N',88h ; 88h = backspace + call conin ; Get response + cp 'Q' ; Quit command? + jr z,exit + cp 'Y' ; Key on yes + ret + endif ; Renon or cpon or eraon or proton + +; ------------------------------------- + +; Give space on current disk and return + + if spaceon and [dirsp or cpsp or erasp or resetsp] +spaexit: + call crspace ; Show space remaining +; fall thru + endif ; spaceon and [dirsp or cpsp or erasp or resetsp] + +; +; Exit to ZCPR3 +; +exit: +z3ret equ $+1 ; Pointer to in-the-code modification + ld hl,0 ; Return address + jp (hl) ; Goto ZCPR3 + +; -------------------------------------------------------- + +; Check for user input; if ^X, return with Z, abort if ^C + + if diron or lton or eraon or proton or peekon +break: + push hl ; Save regs + push de + push bc + ld c,11 ; Console status check + call bdos + or a + ld c,1 ; Get char if any + call nz,bdos + pop bc ; Restore regs + pop de + pop hl +break1: cp ctrlc ; Check for abort + jr z,exit ; Exit + cp ctrlx ; Skip? + ret + endif ; Diron or lton or eraon or proton or peekon + +; --------------------- + +; Print address in DE + + if peekon or pokeon +adrat: + call print + db ' at',' '+80h + ld a,d ; Print high + call pahc + ld a,e ; Print low + jp pahc + endif ; Peekon or pokeon + +; -------------------------------------------------- + +; Extract hexadecimal number from line pted to by HL +; Return with value in DE and HL pting to offending char + + if peekon or pokeon or porton +hexnum: + ld de,0 ; De=accumulated value +hnum1: + ld a,(hl) ; Get char + cp ' '+1 ; Done? + ret c ; Return if space or less + inc hl ; Pt to next + sub '0' ; Convert to binary + jr c,numerr ; Return and done if error + cp 10 ; 0-9? + jr c,hnum2 + sub 7 ; A-f? + cp 10h ; Error? + jr nc,numerr +hnum2: + push hl ; Save pointer + ex de,hl + add hl,hl + add hl,hl + add hl,hl + add hl,hl ; De x16 to hl + ld e,a + ld d,0 + add hl,de + ex de,hl ; De = de * 16 + a + pop hl ; Get the pointer + jr hnum1 ; Try again +; +; Number error +; +numerr: + ld a,ecbadnum ; Numeric error + jp errexit ; Chain to error handler + +; Skip to next non-blank + +sksp: + ld a,(hl) ; Get char + inc hl ; Pt to next + cp ' ' ; Skip spaces + jr z,sksp + dec hl ; Pt to good char + or a ; Set eol flag + ret + endif ; Peekon or pokeon or porton + +; ------------------------------------------------------------------------ + +; Test File in FCB for unambiguity and existence, ask user to delete if so +; Return with Z flag set if R/O or no permission to delete + + if renon or cpon +extest: + call ambchk ; Ambiguous file names not allowed + call searf ; Look for specified file + jr z,exok ; Ok if not found + call getsbit ; Position into dir + inc de ; Pt to file name + ex de,hl ; Hl pts to file name + push hl ; Save ptr to file name + call prfn ; Print file name + pop hl + call rotest ; Check for r/o + jr nz,exer + call eraq ; Erase? + jr nz,exer ; Restart as error if no + ld de,fcb1 ; Pt to fcb1 + ld c,19 ; Delete file + call bdos +exok: xor a + dec a ; Nz = ok + ret +exer: + xor a ; Error flag - file is r/o or no permission + ret + +; Check for ambiguous file name in FCB1 +; Return z if so + +ambchk: + ld hl,fcb1+1 ; Pt to fcb + +; Check for ambiguous file name pted to by HL + +ambchk1: + push hl + ld b,11 ; 11 bytes +amb1: ld a,(hl) ; Get char + and 7fh ; Mask + cp '?' + jr z,amb2 + inc hl ; Pt to next + djnz amb1 + dec b ; Set nz flag + pop de + ret +amb2: + pop hl ; Pt to file name + ld a,ecambig ; Ambiguous name error + ld b,00010000b ; Bit 4 tells EH to load transient + jp ErrEx1 ; Chain to error handler + endif ; Renon or cpon + +; --------------------------------------- + +; Init FCB1, return with DE pting to FCB1 + + if eraon or lton or cpon +initfcb1: + ld hl,fcb1 ; Pt to fcb +initfcb2: + push hl ; Save ptr + ld bc,12 ; Pt to first byte + add hl,bc + ld b,24 ; Zero 24 bytes + xor a ; Zero fill + call fillp ; Fill memory + pop de ; Pt to fcb + ret + endif ; Eraon or lton or cpon + +; Fill a region with byte in A + + if eraon or lton or cpon or diron +fillp: + ld (hl),a ; Store byte + inc hl ; Pt to next + djnz fillp ; Count down + ret + endif ; Eraon or lton or cpon or diron + +; --------------------------------------------------------------------- + +; After a search, return NZ set if desired type of file found, Z if not. +; This algorithm looks at the system bit of the located file; this +; bit is set to 1 if the file is a system file and 0 if not a system +; file. The following exclusive or masks are applied to return Z or NZ +; as required by the calling routine: +; +; SYSTEM BYTE: X 0 0 0 0 0 0 0 (AFTER 80H MASK, X=1 IF SYS, 0 IF DIR) +; +; SYS-ONLY : 0 0 0 0 0 0 0 0 (XOR 0 = 0 if X=0, = 80H if X=1) +; DIR-ONLY : 1 0 0 0 0 0 0 0 (XOR 80H = 80h if X=0, = 0 if X=1) +; BOTH : 0 0 0 0 0 0 0 1 (XOR 1 = 81H or 1H, NZ in both cases) + + if diron or eraon or lton or proton or cpon or renon +getsbit: + dec a ; Adjust to returned value + rrca ; Convert number to offset into tbuff + rrca + rrca + and 60h + ld de,tbuff ; Pt to buffer + add a,e ; Add entry offset to base addr + ld e,a ; Result in e + push de ; Save ptr in de + add a,10 ; Add offset of 10 to pt to system byte + ld e,a ; Set address + ld a,(de) ; Get byte + pop de ; Get ptr in de + and 80h ; Look at only system bit +systst equ $+1 ; In-the-code variable + xor 0 ; If systst=0, sys only; if systst=80h, dir + ; Only; if systst=1, both sys and dir + ret ; Nz if ok, z if not ok + +; Log into user area contained in FCB1 + +logusr: + ld a,(fcb1+13) ; Get user number +setusr: + ld e,a + ld c,32 ; Use bdos fct + jp bdos + +; Print file name pted to by HL + +prfn: + call spac ; Leading space + ld b,8 ; 8 chars + call prfn1 + call print + db '.'+80h ; Dot + ld b,3 ; 3 chars +prfn1: ld a,(hl) ; Get char + inc hl ; Pt to next + call conout ; Print char + djnz prfn1 ; Count down + ret + +; Search for first + +searf: + push bc ; Save counter + push hl ; Save hl + call dirchek ; Check bad dirspec + ld c,17 ; Search for first function +searf1: ld de,fcb1 ; Pt to fcb + call bdos + inc a ; Set zero flag for error return + pop hl ; Get hl + pop bc ; Get counter + ret + endif ; Diron or eraon or lton or proton or cpon or renon + +; ------------------------- + +; Copy HL to DE for B bytes + + if diron or eraon or lton or proton or cpon +blkmov: + ld a,(hl) ; Get + ld (de),a ; Put + inc hl ; Pt to next + inc de + djnz blkmov ; Loop + ret + endif ; Diron or eraon or lton or proton or cpon + +; ----------------------------- + +; Print file not found message + + if diron or eraon +prfnf: + call print + db ' No File','s'+80h + jp exit + endif ; Diron or eraon + +; ------------------------------------------------------------------ + +; Define buffers as high as possible in TPA for the following groups +; of commands: +; +; COPY needs SRCFCB, CBUFF, STPBUF (if STPCALL) +; ERA, PROT, LIST/TYPE need DIRBUF and NXTFILE +; DIR needs DIRBUF +; +; If DIRBUF is defined, its value is in HL on return from this code. The DE +; register pair is not changed by the code, but the BC pair is affected. + +dirbufon equ lton or eraon or proton or diron + + if dirbufon +dirbuf: ds 2 ; Address for directory buffer + endif ; dirbufon + + if lton or eraon or proton +nxtfile: ds 2 ; Ptr to next file in list + endif ; eraon or lton or proton + + if cpon or dirbufon or cledon +define: + push de + ld hl,(bdos+1) ; Get bottom of BDOS + ex de,hl ; ..into DE + ld hl,(ccp) ; From Z34CMN.LIB + +; Now we have to compare and pick the lower address as the top of TPA + + push hl ; Save CPR address while comparing + xor a ; Clear the carry flag + sbc hl,de ; Compute (CPR-BDOS) + pop hl ; Restore CPR address + jr c,define1 ; Branch if BDOS address is higher (use CPR) + ex de,hl ; Otherwise use BDOS address +define1: + if cpon + ld de,-36 ; Calculate place for SRCFCB for copy command + add hl,de + ld (srcfcb),hl + + if stpcall + ld de,-128 + add hl,de ; Buffer for datestamps + ld (stpbuf),hl + endif ; stpcall + + if dirbufon + push hl ; Save if needed below + endif ; dirbufon + + ld de,-[cpblocks*128] ; CBUFF can use same space as DIRBUF + add hl,de + ld (cbuff),hl + + if dirbufon + pop hl + endif ; dirbufon + + endif ; cpon + + if dirbufon + ld de,-[maxdirs*11] ; Space for directory buffer + add hl,de + ld (dirbuf),hl + endif ; dirbufon + + pop de + ret + + endif ; cpon or dirbufon or cledon + +; --------------- + +; Search for next + + if diron or eraon or lton or proton +searn: + push bc ; Save counter + push hl ; Save hl + ld c,18 ; Search for next function + jr searf1 + +; Load directory and sort it +; On input, A=SYSTST flag (0=SYS, 1=DIR, 80H=BOTH) +; Directory is loaded into buffer at top of TPA +; Return with ZERO set if no match and HL pts to 1st entry if match + +direrr: + ld a,ectpafull ; Chain to error handler + jp errexit + +getdir: + ld (systst),a ; Set system test flag + call logusr ; Log into user area of fcb1 + call define ; Define buffer addresses + ld (hl),0 ; Set empty + ld bc,0 ; Set counter + call searf ; Look for match + ret z ; Return if not found + +; Step 1: Load directory + +gd1: + push bc ; Save counter + call getsbit ; Check for system ok + pop bc + jr z,gd2 ; Not ok, so skip + push bc ; Save counter + inc de ; Pt to file name + ex de,hl ; Hl pts to file name, de pts to buffer + ld b,11 ; Copy 11 bytes + call blkmov ; Do copy + pop bc ; Get counter + inc bc ; Increment counter + ld hl,maxdirs-1 ; See if count equals or exceeds MAXDIRS + ld a,b ; Check high bytes + sub h + jr c,gd1a ; If carry set, we are OK + ld a,c ; Check low bytes + sub l + jr nc,direrr ; If no carry, jump to error message +gd1a: ex de,hl ; Hl pts to next buffer location +gd2: call searn ; Look for next + jr nz,gd1 + ld (hl),0 ; Store ending 0 + ld hl,(dirbuf) ; Pt to dir buffer + ld a,(hl) ; Check for empty + or a + ret z + +; Step 2: Sort directory + + if dsort + push hl ; Save ptr to dirbuf for return + call diralpha ; Sort + pop hl + endif + + xor a ; Set nz flag for ok + dec a + ret + + +; DIRALPHA -- Alphabetizes directory in DIRBUF; BC contains +; the number of files in the directory +; + if dsort +diralpha: +; +; SHELL SORT -- +; This sort routine is adapted from "Software Tools" +; by Kernigan and Plaugher, page 106. Copyright, 1976, Addison-Wesley. +; + ld h,b ; Hl=bc=file count + ld l,c + ld (num),hl ; Set "NUM" + ld (gap),hl ; Set initial gap to n for first division by 2 + +; For (gap = num/2; gap > 0; gap = gap/2) + +srtl0: +gap equ $+1 ; Pointer for in-the-code modification + ld hl,0 ; Get previous gap + or a ; Clear carry + rr h ; Rotate right to divide by 2 + rr l + + ld a,l ; Test for zero + or h + ret z ; Done with sort if gap = 0 + + ld (gap),hl ; Set value of gap + push hl + pop ix ; Set ix=gap for following loop + +; For (ix = gap + 1; ix <= num; ix = ix + 1) + +srtl1: + inc ix ; Add 1 to ix + push ix + pop de ; IX is in DE + +; Test for ix <= num + +num equ $+1 ; Pointer for in-the-code modification + ld hl,0 ; Number of items to sort + ld a,l ; Compare by subtraction + sub e + ld a,h + sbc a,d ; Carry set means ix > n + jr c,srtl0 ; Don't do for loop if ix > n + ex de,hl ; Set jj = ix initially for first + ; ..subtraction of gap + ld (jj),hl + +; For (jj = ix - gap; jj > 0; jj = jj - gap) + +srtl2: + ld de,(gap) +jj equ $+1 ; Pointer for in-the-code modification + ld hl,0 ; Get jj + + sbc hl,de ; Compute JJ - GAP + ld a,h + ld (jj),hl ; Jj = jj - gap + jr c,srtl1 ; If carry from subtractions, jj < 0 and abort + or l ; Jj=0? + jr z,srtl1 ; If zero, jj=0 and abort + +; Set iy = jj + gap + + ex de,hl ; Jj in de + ld hl,(gap) ; Get gap + add hl,de ; Jj + gap + push hl + pop iy ; IY = iy + gap + +; If (v(jj) <= v(iy)) + + call icompare ; JJ in de, iy in hl + +; ...then break + + jr c,srtl1 + +; ...else exchange + + ld de,(jj) ; Swap jj, iy + push iy + pop hl + call iswap ; Jj in de, iy in hl + +; End of inner-most for loop + + jr srtl2 + +; +; SWAP (Exchange) the elements whose indexes are in HL and DE +; +iswap: + call ipos ; Compute position from index + ex de,hl + call ipos ; Compute 2nd element position from index + ld b,11 ; 11 bytes to flip + endif ; Dsort + endif ; Diron or eraon or lton or proton + + if diron or eraon or lton or proton or renon or (cpon and leftright) +iswap1: + ld a,(de) ; Get bytes + ld c,(hl) + ex de,hl + ld (de),a ; Put bytes + ld (hl),c + inc hl ; Pt to next + inc de + djnz iswap1 + ret + endif ; Diron or eraon or lton or proton or renon + ; ..or (cpon and leftright) + + if leftright and (cpon or renon) +; +; FCBSWAP exchanges 16 byte FCB1 with FCB2 from the command line. +; This allows COPY and REN commands to execute left to right, +; e.g., "cp source dest". Costs 10 bytes. +; +; If TESTEQ is true, then commands containing '=' still execute right +; to left, e.g., "cp dest=source". Costs 11 bytes additional. +; +fcbswap: + if testeq + xor a ; Zero B + ld b,a + ld hl,80h ; Point to command line, length + ld c,(hl) ; Set up for CPIR + ld a,'=' ; Search for '=' + cpir ; '=' found in command? + ret z ; Yes, don't swap + endif ; Testeq + + ld de,fcb1 ; Point to command fcb's + ld hl,fcb2 + ld b,16 ; Exchange them + jr iswap1 + endif ; leftright and (cpon or renon) + + if diron or eraon or lton or proton + if dsort +; +; ICOMPARE compares the entry pointed to by the pointer pointed to by HL +; with that pointed to by DE (1st level indirect addressing); on entry, +; HL and DE contain the numbers of the elements to compare (1, 2, ...); +; on exit, Carry Set means ((DE)) < ((HL)), Zero Set means ((HL)) = ((DE)), +; and Non-Zero and No-Carry means ((DE)) > ((HL)) +; +icompare: + call ipos ; Get position of first element + ex de,hl + call ipos ; Get position of 2nd element + ex de,hl +; +; Compare dir entry pted to by HL with that pted to by DE; +; No net effect on HL, DE; ret w/CARRY set means DE +; Version: 1.2 +; Date: 16 June 1988 +; Changes: Renamed CRT0 to LINS for NZCOM compatibility. +; Added CUSR " " " + +; Author: Carson Wilson +; Version: 1.1 +; Date: 12 June 1988 +; Changes: Added CDRV for various Z34RCP commands. +; Added CRT0 for Z34RCP TYPE command. +; Added Z3TCAP and CLRSCR for Z34RCP CLS command. +; Added QUIET for ZCPR34 time in prompt. +; Added RSDMSG for ZCPR34 time in prompt. + +; Library: Z34CMN.LIB +; Author: Joe Wright +; Date: 23 March 1988 + +; As a replacement for Z3BASE.LIB, some usual equates. + +base equ 0 ; Base Page + +false equ 0 +true equ not false + +no equ false +yes equ true + +off equ false +on equ true + +; Named COMMON declarations start here. For compatibility, these +; are the same names used by Bridger Mitchell's JetLDR. + + common /_ENV_/ +z3env: ; Z3 Environment descriptor +z3envs equ yes ; There is one + +expath equ z3env+9 ; Address of External Path +expaths equ 10 ; Maximum 10 elements for MPATH + +rcp equ z3env+0ch ; Address of RCP +rcps equ yes ; Used as existence test, not size + +fcp equ z3env+12h ; Address of FCB +fcps equ yes ; Used as existence test, not size + +z3ndir equ z3env+15h ; Address of NDR +z3ndirs equ yes ; Used as existence test, not size + +quiet equ z3env+28h ; Quiet flag address + +z3whl equ z3env+29h ; Wheel byte address +z3whls equ yes ; There is a wheel + +lins equ z3env+33h ; CRT text lines address + +ccp equ z3env+3fh ; CCP entry +ccps equ z3env+41h ; Size + +dos equ z3env+42h ; DOS entry (+6) +doss equ z3env+44h ; Size + +bio equ z3env+45h ; BIO entry + +z3tcap equ z3env+80h ; TCAP address + +clrscr equ z3env+97h ; Clear screen string address + + common /_SSTK_/ +shstk: ; Top of Shell stack +shstks equ yes ; There is a shell stack + + common /_MSG_/ +z3msg: ; Message buffer +z3msgs equ yes ; There is one + +cusr equ z3msg+2eh ; Current user +cdrv equ z3msg+2fh ; Current drive + +rsdmsg equ z3msg+3ah ; Reserved bytes + + common /_FCB_/ +extfcb: ; External file control block +extfcbs equ yes ; There is one + + common /_MCL_/ +z3cl: ; Multiple command line +z3cls equ yes ; There is one + + common /_XSTK_/ +extstk: ; External stack +extstks equ yes ; There is one + + common /_BIOS_/ +bios: + + cseg ; Select Code Segment + +; End of Z34CMN.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/z34defn.lib b/Source/BPBIOS/Z34RCP11/z34defn.lib new file mode 100644 index 00000000..683fc322 Binary files /dev/null and b/Source/BPBIOS/Z34RCP11/z34defn.lib differ diff --git a/Source/BPBIOS/Z34RCP11/z34mac.lib b/Source/BPBIOS/Z34RCP11/z34mac.lib new file mode 100644 index 00000000..8ab3ffbe --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/z34mac.lib @@ -0,0 +1,122 @@ + +; Z33MAC.LIB : Macros for use with ZCPR33 + +; General purpose macros + +putreg macro + push hl ; Save registers in order + push de + push bc + endm + +getreg macro + pop bc ; Restore registers in order + pop de + pop hl + endm + +swap macro + rrca ; Exchange nibbles + rrca + rrca + rrca + endm + +;---------------------------------------- + +; Macro for forming option bytes + +; This macro generates a byte with bits corresponding to up to 8 option +; flags. The bits are filled in the order of the parameters and are right +; justified in the byte. + +optflag macro f1,f2,f3,f4,f5,f6,f7,f8 + +flag defl 0 ;; initial value + + irp temp, + + if not nul temp +flag defl flag shl 1 + if temp +flag defl flag or 1 + endif ;;temp + endif ;;not nul temp + + endm ;; irp + + defb low flag + + endm ;; optflag + +;----------------------------------------------------------------------------- + +; Command table entry definition macro + +; Macro to form an entry for one command in the table. The first parameter is +; the name to be used for the command (no quotes); the second parameter is the +; flag that indicates whether or not the command is to be enabled; the third +; parameter is the wheel control flag; and the last parameter is the jump +; address to the code that carries out the command. The command names are +; automatically padded out to the correct length (they will be truncated and +; an error message will result if a command name is too long). The characters +; in the command name are automatically converted to upper case. + +command macro cmdname,enableflag,wheelflag,address + + if enableflag ;; Generate command only if enabled + +whlmask defl wheelflag ;; Initialize variables +count defl cmdsize ;; Initialize to size of each command name + + irpc char,cmdname ;; Repeat over letters in command name + +count defl count - 1 ;; Count down characters in name + + if [ count lt cmdsize ] + + ;; If character is lower case, convert to upper case + + if [ '&char' ge 'a' ] and [ '&char' le 'z' ] + + if whlmask + defb [ '&char' and 5fh ] + 80h + else ;;not whlmask + defb [ '&char' and 5fh ] + endif ;;whlmask + + else ;;not lower case + + if whlmask + defb '&char' + 80h ;; If controlled by wheel, set high bit + else ;;not whlmask + defb '&char' ;; If not restricted, leave high bit clear + endif ;;whlmask + + endif ;;lower case + + endif ;;[ count lt cmdsize ] + +whlmask defl false ;; Turn off high-bit setting after first char + + endm ;irpc + + ;; Pad command name with blanks + + if [ count gt cmdsize ] ;; If we underflowed + *** Command name "&cmdname" is too long / truncated *** + else + rept count + defb ' ' + endm + endif ;[ count gt cmdsize ] + + dw address ;; Dispatch address for command + + endif ;enable + + endm ;command + +; End Z33MAC.LIB + + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/z34rcp.lib b/Source/BPBIOS/Z34RCP11/z34rcp.lib new file mode 100644 index 00000000..74908d54 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/z34rcp.lib @@ -0,0 +1,515 @@ + +; 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 false + +; 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 'H' ; 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 no 'ERA - erase files? ' +select RENON no 'REN - rename files? ' +select CPON no '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, %' ; 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 + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/z34rcp.lib.sav b/Source/BPBIOS/Z34RCP11/z34rcp.lib.sav new file mode 100644 index 00000000..a0272445 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/z34rcp.lib.sav @@ -0,0 +1,515 @@ + +; 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, %' ; 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 + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/z34rcp11.doc b/Source/BPBIOS/Z34RCP11/z34rcp11.doc new file mode 100644 index 00000000..92195c5d --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/z34rcp11.doc @@ -0,0 +1,429 @@ + + ZCPR Version 3.4 Resident Command Package + Source Code + + Revised Documentation for Version 1.1 + October 7, 1989 by Carson Wilson + + Version 1.0 Documentation + June 17, 1988 by Carson Wilson + + + Contents + -------- + + 1. Files in this Library. + + 2. Purpose of the Resident Command Package. + + 2.1. "Resident" vs. "Transient" Commands. + + 2.2. The Z-System Resident Command Package. + + 2.2.1. Design Philosophy of the Z34 RCP. + + 3. Structure and Operation of the RCP Segment. + + 4. Generating an RCP for your System. + + 4.1. The Z-Relocatable Approach. + + 4.1.1. NZCOM and JetLDR. + 4.1.2. Z-Relocatable (ZRL) Code + + 4.2. The Assembly Approach. + + 4.2.1. Note on Assemblers. + 4.2.2. Assembly to Absolute Code. + 4.2.3. Assembly to Z-Relocatable Code. + 4.2.4. Adding Custom Commands to Z34RCP. + + 5. Legal Use of These Files. + + + +1. Files in this Library. + +This library of files contains the assembler source code and +accompanying documentation for the Z-System Resident Command +Package (RCP). To use Z34RCP you must be running ZCPR versions +3.3 or above. For pre-assembled Z-Relocatable (ZRL) RCPs, see +RCPZRL11.LBR. Z34RCP11.LBR consists of the following files +(uncompress with UNCR.COM, QL.COM or LBRE.COM): + +CLEDINST.CZM - Installer for CLED command. +CLEDSAVE.CZM - Command file utility for CLED. +RCPCLED .DZC - Documentation on CLED. +RCPBASE .LZB - Used to assemble an absolute address RCP. +RCPCMD .LZB - Used to include custom commands in the RCP. +RCP?????.LZB - Code modules for the standard RCP commands. +SYSDEF .LZB - Commonly used equates. +Z34CMN .LZB - Used to assemble Z-Relocatable RCP's. +Z34DEFN .LZB - Offsets in the ZCPR 3.4 code. +Z34MAC .LZB - Assembler macros. +Z34RCP11.DZC - This file. +Z34RCP11.FOR - Short description of the library. +Z34RCP11.HZP - Help file for the RCP, gives command syntax and + examples. +Z34RCP .LZB - Used to select features when assembling the RCP. +Z34RCP11.NZW - Changes since Z34RCP10.LBR. Intended for former + RCP users, this will be only of passing interest + to new users. +Z34RCP11.ZZ0 - Main file for assembling the RCP. +ZSYSTEM .AZ - General information about Z System. + + +2. Purpose of the Resident Command Package. + + 2.1. "Resident" vs. "Transient" Commands. + +Most of the commands used under CP/M and Z-System are "transient" +commands. The machine code for these commands (or "programs") is +stored in "command files," whose file type is normally .COM. +Thus, the machine code for WordStar is stored in a file called +"WS.COM". + +To run WordStar, the user issues the command "WS" at the command +line, the operating system loads WS.COM from the disk drive to +memory, and WS.COM takes over control of the computer. If the +user then exits WordStar and issues another command, the +operating system can load another command file from the disk, +reusing the area of memory previously occupied by WordStar. + +Recycling memory in this way makes personal computers quite +versatile, as the number of commands available to the user is +only limited to the number of command files stored on disk. +There are some drawbacks to this approach, however. Although +disk-based commands conserve memory by recycling it, they must be +loaded from disk each time they operate. This creates its own +costs in terms of speed of execution, disk storage space, and +memory reallocation. + +The most obvious disadvantage of loading a file from disk each +time a command is issued is that it takes time to find and load +disk files. Especially with floppy diskettes, the amount of time +which elapses after the command is issued and before the command +executes is significant. A second drawback to disk-based +commands is that commands will not execute unless their machine +code is available on the disk system. This means that the user +must know what command files are available on disk before issuing +commands. The final disadvantage of disk file based commands is +that some commands (e.g., SAVE) require that the area of memory +normally overwritten by command files (known as the "Transient +Program Area" or TPA) be preserved. + +In answer to these difficulties, the creators of CP/M designed +some of its commands as "built-in" commands. The DIR, REN, SAVE, +ERA, USER, and TYPE commands of CP/M 2.2 remain in memory and can +be issued without loading machine code files from disk. Thus, +the DIR command provides a disk directory regardless of whether +the command file "DIR.COM" is present on disk, and the SAVE +command saves the contents of memory at 100 hex to a disk file. +Residing permanently in memory, these commands are simple in +order to leave memory for disk-based commands to load in. + + 2.2. The Z-System Resident Command Package. + +The creators of Z-System have followed the resident command +philosophy of CP/M, extending and enhancing the capabilities of +resident commands with the Z-System Resident Command Package. +Under CP/M 2.2, resident commands are tightly integrated with the +operating system. The user is therefore limited to a fixed set +of resident commands. The code in the Z-System Resident Command +Package is much more loosely linked with the operating system. + +The RCP occupies a section of protected memory, but how that +memory is used is only very loosely constrained. The Z-System +resident command package may be tailored for a wide variety of +installations, and easily altered within a single installation. + + 2.2.1. Design Philosophy of the Z34 RCP. + +Though any set of commands which will fit in the RCP memory area +can be loaded as an RCP, a standard set of Z-System RCP commands +have evolved over the years. Distributed as the standard +Z-System RCP, this set of commands consists of universal, +single-purpose commands modeled after the resident command set of +CP/M 2.2, such as DIR, REN, and ERA. + +Keeping these commands simple both conserves memory and allows +their use in custom command scripts. None of the standard RCP +commands require interaction on the part of the user--they +perform a single function and quit. Aliases or other command +scripts which build complex commands from simple RCP commands +therefore retain complete control over the user interface. + +However, the standard RCP forms only one of many alternative uses +to which the Z-System RCP memory segment may be put. Since the +RCP memory is protected, it can be used by background programs +which continue to function even while other applications have +been loaded into the transient program area. Several such +programs, including key-redefiners, screen-trapping programs, +background numeric calculators, program assembly environments, +and memory utilities have been developed. + +Until Z34RCP, all but the most advanced users had to surrender +their entire RCP to use the custom commands, even if the commands +needed far less than the available RCP space. Thus, to use a +key-redefinition RCP, one was forced to give up all of his other +RCP commands. Z34RCP solves this problem by acting as a base to +which programmers may easily add code. By modifying the standard +file RCPCMD.LIB, programmers can implement and distribute custom +RCP commands which may be installed by those with only basic +knowledge of assembly language. See "Adding Custom Commands," +below, for details. + + +3. Structure and Operation of the RCP Segment. + +Typically, the Resident Command Package occupies 2 kilobytes of +memory, protected above the system's Basic Input Output System +(BIOS). Its internal structure is very simple, consisting of the +five byte string "Z3RCP", a table of command names and their +addresses within the RCP, and the machine code of the commands +themselves. This means that an RCP of a given length can contain +any number of resident commands which will fit in 2k, from one +large program to many shorter programs. + +Further, since the RCP is independent of the rest of the +operating system, the resident commands may be changed at will. +On system startup, a default RCP is loaded into memory. +Thereafter the RCP's commands remain active until the system is +turned off or another RCP is loaded. + +Using loader programs to load the RCP to memory allows another +important ability--it can exchange RCPs during a single session. +By allowing users to change their RCPs "on-the-fly," loader +programs provide some of the benefits of transient commands even +while preserving the benefits of resident commands. In fact, +even what portion of memory is allocated to the RCP can be +altered in this way by advanced users! (see the Z-System User's +Manual for more on this). + + +4. Generating an RCP for your System. + +Since Z80 computers come with a wide variety of operating system +environments, it is impossible for a single segment of machine +code function as a universal RCP. Due to differences in +operating system and hardware design, the size and location of +memory available to the Z-System RCP vary widely. Until +Z34RCP, this meant that each type of Z80 computer required an RCP +segment assembled specifically for that computer. + +Now, however, there are two basic means by which you may generate +an RCP for your system. The simplest route is to load already- +assembled Z-Relocatable code modules. This technique is +recommended for beginners and those with little experience in +assembly language. See RCPZRL11.LBR for pre-assembled RCP +modules. For more experienced users with an interest in +customizing or their RCPs or adding their own commands, custom +assembly of the files in this library is also an option. + + 4.1. The Z-Relocatable Approach. + + 4.1.1. NZCOM and JetLDR. + +LDR.COM, the familiar Z-System segment loader first introduced by +Rick Conn as a means of loading the various segments of the ZCPR +environment from disk to memory, required that system segments be +assembled to run only at system-specific addresses. For example, +if the system's RCP started at FA00 hex, only an RCP assembled to +run at that starting address would function on the system. +Therefore, separate SYS.RCP files were needed for each computer +installation. + +Thanks to several advanced loader utilities, namely NZCOM by Joe +Wright and JetLDR and Z3PLUS by Bridger Mitchell, custom- +assembling an RCP for a given target machine is no longer +necessary. These three programs can load specially assembled RCP +segments (known as Z-ReLocatable or "ZRL" segments) to any area +of memory. Z-System users now need only obtain previously +assembled RCP segments, much as they need only obtain assembled +.COM or .OBJ files to run transient programs. + +Using information in the system's environmental descriptor, +advanced loaders load pre-assembled segments to the proper +addresses in any system. The only remaining constraint is the +amount of memory allocated to the RCP. While the standard RCP +size is 2 kilobytes, many Z-System installations vary +considerably from this standard, so it is still necessary to +ensure that a ZRL segment does not exceed available RCP memory. +Fortunately, this is taken care of automatically by the advanced +loader programs. + +Using NZCOM or JetLDR, it is possible to load an RCP directly +from RCPZRL11.LBR. See NZCOM or JetLDR documentation for full +instructions on how to load Z-Relocatable RCPs with these +programs. + + 4.1.2. Z-Relocatable (ZRL) Code + +The technique used by NZCOM and JetLDR to load a single RCP to +any address in memory involves relocatable code. Relocatable +code has been used for years by the "linker" programs available +to assembly language programmers. Since only portions of a given +Z80 machine code routine are specific to one memory address, it +is possible to create "relocatable" files of Z80 routines (known +by their file type .REL) containing all but the address-specific +codes. These files can then be very quickly relocated (or +"linked") by a linker program to operate at any memory address. + +Z-Relocatable code is simply a more sophisticated form of +relocatable code. ZRL files contain separately labeled segments, +known as "named common blocks." Where normal relocatable code is +all linked to operate at one address at a time by the linker +program, named common blocks allow the linker to distinguish +between different sections of the file and to link each "block" +to operate at a different address. + +This represents a major step forwards in user convenience, and +will certainly lead to more innovative work using the ZCPR system +segments. There is a minor drawback, however, inherent in the +form of assembly required by NZCOM and JetLDR. Before the advent +of these two programs, system segments were equivalent to .COM +files which were assembled to operate at addresses other than the +standard 100 hex. The ability to load a single system segment to +any address depends partially on the form of the assembled system +segment itself. + +While public domain assemblers will produce absolute object +files, more sophisticated assemblers, such as SLR's Z80ASM (a +bargain at $50) are required to assemble code with named common +addresses. NZCOM and JetLDR thus greatly reduce the time needed +by most users to install Z-System segments, but those wishing to +assemble Z-Relocatable segments will probably need a commercial +assembler. + + 4.2. The Assembly Approach. + +Those with knowledge of assembly language may opt to assemble +their own custom RCPs, including only the commands and options +which match their exact requirements. Z34RCP.LBR contains the +complete source to the ZCPR 3.4 RCP. The file Z34RCP.Z80 +contains include statements to combine the various library files +during assembly. The file Z34RCP.LIB contains all of the equates +controlling assembly time options, and should be edited before +assembling Z34RCP.Z80. + + 4.2.1. Note on Assemblers. + +The development work on Z34RCP was done exclusively with the SLR +Systems line of Z80 assemblers. Hence, some of the source code +is unavoidably specific to SLR and compatible assemblers. Those +using incompatible assemblers such as public-domain Z80 +assemblers should set the SLR equate in Z34RCP.LIB to FALSE. +This removes most SLR-specific pseudo-ops, but some additional +editing of the source files may be required for error-free +assembly. Unless your assembler can handle named common blocks, +you will also want to set the ZRL equate in Z34RCP.LIB to FALSE. + + 4.2.2. Assembly to Absolute Code. + +If you are assembling a custom RCP for use at one memory address +only, or if your assembler can't handle named common blocks, you +can set the ZRL equate in Z34RCP.LIB to FALSE, and instruct your +assembler to produce absolute code (either a .HEX or a .COM file). + +Before generating absolute code you must set addresses in the +file RCPBASE.LIB for the particular installation. Once you have +set these addresses, you may proceed to assemble Z34RCP.Z80 to +either Z34RCP.COM or Z34RCP.HEX. If your assembler generated a +.HEX file, use LOAD.COM to convert Z34RCP.HEX to Z34RCP.COM. + +If you are running a version of ZCPR prior to 3.4, you must now +alter two bytes in your Z-System environment segment to point to +your system's CCP address. The bytes at offset 39 and 40 hex +(formerly containing "width of printer 2" and "lines on printer +2") should contain a 2-byte address of your system's CCP, most +significant byte last. + +Z34RCP.COM may now be renamed to SYS.RCP and loaded with the Z- +System loader program LDR.COM or Bridger Mitchell's JetLDR. + + 4.2.3. Assembly to Z-Relocatable Code. + +Unlike absolute RCP segments, Z-Relocatable segments may be +loaded to ANY address, provided enough RCP space to contain them +is available. To assemble a Z-Relocatable RCP, you will need an +assembler which can handle named common blocks (see 4.2.1 above). +Set the ZRL equate in Z34RCP.LIB to TRUE, and instruct your +assembler to produce a relocatable (.REL) file. The resulting +Z34RCP.REL may then be renamed to Z34RCP.ZRL and loaded with +NZCOM, Z3PLUS, JetLDR. + + 4.2.4. Adding Custom Commands to Z34RCP. + +As mentioned above, I have designed Z34RCP as a base to which +custom RCP commands may readily be added. All code and command +names for custom commands may be included in RCPCMD.LIB. +Thereafter, whenever the RCP is assembled the commands added to +RCPCMD.LIB will be included automatically. To remove the custom +commands, just replace the modified RCPCMD.LIB with an unmodified +copy. See RCPCMD.LIB for detailed instructions on how to add +code and command names. + +RCPCMD.LIB also facilitates distribution of custom commands to be +included by others in their RCPs. Simply distribute a copy of +your modified RCPCMD.LIB along with instructions on how to use +your custom commands. Users may then easily include the new +commands by substituting your modified RCPCMD.LIB for their +original copy and reassembling their RCPs. + +Of course, users of NZCOM, Z3PLUS, or JetLDR may simply trade +custom RCPs in Z-Relocatable form and dispense with the need for +any assembly work on the part of the user. All three of these +advanced loaders are available from Z Systems Associates (see +below). + + +5. Legal Use of These Files. + +Z34RCP is copyright 1989 by Z Systems Associates (ZSA), all +rights reserved. Any commercial use of Z34RCP, defined as any +situation where the duplicator recieves revenue by duplicating or +distributing Z34RCP by itself or in conjunction with any hardware +or software product, is expressly prohibited unless authorized in +writing by ZSA. + +Except for the file RCPCMD.LIB (see 4.2.4 above), you may +redistribute Z34RCP.LBR in its present form only. I encourage +you to explore the source code, suggest improvements, and +document errors. However, please obtain permission from Z +Systems Associates before redistributing any of these files in +altered form. This will prevent confusion by allowing your work +to be coordinated with the efforts of others. + +The Z Systems Associates are: + + Sage Microsystems East + Selling & Supporting the Best in 8-Bit Software + 1435 Centre St., Newton Centre, MA 02159-2469 + Voice: 617/965-3552 (9:00am - 11:30pm) + Modem: 617/965-7259 (password = DDT)(MABOS on PC-Pursuit) + +and: + + Plu*Perfect Systems + "==World-Class Software" + 410 23rd Street, Santa Monica, CA 90402 + Voice: 213/393-6105 (evenings) + Modem: 213/670-9465 (leave message for "Bridger Mitchell") + +For more information on Z System, check at the above bulletin +board systems, or consult The Computer Journal for excellent +articles on ZCPR and CP/M. The Computer Journal is published six +times a year by Publishing Consultants, 190 Sullivan Crossroad, +Columbia Falls, MT 59912, phone 406/257-9119. An issue averages +forty pages with few ads. Subscription rates are $16 for one +year (6 issues), or $28 for two years (12 issues) in the U.S., +$22 for one year Canada and Mexico, and $24 (surface) for one +year in other countries. + + +Carson Wilson is the operator of: + + Antelope Freeway Remote Access System + Chicago, 312-764-5162 + 300-1200-2400 Baud, 24 Hours + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/z34rcp11.for b/Source/BPBIOS/Z34RCP11/z34rcp11.for new file mode 100644 index 00000000..c60e1910 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/z34rcp11.for @@ -0,0 +1,7 @@ +Z-System Resident Command Package (RCP) in source code form, version +1.1. Complete Z80 source code to the RCP plus documentation, for +ZCPR versions 3.3 and above. Adds several exciting new commands and +features and fixes various bugs in the previous release. See +companion file RCPZRL11.LBR for pre-compiled RCP modules which may +be loaded with NZ-COM, Z3PLUS, or JetLDR. + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/z34rcp11.hlp b/Source/BPBIOS/Z34RCP11/z34rcp11.hlp new file mode 100644 index 00000000..991d5d71 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/z34rcp11.hlp @@ -0,0 +1,390 @@ + The RCP Commands + CLED/SPOP Command Line Editor  + CLS Clear the CRT screen  + CP Copy a File  + D Display Directory  + ECHO Echo Command Tail  + ERA Erase Files  + H Display Available Commands  + LIST/TYPE Display a File on Printer/CRT + NOTE Comment  + P/POKE Display/Alter Memory  + PORT Input/Output to system ports  + PROT Protect Files  + Q Alter or Query the Quiet Flag + R Reset Disk  + REG ZCPR3 Register Display/Alter  + REN Rename a File  + SP Display Disk Space Remaining  + WHL Alter or Query Wheel Byte  +:Thå RCÐ Commands + + + Thå   standarä ZCPR³ Systeí Residenô Commanä  Packagå  (RCP© +distributeä  witè thå ZCPR³ systeí containó á numbeò oæ  residenô +commandó  whicè  maù bå enableä (dependinç oî systeí  memorù  anä +securitù  characteristics©  aô thå discretioî oæ  thå  installer® +Usagå oæ thå RCÐ commandó ió describeä iî thió HELÐ file. + + Thå  RCÐ commandó residå iî memorù ratheò thaî beinç  loadeä +froí  disk¬ anä thereforå operatå verù efficientlù anä arå  disë­ +independent®   Oî thå otheò hand¬ duå tï memorù constraints¬  thå +RCÐ commandó arå ofteî lesó powerfuì thaî theiò transienô prograí +counterparts® + + + + Iæ aî erroò occurs¬ thå RCÐ commandó generallù chaiî tï  thå +installeä erroò handler¬ providinç á detaileä reporô oæ thå erroò +anä  allowinç thå commanä tï bå editeä oò aborted® Iæ  nï  erroò +handleò  ió  installed¬  thå commanä whicè causeä  thå  erroò  ió +echoeä tï thå screen¬ followeä bù á questioî mark. + + Alì RCÐ commandó arå installatioî-dependent¬ anä manù maù bå +configureä  aô  assemblù timå tï perforí  iî  slightlù  differenô +ways®   Thå  exampleó giveî iî thió HELÐ filå arå  baseä  oî  thå +distributeä seô oæ options® Seå sourcå codå filå Z34RCP.LIÂ  foò +morå detailó oî commanä anä optioî selection. + +:CLED anä SPOÐ Commands + Transient Counterparts: LSÈ anä SPOP + + Thå  CLEÄ commanä invokeó á speciaì prograí  whicè  provideó +WordStaò-likå editinç oæ commandó aô thå systeí prompt® Iô  alsï +allowó yoõ tï recalì thå lasô severaì commandó invokeä witè  onlù +onå keystroke® Finally¬ iæ available¬ CLEÄ displayó thå  currenô +systeí timå tï thå lefô oæ youò prompt® Thå syntaø is: + + CLED - invoke as shell + CLED / - invoke for next command only + + + + Thå SPOÐ commanä "pops¢ thå toð shelì froí thå shelì  stack¬ +sï thaô iô nï longeò loadó afteò everù command® Thió commanä  ió +rarelù  needed¬  anä ió includeä onlù witè versionó  oæ  thå  RCÐ +includinç CLEÄ (seå above)® Thå syntaø ió simply: + + SPOP +:CLS Command + Transient Counterpart: None + + Thå  CLÓ  commanä  clearó  thå  terminaì  screen¬   removinç +displayó  whicè  mighô  havå beeî lefô bù  previouó  commandó  oò +programs® Thå syntaø is: + + CLS + +:CP Command + Transient Counterpart: MCOPY + + Thå  CÐ  commanä copieó onå filå froí onå DÕ tï  anotheò  oò +intï  thå samå DÕ undeò á differenô name® Iæ functionó 10²  (geô +stamp©  anä 10³ (seô stamp© arå supporteä bù aî RSØ oò DOS¬  filå +datestampó arå preserveä acrosó copies® Thå syntaø is: + + CP dir:ufn1 dir:ufn2 -- ufn1 to ufn2 + CP dir:ufn1 -- ufn1 to current dir: + CP dir:ufn2=dir:ufn1 -- ufn1 to ufn2 + + Examples: + + CP f1.txt f2.txt + CP b0:f1.txt a15: + CP root:f1.txt + +:D Command + Transient Counterpart: DIR, XD, XDIR + + Thå   Ä   commanä  displayó  thå  directorù  oæ   fileó   iî +alphabeticaì ordeò acrosó thå lineó tï thå user® Thå syntaø is: + + D dir:afn.aft o + D .aft o + D /o + + Options (wheel only) are: + + S - Display System Files Only + A - Display Both Non-System and System Files + + Examples: + + D /a + D root:myfile.txt Š D .com + +:ECHO Command + Transient Counterpart: ECHO + + ECHÏ   ió usefuì iî issuinç botè messageó (tï thå  user¬ +saù withiî á commanä filå durinç execution© anä escapå sequences® +Bù  uså oæ thå %¾ anä %¼ parameters¬ ECHÏ caî senä itó outpuô  iî +combinationó  oæ uppeò anä loweò case® Bù uså oæ thå %Ð  anä  %Ã +parameters¬  ECHÏ  outpuô  caî  bå  toggleä  betweeî  screeî  anä +printer®   ECHÏ  useó  BIOÓ  calls¬  sï  alì  controì  characteró +(entereä aó ^character© arå passeä exactly® Hence¬ consolå-leveì +programminç oæ sucè deviceó (CRTó anä printers© ió possible. + + Examples: + ECHO %Pthis is a test%Cof echo%P + -- "THIS IS A TEST" goes to the printer + "OF ECHO" goes to the console + (trailing %P flushes printer buffer) + + ECHO t%>his is a % + prtdec ,%recs,,%bytes, + prtdec ; Trailing CRLF + endm + + else ; Non-SLR assemblers +include macro filename + $include filename&.lib + endm + endif ; SLR + + + if ZRL + +; ============================================================================= + +; J e t L D R I D S E C T I O N + +; ============================================================================= + +; Macro to build ID block message for JetLDR. Max. length is ~256 chars. + +optcnt defl 0 ; Options counter + +option macro string1,enable1,string2,enable2 + + if enable1 ;; Skip if command not present + if [optcnt mod 4] eq 0 + db cr,lf ;; New line every four options + endif + optcnt defl optcnt + 1 ;; Increment options counter + count defl 0 ;; Initialize character count + + irpc char,string1 ;; Count and define characters + count defl count + 1 + db '&char' + endm ; irpc + + if not nul enable2 ;; Sub-option label present + if enable2 ;; Sub-option enabled + db ' (' ;; Begin sub-opt description + irpc char,string2 ;; Count and define characters + count defl count + 1 + db '&char' + endm ; irpc + db ')' ;; End sub-opt description + count defl count + 3 ;; For ' ()' + endif ; enable2 + endif ; not nul enable2 + + if [optcnt mod 4] ne 0 + count defl 11 - count + rept count + db ' ' ;; Pad to 11 spaces + endm ; rept + endif ; [optcnt mod 4] ne 0 + + endif ; enable1 + endm ; option macro + +; --------------------------------------------------------- + + COM /_ID_/ ; JetLDR ID block + db 'Copr. 1989 ZSA. Enabled Commands:' + option Cled,cledon + option Cls,clson,TC,clstcap + option Cp,cpon,stp,stpcall + option Dir,diron,sp, + option Echo,echoon,lst,echolst + option Era,eraon,sp, + option Help,true + option List,liston + option Note,noteon + option Peek,peekon,hdr,peekhdr + ; option Poke,pokeon,q,pokeq + option Poke,pokeon + option Port,porton + option Protect,proton + option Quiet,quieton + option Register,regon + option Rename,renon + option Reset,reson,sp, + option Space,spaceon + option Spop,cledon + option Type,lton,cls, + option Wheel,whlon,q,whlquiet + db 0 ; ID string terminator + +;============================================================================= +; +; E N T R Y C O D E S E C T I O N +; +;============================================================================= + + cseg + else + org z3rcp + endif ; ZRL + +RCPbegin: + db 'Z3RCP' ; Package ID + + include RCPcmd ; Command table and custom commands + + include RCPsubs ; File of subroutines + + include RCPh ; 'H' help (command list) command + +; Include only selected code sections. + + if cledon ; 'CLED' and 'SPOP' commands + include RCPcled + endif ;cledon + + if clson + include RCPcls ; 'CLS' clear screen command + endif ;clson + + if reson + include RCPr ; 'R' disk reset command + endif ;reson + + if spaceon + include RCPsp ; 'SP' space on disk command + endif ;spaceon + + if diron + include RCPdir ; 'DIR' directory command + endif ;diron + + if eraon + include RCPera ; 'ERA' erase command + endif ;eraon + + if renon + include RCPren ; 'REN' rename command + endif ;renon + + if cpon + include RCPcp ; 'CP' file copying command + endif ;cpon + + if echoon + include RCPecho ; 'ECHO' command + endif ;echoon + + if quieton + include RCPquiet ; 'Q' quiet flag + endif ;quieton + + if lton + include RCPlt ; 'LIST' and 'TYPE' commands + endif ;lton + + if proton + include RCPprot ; 'PROT' file attribute setting command + endif ;proton + + if peekon or pokeon or porton + include RCPiom ; 'PEEK', 'POKE', 'PORT' commands + endif ;peekon or pokeon or porton + + if regon + include RCPreg ; 'REG' register operation commands + endif ;regon + + if whlon + include RCPwhl ; 'WHL' command + endif ;whlon + + include RCPid ; Add ID string (must come last) + +RCPend: ; Used to calculate length + end + +; End of Z34RCP.Z80 + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/z34rcp11.z80.sav b/Source/BPBIOS/Z34RCP11/z34rcp11.z80.sav new file mode 100644 index 00000000..7af6b875 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/z34rcp11.z80.sav @@ -0,0 +1,267 @@ + +; Program: Z34RCP +; Description: Resident Command Package (RCP) for ZCPR34 +; Version: 1.3 +; Author: Carson Wilson +; Date: September 13, 1989 +; Changes: Added CLED (command line editor shell) command. +; To save space, JetLDR ID section no longer pads end of each +; line. (JetLDR allows only 256 bytes maximum in its +; description field). + +; Version: 1.2 +; Author: Carson Wilson +; Date: July 9, 1989 +; Changes: Uses spaces instead of tabs in JetLDR displays. +; Copyright now ZSA. + +; Version: 1.1 +; Author: Carson Wilson +; Date: September 14, 1988 +; Changes: RCPID macro called from RCPID.LIB so that the final INCLUDE +; macro call gives total size of the RCP, including the ID +; string, with SLR assemblers. +; Label WHLQ changed to WHLQUIET in Option macro to match +; Z34HDR.LIB equate. + +; Version: 1.0 +; Author: Carson Wilson +; Date: June 15, 1988 + +; Derivation: SYSRCP (Richard Conn) + +; Z34RCP is copyright 1989 by Z Systems Associates. All rights reserved. +; End-user distribution and duplication permitted for non-commercial purposes +; only. Any commercial use of Z34RCP, defined as any situation where the +; duplicator recieves revenue by duplicating or distributing Z34RCP by itself +; or in conjunction with any hardware or software product, is expressly +; prohibited unless authorized in writing by Z Systems Associates. + +;============================================================================= +; +; D E F I N I T I O N S S E C T I O N +; +;============================================================================= + + maclib sysdef.lib ; Common logic, sys, ascii defines + maclib z34defn.lib ; Defines offsets in Z34 command processor + maclib z34mac.lib ; Macros + maclib z34rcp.lib ; Defines command options + + if ZRL + maclib z34cmn.lib ; Defines universal ZCPR named common blocks + else + maclib rcpbase.lib ; Defines addresses for one system + endif + + name RCP11 ; Declare module name + +; ============================================================================ + +; M A C R O S S E C T I O N + +; ============================================================================ + +; Macros to include module file and print module length. +; Under SLR and compatible assemblers, a running account of current RCP +; size and bytes added will be given for each module. +; +; For other assemblers you may have to either modify the non-SLR include +; macro or use a text editor to read in the actual contents of each file +; in place of the include statement. + + if SLR +; +; General purpose macro to display decimal values and messages +; +prtdec macro m1,m2,m3,m4,m5 + .radix 10 ; Decimal output + .printx m1 m2 m3 m4 m5 ; Print to screen + endm +; +; Macro to include modules and display lengths. +; +include macro filename +before defl $ + $include filename&.lib +after defl $ +modlen defl after - before ; Module length +rcplen defl after - RCPbegin ; RCP length +recs defl rcplen / 128 ; ..in records +bytes defl rcplen mod 128 ; ..and additional bytes + prtdec %modlen, + prtdec ,%recs,,%bytes, + prtdec ; Trailing CRLF + endm + + else ; Non-SLR assemblers +include macro filename + $include filename&.lib + endm + endif ; SLR + + + if ZRL + +; ============================================================================= + +; J e t L D R I D S E C T I O N + +; ============================================================================= + +; Macro to build ID block message for JetLDR. Max. length is ~256 chars. + +optcnt defl 0 ; Options counter + +option macro string1,enable1,string2,enable2 + + if enable1 ;; Skip if command not present + if [optcnt mod 4] eq 0 + db cr,lf ;; New line every four options + endif + optcnt defl optcnt + 1 ;; Increment options counter + count defl 0 ;; Initialize character count + + irpc char,string1 ;; Count and define characters + count defl count + 1 + db '&char' + endm ; irpc + + if not nul enable2 ;; Sub-option label present + if enable2 ;; Sub-option enabled + db ' (' ;; Begin sub-opt description + irpc char,string2 ;; Count and define characters + count defl count + 1 + db '&char' + endm ; irpc + db ')' ;; End sub-opt description + count defl count + 3 ;; For ' ()' + endif ; enable2 + endif ; not nul enable2 + + if [optcnt mod 4] ne 0 + count defl 11 - count + rept count + db ' ' ;; Pad to 11 spaces + endm ; rept + endif ; [optcnt mod 4] ne 0 + + endif ; enable1 + endm ; option macro + +; --------------------------------------------------------- + + COM /_ID_/ ; JetLDR ID block + db 'Copr. 1989 ZSA. Enabled Commands:' + option Cled,cledon + option Cls,clson,TC,clstcap + option Cp,cpon,stp,stpcall + option Dir,diron,sp, + option Echo,echoon,lst,echolst + option Era,eraon,sp, + option Help,true + option List,liston + option Note,noteon + option Peek,peekon,hdr,peekhdr + option Poke,pokeon,q,pokeq + option Port,porton + option Protect,proton + option Quiet,quieton + option Register,regon + option Rename,renon + option Reset,reson,sp, + option Space,spaceon + option Spop,cledon + option Type,lton,cls, + option Wheel,whlon,q,whlquiet + db 0 ; ID string terminator + +;============================================================================= +; +; E N T R Y C O D E S E C T I O N +; +;============================================================================= + + cseg + else + org z3rcp + endif ; ZRL + +RCPbegin: + db 'Z3RCP' ; Package ID + + include RCPcmd ; Command table and custom commands + + include RCPsubs ; File of subroutines + + include RCPh ; 'H' help (command list) command + +; Include only selected code sections. + + if cledon ; 'CLED' and 'SPOP' commands + include RCPcled + endif ;cledon + + if clson + include RCPcls ; 'CLS' clear screen command + endif ;clson + + if reson + include RCPr ; 'R' disk reset command + endif ;reson + + if spaceon + include RCPsp ; 'SP' space on disk command + endif ;spaceon + + if diron + include RCPdir ; 'DIR' directory command + endif ;diron + + if eraon + include RCPera ; 'ERA' erase command + endif ;eraon + + if renon + include RCPren ; 'REN' rename command + endif ;renon + + if cpon + include RCPcp ; 'CP' file copying command + endif ;cpon + + if echoon + include RCPecho ; 'ECHO' command + endif ;echoon + + if quieton + include RCPquiet ; 'Q' quiet flag + endif ;quieton + + if lton + include RCPlt ; 'LIST' and 'TYPE' commands + endif ;lton + + if proton + include RCPprot ; 'PROT' file attribute setting command + endif ;proton + + if peekon or pokeon or porton + include RCPiom ; 'PEEK', 'POKE', 'PORT' commands + endif ;peekon or pokeon or porton + + if regon + include RCPreg ; 'REG' register operation commands + endif ;regon + + if whlon + include RCPwhl ; 'WHL' command + endif ;whlon + + include RCPid ; Add ID string (must come last) + +RCPend: ; Used to calculate length + end + +; End of Z34RCP.Z80 + \ No newline at end of file diff --git a/Source/BPBIOS/Z34RCP11/zsystem.ad b/Source/BPBIOS/Z34RCP11/zsystem.ad new file mode 100644 index 00000000..5231a575 --- /dev/null +++ b/Source/BPBIOS/Z34RCP11/zsystem.ad @@ -0,0 +1,97 @@ + + Z System Upgrades CP/M + +Z System is first-rate, state-of-the-art software for your CP/M machine. +ZCPR has been with us for over five years now, and has enhanced computer +productivity for thousands of CP/M users. Z System is now a mature +replacement for CP/M 2.2 or CP/M Plus, yet is "backward compatible" with +almost all programs written for CP/M. This means that you can still run +the CP/M programs you now use, yet take advantage of greatly increased +power and performance at the same time. + +NZ-COM and Z3PLUS form the heart of Z System. They replace the most +visible parts of CP/M 2.2 and CP/M Plus respectively, adding enhanced +command processing, named directories, vastly improved resident +commands, flow control processing, error handling, and much more. But +it isn't necessary to master all of these (at least at first!) to take +advantage of NZ-COM and Z3PLUS. In fact, though both packages come with +several disks of software and excellent manuals, almost anyone can +install either of these packages on their CP/M computer in just a few +minutes' time. The price for either NZ-COM or Z3PLUS is $69.95 plus $3 +shipping. + +The next step up in sophistication for CP/M 2.2 users is ZSDOS. ZSDOS +replaces the less visible portion of CP/M 2.2 which controls program +input and output. Through clever coding and exhaustive testing, the +authors of ZSDOS offer significant improvements in performance, safety, +and versatility for CP/M 2.2, including file time and date stamping, +file archiving for faster backups, public files (accessable from all +user areas), path access to files, and improved error messages and +handling. As with NZ-COM and Z3PLUS, ZSDOS installation is completely +menu-driven. ZSDOS comes with a collection of state-of-the-art utility +programs and a 140 page manual to help you make the most of the extended +features. ZSDOS costs $75 ($60 when purchased with NZ-COM) plus $3 +shipping. + +Another path to system enhancement for CP/M 2.2 users with hard or RAM +disks is available in the form of BackGrounder ii (BGii). BGii allows +you to "suspend" any program at the touch of a button and use a wide +range of resident commands such as DIR, REN, ERA, CALC, or TYPE. Then +hit the button again and BGii quickly returns you to the program you +suspended, right where you left off. Or use BGii's SWAP command and +you're back at the CP/M prompt, ready to run any other CP/M program. +When you're through, SWAP again and BGii returns you to your original +program, exactly as you left it! Advanced "Cut" and "Paste" commands +are also available for many terminals, allowing you to transfer sections +of screen directly from one program to another. Print spooling, +advanced key redefinition and recording capabilities, and a beautifully +designed 140-page user's manual are included. Installation is +menu-driven and easy. BGii is compatible with either ZCPR or CP/M 2.2, +and costs $75.00 plus $3 shipping. + +Last but not least is DosDisk, a small but powerful program which allows +you to read or write DIRECTLY to MS-DOS disks with your CP/M computer. +No more file transfers--simply insert a standard MS-DOS DSDD diskette in +your CP/M machine, type "DosDisk :", and away you go--all files +on the diskette are now accessable by all of your CP/M programs--even +files in MS-DOS subdirectories! DosDisk comes with a handsome 38-page +user's manual, and is available preconfigured for most machines at just +$30.00 plus $3 shipping. DosDisk is compatible with either ZCPR or +CP/M 2.2. + +These and other fine products for CP/M and CP/M Plus are available from +users groups around the country, or directly from Z Systems Associates. +Sizeable discounts for users' groups are also available from Z Systems +Associates through the Z Plan. The Z Systems Associates are: + + Sage Microsystems East + Selling & Supporting the Best in 8-Bit Software + 1435 Centre St., Newton Centre, MA 02159-2469 + Voice: 617/965-3552 (9:00am - 11:30pm) + Modem: 617/965-7259 (password = DDT)(MABOS on PC-Pursuit) + + Same-day shipping of most products with modem download and support + available. Order by phone, mail, or modem. Shipping and handling $4 + per order (USA). Check, VISA, or MasterCard. Specify exact disk format. + +and: + + Plu*Perfect Systems + "==World-Class Software" + 410 23rd Street, Santa Monica, CA 90402 + Voice: 213/393-6105 (evenings) + Modem: 213/670-9465 (leave message for "Bridger Mitchell") + + To order: Specify product, operating system, computer, 5 1/4" disk + format. Enclose check, adding $3 shipping ($5 foreign) + 6.5% tax in + California. Enclose invoice if upgrading BGii or ZRDOS. + +For more information on Z System, check at the above bulletin board +systems, or consult The Computer Journal for excellent articles on ZCPR +and CP/M. The Computer Journal is published six times a year by +Publishing Consultants, 190 Sullivan Crossroad, Columbia Falls, MT +59912, phone 406/257-9119. An issue averages forty pages with few ads. +Subscription rates are $16 for one year (6 issues), or $28 for two years +(12 issues) in the U.S., $22 for one year Canada and Mexico, and $24 +(surface) for one year in other countries. + \ No newline at end of file diff --git a/Source/BPBIOS/dph.lib b/Source/BPBIOS/dph.lib index 72f39fef..1f6021e6 100644 --- a/Source/BPBIOS/dph.lib +++ b/Source/BPBIOS/dph.lib @@ -11,6 +11,11 @@ ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: CSEG + +; Table has been reordered so that hard disk entries come before +; floppy entries. This means that "DRV_A" appears as I: and "DRV_E" +; appears as A:. The point is to allow booting from the first +; hard drive which pretty much needs to be A: DPHTBL: IF DRV_E AND HARDDSK @@ -34,46 +39,46 @@ DPHTBL: DEFW 00 ENDIF - IF DRV_A - DEFW DPH$00 ; Dph for drive A (Floppy) + IF DRV_I AND HARDDSK + DEFW DPH$54 ; Dph for Hard drive Partition I ELSE DEFW 00 ENDIF - IF DRV_B - DEFW DPH$01 ; Dph for drive B (Floppy) + IF DRV_J AND HARDDSK + DEFW DPH$55 ; Dph for Hard drive Partition J ELSE DEFW 00 ENDIF - IF DRV_C - DEFW DPH$02 ; Dph for drive C (Floppy) + IF DRV_K AND HARDDSK + DEFW DPH$56 ; Dph for Hard drive Partition K ELSE DEFW 00 ENDIF - IF DRV_D - DEFW DPH$03 ; Dph for drive D (Floppy) + IF DRV_L AND HARDDSK + DEFW DPH$57 ; Dph for Hard drive Partition L ELSE - DEFW 0 ; Dph for drive D + DEFW 00 ENDIF - IF DRV_I AND HARDDSK - DEFW DPH$54 ; Dph for Hard drive Partition I + IF DRV_A + DEFW DPH$00 ; Dph for drive A (Floppy) ELSE DEFW 00 ENDIF - IF DRV_J AND HARDDSK - DEFW DPH$55 ; Dph for Hard drive Partition J + IF DRV_B + DEFW DPH$01 ; Dph for drive B (Floppy) ELSE DEFW 00 ENDIF - IF DRV_K AND HARDDSK - DEFW DPH$56 ; Dph for Hard drive Partition K + IF DRV_C + DEFW DPH$02 ; Dph for drive C (Floppy) ELSE DEFW 00 ENDIF - IF DRV_L AND HARDDSK - DEFW DPH$57 ; Dph for Hard drive Partition L + IF DRV_D + DEFW DPH$03 ; Dph for drive D (Floppy) ELSE - DEFW 00 + DEFW 0 ; Dph for drive D ENDIF IF DRV_M AND RAMDSK diff --git a/Source/BPBIOS/z33.zex b/Source/BPBIOS/z33.zex index bd8b92d3..ea1e714e 100644 --- a/Source/BPBIOS/z33.zex +++ b/Source/BPBIOS/z33.zex @@ -1,3 +1,3 @@ IOPINIT -LDR SYS.RCP,SYS.NDR,SYS.FCP,WW.Z3T +JETLDR RCP.ZRL,SYS.NDR,FCP.ZRL,MYTERM.Z3T  \ No newline at end of file diff --git a/Source/BPBIOS/z34.zex b/Source/BPBIOS/z34.zex index bd8b92d3..ea1e714e 100644 --- a/Source/BPBIOS/z34.zex +++ b/Source/BPBIOS/z34.zex @@ -1,3 +1,3 @@ IOPINIT -LDR SYS.RCP,SYS.NDR,SYS.FCP,WW.Z3T +JETLDR RCP.ZRL,SYS.NDR,FCP.ZRL,MYTERM.Z3T  \ No newline at end of file diff --git a/Source/BPBIOS/z41.zex b/Source/BPBIOS/z41.zex index 010e3334..aa944b80 100644 --- a/Source/BPBIOS/z41.zex +++ b/Source/BPBIOS/z41.zex @@ -1,4 +1,4 @@ IOPINIT -LDR SYS.NDR,SYS.FCP,WW.Z3T +JETLDR SYS.NDR,FCP.ZRL,MYTERM.Z3T ZSCFG2 CB  \ No newline at end of file diff --git a/Source/Build.cmd b/Source/Build.cmd index ef139f9d..9419b3ce 100644 --- a/Source/Build.cmd +++ b/Source/Build.cmd @@ -4,6 +4,6 @@ setlocal REM setlocal & call BuildDoc || exit /b 1 & endlocal setlocal & call BuildProp || exit /b 1 & endlocal setlocal & call BuildShared || exit /b 1 & endlocal -setlocal & call BuildImages || exit /b 1 & endlocal REM setlocal & call BuildBP || exit /b 1 & endlocal +setlocal & call BuildImages || exit /b 1 & endlocal setlocal & call BuildROM %* || exit /b 1 & endlocal \ No newline at end of file diff --git a/Source/Images/Build.cmd b/Source/Images/Build.cmd index 891419cb..86533ade 100644 --- a/Source/Images/Build.cmd +++ b/Source/Images/Build.cmd @@ -25,4 +25,5 @@ call BuildHD.cmd nzcom ..\zsdos\zsys_wbw.sys call BuildHD.cmd cpm3 call BuildHD.cmd zpm3 call BuildHD.cmd ws4 -call BuildHD.cmd bp + +if exist ..\BPBIOS\bpbio-ww.rel call BuildHD.cmd bp diff --git a/Source/Images/d_bp.txt b/Source/Images/d_bp.txt new file mode 100644 index 00000000..0a5b33c5 --- /dev/null +++ b/Source/Images/d_bp.txt @@ -0,0 +1,31 @@ +# +# Add RomWBW utilities +# +../../Binary/Apps/assign.com 0: +../../Binary/Apps/fat.com 0: +../../Binary/Apps/fdu.com 0: +../../Binary/Apps/format.com 0: +../../Binary/Apps/mode.com 0: +../../Binary/Apps/osldr.com 0: +../../Binary/Apps/rtc.com 0: +../../Binary/Apps/survey.com 0: +../../Binary/Apps/syscopy.com 0: +../../Binary/Apps/sysgen.com 0: +../../Binary/Apps/talk.com 0: +../../Binary/Apps/timer.com 0: +../../Binary/Apps/xm.com 0: +../../Binary/Apps/inttest.com 0: +# +# Add Tune application and sample files +# +../../Binary/Apps/tune.com 3: +../../Binary/Apps/Tunes/*.* 3: +# +# Add ZSystem images +# +../BPBIOS/*.img 0: +../BPBIOS/*.rel 0: +../BPBIOS/*.zex 0: +../BPBIOS/myterm.z3t 0: +../BPBIOS/Z34RCP11/z34rcp11.rel 0:rcp.zrl +../BPBIOS/NZFCP13/nzfcp13.rel 0:fcp.zrl diff --git a/Source/Images/d_bp/u0/FAT.COM b/Source/Images/d_bp/u0/FAT.COM deleted file mode 100644 index 1dd7dcca..00000000 Binary files a/Source/Images/d_bp/u0/FAT.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/HDIR.COM b/Source/Images/d_bp/u0/HDIR.COM deleted file mode 100644 index 17096622..00000000 Binary files a/Source/Images/d_bp/u0/HDIR.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/JETLDR.COM b/Source/Images/d_bp/u0/JETLDR.COM new file mode 100644 index 00000000..c33c0738 Binary files /dev/null and b/Source/Images/d_bp/u0/JETLDR.COM differ diff --git a/Source/Images/d_bp/u0/R.COM b/Source/Images/d_bp/u0/R.COM deleted file mode 100644 index fecaa4ac..00000000 Binary files a/Source/Images/d_bp/u0/R.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/RSETSIMH.COM b/Source/Images/d_bp/u0/RSETSIMH.COM deleted file mode 100644 index e055f07a..00000000 Binary files a/Source/Images/d_bp/u0/RSETSIMH.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/TIMER.COM b/Source/Images/d_bp/u0/TIMER.COM deleted file mode 100644 index 83e6e688..00000000 Binary files a/Source/Images/d_bp/u0/TIMER.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/W.COM b/Source/Images/d_bp/u0/W.COM deleted file mode 100644 index 2e5ab12a..00000000 Binary files a/Source/Images/d_bp/u0/W.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/Z41.ZRL b/Source/Images/d_bp/u0/Z41.ZRL deleted file mode 100644 index ed10dfad..00000000 Binary files a/Source/Images/d_bp/u0/Z41.ZRL and /dev/null differ diff --git a/Source/Images/d_bp/u0/ZCPR33.REL b/Source/Images/d_bp/u0/ZCPR33.REL deleted file mode 100644 index 7c0a2567..00000000 Binary files a/Source/Images/d_bp/u0/ZCPR33.REL and /dev/null differ diff --git a/Source/Images/d_bp/u0/ZS203.ZRL b/Source/Images/d_bp/u0/ZS203.ZRL deleted file mode 100644 index 11be02dd..00000000 Binary files a/Source/Images/d_bp/u0/ZS203.ZRL and /dev/null differ diff --git a/Source/Images/d_bp/u0/ZSDOS.ZRL b/Source/Images/d_bp/u0/ZSDOS.ZRL deleted file mode 100644 index e43d1b0a..00000000 Binary files a/Source/Images/d_bp/u0/ZSDOS.ZRL and /dev/null differ diff --git a/Source/Images/d_bp/u0/z34.rel b/Source/Images/d_bp/u0/z34.rel deleted file mode 100644 index 0e9d5236..00000000 Binary files a/Source/Images/d_bp/u0/z34.rel and /dev/null differ