Z33TRCP - TEMPORARY RESIDENT COMMAND PACKAGE RSX I. OVERVIEW Z33TRCP is designed to address the situation where TPA hungry programs such as WS4 are going to run on a ZCPR33 system and defining a 2k block for the RCP makes the difference between such programs running and not running. Z33TRCP creates a removable RCP buffer below ZCPR33, making the RCP available on systems that couldn't use it otherwise due to TPA size restrictions. Because Z33TRCP exists at the top of TPA and can be removed quickly it can get out of the way of programs that need big TPA's in a way that is impossible to do with a 'normal' ZCPR33 system. This in effect allows dynamic re-sizing of the TPA. This concept could be extended to other optional system segments such as NDR and FCP, although the gains in space in these cases are smaller and probably not worth the effort. There is a tradeoff with TPA space when Z33TRCP is used (there is no free lunch...) - ZCPR33 is kept resident and TPA is thus smaller by a little over 2k plus the RCP size. This means that using a 2k RCP (standard), the available TPA for programs is actually reduced by a little over 4k. The good news is that you can have this space back whenever you need it. Because the RCP space is removable, this also makes bigger RCP's a more reasonable option. Even an extra 1k makes a big difference in how many commands can be stuffed in! Naturally, this also makes the system seem faster during normal operations. II. INSTALLATION OF Z33TRCP Z33TRCP must be assembled for the target system. SYSDEF.LIB and Z3BASE.LIB must be available at assembly time. Be sure that Z3BASE has the RCP and RCPS values coded in properly. A good way to set the RCP equate is: RCPS EQU 16 ; size of RCP in 128 byte blocks (2k) RCP EQU CCP-[RCPS*128] ; address of RCP Note that the automatic address setting of Z3BASE can't be used with Z33TRCP. Z33TRCP is coded for the ZAS 3.0 assembler and uses .phase and .dephase psudo ops. Assemble with the command ZAS [DIR:]Z33TRCP. Link with the command ZLINK [DIR:]Z33TRCP. Z33TRCP is a type 3 program, so the $R option may be used if you want Z33TRCP to load high. To use Z33TRCP, ZCPR33 must be configured to obtain the RCP address from the environment. Because of this requirement, Z33TRCP will not work with any version or ZCPR lower than 3.3. Z3BASE must contain the information of where the RCP will exist when loaded, however, the loaded .ENV should not have it. In order to remove Z33TRCP, the command RCPX is used. Normally, RCPX is a transient program but it may be made RCP resident if desired by adding the following line to the command macro in Z33RCP.LIB: ; wheel protect command RCPX,true,,rcp-7ah This step is optional. III. USING Z33TRCP Z33TRCP can be invoked from the ZCPR33 command line, alias, shell, or submit file. It WILL NOT load while ZEX (or any other RSX such as Plu*Perfect's DateStamper running below CCP) is present. It is a true ZCPR utility and needs to be installed (though this step is automatic with ZCPR33). There are no command options other than the normal ZCPR help message. If Z33TRCP is successful in creating the RCP buffer, it prints a message on the console confirming this if the quiet flag is off. LDR may then be used to load the RCP in the normal manner. To remove Z33TRCP, use the RCPX command. This will remove the RCP and free up the TPA space (provided no other RSX's are loaded below it). Like the Z33TRCP command, the RCPX command can't be issued when ZEX is running. If you own Backgrounder ii, the REMOVE.COM utility supplied with BGii may also be used to remove Z33TRCP. Once Z33TRCP is loaded, ZEX may be used as normal. Note that you must use ZEX31A or later with Z33TRCP or any other RSX. Earlier versions of ZEX will overwrite the RCP and could crash the system upon exit. Z33TRCP sets the command error byte at the base address of the message buffer and signals ZCPR33 to invoke the error handler under the following cases: 1. An attempt is made to load Z33TRCP when other RSX's are already loaded. This generates error number 20. Z33TRCP will also print a short error message. 2. An attempt is made to remove Z33TRCP when other RSX's are loaded. This generates error number 21. IV. THEORY OF OPERATION Z33TRCP creates the RCP buffer below ZCPR33 as a RSX, patches the environment to show its presence as an RCP, clears the new RCP space, patches the bdos jump at 0005h to protect itself, and then exits to ZCPR33. Z33TRCP has a Plu*Perfect RSX header and all the proper RSX support, including a remove routine. It may be removed via the 'RCPX' command. Z33TRCP is not relocatable and must be the highest RSX in memory. Z33TRCP does not actually load the RCP. It only creates the space for it. LDR is used to load the RCP itself, just as if the RCP was in a normal location. In fact, so far as the system is concerned, RCP is in a normal location. All utilities tested to date work properly. The only application program that has caused any problems is MBASIC (which is already well known for its poor manners). Note that ZEX V3.1A or higher is required for Z33TRCP or any other RSX. If Z33TRCP is removed, it zeros the RCP and RCPS entries in the environment. Z33TRCP steals the BIOS warm boot vector from the BIOS jump table and prevents the system from running the BIOS warm boot code (which would remove protection from the RCP, setting the stage for system crashes). Instead, the stack pointer and default DMA buffer are set to 80H, then ZCPR33 is entered directly. This should present no problems for most BIOSes, and should work properly with other Plu*Perfect type RSX's. Of course, the BIOS warm boot code is re-enabled when the RCP is removed with the 'RCPX' command. Note that the vector is stolen from the BIOS jump table itself. The warm boot vector at 001H remains unchanged. In fact, the warm boot vector at 001H is restored by Z33TRCP every time a warm boot is requested (as specified by the Plu*Perfect RSX specification). Because some programs either benefit from or need a large TPA, using aliases to remove Z33TRCP prior to invoking a hungry program (you are using ARUNZ as your ECP, aren't you?), then restoring Z33TRCP and the RCP at the end will result in what I believe to be the best tradeoff of TPA, features, and speed ever available to ZCPR users. A note for users of Ampro Little Boards: only run Z33TRCP after running HINIT. HINIT looks at the env at FE00H and uses the lowest package address as the top of hard disk vector storage. Because Z33TRCP is below BIOS, HINIT will not work correctly if Z33TRCP is present OR if the environment shows the RCP space as being allocated below BIOS. Z33TRCP and RCPX are copyright 1987 by Cameron W. Cotrill. All rights reserved. End-user distribution and duplication permitted for non-commercial purposes only without prior written permission from the author. Permission to use routines from Z33TRCP or RCPX in other programs subject to the above mentioned distribution and duplication restrictions is automatically granted provided the source of the routines is noted in both the source code and documentation and the copyright notice is retained. Cameron W. Cotrill 2935 Manhattan Ave. La Crescenta, Ca. 91214 818/248-0553 (voice) Compuserve 75126,2330