PT_CPM_2_TRS 80_II_12_and_16_Users_Manual_1983 PT CPM 2 TRS 80 II 12 And 16 Users Manual 1983
PT_CPM_2_TRS-80_II_12_and_16_Users_Manual_1983 manual pdf -FilePursuit
PT_CPM_2_TRS-80_II_12_and_16_Users_Manual_1983 PT_CPM_2_TRS-80_II_12_and_16_Users_Manual_1983
User Manual: PT_CPM_2_TRS-80_II_12_and_16_Users_Manual_1983
Open the PDF directly: View PDF .
Page Count: 354
Download | |
Open PDF In Browser | View PDF |
, P&T CP/M® 2 USER'S MANUAL P&TCPIM®2 for the TRS-80 Models II, 12, and 16 .User's Manual Published by Pickles & Trout P.O. Box 1206 Goleta, California, 93116 U.S.A. Copyright © 1983 Pickles & Trout All rights reserved. No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language, in any form or by any means, electronic, magnetic, optical, chemical, manual, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. 10 9 8 7 6 5 Pickles & Trout is a registered trademark of Pickles & Trout CP/M is a registered trademark of Digital Research, Inc. MAC is a trademark of Digital Research, Inc. TRS-80 and TRSDOS are trademarks of Tandy Corp. Z-80 is a trademark of Zilog, Inc. IMPORTANT NOTE You should have received P&T CP/M 2 on a diskette with a label like the one shown below. If you did not receive such a diskette, you may not have received a valid copy of the system. Please contact Pickles & Trout at once. All P&TCP/M 2 labels are printed in green ink on white paper. If you purchased a registered user's copy of P&T CP/M 2 you are required to transfer the registration to your name. There is a fee for this transfer. If you fail to transfer the registration you will not receive the Pickles & Trout newsletter, will not be eligible for updates to the system, and will not be able to receive assistance from Pickles & Trout. P.O. Box 1206 Goleta, CA 9311 6 All software on this diSltijther in source or object form, is C ~ d and may be used an~ n r the term~Sf e & are Lit. " i tte is serialcens u ybytheregistered " h"t or software on it may " ruted, resold, or transferred withthe w,ltten consent of Pickles & Tmut. ~~ DISCLAIMER The publisher has made a reasonable effort to insure that the computer programs described herein are correct and operate properly and that the information presented in this publication is accurate; however they are sold and licensed without warranties either expressed or implied, including, but not limited to, the implied warranties of merchantibility and fitness for a particular purpose. The publisher is not liable for consequential damages resulting from the use of this product either individually or in concert with other computer programs. Further, the publisher reserves the right to revise this publication and the programs described herein and to make changes from time to time in the contents thereof without obligation of the publisher to notify any person or organization of such revision or changes. TABLE OF CONTENTS 1. INTRODUCTION General Comments .............................................. ..... What is an Operating System? ......................... ',' . . . . . . . . . . . . . . P&T CP/M 2 Capabilities .............................................. Files on the Disk . . . . . . . . . . . . . . . . . . . . . .. . . .. . . . . . . . . . . . . . . . . . . .. . . . . . . Other Documentation ................................................. 1.1 1.1 1.2 1.4 1.5 2. NOTATION 2.1 Conventions of Notation 3. GETTING ON THE AIR Introduction ......................................................... . Making a Working System Diskette ................................... . Operational Notes ................................................... . 3.1 3.1 3.3 4. THE SYSTEM MENU Introduction ......................................................... . General Comments .................................................. . Selection Menus ..................................................... . AE (Auto Execution) ................................................. . AK (Save Autokey Strings) ........................................... . AS (Set 110 Device Assignment ....................................... . CA (Change CCB Port Number) ....................................... . CD (Copy Diskette) ................................... CE (Non-destructive Check of Diskette) ................................ . CH (Clean ReadlWrite Heads) ........................................ . CP (Change Console Parameters) ..................................... . CS (Set CCB Date and Time) ......................................... . DM (Disable Menu Options) .......................................... . DP (Set Drive Step Rate) ............................................. . DT (Display Date and Time) .......................................... . EX (Exit Menu) ..................................................... . FR (Freeze 110 Parameters) ........................................... . GD (Generate Data Diskette and Copy Files) ........................... . GS (Generate System Diskette) ....................................... . HZ (Change Power Frequencies) ...................................... . KT (Save Key Translations) ........................................... . LA (Set Last Address Used by CP/M) .................................. . MT (Test Computer's Memory) ........................................ . ND (Format aNew Diskette) .......................................... . PP (Set Parallel Port Parameters) ..................................... . SD (Set System Date) ................................................ . SM (Select System Modules) .......................................... . SP (Set Serial Port Parameters) ....................................... . ST (Set System Time) ................................................ . SY (Sychronize System Date and Time with CCB) ...................... . TE (Test Diskette) ................................................... . F ••••••••••••••• 4.1 4.3 4.5 4.8 4.9 4.10 4.11 4.12 4.13 4.14 4.15 4.16 4.17 4.18 4.20 4.21 4.22 4.23 4.25 4.27 4.28 4.29 4.30 4.31 4.32 4.33 4.34 4.35 4.36 4.37 4.38 61 a DI IDJ III (g m m m 1m 111 OIl 111 5. OVERVIEW OF CP/M Memory Usage ....................................................... Disk Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Files and Disk Storage .. . .. .. . . . . .. . . .. . . . . .. .. . . .. . . . . . . . . . . . . . . . . . . . Disk Allocation Blocks ............................... , . . .. .. . . . . . . . . . . Random Access Files ...... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Non-Disk I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command Structure .................................................. DIR Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ERA Command ....................................................... REN Command ....................................................... SAVE Command ...................................................... TYPE Command ...................................................... USER Command ..................................................... Transient Commands ................................................. Boots: Warm and Cold ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Console Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 5.2 5.4 5.7 5.8 5.8 5.9 5.11 5.13 5.14 5.15 5.16 5.17 5.18 5.19 5.19 5.20 6. MODULARITY Introduction .......................................................... Types of Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Selecting Modules (MODSEL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 6.2 6.3 7. UTILITY MODULES Introduction .............................. ',' . . . . . .. . . . . . . . .. . . . . .. . . . . AUTOKEY Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . KEYXLATE Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SCRNDUMP Module .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ADM3A Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 7.1 7.4 7.6 7.6 8. UTILITY PROGRAMS Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1 Command Line Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1 List of Utility Programs ............................................... 8.2 ASM .... .......... .... ............ .... ... ... ... ......... ... .......... 8.4 ASSIGN ............................................................. 8.9 CLEAN .............................................................. 8.13 CLONE .............................................................. 8.15 DATIME ..... ; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.27 DDT ................................................................. 8.29 DENSITY ......... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.36 DISKCHK .................................................... , . . . . . . 8.39 DISKTEST .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.46 DUMP ................ '" ................ , ........................... 8.55 ED .................................................................. 8.56 ERROR .............................................................. 8.57 FASTCOPY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.58 FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.69 KXEDIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.78 LOAD ............................................................... 8.82 MODSEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.84 PATCH .............................................................. 8.85 PIP .................................................................. 8.90 SETCCB ............................................................ 8.104 SETDATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.108 SETMISC ........................................................... 8.111 SETrIME .......................................................... . SETUP ............................................................ . STAT .............................................................. . SUBMIT ............................................................ . SYNCRO .......................................................... . TRS2CPM ......................................................... . VERIFy ........................................................... . XSUB ............................................................. . Examples of Using the Command Mode 8.120 8.122 8.130 8.137 8.140 8.141 8.149 8.151 8.154 9. SYSTEM ERROR MESSAGES Introduction ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BDOS Error Messages .......................................... . . . . . . . BIOS Error Messages ........................................... ...... Warm Boot Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System Load Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mod:ule Error Messages ......................................... ...... 9.1 9.2 9.3 9.3 9.4 9.5 10. CONSOLE DISPLAY General Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Display Control Codes . . . .. . .. . .. . .. .. .. .. . . .. .. . . . . . . . . .. . . . .. . .. . . . Cursor Addressing ................................................... Graphics Mode ...................................•............. ..... Languages with Auto New Line ....................................... Languages with Buffered Output ..................................... Converting TRS Basic Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Console Functions ............................................. Special System Functions .. . .. . .. . . .. .. . .. . . .. . .. .. . . . . . . . .. .. .. .. . . . Line Wrap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... . . . . . . . . . . . . . . . . . . . . . Direct Video Access ............................... " ...... " .... .. . . . SCRNDUMP Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1 10.1 10.4 10.6 10.6 10.7 10.7 10.8 10.9 10.11 10.12 10.13 11. THE KEYBOARD General Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Direct Keyboard Input ............................................... 'l'ype-ahead ....................... " . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . The (break) 1'rap . . .. . . .. .. . . .. .. . . .. .. . . .. .. .. .. ...... . .. . .. ... .. . . . AUTOKEY Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . KEYXLATE Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 11.2 11.3 11.4 11.5 11.5 12. SERIAL 110 General Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SIO Protocols ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Serial Port Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing the Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Connecting to the Ports .......................................... " . . 12.1 12.1 12.2 12.3 12.4 13. PARALLEL PRINTER PORT General Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parallel Port Options . . .. . .. . .. . .. . .. .. . . .. . .. . .. . .. .. . . . . . .. .. . .. . . . Special Notes (Radio Shack Printers) .............................. " . . Error Messages ............................................... . . . . . . . 13.1 13.2 13.3 13.3 14. 1/0 ASSIGNMENT IOBYTE 14.1 15. NOTES ABOUT BIOS General Comments .................................................. Register Preservation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • . . . . . . . . . . . . . . BIOS Jump Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System Parameter Area .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interrupts ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.1 15.1 15.2 15.4 15.4 16. SPECIAL SYSTEM FUNCTIONS Introduction ....... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Special System Functions from Assembly Language .............. Using Special System Functions from High Level Languages ............ #0 Set up serial ports . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . #1 Read from serial port A ......................................... #2 Read from serial port B .......................................... #3 Output to serial port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #4 Output to serial port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #5 Read serial port A status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . #6 Read serial port B status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #7 Read parallel port status . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . #8 Output to parallel port . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . #9 Set parallel port options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #10 Set parallel printer page length ..... . . . . . . . . . ... . . . . . . . . . . . . .. . . #11 Set parallel printer lines/page ................................... #12 Set parallel printer top of page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . #13 Set all drives to unknown density . . . . . . . . . . . . . . . . . . . . . .. . . . . .. . . #14 Read real time clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #15 Read time of day clock .......................................... #16 Set time of day clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #17 Read XY location of cursor ...................................... #18 Read character at cursor location ................................ #19 Set cursor size and blink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #20 Set cursor blink and on/off ...................................... #21 Enable access to screen .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #22 Disable access to screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #23 Set split screen mode ............................ . . . . . . . . . . . . . . . #24 Read system date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #25 Set system date ................................................ #26 Set ctl-C trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #27 Set/clear drive flag .. . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #28 Set/clear drive read/write flag .......................... '. . . . . . . . . #29 Reserved . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #30 Send break to serial port . . . . . . . . . . . . . . .. . . . . . . . . . . .. . . . . . . . .. . . #31 Terminal emulation on/off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #32 Initialize flashing message ...................................... #33 Flash message .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #34 Restore display after flashing message ........................... #35 Read disk status ............................................... #36 Reserved .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . APPENDICIES GLOSSARY INDEX 16.1 16.1 16.2 16.7 16.8 16.9 16.9 16.10 16.10 16.11 16.11 16.12 16.12 16.13 16.13 16.14 16.14 16.15 16.15 16.16 16.16 16.17 16.17 16.18 16.18 16.19 16.19 16.20 16.20 16.21 16.21 16.22 16.22 16.23 16.23 16.24 16.25 16.26 16.26 16.27 P&T CP/M 2 User's Manual INTRODUCTION page 1.1 General Comments III 1.1 General Comments P&T CP/M 2 is a customization of the popular CP/M operating system for the TRS-80 Models II, 12, and 16. This manual is intended to provide the information necessary to make use of P&T CP/M 2. It provides a brief introduction to the CP/M operating system in general and specifically describes the extensions that P&T CP/M 2 adds to standard CP/M. Also covered are topics that are unique to the TRS-80 Models 11/12/16, such as using the serial I/O ports and the video display. Finally, all of the utility routines that have been added by Pickles & Trout are fully documented. This manual is not a tutorial introduction to the CP/M operating system. In many places it will assume some familiarity on the part of the user with CP/M. If you are just beginning to use CP/M, you should consider acquiring one of the several books currently on the market dealing with using the system. As with any new subject of study, it will take some time to become familiar with CP/M and learn the most efficient ways of using it. Neither does this manual attempt to instruct you in the use of application programs. Many application programs require some customization to make use of the system console, printer, and other facilities. This manual presents general information about P&T CP/M 2 which is needed to make these customizations, but it is not possible to give exact instructions for every application program available. If you desire assistance from Pickles & Trout, it is absolutely necessary that your copy of P&T CP/M 2 be registered. To register your copy, you must fill out and return the registration cards you received with the original diskette. If you did not receive the cards, please call Pickles & Trout at once for instructions on registra tion. Please realize that we must limit assistance with P&T CP/M 2 to matters concerning the operating system and its supporting utility routines. We would like to help everyone with their programming problems, but that would be impossible. We cannot, for example, provide step-by-step instructions on customizing a specific software package. In such a case, we can only supply general directions and point out the appropriate parts of this manual. 1.2 What is an Operating System Any computer system is made up of a variety of component parts. These components can be loosely defined as falling into two groups: those that are closely associated with the processing unit of the computer and those which are not very closely tied to the processor. The elements of the system that are not closely tied to the computer are commonly referred to as peripherals, since they usually reside around the fringes of the system. Typically, there is much variation among computer systems in the type and arrangement of peripheral devices. For this reason, it is very undesirable to force each program to deal with the peripherals directly. To do so would impose a heavy burden on the programmer, and it would cause great difficulty in running the same program on different machines. If an accounting program, for instance, is to keep files of information on a diskette, it is not productive to have the applications page 1.2 What is an Operating System? INTRODUCTION P&T CP/M 2 User's Manual programmer write the diskette interface routines himself. Besides extra time and effort, the routines may require programming in a language the programmer doesn't even know! The function of an operating system is to provide a unified, coherent way for programs to interact with the resources of a computer system. By providing this standardized interaction with system resources, the operating system makes it possible to write programs for a large variety of computer configurations without knowledge of the details of each one. Such standardization also makes it possible for a number of programs, perhaps written by a number of programmers, to work on the same pool of data and to be coordinated in their actions. The operating system, then, spares the programmer a formidable task because it shields the program from the mundane but complex details of hardware interaction. The programmer no longer worries whether the system printer is a dot matrix or complete character type, or whether it is interfaced to a serial or parallel port. When a program sends a character to the printer, the operating system sees that it gets to the printer, regardless of how the printer is connected to the system. CP/M 2 is a powerful single-user operating system for all microcomputers based on 8080 and Z-80. Since its introduction, it has gained rapid and continuing popularity in the small computer field and, in fact, has become one of the few de facto standards in the widely diversified field of microcomputing. Thousands of applications programs written in a dozen or more languages have been developed for computers running CP/M. This diversity allows the programmer to choose from a range of languages not found in most mainframe and mini computer systems. Because of the standardization CP/M has brought to microcomputer systems, it is possible to buy "off the shelf" software that will actually run with no modification on a machine different than the one on which it was developed. 1.3 P&T CP/M 2 Capabilities P&T CP/M 2 provides access to all the peripheral devices and ports which are part of the standard equipment of the TRS-80 Models ll/12/16. Each peripheral device is tied into the system with the CP/M standard facilities, allowing programs to use the full power of the TRS-80 Models ll/12/16 without resorting to tricks and special I/O handlers. P&T CP1M 2 is designed on a modular concept which gives you considerable flexibility over the system configuration. For example, this modularity allows you to select only the I/O drivers you need for your system. If you do not have a parallel printer, you need not include the parallel port driver software in the system. You can also choose to include a variety of utility modules that are designed to provide various useful functions (like programmable function keys). Selecting the modules to be included in the system is a very easy task and may be done at any time. To change the modules included in the system, you need merely run the MODSEL utility program and reboot the system. Many of the utility programs included with P&T CP/M 2 are designed to make them useful in an integrated system of programs. These utility programs have both a prompted mode and a command line mode. In the prompted mode, the program will ask you for all the information (e.g. drive letters, if you want verification, etc.) it needs in order to perform its job. In the command line mode all of the necessary information is included on the command line that executes the program. Figure 1.1 gives an example of using the FORMAT utility program in the command line mode to P&T CP/M 2 User's Manual INTRODUCTION page 1.3 P&T CP/M 2 Capabilities format the diskette on drive B at double density and verify that there are no bad spots on the· diskette. ~ Figure 1.1 FORMAT DR=B,DD,V ~ Sample Command Line for FORMAT Program If you use a particular program frequently, you may want to use the command line mode to avoid having to answer the questions the program asks in the prompted mode. The command line mode also makes it possible to use standard system utility programs in submit files, with menu systems, and (in some cases) from other programs. Other examples of using the command line mode are given in Chapter 8, UTILITY PROGRAMS. Full access to the serial ports is available through the standard 1/0 mechanisms of CP /M and by special system functions. These special functions provide capabilities not normally available with CP/M, such as port status checking. Within the standard serial port routine, several common printer protocols are available (such as RS-232 , XON/XOFF, and ETX/ACK) which allow the use of almost any serial printer without special programming. The parallel printer port is also accessible via the standard 1/0 functions of CP/M and by special system functions added by P&T CP/M 2. Options available for the parallel printer port allow the use of printers that perform automatic line feeds wi th carriage returns. P&T CP/M 2 implements a real time clock which can be accessed by programs for timing purposes. As part of the real time clock, the system maintains a time of day clock and a system date. When the Pickles & Trout CCB Clock/Calendar/Bell board is installed in the computer, the system time of day and date are automatically set whenever the system is reset. P&T CP/M 2 supports single sided double density, double sided double density, and standard CP/M single density floppy diskette storage. Standard single density diskettes are fully interchangeable with other CP/M systems supporting standard 8 inch single density diskettes. The double density formats are, in general, not interchangeable with other CP/M systems. Figure 1.2 shows the usable capacity and number of directory entries for each of the formats. format single density double density double sided usable storage 243 Kbytes 596 Kbytes 1210 Kbytes Directory Entries 64 128 192 Figure 1.2 Capacities and Number of Directory Entries for Disk Formats In addition to the greater storage capacity, double density diskettes improve the speed of disk access by approximately a factor of 3 over single density. The operating system detects the density of the diskettes and automatically treats them properly, making diskette density completely transparent to application programs. For most programs, either a single or double density diskette may be used (unless the greater storage of a double density diskette is needed). However, all system diskettes must be double density. A full function console interface is provided in P&T CP/M 2, including a comprehensive set of display functions and type-ahead capability on the standard console keyboard. page L4 Files on the Disk INTRODUCfION P&T CP/M 2 User's Manual 1.4 Files on the Disk The distribution diskette you received should contain the following files: ASM.COM The standard CP/M assembler. (CP/M Operating System Manual, pA7) ASSIGN.COM P&T CP/M 2 utility to change the I/O device assignment quickly (e.g. change the system printer from the parallel port to a serial port). BIOSMODS.PNT Library of I/O driver modules that can be included in the operating system when it is loaded. BIOSPAR.M.PNT Parameter file that contains information about how the system is to be configured when it is booted. CLEAN.COM P&T CP/M 2 utility for use when cleaning diskette drive heads. CLONE.COM P&T CP/M 2 utility to make an image copy of a diskette. CRT.DEF CRT parameter file for using Structured Systems Group software with P&T CP/M 2. DATIME.COM P&T CP/M 2 utility to display the current system date and time. DDT.COM The standard CP/M debugger. (CP/M Operating System Manual, p.69) DENSITY.COM P&T CP/M 2 utility to report and, optionally, change the density flag on a diskette. DISKCHK.COM P&T CP/M 2 utility to check a diskette for flaws. It does not affect the data on a diskette and may be used at any time. DISKTEST.COM P&T CP/M 2 utility to test a diskette for flaws. This program destroys any data on a diskette and should be used only on a new diskette or before reusing one. DUMP.COM Standard CP/M 2 program to display a disk file in hexadecimal format. ED.COM Standard CP/M 2 line oriented editor. Manual, p.33) ERROR.COM P&T CP/M 2 utility to explain error messages given by the system. (CP /M Operating System FASTCOPY.COM P&T CP/M 2 utility to make a file by file copy of all files under all user numbers from one drive to another. FASTCOPY reads as many files from the source drive into memory as will fit before beginning to write them out to the destination drive. FORMAT.COM P&T CP/M 2 utility to format diskettes. KXEDIT.COM P&T CP/M 2 utility to define and edit the keyboard character translations performed by the KEYXLATE utility module. LOAD.COM Standard CP/M 2 utility that creates an executable "COM" file from the "HEX" file generated by an assembler. (CP/M Operating System Manual, p.l6) , MENU.COM P&T CP/M 2 system menu program to assist you in common system operations like generating new diskettes MENUOLYl.COM Additional portions of the system menu that are loaded as overlays. MODSEL.COM P&T CP/M 2 utility to select the modules that are to be included in the system when it is loaded. PAGE.COM P&T CP/M 2 utility which sends a form feed (page eject) character to the system printer. P&T CP/M 2 User's Manual INTRODUCTION page L5 Files on the Disk PATCH.COM P&T CP/M 2 utility for installing P&T supplied patches to programs. PIP.COM Standard CP/M 2 program for file transfer. Manual, p.17) SAMPLE.TXT A sample text file for use in trying out the VEDIT text editor. SETCCB.COM P&T CP/M 2 utility for setting the P&T CCB clock, calendar, and bell board. SETDATE.COM P&T CP/M 2 utility for setting the system date. SETMISC.COM P&T CP/M 2 utility for setting miscellaneous I/O parameters such as the cursor size and blink rate, floppy drive stepping rate, parallel printer port options, etc. SETTIME.COM P&T CP/M 2 utility for setting the system time. SETUP.COM P&T CP/M 2 utility for setting the serial port parameters and the I/O device assignments. STAT.COM Standard CP/M 2 utility for displaying statistics on disk drives and files. (CP/M Operating System Manual, polO) SYNCRO.COM P&T CP/M 2 utility for synchronizing the system date and time to the P&T CCB clock, calendar, and bell board. SUBMIT.COM Standard CP/M 2 utility for submitting multiple command lines for batch processing. (CP /M Operating System Manual, p.25) TRS2CPM.COM P&T CP/M 2 utility to transfer files from a TRSDOS diskette to a CP /M diskette. VEDIT.COM Pre configured copy of the special P&T CP/M 2 version of the VEDIT full screen editor. This program is ready to run as is. VEDIT.SET Unconfigured copy of the special P&T CP/M 2 version of the VEDIT editor. This file must be configured before it can be used. VEDSET.COM The program for configuring the special P&T CP/M 2 version of the VEDIT full screen editor. VERIFY.COM P&T CP/M 2 utility to verify that a copy of a utility program is correct. This program may be used periodically to insure that nothing has damaged the copies of programs you are using. XSUB.COM Standard CP/M 2 utility that allows a submit file to feed console input into running programs. (CP/M Operating System In addition to these files there are several files with names having the form "FIGxxxxx.yyy". These files contain the source code used in the examples given in various figures throughout this manual. The "xxxxx" will be replaced by the number of the figure with which the file is associated. These files have been included as a convenience to you in case you want to use some of the code appearing in the examples. 1.5 Other Documentation The standard Digital Research manual CP/M Operating System Manual is included with the documentation for P&T CP/M 2. You will be referred to this manual, in some instances, for information about standard CP/M 2 features and programs. In addition to this manual, a number of books have appeared which provide information on the CP/M operating system. Most of these books are written in a III page 1.6 Other Documentation INTRODUcrION P&T CP/M 2 User's Manual general manner, which allows them to serve most implementations of CP/M. Because of this generality, most of them contain information irrelevant to P&T CP/M 2. In general, their discussion of the standard CP/M utilities should be directly applicable, but most of the information on system generation procedures is not. P&T CP/M 2 User's Manual NOTATION page 2.1 Conventions of Notation 2.1 Conventions of Notation For ease of reference, all page numbers in this manual consist of two numbers. The first refers to the chapter number and the second to the page number within the chapter. Figures within this manual are numbered in a similar way, but the second number denotes the figure, not the page, within the chapter. For example, Figure 5.8 refers to the eighth figure in the fifth chapter. If it is necessary to indicate a specific line within a figure, a hyphen separates the figure and line numbers (e.g. Line 5.8-12 means line 12 of Figure 5.8). Keep in mind that "Line _It refers to a line of a figure, not a line of the text. When numbers are used within the manual, they should be considered to be decimal (base 10) unless otherwise noted. A hexadecimal number (base 16) is indicated by appending the letter "h" to the number (e.g. lAh). A binary number (base 2) is indicated by appending the letter Itb" to the number (e.g. 101b). In figures that represent console displays, this convention will not be used if the program that generated the display does not follow it. Every effort has been made to make the figures representing console displays as accurate as possible. The text relating to a figure will specify the base of the numbers displayed if it is not obvious from the context. When it is necessary to refer to one of the named keys on the keyboard, the name of the key is enclosed in angle brackets. For example,refers to the key on the keyboard labeled "ENTER". If you are instructed to type or press at some point, it is expected that you will press the key labeled "ENTER" rather than typing the 7 characters "<", "e", "n", "t", "ett, "r", ">". Note that the key generates an ABcn carriage return character. The key that generates this character is sometimes labeled "RETURN" on other computers and terminals. In some cases the symbol is used to denote the ABCn carriage return character. Control keys and control codes are denoted by the characters "ctl-It followed by a letter and enclosed in angle brackets (e.g. , you would type the "A" key on the keyboard while holding down the and keys while RESETing in order to make the system boot from the floppy diskette. After the system is loaded it should immediately begin running a special program to help you create a working system diskette. You should generate a working system diskette from the master diskette and then store the master diskette away in a safe place. The working system diskette you generate will have all the capabilities of the master diskette. You should NEVER cover the write protect notch on the master diskette. There is no need to write information to the master diskette and covering it's write protect notch is an invitation to trouble. To generate a working system diskette you will need a blank diskette or a diskette that can be reused The working system diskette can be either single or double sided and will always be double density. We suggest that you use a new double density certified diskette for your first working system diskette since you will be using it a lot. The console display created by the system generation program is shown in Figure 3.1. It first asks you whether you have more that one floppy drive (Line 3.1-3). If you have only one floppy drive, you will have to swap the master diskette and the new diskette several times during the generation process. If you have two or more floppy drives, you should give an affirmative response as is shown on Line 3.1-3. The program will then use the second floppy drive (drive B) for generating the working system diskette, eliminating the need for swapping diskettes. III page 3.2 GETTING ON THE AIR Making a Working System Diskette Generate a System Disk 1: 2: 3: 4: 5: Do you have more than one floppy disk drive? [YIN) y 6: We wil I now format (initialize) a disk so that we can put the Pickles & Trout CP/M operating system on It. 7: 8: NOTE: Any Information on the disk wll I be DESTROYED!!! 9: 10: 11: 12: Mount the new disk on drive Band Press when ready 13: 14: 15: 16: 17: 18: 19: 20: 21: P&T CP/M 2 User's Manual Formatting Single-sided disk In drive B: at Double-density. Format complete. Checking disk on drive B: Checking complete. Copying from drive A: to drive B: at Double Density. System tracks copied. Copying from drive A: to drive B: Reading BIOSMODS.PNT R/W, DIR, user= 0 22: 23: 24: 25: 26: 27: The new disk Is now a working CP/M system disk. Mount It on drive A and RESET the computer Figure 3.1 Making Your First Working System Diskette The program will then tell you that the new diskette will be formatted before the system is installed on it (Lines 3.1-5 and 3.1-6). It also warns you that any information on the diskette will be destroyed by the format operation. This is a reminder that you should use only a new diskette or one that has no needed information recorded on it. On Lines 3.1-10 and 3.1-11 the program asks you to mount the diskette on drive B and press the key. After you press the format operation begins and is announced by Line 3.1-13. If any errors occur during the format operation, error messages will be displayed. This program makes use of the FORMAT utility program to do the disk formatting; refer to Section 8.17 for an explanation of any error messages that are displayed. Should an error occur while any utility program is running, the error message from that program will be displayed on the console. After the utility program is finished the system generation program will inform you that the diskette was bad and will ask you to press . After you press , the program will begin over again. After the format is complete, the diskette is checked for bad spots as shown on Lines 3.1-15 and 3.1-16. The check is also performed by the FORMAT utility program; refer to Section 8.17 for an explanation of any error messages that are displayed. After the diskette is formatted and checked, the system tracks are copied to it as shown on Lines 3.1-18 and 3.1-19. This operation is performed by the CLONE utility program; refer to Section 8.7 for an explanation of any error messages that are displayed. After the system tracks have been copied to the new diskette, all files are copied from the master to the new diskette (Lines 3.1-20 to 3.1-24). The files are copied using the FASTCOPY utility program; refer to Section 8.16 for an explanation of any error messages that are displayed. After all files are copied to the new diskette, the message shown on Lines 3.1-26 and 3.1-27 is displayed. At this point you should P&T CP/M 2 User's Manual GETTING ON THE AIR page 3.3 Making a Working System Diskette remove the master diskette and store it in a safe place. You may now mount the new working system diskette on the system drive and RESET the computer to begin using it. 3.3 Operational Notes Everyone will have his or her own way of using a computer system. There is no "best" way to work with a system, but a few general ideas have gained wide acceptance. The following comments result from several years of work with microcomputers and larger computers. They do not represent any absolute truths, but we feel that they are worth considering. L Plan Ahead This notion may seem trite, but planning can make a crucial difference in what you get out of your system. Take a few minutes (or hours, if necessary) and carefully think over what you want to do with your computer and how you intend to do it. It is advisable to adopt a system philosophy and to follow it consistently. It may be modified as necessary, but only with careful considera tion. 2. Make Frequent Backups (copies) If there is one golden rule in working with microcomputers, it is: "Backup important files often!!!". The importance of this statement cannot be overemphasized. The agony a system crash, diskette failure, or a program bug can cause is inversly proportional to the frequency of backup. A diskette may cost 3 or 4 dollars, but the information stored on it can cost hundreds or thousands of dollars. Frequent backups are cheap insurance. 3. Divide Diskette Usage It is an undeniable fact of microcomputers that some diskettes will occasionally become unreadable for one reason or another. The one which is lost is usually the working system diskette, since it spends more time in the machine than any other. (Note: If the system is functioning properly, this should be a relatively rare occurrence. In a system that is running 8 hours a day, 5 or more days a week, we loose about one diskette every 3 or 4 months, and it is nearly always the system diskette.) For this reason, it is usually a good idea to keep system-related files and programs on the system diskette while keeping data files and applications programs on another. By keeping the program generated data files separate from the working system diskette, you will minimize the possibility of losing important information when a diskette dies. If something does happen to the system diskette, it can then be easily regenerated. You should make up 2 or 3 working system diskettes and transfer all of your standard programs (such as text editors, compilers, and the like) onto them. If you use many different programs, you may wish to make up system diskettes with different combinations of programs on them. In any case, keep one of the diskettes as a backup and put the others into use. Store data files generated by these programs on data diskettes rather than the working system diskette. It also pays to keep different data diskettes for different tasks. This practice can reduce the number of files which could be lost with a diskette, and it helps maintain order in data storage. Of course, you should still back up important files often. GETTING ON THE AIR page 3.4 Opera tional Notes P&T CP/M 2 User's Manual In some cases (as with a single drive system) it is not practical to make this division of usage. Backup then becomes even more important. 4. Maintain Your Equipment Computers share with most other machines the need for periodic maintenance. Perhaps the most important maintenance item is the cleaning of diskette drive heads, as dirty heads are a common cause of unreliable system performance. Special head cleaning diskettes offer a very simple solution, and they are available from many sources. The CLEAN utility program supplied with P&T CP /M 2 is specifically designed to be used with these cleaning diskettes. For other aspects of routine maintenance, contact your hardware supplier. Apply Power to Your Computer With Care In general, it is not recommended that power be applied to the computer or any external drives when diskettes are mounted and the drive door closed If the drive door is open, the read/write head of the drive is not engaged and the diskettes are 99.9% safe from any anomalies that occur while the power is being applied For complete safety, the diskettes should be entirely removed from the drives when the power is turned on or off. With most TRS-80 Model n computers manufactured before 1982, it is extremely important to apply power to the various devices in the system in the proper order. Improper application of power will not result in physical harm to the computer, but it is possible to destroy the information stored on a diskette. This information is lost REGARDLESS OF WHETHER THE DISKETTE IS "WRITE PROTECTED" OR NOT. All of the problems associated with the "power on" sequence result from a diskette being mounted in the built-in drive and the door closed before power is applied to the external drives. If you should attempt to boot the operating system before the external drives are running, an error message will indicate that the system diskette cannot be read. In this event, OPEN THE BUILT-IN DRIVE DOOR BEFORE APPLYING POWER TO THE EXTERNAL DRIVES. You can avoid the risk to your system diskette by insuring that power is supplied both to the computer and to the external drives before closing the door of the built-in drive. An easy way to do this is to plug the computer and external drives into a switched outlet (or extension cord). By letting this switch turn the system on and off, power is always applied simultaneously to the computer and external drives, and the problem is solved. Changing Disks When changing disks, the operating system must be informed of the change so it can make allowances for it. If you change disks while at the system command level, you need merely press the key after mounting the new diskette. When a program is running, you should change disks only at the times the program allows you to do so (you should see the program documentation to find out when you can change disks). Programs that allow you to change disks call a system function to inform the system of the change so you do not need to press the key. When each disk is first accessed, P&T CP/M 2 begins keeping a map of its free space in order to determine which areas of the disk may be assigned to files as they are written. The map is initialized (at the very first access) by a reading of the disk's directory. Thereafter, it is updated as storage on the disk is increased P&T CP/M 2 User's Manual GETTING ON THE AIR page 3.5 Opera tional Notes or decreased. All free space maps are kept until a warm boot or disk system reset occurs. Each is then cleared and must be rebuilt, which cannot take place until the next access of the disk. It is vitally important that the free space maps agree with the actual status of the disks. Otherwise, information could be written to a part of the disk which has been assigned to another file, with disastrous results. As a safeguard, P&T CP/M 2 keeps information regarding the current contents of each disk directory, and this information is compared to the disk's actual directory each time it is accessed. If a discrepancy is found, it is assumed that the disk has been changed and should not be written on, so the system sets the disk to "read only" status. It is still possible to read information from the disk, but an attempt to write on it will result in a "Read Only" error message. (See Chapter 9 for a description of error messages.) Once a map is made up for a given disk, the corresponding drive is said to be active. When a warm boot is performed, all active drives except the current drive and logical drive A (often one and the same) are returned to an inactive state. (Actually, as noted above, all free space maps are cleared, but the current drive and logical drive A are immediately "reactivated".) Since the free space map being kept for a given disk is unique to it, it is standard practice to do a warm boot (press at the command level of the system) or reset the disk system whenever a disk is changed. Many programming languages have a standard CP/M function for resetting the disk system when diskettes are changed. (In Microsoft Basic-80 it is called RESET.) In this way, the map is rebuilt and is thus valid for the new disk. NOTE: Disks may be changed with neither of these actions taken, but ONLY if no writing 0 erations are going to be performed on the disk. Any attempt to write on the disk such as erasing or renaming a file) will result in an error, and the program which is running will be aborted. A warm boot sets all disks to "read/write" status. Since a warm boot automatically follows a "Read Only" error message (see Chapter 9), information cannot be effectively protected by setting a disk to "read only" status. Such protection is available through one of the standard CP/M system functions (see BDOS Function 28, p.105 of CP/M Operating System Manual), but the only sure method is to uncover the disk's write protect notch. When this notch is detected by an optical sensor in the drive, the drive's write circuitry is disabled. P&T CP/M 2 also keeps information on the density of a diskette. As a diskette is first accessed, the automatic density selection subsystem determines its density and sets the I/O routines accordingly. A warm boot or a disk system reset will clear the density information for the diskette drives affected. You can therefore change diskette densities when you change diskettes provided you perform a warm boot or disk system reset before next using the diskette. Note that if you mount a different density of diskette when changing, you will not even be able to read it until a warm boot or disk system reset is performed since the system will still be accessing it at the previous density. A program can also make use of P&T Special System Function 13 (see Section 16.17) to set all drives to unknown density before accessing a drive on which a new diskette of a different density may have been mounted. Because a system diskette must always be double density, a program must perform a disk system reset (or optionally use Special System Function 13) to access a single density diskette on the system boot drive. NOTE: Any program that permits a non-system diskette (single or double density) to be mounted on logical drive A should prompt the user to mount a system diskette before attempting to return to III page 3.6 Operational Notes GETTING ON THE AIR P&T CP/M 2 User's Manual the system. If a system diskette is not mounted, the system may attempt to warm boot from a non-system diskette, which is guaranteed to spell disaster. Some systems (e.g. Model 12 computers and computers with the Radio Shack hard disk installed) do not require a system diskette for a warm boot operation. Therefore the previous paragraph does not apply to these systems. Single Drive Systems P&T CP/M 2 has a built-in mechanism which enables TRS-80 Models n/12/16 with only a single floppy drive to run software designed for multiple drives. As the program is running, different diskettes must be substituted in the one physical drive. While this practice allows you to run software requiring multiple drives on a single drive system, it is not a recommended alternative to the purchase of additional drives. A multiple-drive system will do the same job in much less time. (If your machine operates in a commercial environment, a second diskette drive will often pay for itself in a month or two.) It also simplifies file copying, which tends to encourage frequent backups, and it avoids the risk of human error in the interchange of diskettes. On a system which does have only one floppy drive, P&T CP/M 2 allows software to act as though up to 4 logical drives are available to it. The operating system automatically assigns a different diskette to each logical drive, and it keeps track of the diskette which is currently mounted in the actual (built-in) physical drive. When it is necessary to access a diskette other than the one in the drive, the appropriate diskette is specified in a mount request on the console display. This mechanism can be used only on a one-drive system. It is not possible, for example, to simUlate 4 logical drives when there are 2 or 3 physical drives on the system. To illustrate the disk swapping process, let us suppose that a program expects to find four logical drives on the system. Running the program would then require 4 different diskettes. Logical drive A would be assigned to one diskette we shall call "disk A," logical drive B to one called "disk B", and so on. When the program needs to access a particular drive and the appropriate diskette is not currently mounted, the special message shown in Figure 3.2 is flashed in the center of the console display. Please mount disk x on main drive and hit enter Figure 3.2 Diskette Swapping Prompt The "x" in the request would be replaced by the letter of the needed logical drive. If, for example, disk B is currently mounted and the program needs the third logical drive, the message would call for disk C. Once you have mounted the requested diskette, the system will continue when you press the key. After you press , the flashing message will disappear and the console display will be returned to its state before the message was given. The swapping process continues until the program is finished. In order to hold diskette swapping to an absolute minimum, P&T CP/M 2 does not issue a mount request (Figure 3.2) until an actual operation needs to be performed on the disk. For this reason, there can be situations when the CCP command prompt on the console (indicating the current default drive) does not agree with the diskette currently mounted on the drive. GETTING ON THE AIR P&T CP/M 2 User's Manual page 3.7 Opera tional Notes As an example, suppose that drive A is the current default drive and that disk A is mounted on the drive. You wish to list the directory on drive B, so you type "DIR B: ". A message on the console then instructs you to mount disk B. After you mount the disk and press , the directory is listed. Now the CCP prompt on the console shows "A", the current default drive, even though disk B is on the drive. There will be no request to remount disk A until the system actually attempts to access it. Except for mild confusion, the situation poses no potential problems. The appropriate message will be given as it is needed. Swapping diskettes to simulate a multi-drive system can lead to errors. In particular, there is always the danger of mounting the wrong diskette. It is a very good idea to invest in a package of small removable labels. If you need to do a lot of diskette swapping, you can use these labels to temporarily mark each diskette with its logical drive letter (ie. "A", "B", etc.). However, it is an even better idea to invest in a second disk drive. Drive Not Ready When the system attempts to access a floppy drive that is not ready, the message shown in Figure 3.3 is flashed in the center of the console display. A drive may be "not ready" if there is no diskette mounted, the door is not closed, the diskette is inserted backwards, or a double sided diskette is mounted on a single sided drive. In rare cases this may also be caused by a hardware problem. Drive X is not ready - please check it. X is replaced with the letter of the drive that is not ready. Figure 3.3 Message Flashed if a Drive is Not Ready While the message is flashing on the screen, there are three actions you may take: L You may make the drive ready (by mounting a diskette and closing the door). 2. You may press the key to perform a warm boot and return immediately to the operating system. Note that in this case any program that was running when the error occurred will be term ina ted. 3. You may press the . MENU will then load the file from the disk you have mounted. If you wish to abort the operation that needs the file, you may press to do so. In this case, MENU will cease attempting to load the file and return the selection menu. MENU files are not on the current disk. Enter the letter of the drive on which to find them «ESC> to quit) Figure 4.1 Message When MENU Cannot Find its Files When MENU looks for a program or overlay file, it may not be able to find it. This can occur if you removed the disk on which the files are stored or if you forgot to put a needed program file on the disk. In this case, MENU will display the message shown in Figure 4.2. You may then mount the disk with the required file on the specified drive and press . MENU will then load the file from the disk you have mounted. If you wish to abort the operation that needs the file, you may press to do so. In this case, MENU will cease attempting to load the file and return to its initial display. III page 4.4 General Comments I ~ ~: ~ 3: THE SYSTEM MENU Cannot find xxxxxxxx.yyy on Drive X user N Mount correct disk and press or press to quit Figure 4.2 P&T CP/M 2 User's Manual 'I ~ Message Given When a File Cannot be Found Since MENU loads and executes utility programs in some cases, it also needs to reload itself after the utility programs are finished. When reloading itself, MENU always looks for a file named "ME NU.COM". For this reason, you must not rename MENU. If you want to execute MENU with another name, you should make a copy of MENU.COM with another name but leave the original MENU.COM file on the disk. In a similiar manner, the MENUOLYLCOM file must not be renamed. If MENU requests information and your response is invalid, MENU will ignore your response and ask the question again. The appearance on the console display is that the invalid response is erased and the cursor is moved to the position where it is waiting for a response. As an example, when MENU asks you to specify a disk drive, you may enter a logical drive letter in the range A-P or a physical drive number in the range 0-3. If the letter or number you enter is not in one of these ranges or it corresponds to a drive that does not exist on the system, MENU will ignore your response and ask the question again. Several of the options available with MENU involve copying information from one disk to another. These options will ask you to specify source and destination drives. The source drive is the one from which the data is to be copied and the destination drive is the one to which the information is to be copied. Note that when generating a system diskette, a copy operation is involved to install the operating system on the new diskette. In this case, the source disk should be a working system diskette (ie. one from which the system can be loaded). In the discussion of the various MENU options there are two cases where figures are abbreviated to save space. One is when a number of files are being copied. The names of the files are displayed on the console as they are copied. Only one or two file names are shown in the figure. The second abbreviation involves leaving blank lin.es out of the figures. In some cases, the display presented by MENU will have several lines at the top, one line at the bottom, and several blank lines in between. Some figures leave out most of these blank lines since they are not necessary. to understanding how the option works. Some options involve changes to the system that you mayor may not wish to make permanent. For example, if you change the baud rate on a serial port, you might want to make it permanent if you are connecting a printer to the port. You may not want to make the new baud rate permanent if you changed it temporarily to communicate to another computer over the telephone lines. Most changes will stay in effect only until the next time the system is loaded (RESET). When the system is loaded, the default (permanent) system configuration will be in effect. The default system configuration is stored in a disk file named BIOSPARM.PNT. In order to change the default (or permanent) configuration, MENU must make changes in this file. After you are finished with an option that made changes to the default configuration, MENU will ask you the question shown in Figure 4.3. If you respond affirmatively, MENU will install the changes in the BIOSPARM.PNT file. If you respond negatively, the BIOSPARM.PNT file will not be modified and any changes you have made will remain in effect only until the next time you RESET the computer. THE SYSTEM MENU P&T CP/M 2 User's Manual page 4.5 General Comments Do you want these changes to remain in effect after RESET? [YIN) Figure 4.3 MENU Prompt for Making Changes Permanent In order to change the BIOSPARM.PNT file, MENU must first locate it. It first looks for the file on the drive from which the system was initially loaded. Assuming it finds the file, it displays the message shown in Figure 4.4 on the bottom 5 lines of the screen. This message shows you the drive on which the file was found and gives you the option of specifying a different drive. If you just want to use the drive specified, merely press . If you want to have MENU change a BIOSPARM.PNT file on another drive, enter the drive letter or number. You might want to specify another drive if you have moved the disk from which the system was loaded or if you want to modify some other disk. After you have responded to the question, MENU will restore the bottom 5 lines of the screen to their previous state. 1 ~1It. 1: 2: 3: System parameter fi ie (BIOSPARM.PNT) is on drive X Press if this is the one you want to use. Otherwise, specify drive on which to find the system parameter fi Ie [A-P, 0-3) Figure 4.4 ) MENU Prompt for Locating BIOSPARM.PNT If MENU cannot find the BIOSPARM.PNT file on the drive from which the system was loaded, it displays the message shown in Figure 4.5 on the bottom 5 lines of the screen. This allows you to direct MENU to another drive if you have moved the disk. If the disk is not mounted, you should mount it (on any available drive) at this time and then specify the drive in response to the message in Figure 4.5. After you have responded to the question, MENU will restore the bottom 5 lines of the screen to their previous state. 1 ~1It. 1: 2: 3: Cannot find system parameter fi Ie (BIOSPARM.PNT) on drive X Specify drive on which to find the system parameter file [A-P, 0-3) Figure 4.5 ] MENU Prompt if it Cannot Find BIOSPARM.PNT MENU will display the prompts shown in Figures 4.4 and 4.5 only once each time you run MENU. After it has located the BIOSPARM.PNT file, it will assume that it can always find the file on the same drive. If it cannot find the file on that drive at a later time, it will display a message as shown in Figure 4.2 and allow you to mount the disk with the file. 4.3 Selection Menus When MENU is first executed, it displays the selection menu shown' in Figure 4.6. It also returns to this menu after an option is completed. To select an option you need merely enter the two character code corresponding to that option on Line 4.6-20. III page 4.6 Selection Menus THE SYSTEM MENU P&T CP/M 2 User's Manual , MENU Copyright 1983 by Pickles & Trout 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: Type This OF SC CL AK KT GS GO CD MT OM EX To Perform This Function Disk and FI Ie Operations Change system configuration (Cursor, Disk step rate, Baud rate, etc.) Clock Functions Save AUTOKEY table Save KEY TRANSLATION table Generate a System disk (SYSGEN) Generate a Data (non-system) disk Copy a disk Test Memory Disable Menu functions Exit to CP/M Selection? Figure 4.6 Initial Selection Menu If you select option DF on the initial selection menu, you will be presented with another selection menu as shown in Figure 4.7. This selection menu contains options that deal with preparing diskettes for use and copying files to them. Disk and Fi Ie Operatlons 1: ***** 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: Type This NO GS GO CD CE TE CH OM EX To Perform This Function Prepare a new disk for use (FORMAT) Generate a System disk (SYSGEN) Generate a Data (non-system) disk Copy a disk Check a disk for errors (does not affect Information on the disk) Test a disk for bad areas (destroys any Information on the disk) Clean disk drive heads Disable Menu functions Exit to CP/M Selection? Press to quit Figure 4.7 MENU Display for Disk and File Operations (option OF) If you select option SC on the initial selection menu, another selection menu, as shown in Figure 4.8 will be displayed. This selection menu contains options that are used to change the system configuration. In general, most of the options presented in this menu will be used 6nly once. Once you have configured the system, you may wish to disable (see option DM) the options you no longer need THE SYSTEM MENU P&T CP/M 2 User's Manual 1: 2: 3: 4: 5: Change Type This page 4..7 Selection Menus Syst:~*~~nflguratlon To Perform This Function 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: SM AS SP CP DP PP CA HZ LA AE AK KT FR DM EX Select system modules Assign logical devices CON:, lST:, PUN: and ROR: Set serial port parameters (baud rate, parity, etc) Set CRT parameters (cursor size, blink rate, etc) Set floppy disk parameters (Disk step rate) Set paral lei port parameters (suppress extra line feed on Tandy printers) Set CCB port address Set up system for 50 Hz or 60 Hz line frequency Set last memory address used by CP/M (MOVCPM) Set up AUTO EXECUTE command Save AUTOKEY table Save KEY TRANSLATION table Save current system parameters permanently (FREEZE) Disable Menu functions Exit to CP/M Selection? Figure 4.8 Press to quit MENU Display for Changing the System Configuration (option SC) If you select option CL on the initial selection menu, you will be presented with another selection menu as shown in Figure 4.9. This menu includes options that deal with system timekeeping functions. Clock Functions ***** 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: Type This DT ST SD SY CS CA OM EX To Perform This Function Display system date and time Set system time Set system date Synchronize system date and time with CCB Set CCB date and time Set CCB port address Disable Menu functions Exit to CP/M Selection? 18: 19: 20: 21 : -... 22: 23: 24: Press to quit Figure 4.9 MENU Display for Clock Functions (option Cl) III THE SYSTEM MENU page 4.8 AE 4.4 P&T CP/M 2 User's Manual Option code: AE Purpose: To set up a command line for automatic execution after the system is loaded or a warm boot. Programs used: none The AE option allows you to specify a command line that will be automatically executed either when the system is initially loaded (cold boot) or both after the initial load and on every warm boot. The console display for this option is shown in Figure 4.10. MENU first reads the BIOSPARM.PNT file (where the automatic execution information is kept) and reports to you the current state of the auto command line (Lines 4.10-5 to 4.10-7). 1: 2: Set up AUTO command ***** 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: The command line MENU is executed on each warm and cold boot Do you want to change the command I ine? [YIN) Y Enter new command SUBMIT STARTUP 13: 14: Do you want to change when the command I ine executes? [YIN) Y 15: 16: 17: 18: 1 Never 2 Cold boot only 3 On each warm and cold boot 19: 20: 21: 22: 23: 24: Selection? 2 Is this correct? [YIN) Y Press to quit Figure 4.10 MENU Display for Setting the Auto Command (option AE) On Line 4.10-10 you are given the option of changing the command line. If you indicate that you want to make a change (as shown), you will be prompted for the new command line (Lines 4.10-11 and 4.10-12). You will then be asked if you want to change when the command is executed (Line 4.10-14). If you want to make a change respond affirmatively (as shown) and MENU will present you with the options shown on Lines 4.10-16 to 4.10-17. Enter your choice on Line 4.10-20. On Line 4.10-21, MENU asks you to verify that what you have entered is correct. If you respond affirmatively, it will make any necessary changes to the BIOSPARM.PNT file and return to the selection menu. If you respond negatively, MENU allows you to re-enter your choice. Note that if you simply want to stop a command line from executing, you should choose option 1. Note that any changes in the auto executed command line or when it is executed will not take effect until the next time the system is loaded (RESET). P&T CP/M 2 User's Manual 4.5 THE SYSTEM MENU page 4.9 AK Option code: AK Purpose: To save the strings programmed into the autokeys. Programs used: none If you elect to include the AUTOKEY module with the system when it is loaded, you will have available 5 programmable function keys. These keys may be programmed at any time either directly from the keyboard or by a program (see Section 7.2). Normally, the programmed strings are lost if the system is reloaded (RESET). This option allows you to save the current AUTOKEY strings in the BIOSPARM.PNT file so that they still will be in effect the next time the system is reloaded (RESET). Figure 4.11 shows the console display as the programmed strings are being saved. After you press MENU will return to the selection menu. 1 Save AUTOKEY Table 2 3 4 Done Press when ready 5 6 Figure 4.11 MENU Display for Saving the AUTOKEY Strings (option AK) III page 4.10 THE SYSTEM MENU AS 4.6 P&T CP/M 2 User's Manual Option code: AS Purpose: To change the logical-to-physical 1/0 device assignments. Programs used: ASSIGN This option executes the P&T CP/M 2 utility program ASSIGN for changing the logical-to-physical I/O device assignments. Refer to Section 5.7 for a discussion of I/O devices and to Section 8.5 for instructions on using ASSIGN. P&T CP/M 2 User's Manual 4.7 THE SYSTEM MENU page 4.11 CA CA To change the port number used by the system to access a CCB board. Programs used: none Option code: Purpose: If a Pickles & Trout CCB board is installed in the computer, the system must know how to access it. This option allows you to specify the port address you have assigned to the CCB. Note that a port address of FF is interpreted as meaning that no CCB is installed in the computer. The standard port address for CCB boards is BEh. See the CCB manual for instructions on changing the port address. Figure 4J.2 shows the console display for changing the port address. On Line 4.12-5, the current setting is reported. This example shows the current setting as port FF indicating that no CCB is present. You are then asked if the current setting is correct (Line 4.12-7). If you respond negatively, you are asked to enter the new port address as shown on Line 4J.2-8. After entering the new port address, the display will start over with the new port address shown on Line 4J.2-5. Age.in you will be asked if it is correct. You may continue to change the port address as many times as you wish until you have it the way you want it. When you indicate that the port address is correct MENU will return to the selection menu. 1: Set CCB port Address ***** 2: 3: 4: 5: 6: 7: 8: The CCB port address Is presently set to BE Is this correct? [YIN) N Enter new port address number in hex [O •• FF) BC 9: 10: 11: 12: Press to quit Figure 4.12 MENU Display for Setting the CCB Port Address (option CAl Note that the CA option of menu asks you for the CCB port number in hexidecimal rather than decimal as did previous versions of P&T CP/M 2. page 4.12 CD 4.8 THE SYSTEM MENU P&T CP/M 2 User's Manual CD To make a copy (backup) of a diskette. Programs used: FORMAT, CLONE, FASTCOPY, PIP Option code: Purpose: This option allows you to make copies of diskettes for backup purposes. You have a choice of either an image copy or a file-by-file copy. The image copy is faster but it does not remove any file fragmentation which might limit disk performance. Figure 4.13 shows the console display for making an image copy of a diskette. First you are asked to specify the source and destination drives for the copy operation (Lines 4.13-5 and 4.13-6). Next you are asked if you want to make an image copy (Line 4.13-7). In this example, an image copy is· specified. An image copy always formats and checks the destination disk (Lines 4.13-10 to 4.13-15) before copying. The FORMAT program (see Section 8.17) is used for the format and check. Copy a Disk 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: Press to quit Copy from disk (SOURCE) [A-P, 0-31 A Copy to disk (DESTINATION) [A-P, 0-31 B Do you want an exact Image of the source disk? [YINI Y Mount disk to format on drive B: and press when ready to start : Formatting Single-sided disk in drive B: at Double-density. Format complete. Checking disk on drive B: Checking complete. 17: 18: 19: 20: 21: 22: 23: 24: 25: Mount source disk on drive A: Mount destination disk on driveB: Press when ready : Copying from drive A: to drive B: at Double Density. Data and System tracks copied. »> DISK OK «< Do you want to do another disk? [YINI N Figure 4.13 MENU Display for Copying a Diskette (option CD) The CLONE utility is then used to make an image copy of the source diskette to the destination diskette (Lines 4.13-18 to 4.13-22). See Section 8.7 for a description of CLONE and its error messages. On Line 4.13-25, MENU indicates that the copy was successful and gives you the chance to make another. If you respond affirmatively, the CD option will start over again while a negative response will return you to the initial selection menu. If you do not select a image copy, you will be given the option of formatting the destination disk and will be given a selection of the types of files to be copied. In this case the format is performed only if you request it and the copy is performed by either FASTCOPY (see Section 8.16) or PIP (see Section 8.22) depending on whether you elect to transfer all or some of the files on the source disk. P&:T CP/M 2 User's Manual 4.9 THE SYSTEM MENU page 4.13 CE Option code: CE Purpose: To perform a non-destructive check on a diskette for bad areas. Programs used: DISKCHK This option allows you to perform a non-destructive check for bad spots on a diskette. Performing such a check periodically will help you to detect any degradation of a diskette while. there is still time to make a backup before data is lost. Figure 4.14 shows the console display for performing such a check. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: Check a Disk for Errors NOTE: Information on the disk will NOT be affected Press to quit Drive to be Checked [A-P, 0-31 B Mount disk to check on drive B: and press when ready to start : Checking Double-density disk In drive B: Checking complete. 15: 16: »> DISK OK «< Do you want to do another disk? [YINI N Figure 4.14 MENU Display for Checking (Non-Destructive) a Disk (option CE) On Line 4.14~, MENU asks you to specify the drive on which the check is to take place. After receiving this information from you, MENU loads and executes the DISKCHK (see Section 8.11 for information about DISKCHK and its error messages) utility program (Lines 4.14-10 to 4.14-13) to perform the check. Finally, MENU reports the results of the check and gives you the option of checking another one (Line 4.14-16). An affirmative response will cause the CE option to start over while a negative response will return you to the selection menu. page 4.14 CH 4.10 THE SYSTEM MENU P&T CP/M 2 User's Manual Option code: CH Purpose: To clean the read/write heads of a floppy drive with a cleaning diskette. Programs used: CLEAN This option loads and executes the CLEAN utility program. This program allows you to load the heads on a specified disk drive and move them around for about 20 seconds. CLEAN is designed to be used with a head cleaning diskette for periodic cleaning of floppy drive read/write heads. See Section 8.6 for further information on using CLEAN. After CLEAN is finished, MENU will retum to the selection menu. P&T CP/M 2 User's Manual 4.11 THE SYSTEM MENU page 4.15 CP CP To change system parameters related to the console display. Programs used: MENUOLY1 Option code: Purpose: After selecting this option MENU will show you a display like that shown in Figure 4.15. You may change any of the listed parameters by entering the number of the parameter. After you enter a number, you will be presented with a variety of choices for that parameter. You may change as many parameters as you wish. Press when you are finished making changes and wish to return to the selection menu. 1: 2: 3: 4: 5: 6: 7: 8: 9: CRT Parameters Press to quit 1. Line wrap = 2. First line of cursor 3. Cursor blink = enabled =9 slow 10: 11: 12: Enter number of Item to change: Figure 4.15 MENU Display for Changing CRT Parameters (option CP) Note that these parameters can also be changed by the SETMISC utility program. See Section 8.25 for further information. 01 page 4.16 CS 4.12 THE SYSTEM MENU P&T CP/M 2 User's Manual Option code: CS Purpose: To set the CCB board's date and time if one is installed in the computer. Programs used: SETCCB This option allows you to set the date and time of a Pickles & Trout CCB board if one is installed in the system. It loads and executes the SETCCB utility program. See Section 8.23 for information on using SETCCB and the error messages it might display. Note that, since the CCB includes a backup battery, you need set it only occasionally to correct any long term errors that might accumulate (just like a watch). THE SYSTEM MENU P&T CP/M 2 User's Manual 4.13 page 4.17 DM Option code: DM Purpose: To disable options from a selection menu. Programs used: none One of the convenient features of MENU is the ability to disable options on a selection menu. Since some of the options are very rarely used you may wish to configure the system and then disable them. This will result in less cluttered selection menus and reduce the possibility of selecting a wrong option. Disabling selection menu options is also useful when setting up a disk for a nontechnical user. After configuring the system, you may disable all options that could allow the neophyte user to make the system un-usable. For example, you might disable the SP option so that the serial port configuration cannot be changed. When you select the DM option from any selection menu, the menu will be displayed as shown in Figure 4.16. As you enter the two character option codes, the options will be removed from the menu and the menu will be redisplayed. Disable Menu Functions Type This NO GS GO CD CF CE TE CH EX To Disable This Menu Function Prepare a new disk for use (FORMAT) Generate a System disk (SYSGEN) Generate a Data (non-system) disk Copy a disk Copy files Check a disk for errors (does not affect Information on the disk) Test a disk for bad areas (destroys any Information on the disk) Clean disk drive heads Exit to CP/M Selection? Press to quit Figure 4.16 MENU Display for Disabling Menu Functions (option OM) Important notes about the DM option are: L Once options are disabled there is no way to bring them back. a fresh copy of MENU.COM to reinstate disabled options. 2. Selecting the DM option disables the DM option itself from a selection menu. This means that you must disable all the options you· want disabled from a selection menu at one time. 3. You should NEVER attempt to use the DM option on your master disk. 4. If an undesired option appears in multiple selection menus, you must disable it everywhere that it appears to eliminate access to it. You must get III page 4.18 THE SYSTEM MENU P&T CP/M 2 User's Manual DP 4.14 Option code: DP Purpose: To set the floppy drive step rates and the number of floppy drives on a floppy only system. Programs used: none In order to optimize system performance, P&T CP/M 2 allows you to specify the head step rate individually for each floppy drive on the system. This option allows you to perform this operation. For floppy only systems, it also allows you to specify the number of floppy drives on the system. The thinline disk drives used in the Models 12 and 16 are capable of a 3 msec step rate while the full width drives used in the Model IT cannot move the head that fast. The full width drive should all work at a 10 msec step rate but many of them will also run reliably at 6 msec. You will have to try different values to find out what works with your hardware. To allow such experimentation, this option allows you to make changes either to the running system (in memory) or permanently in the BIOSPARM.PNT file (which will take effect after the next RESET). If you are trying different values, you should change only the current system until you are satisfied that you have a set of parameters that work properly. Making a permanent change with untested stepping rates can result in a non-functional system disk. Figure 4.17 shows the console display for setting the floppy parameters. You may use the arrow keys to move the cursor to the parameter you want to change. Note that the cursor can be positioned only in the two "step rate" columns and on the number of drives for the new system (after RESET). You cannot change the number of drives in a running system. , Floppy Disk Parameters Press to quit Current System New System (after RESET> Number of Floppy Drives: 2 Number of Floppy Drives: 2 Drive Name Step Rate Drive Name Step Rate A B 3 3 A 3 3 Arrows move cursor Figure 4.17 sma I ler: comma - B larger: period = MENU Display for Changing Floppy Drive Parameters (option DP) When the cursor is positioned at a parameter you want to change, you may press , P&T CP/M 2 THE SYSTEM MENU page 4.19 User's Manual DP period, or = to make the parameter larger. The step rates can assume the values 3, 6, 10, and 15 while up to 4 floppy drives can be specified for the new system. When you have finished the changes, press to return to the selection menu. Any changes you have made in the "new system" column will be recorded in the BIOSPARM.PNT file so that they will be in effect the next time the system is loaded (RESET). Note: If you increase the number of drives, you must reload the system (RESET) before you can change the step rate of the additional drives. III page 4.20 DT 4.15 THE SYSTEM MENU P&T CP/M 2 User's Manual Option code: DT Purpose: To display the system date and time. Programs used: DATIME This option allows you to display the current system date and time on the console. The form of the display is described in Section 8.8 which discusses the DATIME utili ty program. P&T CP/M 2 User's Manual 4.16 THE SYSTEM MENU page 4.21 EX Option code: EX Purpose: To exit from the MENU program to the command level ofP&T CP/M 2. Programs used: none Selecting this option will return you directly to the command level of P&T CP/M 2The EX option is the only way to exit MENU so that you can perform other system operations. You should not disable the EX option in all the selection menus; doing so will make it impossible to exit MENU once it is executed. II page 4.22 THE SYSTEM MENU FR 4.17 P&T CP/M 2 User's Manual Option code: FR Purpose: To make the current 1/0 parameters permanent so that they will be in effect when the system is reloaded (RESET). Programs used: none When you are first configuring the system or adding a new piece of equipment, you may make several changes to the system I/O configuration without making them permanent. After you have arrived at the configuration you want, you may make it permanent by selecting this option. The console display for this option is shown in Figure 4.18. On Lines 4.18-5 to 4.18-11 it tells you which parameters have been made permanent. It then gives you the option (Line 4.18-13) of saving any strings programmed into the programmable function keys (if AUTOKEY has been included in the system). It also gives you the option (Line 4.18-16) of saving the key translation table if the KEYXLATE module has been included in the system. After pressing on Line 4.18-19, MENU will return to the selection menu. 1: 2: FREEZE Save Current System Parameters 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: The fol lowing system parameters have been permanently saved: * Serial Port parameters (baud rates, parity, etc) * Parallel printer port parameters (line feed suppression, page length, etc) * Disk step rates * CRT parameters (line wrap, cursor size and blink rate) * Logical device assignments (CON:, LST:, etc) * CCB port address Do you want to also permanently save the Auto Key strings? (Y/N) Y Done Do you want to also permanently save the Key Translation table? (Y/N) Y Done Press when ready Figure 4.18 MENU Display for Freezing the I/O Configuration (option FR) THE SYSTEM MENU P&T CP/M 2 User's Manual 4.18 page 4.23 OD Option code: GD Purpose: To create a new data diskette and copy files to it. Programs used: FORMAT, FASTCOPY, PIP This option allows you to create a new data diskette (ie. no system on the diskette) and copy files to it. Figure 4.19 shows the console display for using this option. It first asks you whether you intend to copy files to the new diskette (Line 4.19-5). If you indicate that you do not wish to copy files to the diskette, it will inform you that you should be using the ND option and will give you a chance to go directly to ND. Assuming that you want to copy files to the diskette, MENU will then ask you to specify the source and destination drives (Lines 4.19-8 and 4.19-9). The destination drive is the drive on which the new data diskette will be created. MENU then asks --if you want to format the diskette before transferring files to it (Line 4.19-10). If you answer affirmatively, as shown, MENU will then ask for the density at which the new diskette is to be formatted (Line 4.19-11). Generate a Data Disk 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: Press to quit Do you want to copy files to the new disk? [YIN) Y Copy from disk (SOURCE) [A-P, 0-3) A Copy to disk (DESTINATION) [A-P, 0-3) B Initialize (format) the DESTINATION disk [YIN) Y Density [1 for single, 2 for double) 2 Do you want to copy A. All .COM files B. All files Selection? (AlB) A 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: Mount disk to format on drive B: and press when ready to start : Formatting Single-sided disk In drive B: at Double-density. Format complete. Checking disk on drive B: Checkl ng comp lete. COPYING VERIFY.COM 31: 32: 33: >>> DISK OK <<< Figure 4.19 Do you want to do another disk? [YIN) N MENU Display for Generating a Data Diskette (option GD) MENU then gives you two choices for which files to copy. After entering your selection (Line 4.19-17) MENU begins the generation process. First it loads the FORMAT utility (if requested) to format and check the new diskette (Lines 4.19-20 to 4.19-24). See Section 8.17 for information on the FORMAT utility and the error messages it might report. 01 page 4.24 GD THE SYSTEM MENU P&T CP/M 2 User's Manual MENU then uses either PIP or FASTCOPY to copy the specified files from the source disk to the destination diskette. If you selected option A (Line 4.19-14) MENU will use PIP to copy all ".COM" files from the current user. If you selected option B (Line 4.19-15) FASTCOPY will be used to copy all files from all user numbers. See Section 8.22 for further information on PIP and Section 8.16 for further information on FASTCOPY. In either case the names of the files transferred will be displayed on the console as they are copied. Finally MENU reports whether or not all went well and gives you the option of generating another data diskette (Line 4.19-33). An affirmative response will cause the GD option to be restarted while a negative response will return you to the selection menu. THE SYSTEM MENU P&T CP/M 2 page 4.25 User's Manual 4.19 Option code: Purpose: OS GS To generate a new working system diskette. Programs used: FORMAT, FASTCOPY, CLONE, PIP This option allows you to create a new working system diskette and copy files to it. Figure 4.20 shows the console display for using this option. It first asks you to specify the source and destination drives (Lines 4.20-5 and 4.20-6). The source drive is the drive on which a working system diskette is (or will be) mounted and the destination drive is the drive on which the new system diskette will be created. MENU then asks if you want to format the diskette before transferring the system and files to it (Line 4.20-7). Note: The new diskette must be double density. If it is not, you must format it or switch to one which is already formatted double density. Generate a System Disk 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: Press to quit Copy from disk (SOURCE) [A-P, 0-3) A Copy to disk (DESTINATION) [A-P, 0-3) B Initialize (format) the DESTINATION disk [YIN) Y Do A. B. C. you want to copy Only System (.PNT) files System (.PNT) and al I .COM files All files Selection? [AlBIC) C Mount disk to format on drive B: and press when ready to start : Formatting Single-sided disk In drive B: at Double-density. Format complete. Checking disk on drive B: Checking complete. Mount source disk on drive A: Mount destination disk on drive B: Press when ready : Copying from drive A: to drive B: at Double Density. System tracks copied. Mount source disk on drive A: Mount destination disk on drive B: Press when ready : Copying from drive A: to drlv~ Reading BIOSPARM.PNT R/W, DIR, user= 0 »> DISK OK «< Do you want to do another disk? [YIN) N Figure 4.20 MENU Display for Generating a System Diskette (option GS) MENU then gives you three choices for which files to copy. In this instance, "system files" refer to the disk files that must be present on the diskette in order II page 4.26 GS THE SYSTEM MENU P&T CP/M 2 User's Manual for the system to be loaded. All of these files have the file type "PNT". After entering your selection (Line 4.20-14) MENU begins the generation process. First it loads the FORMAT utility (if requested) to format and check the new diskette (Lines 4.20-17 to 4.20-21). See Section 8.17 for information on the FORMAT utility and the error messages it might report. Menu next uses CLONE to copy the system tracks from the source drive to the new diskette (Lines 4.20-24 to 4.20-28). See Section 8.7 for information on the CLONE utility program and the error messages it might produce. MENU then uses either PIP or FASTCOPY to copy the specified files from the source disk to the destination diskette. If you selected options A or B (Lines 4.20-10 and 4.20-11) MENU will use PIP to copy files from the current user (usually user 0). If you selected option C (Line 4.20-12) FASTCOPY will be used to copy all files from all user numbers. In either case the names of the files transferred will be displayed on the console as they are copied. See Section 8.22 for further information on PIP and Section 8.16 for further information on FASTCOPY. Finally MENU reports whether or not all went well and gives you the option of generating another system diskette (Line 4.20-40). An affirmative response will cause the as option to be restarted while a negative response will return you to the selection menu. P&T CP/M 2 User's Manual THE SYSTEM MENU HZ Option code: Purpose: 4.20 page 4.27 HZ To set up the console display for different power line frequencies. Programs used: none The console display is normally set up to be used with a 60 hertz power line frequency. If you have 50 hertz power, use this option to configure the display for it. Figure 4.21 shows the console display when this option is selected. On Line 4.21-11 you should enter either 50 or 60 depending on your power line frequency. The change will take effect immediately on the console display and the BIOSPARM.PNT file will be updated so that the display is initialized properly when the system is loaded (RESET). Note: You do not need to use this option if you have 60 hertz power since the system defaults to it. 1 2 3 4 5 6 7 8 9 10 11 Set up system for 50 or 60 Hz line frequency ***** Type This 50 60 To Perform This Function Set up system for 50 Hz I ine frequency Set up system for 60 Hz I ine frequency Selection? 50 12 13 14 Press to quit 15 Figure 4.21 MENU Display for Configuring Power Line Frequency (option HZ) III page 4.28 KT 4.21 THE SYSTEM MENU P&T CP/M 2 User's Manual Option code: KT Purpose: To save the key translations currently defined for the KEYXLATE module. Programs used: none If you elect to include the KEYXLATE module with the system when it is loaded, you will be able to translate 16 key· codes generated by the keyboard into 16 other codes. These translations may be set by the utility program KXEDIT (see Section 8.18) or by a program (see Section 7.3). Normally, the translations are lost if the system is reloaded (RESET). This option allows you to save the current translations in the BIOSPARM.PNT file so that they still will be in effect the next time the system is reloaded (RESET). Figure 4.22 shows the console display as the translations are being saved. After you press MENU will return to the selection menu. 1 2 Save Key Translation Table 3 4 5 6 Done Press when ready Figure 4.22 MENU Display for Saving Key Translation Table (option KT) P&T CP/M 2 User's Manual 4.22 THE SYSTEM MENU page 4.29 LA Option code: LA Purpose: To set the last address in memory that may be used by P&TCPIM2. Programs used: none In some cases it is desirable to reserve some memory above the operating system for special usage. This memory may be used for loading special programs or as a communication area between programs. The system functions as if this memory did not exist, hence it is completely free for other uses. This option allows you to specify the last address in memory that may be used by the system. After using this option and reloading (RESETting) the system, you are guaranteed that the system will use no memory addresses above the one you specified Figure 4.23 shows the console display while using this option. It first gives a little explanation about what it does (Lines 4.23-5 to 4.23-7). It then reports the current last address available to P&T CP/M 2 (Line 4.23-9). Next it asks you if the value just displayed is correct (Line 4.23-11). If you respond negatively, it then asks you for the last address that you want CP/M to use (Line 4.23-12). 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: Set last memory address that CP/M may use ***** You may reserve some space In memory above CP/M. This is done by setting the last memory address that CP/M may use. If you do not want to reserve any space above CP/M, enter the value FFFF. The last memory address that CP/M may now use is FFFF Is this correct? [YIN) N What Is the last address that CP/M may use? (In hex) IBFFF •• FFFFI FEFF 13: 14: 15: 16: Press to quit Figure 4.23 MENU Display for Setting Last Address Used by CP/M (option LA) Note that you should enter the last address that you want PH CP/M 2 to use, not the first address that you want free. In this example, memory from FFOO to FFFF is reserved above the system. Note that the address entered is FEFF, the last address available to the system. After you enter the last address to be used, MENU redisplays lines 4.23-5 to 4.23-11, reporting the new last address. You may change the last address as many times as you wish. When you respond with an affirmative answer to the question on Line 4.23-11, the new last address value will be written to the BIOSPARM.PNT file and will be effective the next time the system is loaded (RESET). If you press in response to the question, any changes that you have made to the last address will be ignored and MENU will return to the selection menu. II page 4.30 MT 4.23 THE SYSTEM MENU P&T CP/M 2 User's Manual Option code: MT Purpose: To test the computer's memory and report any bad memory cells. Programs used: none This option tests all banks of memory (including the console display memory) that are installed in the computer. Half banks such as are found in the Model 12 and with the Radio Shack hard disk are detected and properly reported. The console display for the test is shown in Figure 4.24. In this case the test was run on a computer that has a Radio Shack hard disk installed which provides a half bank (16 Kbytes) of memory accessible as banks E and F. If memory errors are detected, the half bank in which the error was found is reported as well as the bits which are in error. This information may help in describing the problem to your Radio Shack service center. Memory Test Press to quit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 Bank Comments CRT OK MAIN OK 2 Not Installed 3 Not Installed 4 Not Installed 5 Not Installed 6 Not Installed 7 Not Installed 8 Not Installed 9 Not I nsta I led A Not I nsta lied B Not Installed C Not Installed D Not I nsta I led E COOO-FFFF Not Instal led F COOO-FFFF Not Instal led Figure 4.24 MENU Display for Memory Test (option MT) Pattern = 02FD THE SYSTEM MENU P&T CP/M 2 User's Manual 4.24 page 4.31 ND Option code: ND Purpose: To initialize (format) a new diskette for use. Programs used: FORMAT This option formats a diskette so that it can be used on the system. It allows you to format the diskette at either single or double density. Figure 4.25 shows the console display for this option. On Line 4.25-7 it asks you for the drive on which the format operation is to take place. On Line 4.25-8 it asks you for the density at which the diskette is to be formatted After gathering this information, MENU loads and executes the FORMAT utility program to format and check the diskette (Lines 4.25-10 to 4.25-15). See Section 8.17 for further information on FORMAT and the error messages it might display. After the format operation is complete, MENU tells you that the diskette is initialized and gives you a chance to format another one (Line 4.25-18). An affirmative response will cause the ND option to be started over while a negative response will return you to the selection menu. 1: 2: 3: 4: 5: FORMAT Prepare a disk for use NOTE: Any Information on the disk will be DESTROYED!!! Press to quit 6: 7: 8: Drive to be formatted (Initialized) [A-P, 0-3) B Density [1 for single, 2 for double) 2 9: 10: 11 Mount disk to format on drive B: and press when ready to start 12 13 14 Formatting Single-sided disk In drive B: at Double-density. Format complete. Checking disk on drive 8: Checking complete. 15 16 17 18 Disk Initialized Do you want to do another disk? [YIN) N Figure 4.25 MENU Display for Formatting a New Diskette (option NO) :~ III THE SYSTEM MENU page 4.32 PP 4.25 P&T CP/M 2 User's Manual Option code: PP Purpose: To set the parallel printer port parameters. Programs used: ME NUOLYI After selecting this option MENU will show you a display like that shown in Figure 4.26. You may change any of the listed parameters by entering the number of the parameter. After you enter a number, you will be presented with a variety of choices for that parameter. You may change as many parameters as you wish. Press when you are finished making changes and wish to return to the selection menu. , 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: Paral lei Port Parameters Press to quit 1. 2. 3. 4. 5. Centronics Options Suppress extra line feeds: disabled Emulate form feed: disabled Do auto form feed: disabled Paper length (In lines): 66 Number of lines before auto form feed: 60 12: 13: 14: 15: 16: Enter number of Item to change: Figure 4.26 MENU Display for Changing Paral lei Port Parameters (option PP) The functions available for the parallel printer port are discussed in Chapter 13. They may also be changed by the SETMISC utility program (see Section 8.25). P&T CP/M 2 User's Manual 4.26 THE SYSTEM MENU page 4.33 SD Option code: SD Purpose: To set the system date. Programs used: SETDATE This option allows you to set the system date. If you do not have a P&T CCB board installed in your computer, you must set the system date if you have programs that use it. This option loads and executes the SETDATE utility program. See Section 8.24 for details on using SETDATE. III page 4.34 SM 4.27 THE SYSTEM MENU P&T CP/M 2 User's Manual 8M To select the modules that are to be loaded with the system. Programs used: MODSEL Option code: Purpose: This option allows you to select the modules that are to be included in the system when it is loaded. You may use this option to include or remove utility modules such as AUTOKEY and KEYXLATE or to change I/O drive modules. It loads and executes the MOnSEL utility program. See Section 6.3 for details on using MOnSEL. Note: Any changes you make with MOnSEL will not take effect until the next time the system is loaded (RESET). P&T CP/M 2 User's Manual 4.28 THE SYSTEM MENU page 4.35 SP Option code: SP Purpose: To change the serial port configuration. Programs used: SETUP This option allows you to configure the serial ports for your particular use. The features of the serial port driver are discussed in Chapter 12. This option loads and executes the SETUP utility program. See Section 8.27 for details on using SETUP. • page 4.36 ST 4.29 THE SYSTEM MENU P&T CP/M 2 User's Manual Option code: ST Purpose: To set the system time. Programs used: SETTIME This option allows you to set the system time. If you do not have a P&T CCB board installed in. your computer, you must set the system time if you have programs that use it. This option loads and executes the SETTIME utility program. See Section 8.26 for details on using SETTIME. P&T CP/M 2 THE SYSTEM MENU User's Manual 4.30 page 4..37 SY Option code: SY Purpose: To synchronize the system date and time to a P&T CCB board. Programs used: none Since the time of day clock in the system loses about 5 seconds an hour, it may be desirable to resynchronize it to a P&T CCB board (if one is installed) periodically. This menu option performs this function. It also sets the system date according to .the CCB board. This can be useful when running programs that change the system time or date. Figure 4..27 shows the console display as the synchronization takes place. After you press at the end of the process, MENU will return to the selection menu. 1 2 3 Synchronize system date and time with CCB 4 5 6 7 Synchronizing Done Press when ready Figure 4.27 MENU Display for Synchronizing Date & Time to a CCB (option SY) THE SYSTEM MENU page 4.38 TE 4.31 P&T CP/M 2 User's Manual Option code: TE Purpose: To test a diskette for bad areas (destroys data on the diskette). Programs used: DISKTEST This option tests a diskette by writing several data patterns on it and checking that they can be read back correctly. This test, by its nature, destroys any data already recorded on the diskette, so it should be used only on diskettes that contain no useful information. Figure 4.28 shows the console display for this option. On Line 4.28-6, MENU asks for the drive on which the test is to be conducted. It then loads and executes the DISKTEST utility program to perform the test (Lines 4.28-11 to 4.28-16). After the test is complete, MENU gives you a chance to test another diskette (Line 4.28-19). An affirmative response at this point will cause the TE option to be restarted while a negative response will return you to the selection menu. 1 2 Test a Disk for Bad Areas NOTE: Any information on the disk wil I be DESTROYEDl!! 3 Press to quit 4 5 6 Drive to be Tested [A-P, 0-3) B 7 8 9 10 11 13 14 15 16 17 18 Mount disk to test on drive Testing Double-density disk Beginning pass with Beginning pass with Beginning pass with Testing complete. B: and press when ready to start in drive B: pattern = 00 pattern = FF pattern = DBB6 19 20 >>> DISK OK «< Do you want to do another disk? [YIN) N Figure 4.28 MENU Display for Testing (destructive) a Disk (option TE) OVERVIEW OF CP 1M P&T CP/M 2 User's Manual page 5.1 Memory Usage 5.1 Memory Usage P&T CP/M 2 divides memory into four parts, each having a specific purpose. These four parts are illustrated in Figure 5.1 and are described as follows: The System Parameter Area (SPA) occupies the region of memory from location OOOOh through OFFh. In this area are various system entry points, buffers, and other information. In general, programs are not allowed to make use of the memory in the System Parameter Area other than to access the buffers and pointers that are kept there. This region of memory is sometimes called the Base Page. The Transient Program Area (TPA) begins at location 100h in memory and extends upward. The upper limit of the TPA varies with the total amount of memory allotted to CP/M. This is the region of memory in which most programs run. The Console Command Processor (CCP) begins at the end of the TPA and extends upward in memory for SOOh bytes (2K bytes). This section of memory is occupied by the program which interacts with the user when the system is at the command level. It is responsible for carrying out certain operations, such as loading and executing a program, in response to input from the user. The final region of memory is referred to as FDOS. It consists of the Basic Disk Operating System (BDOS) and the Basic Input Output Subsystem (BIOS). The BDOS is the part of the system which maintains the diskette data structure and supervises input/output operations. BIOS is responsible for the customization of CP/M to a specific set of hardware. P&T CP/M 2 integrates a custom BIOS and special utility programs with the standard CP/M 2 operating system. top of memory al located to P&T CP/M 2 FDOS (BDOS & BIOS) beginning of FOOS (FBASE) - 1----------1 CCP beginning of CCP (CBASE) - 1--------=----1 TPA beginning of TPA (TBASE) lOOh - beginning of memory (Oh) _ Figure 5.1 system parameter area L..-.._------I Memory Map of P&T CP/M 2 For additional information on memory usage by CP/M 2 see pp 89, 90, 144 of CP/M Operating System Manual. page 5.2 Disk Storage OVERVIEW OF CP/M P&T CP/M 2 User's Manual 5.2 Disk Storage Mass storage of information on most CP/M systems is accomplished by use of magnetic disks. These storage units may be flexible diskette drives (called floppy diskette drives), or they may be hard disk units. The basic concepts of disk storage are the same for all types of disk~ A magnetic disk consists of a thin disc of some sort of base material coated with a compound that can be easily magnetized. The base material can be plastic, as with floppy diskettes, or metal, as with hard disks. The coating resembles the type found on audio magnetic tape. Information is stored in the form of minute magnetized areas in the coating of the disk. In order to provide rapid access to the stored information, the coated disk is spun and a magnetic recording head is moved back and forth over its surface. The head can be stopped at various locations for reading and writing information. While the head is in a given location, it reads and/or writes along a circular path on the disk surface, called a track. The tracks on a disk can be pictured as a series of concentric circular recordings on the disk's surface. Since the recording head can be moved from track to track quite rapidly, all of the information recorded on the disk can be accessed in a short period of time. Since a large amount of information can be stored on one track, it may be inconvenient to deal with it all at one time. For this reason, a track is divided into smaller portions, called sectors, in one of several possible ways. Some disk drives have internal mechanisms for creating the divisions, while others require instructions from the computer. The floppy diskette drives used with the TRS-80 Model n/12/16 do not force a sector structure on the diskette. Through an operation called "formatting the diskette", the computer determines the sector size to. be used and writes an entire set of sectors to each track on the disk. For all subsequent operations on the diskette, the sector size determined by the formatting process will be used. The diskette can be erased and re-formatted with a different sector size if desired. The track recorded on a disk is often called a physical track, since it is determined by the physical attributes of the disk drive and what is recorded on the disk. Similarly, the sectors on a track are referred to as physical sectors. In other words, physical tracks and sectors are the actual patterns of recording on the disk and the term physical drive refers to the actual disk drive. In order to treat all disk storage in a uniform way, CP/M operates in terms of logical drives. In contrast to physical drives, logical drives are what CP1M considers as one storage unit. A logical drive may be identical to a physical drive (this is usually the case for floppy diskette drives), or it might encompass only a portion of a disk drive (this often occurs on hard disk drives). In CP/M, the logical drives are named with letters of the alphabet starting with "A" and continuing through "P" for a total of 16 logical drives. Up to 8 Mbytes (8,388,608 bytes) can be stored on each logical drive. The correlation between logical and physical drives is set when the CP1M system is adapted to a particular type of hardware. For the TRS-80 Model n/12/16 with floppy disks only, the built-in floppy drive is assigned to logical drive A, while the expansion drives (if any) are assigned to logical drives B, C, and D. (With hard disk versions of P&T CP1M 2 these assignments are under your controL) Under TRSDOS, the floppy drives are referred to as drives 0, 1, 2, and 3. The correspondence OVERVIEW OF CP/M P&T CP/M 2 User's Manual page 5.3 Disk Storage between the TRSDOS drive numbers and the CP/M logical drive assignments is shown in Figure 5.2. TRSDOS Drive Number o P&T CP/M 2 Drive Letter A 1 B 2 C 3 D Figure 5.2 TRSDOS to CP/M Logical Drive Correspondence Once again for the sake of uniformity, CP/M reads and writes to a disk in standard chunks of information called logical sectors (sometimes referred to as logical records). The basic element of information used by CP/M is the byte (8 bits). 128 bytes are grouped together to form a logical sector, which is the smallest amount of data that can be input from or output to a disk. Since access to a disk must be in multiples of these sectors, a diskette is sometimes referred to as a record or block oriented device. Whenever CP/M reads or writes to disk storage, it ALWAYS treats 128 bytes of information as one logical sector. If the size of the physical sector on the actual disk drive is not 128 bytes, the BIOS disk I/O routines of CP/M make the necessary correlation between logical and physical sectors. For example, a P&T CP/M 2 double density disk stores 512 bytes in each physical sector, so BIOS assigns four logical sectors to each physical sector. In general, a physical sector on a disk may accommodate one or several logical sectors. The sum total of the logical sectors allowed on a given track is, quite naturally, called a logical track. The size of a logical track is not rigidly fixed by CP/M. When CP/M is customized to a certain set of hardware, the logical track size for each disk drive on the system may be fixed at a convenient value. Usually the logical track is chosen to correspond to the physical track on the disk drive. The logical drive, logical track, and logical sector numbers can be thought of as forming a unique address for each logical sector of disk storage available in the computer system. P&T CP/M 2 divides logical drives into three regions, each of which has a distinct usage. A number of tracks at the beginning of a disk may be reserved for system usage and are typically called the system tracks or the reserved tracks. The first two tracks (0,1) of a diskette are reserved for the operating system. These tracks are often referred to as the system area of the diskette. They contain the program which is the operating system and various other parameters. Under normal circumstances you should never need or attempt direct access to these tracks. The second region of a disk is where the directory is maintained. The directory is used to store information about the files on the disk. This area takes up part of track 2 of the diskette, and its size depends on the number of directory entries allowed in the system. The third region starts immediately after the end of the directory and continues to the end of the disk. This area is where file data is actually stored. Often, the directory and data regions are lumped together and referred to as the data area. Figure 5.3 gives a schematic representation of the regions into which a floppy diskette is divided page 5.4 Disk Storage OVERVIEW OF CP/M track /I 0 2 3 P&T CP/M 2 User's Manual • 76* I I I I I L I I data tracks directory and data ---- system tracks * Figure 5.3 153 for double sided Floppy Disk Track Assignments 5.3 Files and Disk Storage Information is stored on the diskettes in logical entities called files. A file is a collection of data that has been grouped together because of some common tie between the data elements. For example, the characters which make up this manual are grouped together in a file which was generated by a text editor and subsequently manipulated by a text processing program. Another example of a file could be the collection of characters which makes up the text of a computer program. Yet another example of a file is the collection of bytes of data which make up the binary image of a program that can be loaded into the computer's memory and executed. A text file consists of a group of coded representations of numeric, alphabetic, and special characters. The most common character code in use today, and the one used by P&T CP/M 2, is the American Standard Code for Information Interchange (ASCII). The numerical codes for the characters defined by ASCII are given in Appendix A. In ASCII files, only 7 bits out of each byte carry the encoding of the character. The eighth bit is sometimes used for error detection but is frequently merely ignored. Since the characters in a text file are represented by ASCII, text files are often referred to as ASCII files. A binary file contains information which utilizes all eight bits of each byte and does not usually represent character data. The information may be actual machine instructions of a program or the binary representation of numerical data. With binary files all of the bits of each byte are significant. Each file on a P&T CP/M 2 diskette is given a unique name for purposes of referring to the file. CP/M takes care of all the details of finding room on the diskette and allocating that room to the file. This allows programs to refer to files by name alone. Typically, a program will have no information about the actual location of the file's information on the diskette, yet it still is able to access any part of the file via CP/M. A file name consists of up to 11 characters divided into a 1 to 8 character primary name and a 0 to 3 character secondary name (sometimes called an extension or type). A file name is written with the primary and secondary names separated by a period (.) as shown in Figure 5.4. In Figure 5.4, "p" stands for a character of the primary file name and "s" stands for a character of the secondary file name. P&T CP/M 2 User's Manual OVERVIEW OF CP/M ( Figure 5.4 page 5.5 Files and Disk Storage pppppppp.sss ) Example of a P&T CP/M 2 File Name The primary and secondary names may be made up of any combination of characters, with the exception of the special characters shown in Figure 5.5. ( < > • , ; : =1 * ( ) space) Figure 5.5 Characters not Allowed In a FI Ie Name The secondary name frequently denotes the type of information contained in the file. Many programs which are designed to operate on a specific type of information will reguire a specific secondary name as an indication that the information in the file is of the proper type. Consequently the secondary name is also referred to as the "file type". Some common file types are given in Figure 5.S. extension ASM BAS COM HEX LIB OVL PAS PRN REL SRC SUB TXT common usage assembly language source code file Basic language source code fl Ie executable object code fl Ie object code file In hex format - usually output from an assembler library of macros or re-Iocatable modules object code that Is used as an overlay Pascal language source code fl Ie listing fl Ie from assemblers and compilers relocatable object code file - usually output from an assembler or compiler source code file - used by several languages fl Ie containing commands to use with SUBMIT text file Figure 5.6 Common FI Ie Types If all the characters of the primary and secondary names of a file are given in referring to it, the reference is said to be unique, since only one file on a disk can be indicated by the name. Several examples of unique file names are given in Figure 5.7. I ~ X X.l Xl.BAS Figure 5.7 CONVERT.PAS CONVERT.COM SAMPLE.TXT 1984TAX TAX.OAT MANUALP 1• TXT . .1 ~ Examples of Unique FI Ie Names In the remainder of this manual, the abbreviation "unqfn" will represent a unique file name. When "unqfn" appears in an example or reference, it means that some unique file name is to be inserted in its place. (Note that the CP/M Operating System Manual and some other documents refer to a unique file name as an unambiguous tile name and abbreviate it as "ufn".) It is often desirable to refer to a number of files at one time and P&T CP/M 2 provides this capability by allowing wildcard file names under certain circumstances. Two special characters are used to construct wildcard file names, "?" and ''*''. "?" will match anyone character (including the absence of a character) in a file name. As an example, suppose a program has created a series of work files named WORK1.DAT, WORK2.DAT, WORK3.DAT, WORK4.DAT, and WORK5.DAT. Having run the page 5.6 Files and Disk Storage OVERVIEW OF CP/M P&T CP/M 2 User's Manual program, the user now wishes to erase all the work files. Instead of naming indi vidual files in the erase command, the user could specify the wildcard filename WORK?DAT, which would match all the workfiles mentioned above. (Note that a file with the name WORK.DAT will also be matched, which may cause a problem if you don't want it erased.) WORK?DAT will not match WORK10.DAT because only one "?" was used in the wildcard file name, leaving one character of the file name (the 0) unmatched in the wildcard file name. "*" will match any number of characters in a file name. If "*" is used as the primary part of a wildcard file name, it will match all possible primary names from o to 8 characters. If "*" is used as the secondary part of a wildcard file name, it will match all possible secondary names from 0 to 3 characters. For example, *.ASM will match all files with the secondary name ASM. Likewise, TESTPROG.* will match all files with the primary name TESTPROG and *.* will match all files on a disk. "*" may be used in conjunction with other characters to specify wildcard file names. For example, if a program created work files with the names WORK1.DAT, WORK5.DAT, WORK10.DAT, WORK15.DAT, and WORK100.DAT they could all be referred to by the wildcard file name WORK*.DAT. The ''*'' will match any 4 characters following WORK in the primary file name (in this case 1, 5, 10, 15, 100). If a ''*'' is used with other characters as just illustrated, it must appear as the last character in the primary or secondary name. Note: an embedded "*" in the primary or secondary part of a file name is not allowed. If you use an embedded "*", all of the remaining characters of the primary or secondary name will be ignored. As an example, if you give the command ERA *WORK.DAT, all files with a secondary name of "DAT" will be erased. The characters "WORK" will be ignored. SPECIAL WARNING: Figure 5.8 gives several examples of wildcard file names. *.ASM MANUAL.Vl? Figure 5.8 WORK*.* SAMPLE 1. TXT TIME.* *.* Examples of Wild Card File Names In the remainder of this manual, a wildcard file name will be abbreviated as "wcfn". When this abbreviation appears in an example, it should be replaced by an actual wildcard file name. Note that a unique file name is a subset of wildcard files names; hence a unqfn can be used wherever a wcfn is indicated. (Note that the CP/M Operating System Manual and other documents refer to a wildcard file name as an ambiguous file name and abbreviate it as "afn".) P&T CP/M 2 allows access to as many as 16 disk drives. In order to specify which drive is to be searched for the desired file, the file name may be prefixed by the drive name character (A through p) followed by a colon (:) as shown in Figure 5.9. Note that when a drive designation is included in a file name, the entire name may have up to 14 characters (2 for the drive designation, 8 for the primary name, 1 for the period, and 3 for the secondary file name). A: STAT H:BIG.FIL Figure 5.9 B:SAMPLE.TXT G:X.l B:PARTl.DAT D:DUMP.* Examples of File Names with Drive Designation P&T CP/M 2 User's Manual OVERVIEW OF CP/M page 5.7 Files and Disk Storage Note to programmers: While it is possible to have file names with lower case letters in them, it is not usually a good practice. The CCP always translates file names to upper case, making it impossible to refer to a file whose name contains lower case letters while in the CCP. The most common way in which file names containing lower case letters are created on a disk is by some sort of high level language. Some high level languages do not convert lower case letters in a file name to upper case before creating the file. (While it is not required for a program to make this conversion, it is customary to do so to avoid the previously mentioned problem.) If a file name is specified with lower case letters in these languages, the file will be created on the disk with lower case letters in its name. Since it is not possible to erase a file with lower case letters in its name directly from the CCP (remember that it translates file names to upper case), deletion of the file must use a more indirect method. The easiest way of deleting such a file is to use the facilities of the language that created it in the first place. Most languages provide the ability to delete files, hence a short program should enable you to erase the file. 5.4 Disk Allocation Blocks P&T CP/M 2 uses a method of dynamic disk storage allocation which eliminates the need for periodic repacking of a disk to reclaim unused space. The disk is broken up into a number of sections called allocation blocks. When a file needs room on the disk, an unused allocation block is assigned to it. As one allocation block is filled, another is assigned to the file, and so on. These blocks need not be in the same area of the disk and may, in fact, be scattered all over the disk. Also, any created file which has been written to will consume at least the amount of storage required by one allocation block: 2K bytes on a double density diskette and lK byte on a single density diskette. When a file is deleted, the allocation blocks it occupied are returned to the pool of free blocks and can be reused as necessary by other files. After using a diskette for some period of time, the storage allocated to a disk file may become scattered over different parts of the disk. This condition is called fragmentation and can cause substantially slower disk performance. When files become severely fragmented, the read/write head of the disk drive must be moved frequently while accessing the file. As an extreme example, consider a file whose first block is on track 3, second block is on track 76, third block is on track 4, fourth block is on track 75, etc. In order to access the file sequentially, the head would have to move nearly the full width of the diskette (taking as much as .7 seconds) between blocks. Fortunately, fragmentation rarely becomes this severe. If a diskette becomes severely fragmented,. the solution is to copy the files of interest to an empty diskette using a routine that handles each file through CP/M, such as PIP or FASTCOPY. When CP/M is putting a file on an empty diskette, it allocates sequential allocation blocks, so a newly copied diskette will have no fragmentation. Do not use an image copy routine such as CLONE. This type of copy routine bypasses CP/M to create a direct image of the original diskette, complete with any fragmentation that existed on the originaL CP/M maintains a directory of the files on a diskette which associates the file name with the file's actual storage locations on the diskette. Figure 5.10 shows the number of directory entries, allocation block size, and number of logical sectors per track for each of the supported diskette formats. page 5.8 Disk Allocation Blocks Format single density double density double sided Figure 5.10 OVERVIEW OF CP/M Directory Entries Allocation Block Size 64 1 Kb 2 Kb 2 Kb 128 192 P&T CP/M 2 User's Manual Logical Sectors per Track 26 64 64 Number of Directory Entries for Disk Formats Each directory entry has a limited amount of space. If the numbers of the allocation blocks occupied by a large file cannot be stored in one directory entry, another entry with the same name is created to provide more room. For this reason, one file may take up several directory entries, even though the file appears only once when the directory is listed. Obviously, it follows that the number of different files which may be stored on a disk can vary according to their sizes. 5.5 Random Access Files In order to maintain compatibility with previous versions of CP/M, disk files are considered to be broken up into 16K byte segments called logical extents. (16K bytes is the maximum amount of storage for 1 directory entry on a single density disk.) Compatibility with earlier versions of CP/M exists for all file sizes when the files are accessed sequentially, but is limited to files of 512K bytes if the random access technique of the earlier CP/M versions is used. Application programs requiring random access to files larger than 512K bytes must be converted to use the random access capability of P&T CP/M 2. In particular, if you are using CBASIC programs which make random access to disk files, you must use the appropriate CRUN file to run the programs. If the digit following the decimal point in the version number of the CRUN file is "3" (e.g. 2.38), that file uses the version 2 random access technique. Using this CRUN file will assure you of being able to randomly access files of any size. If you are not sure of the version number of your CRUN file, merely type "CRUN ), to the console. This prompt is illustrated in Figure 5.15. o Figure 5.15 Command Level Prompt The current default drive has a variety of other names. Most commonly, it may also be called the "current drive", "default drive", or "logged on drive". In any case, it is the logical disk drive that is used for any disk operation when no particular logical drive is specified This is true when the system is in the command mode and when programs are running. As shown in Figure 5.16, the current default drive can be changed from the command mode merely by typing the letter of the desired drive, a colon, and . The current default drive may also be changed by programs through standard system calls. ( A>B: ) Figure 5.16 Changing the Current Default Drive from A to B There are two types of commands that can be given to the CCP: those that use the internal functions of the CCP, and those that execute programs. The internal functions are contained entirely within the CCP, so there is no need to access a disk unless the function requires it (for example, listing a directory or erasing a page 5.12 Command Structure OVERVIEW OF CP/M P&T CP/M 2 User's Manual file). Functions that are too complex to be an integral part of the CCP are supplied as utility programs which must be loaded into the TPA (Transient Program Area of memory) and executed. Since they remain in memory only while they are executed, they belong to a group known as "transient programs." Transient programs retain control of the computer until they have finished their task and then return control to the CCP. The six functions that are built into the CCP are summarized in Figure 5.17. Additional information about the CCP built-in commands may be found on pp.6-8 of CP/M Operating System Manual. DIR ERA REN SAVE TYPE USER Lists files In a disk's directory Erases (deletes> files from a disk Renames a file Saves a portion of the TPA as a disk file Displays a disk file on the console Changes the current user number Figure 5.17 Summary of the Built-In Commands of the CCP P&T CP/M 2 User's Manual OVERVIEW OF CP/M page 5.13 The DIR Command 5.9 The DIR Command This command displays all the files in the directory which are tagg.ed with the DIR attribute (see Section 5.2) and which are stored under the current user number on the console. The file names are shown four to a line and in the order of their appearance in the disk directory. Several variations of the DIR command are allowed, as shown in Figure 5.18. DIR DIR unqfn DIR wcfn DIR x: I ists the names of al I fi les on the current drive I ists the name of the fi Ie specified if it exists on the current disk. This command is useful for finding out if a specific fi Ie is on a disk. I ists the names of al I fi les matching the wildcard file name on the current disk lists the names of all files on drive x Figure 5.18 Examples of Using the DIR Command The DIR command may specify the name of a file or set of files to list. If a unique file name is given on the command line, the disk directory will be searched for a file by that name. If one is found, the name will be displayed on the console. The command may also specify the drive on which to search. A wild card file name may be used with the DIR command. In this case, all file names that match the wild card name will be listed. Any character typed at the console (except and and will cause the display to stop until another key is pressed. They are especially useful if the directory is so long that it cannot be displayed on a single screen. Figure 5.19 shows the console dialog for a listing of all files on a disk that have the extension "ASM". A>DIR *.ASM A: DUMP ASM : SETTIME ASM: TIME A> ASM Figure 5.19 Console Display for DIR *.ASM Command Possible Error Messages NO FILE This response is given if no files are found on the specified disk and user number that match the one given in the DIR command If no file name was given with the DIR command, this message indicates that the directory of the disk is empty. If files do exist that match the file specification but have the SYS attribute set (so they will not be displayed in a directory listing), neither the NO FILE message nor any file names will be displayed. page 5.14 The ERA Command OVERVIEW OF CP/M P&T CP/M 2 User's Manual 5.10 The ERA Command The ERA command is used to ERASE one or more files from a disk. general form shown in Figure 5.20. ( ERA has the ERA wcfn ) Figure 5.20 General Form of the ERA Command All files under the current user number that match the wildcard file name will be removed from the disk. As always, the term "wildcard file name" includes unique file names as a special case, so individual files can also be erased by the ERA command The erasure will occur on the current default drive unless another logical drive is specified in the command. Sample ERA commands are given in Figure 5.21. CAUTION: ERA performs the erasure immediately after you press at the end of the command line. You do not get a chance to change your mind after pressing . Check your command line carefully when using ERA. You should also keep in mind that ERA will erase files with the SYS attribute set as well as nIR files. (Remember SYS files do not show up in a directory display.) Some people develop the habit of using DIR to see what files will be affected by an ERA command with a wildcard file name. If you do this and then use ERA with the same wildcard file name, you may end up erasing some SYS files (if they happen to match the wildcard) without even knowing it. ERA TAX.OAT ERA TAX.* removes the file TAX.OAT from the current disk removes all files with the primary name TAX from the current disk ERA *.* removes al I files from the current disk. As a precaution, the system prompts the user with All Files (YIN)? Any response other than Y will abort the process and return the user to the command level of the CCP. ERA B:TAX.OAT removes the fl Ie named TAX.OAT from the diskette on drive B. Figure 5.21 Examples of Using the ERA Command Possible Error Messages NO FILE This message indicates that no files could be found matching the given file specification. Bnos Err on x: File RIO This message indicates that you have attempted to erase a file which has its read only attribute set. The "x" in the message will be replaced with the single letter name of the drive on which the error occurred (A - P). After displaying this message, the system will wait for input from the console. The first character input from the console will cancel the ERA command and cause the system to perform a warm boot. Essentially, a warm boot involves the reloading of the CCP and BnOS from the diskette and a return to command level (this may require a system diskette on the system drive - see Section 5.16). P&T CP/M 2 User's Manual OVERVIEW OF CP/M page 5.15 The REN Command 5.11 The REN Command The REN command is used to RENAME disk files. Figure 5.22. It has the general form shown in REN unqfnl=unqfn2 Figure 5.22 General Form of the REN Command If the file with name "unqfn2" is found on the disk under the current user number, its name will be changed to "unqfn1". The file to be renamed must be on the current default drive unless another drive is specified in the command. In this case, the letter of the drive and a colon are placed before "unqfn1". Both file names may be prefixed with logical drive indications, but only if they specify the same drive. If the drive prefix is placed only before the second name, it will be interpreted as part of the file name itself. Note that both file names must be unique; REN cannot rename a group of files by means of wildcard file names. Some specific examples of REN commands are given in Figure 5.23. REN OLDTAX.DAT=TAX.DAT .. renames the f II e TAX.DAT to OLDTAX.DAT on the current drive. REN B:REDUC.BAK=REDUC.BAS renames the fl Ie REDUC.BAS to REDUC.BAK on drive B• Figure 5.23 Examples of Using the REN Command Possible Error Messages NO FILE This message indicates that no file can be found to match "unqfn2". FILE EXISTS This message indicates that a file already exists on the specified disk with the name given by unqfnl. REN will take no further action. If you wish to perform the rename operation, you must first erase the file that has the name you want to use. BDOS Err on x: File RIO This message indicates that the file referred to by "unqfn2" is set to "read only" status. The "x" in the message will be replaced with the single letter name of the drive on which the error occurred (A - Pl. The system will then wait for input from the console. The first character input will cancel the REN command and cause the system to perform a warm boot. page 5.16 The SAVE Command OVERVIEW OF CP/M P&T CP/M 2 User's Manual 5.12 The SAVE Command The SAVE command is used to save a portion of the transient program area (TPA) as a file on the disk. This command is most used by experienced programmers. You may find that you have very little use for it in your normal system usage. If you don't understand SAVE very well it will not affect your ability to use the system. The general form of the SAVE command is given in Figure 5.24. ( SAVE n unqfn ) Figure 5.24 General Form of the SAVE Command The "n" in the SAVE command specifies the number of "pages" (256 byte blocks) of memory from the beginning of the TPA that is to be saved in the file specified by "unqfn". "n" in the command must be a decimal number. As an example, suppose that you wish to save the section of memory from 100h (the start of TPA) to A75h. The amount of memory that you want to save is 975h bytes (A75h - 100h = 975h). Since you must save memory in entire page increments, you would then save 10 pages. (There are 100h (256) bytes per "page".) Note that you will actually save more than the desired section. In this example, all of the memory between 100h to AFFh would be saved. WARNING: if a file exists with the "unqfn" specified in the SAVE command, it will be replaced by the new file. The "unqfn" may specify a logical drive on which to save the file with the standard drive specification. A specific example of the SAVE command is given in Figure XX2L SAVE 40 B:SAMPLE.COM saves memory from 100H to 28FFH in a file named SAMPLE.COM on drive B. Figure 5.25 Example of Using the SAVE Command Possible Error Messages NO SPACE The message is displayed if there is no room in the disk directory to create a new file or there is insufficient space on the disk to save the requested number of pages. In most cases, no action will be taken and you should repeat the command with another disk. If storage space on the disk is exhausted in the middle of the SAVE operation, a portion of the created file may be left on the disk (since this is an incomplete file, you should probably erase it to prevent future confusion). Bnos Err on x: File R/O This message indicates that a file with the specified "unqfn" already exists and is set to "read only" status. The "x" in the message will be replaced by the single letter name of the drive on which the error occurred (A - P). The system will then wait for input from the console. The first character input will cancel the SAVE command and cause the system to perform a warm boot. The warm boot operation will not affect the contents of the TPA so you may use the SAVE command again with another file name. P&T CP/M 2 User's Manual OVERVIEW OF CP/M page 5.17 The TYPE Command 5.13 The TYPE Command The contents of a file may be displayed on the console using the TYPE command. Its general form is given in Figure 5.26. ~ TYPE unqfn ~ Figure 5.26 General Form of the TYPE Command The "unqfn" must be specified, and it must be listed under the current user number. The command may also specify the logical drive from which to access the file by specifying the drive letter at the beginning of the file name in the normal manner. As a file is being displayed, any character typed at the console keyboard (except and and will cause the display to stop until another key is pressed. They are especially useful if the file is so long that it cannot be displayed on a single screen. It is assumed that the file contains ASCII characters. Tab characters will be expanded with spaces, with a tab stop at every eighth column. NOTE: no checks are made to insure that the information is in ASCII characters. Typing a non-ASCII file can produce very strange results. Figure 5.27 gives an example of using the TYPE command. A>TYPE TIME.ASM title 'Uti I Ity routine to report current time 4/27/80' page 62 mac I I b z80s This routine reads the current value of the system time of day clOCk and reports It on the console. spcfun equ bufprn equ . tlmsg: hmsg: mmsg: smsg: jentry point for special system functions jCPM function number for line output 40h 9 . . . db db db db cr, If,cr, If, 'The current system time Is ' '00: ' '00:' 'OO',cr,lf,es end 0100h A> Figure 5.27 Example of Using the TYPE Command Possible Error Messages filename? If a file cannot be found that matches the specified unqfn, TYPE will display the file name followed by a question mark on the console and then return to the system command level You can use the DIR command to display the names of the files on the disk. page 5.18 The USER Command OVERVIEW OF CP/M P&T CP/M 2 User's Manual 5.14 The USER Command P&T CP/M 2 supports a division of the directory into as many as 16 sections, with each section assigned a number. When the disk system is set to a certain user number, access to files stored in other sections of the directory is not allowed (except in special circumstances). This partitioning of the directory may be used to provide some separation between groups of programs that have different functions. When the system is first started, it comes up as USER O. With the system set to USER 0, the directory entries generated are compatible with earlier versions of CP/M. If you are reading or writing a diskette that must be compatible with earlier versions of CP/M, work at single density only and always remain at USER O. The USER command changes the current user number. Its form is shown in Figure 5.28. The "n" is a number from 0 to 15 which specifies the desired user number. ( USER n ) Figure 5.28 General Form of the USER Command NOTE OF CAUTION: under earlier versions of CP/M, ERA *.* was a convenient way to remove all files from a diskette, leaving it essentially blank. In P&T CP/M 2, this command will erase only the files under the current user number. In order to clear the disk completely, you must repeat the ERA *.* command under every user number which has file storage. A faster way of obtaining a blank diskette is to run the format program on it. However, this has the undesirable side effect of erasing the system tracks as well as the data tracks. Possible Error Messages nn? If the parameter given in the USER command is not an integral number between o and 15, the console will display the parameter followed by a question mark, and the system will return to the command level. OVERVIEW OF CP/M P&T CP/M 2 User's Manual page 5.19 Transient Commands 5.15 Transient Commands As already noted, some of the more complex functions of CP/M cannot be included in the built-in commands of the CCP, so they are supplied as utility programs (also known as "transient programs"). The utility programs supplied with P&T CP/M 2 are described in Chapter 8. In addition, the utility programs that are a standard part of CP/M 2 are also described in the CP/M Operating System Manual. The commands used to execute utility programs (or any programs) are no different than those which execute the built-in functions of the CCP. All executable programs are stored on the disk with a secondary file name of "COM". From the command level, the user types the primary name of the file, any parameters the program may require, and . The CCP then loads the program into memory, passes the parameters to it, and starts execution. Figure 5.29 gives an example of the command line which would be entered to edit a file named TEXT.1 with the ED text edi tor. A>ED TEXT.l Figure 5.29 Example of Executing a Transient Program Strictly speaking, the user is entering a transient command when any program, such as BASIC or a compiler, is executed. The command is the primary name of the file in which the program is stored. Thus, you can change the names of the transient commands at will merely by changing the file names. For example, if you want to run the text editor by typing EDITOR instead of ED, simply rename the file ED.COM as EDITOR.COM. 5.16 Boots: Warm and Cold Following a RESET, it is assumed that the machine is in an unknown state, so the entire system is loaded into memory. This operation is often referred to as a cold boot. During a system load, the CCP, BDOS, and BIOS are loaded from the system diskette and certain initialization procedures are performed (such as setting up the serial ports, reading the date and time from the CCB board if one is installed, etc.). The Console Command Processor (CCP) has no function while a transient program is running so transient programs are allowed to make use of the memory normally occupied by the CCP. If a transient program uses this area, the CCP must be reloaded when the program terminates. The function that reloads the CCP and BDOS is called a warm boot. It is the normal way of terminating any program. A warm boot also occurs when you press the key at the command level of the system. The warm boot function also performs other operations like resetting the disk system so that you can change disks. In some systems, the warm boot operation reloads the CCP and BDOS from the diskette mounted on the system drive. In others, they are stored in additional memory making a diskette unnecessary for a warm boot. When loading the CCP and BDOS from a diskette, it is necessary that they have been set up to run at the memory location to which they are loaded (See Section 9.4 for further information about this matter). You may switch system diskettes between warm boots as long as the CCP and BDOS on the new diskette are set up the same as on the disk from which the system was OVERVIEW OF CP/M page 5.20 Boots: Warm and Cold P&T CP/M 2 User's Manual loaded. If they are set up differently the error message shown in Figure 5.30 will be displayed. If you get this message, you have mounted a system diskette that is incompatible with the system that is running in the computer. You may either RESET the computer to reload (cold boot) the system from that disk or remount the system disk from which the system was last loaded and press . Mismatched system disk - please try another. Figure 5.30 Error Message for Incompatible System Diskette 5.17 Console Input If a is typed from the command level of CP/M, all subsequent output to the console will also be sent to the LST: logical device. This will continue until a warm boot occurs or is typed again. CP/M has a buffered input capability which is used by many programs and the CCP. When buffered input is performed, all characters entered from the console are held in a buffer until is pressed. Once you press , the entire line is acted upon. Before pressing , you have some editing capability available to you. The edi ting functions are accessed by means of control characters, as described in Figure 5.31. ~ «break» will cause a warm boot If it is the first character on a line. sends a carriage return and line feed to the console but does not put them In the line. This feature Is used to break up long lines for Increased readability. «back space» causes the cursor to back up one position and erase the character at that position. terminates Input of line. «enter» move to a new line and retype the current contents of the line. terminates input of line. delete the contents of the current line and move to a new line. delete the contents of the current line and erase all characters back to the beginning of the line. rubout «ctl-mlnus» Figure 5.31 deletes and echos the last character entered. Line Editing Control Characters When information is being displayed on the console, the display can be stopped by typing or on the console keyboard. The display will continue when any additional character is typed. Two notes of caution are needed here: 1. Some programs bypass the part of CP/M that performs this function, so it will not work when those programs are running. 2. If, while information is being displayed on the console, you type any key other than , the function will not work until an input from the console has been performed (to read the character that was typed). P&T CP/M 2 User's Manual MODULARITY page 6.1 Introduction 6.1 Introduction P&T CP/M 2 revision M is designed with a modular concept. Various different functions are contained in different modules. For example, the serial port driver routines are in their own module. Similarly the parallel port driver routine is in a separate module. Although a maximum of 31 modules can be included in the system, it is very rare that more than 10 are used. The advantage of modularity is that you can configure the system much more closely to your needs. If you do not need to use the serial ports, you need not include the serial port module in your system. The MODSEL utility program provides (see Section 6.3) an easy means of selecting the modules which are to be included in the system. One result of the ability to select only certain modules to be included in the system is that you can have several different "versions" of the system each with a different combination of modules. In general, when you load the system from a working system diskette from one "version" of the system, the system will not be able to warm boot from diskettes containing other "versions". We suggest that you color-code the different versions so that you will not get them mixed up. With P&T CP/M 2 the CCP and BDOS are stored on the system tracks of a. system diskette in a relocatable form. The various modules that make up the remainder of the system are stored in a file called BIOSMODS.PNT. A second file, named BIOSPARM.PNT, contains the names of aU the modules to be included when the system is loaded (RESET) as well as other information about the initial state of the system. When the system is loaded, it first reads the BIOSPARM.PNT file to determine which modules are to be included. It then performs 4 operations. 1) It determines how much memory space is required for all of the modules to be included in the system and for any free memory space that is to be left above the system. 2) From this information it determines where in memory the CCP and BDOS are to reside. The copy of the CCP and BDOS on the system tracks is then set up to run at the appropriate memory address and loaded into memory. Once the CCP and BDOS on the system tracks have been set up, they can simply be reloaded when a warm boot occurs•. 3) The system then loads the requested modules from BIOSMODS.PNT and locates them at the appropriate places in memory. 4) Finally any required initialization is performed before the system begins operation. The BIOSPARM.PNT and BIOSMODS.PNT files are not needed for a warm boot operation. The only requirement ·for a warm boot is that an appropriate copy of the BDOS and CCP reside on the system tracks of the diskette mounted in the system boot drive (note: even this is not required in some systems such as a Radio Shack hard disk system). Thus you can change diskettes in the system boot drive as long as the CCP and BDOS appear on the system tracks and have been set up appropria tely. You can insure that the copy of CCP and BDOS on the system tracks of a diskette are properly set up in two ways. 1) You can make several working system diskettes and copy the same BIOSPARM.PNT and BIOSMODS.PNT files to all of them. Then you should load (RESET) the system at least once from each of them. By loading the system causes the CCP and BDOS to be set up and, since the same modules are page 6.2 Introduction MODULARITY P&T CP/M 2 User's Manual being loaded (you insure this by copying the BIOSPARM.PNT and BIOSMODS.PNT files), the CCP and BDOS will be set up identically on each diskette. 2) You can CLONE the system tracks from your working system· diskette to other diskettes that are likely to be mounted on the system drive. This insures that the system tracks (and hence the copies of CCP and BDOS) are identicaL Note that in this case it is not necessary to have the BIOSPARM.PNT and BIOSMODS.PNT files on each diskette. They are only required on the diskette from which the system is initially loaded. Should you up copy of opportunity the system work for a attempt to warm boot from a diskette that does not have a properly set CCP and BDOS, an error message will be given and you will have the to mount another system disk to complete the warm boot. Note that diskette from which the system was last loaded (RESET) willal ways warm boot. . 6.2 Types of Modules There are several different types of modules available in P&T CP/M 2. When selecting modules to be included in the system there are some types that are required to be present and some that are optionaL The following are the general categories of modules: Core Modules (one required) These modules make up the basic core of the I/O system. There may be one or more core modules available to choose from. Warm Boot Modules (one required) These modules control the action taken during a warm boot. Different warm boot modules may be available· to take advantage of differing hardware configurations. CRT Modules (one required) The CRT modules take care of output to the console display of the computer. Disk Parameter Modules (one required) These modules contain the parameters that define how disk storage is to be allocated. For floppy based systems, there are 4 predefined disk parameter modules; one each for 1, 2, 3, and 4 floppy drive systems. For hard disk drive systems additional predefined disk parameter modules are available which cover typical hard disk configurations. Hard disk systems include the HDCONFIG utility program which allows you to edit and create disk parameter modules. Hard Disk Driver Modules (optional) These modules contain the necessary interface software to allow the system to use a hard disk drive in addition to the floppy drives. If your system has a hard disk driver module, you may elect whether or not to use it. If you do not use it, the system will load as a standard floppy disk system. Serial Port Modules (optional) The serial port modules provide access to the serial ports on the computer. One may be included if you require access to the serial ports. Parallel Printer Port Modules (optional) These modules provide access to the parallel printer port. Different parallel printer port modules may be supplied for use with different parallel printers. A parallel printer port module may be included if you require access to the port. MODULARITY P&T CP/M 2 User's Manual page 6.3 Types of Modules Utili ty Modules (optional) These modules provide useful functions such as programmable function keys, key translation, terminal emulation, etc. You may select as many of them as you wish. 6.3 Selecting Modules The MODSEL utility program is provided to allow you to easily select the modules you want included in the system. It is described here rather than in Chapter 8 with the rest of the utility programs. Utility name: MODSBL Purpose: To select the modules that are to be included when PH CP1M 2 is loaded. General Description The MODSEL program allows you to select the modules you want included when P&T CP/M 2 is loaded into memory. MODSEL shows you the module names that are currently listed in the BIOSPARM.PNT file for inclusion in the system and allows you change, add to, or delete them. MODSEL also insures that you include all required modules. Note: MODSEL does not alter the operating system that is in memory. The selections you make will included in the system the next time it is loaded (RESET). Each module in the library of modules includes a description of the module. As you are choosing the modules to be included in the system, MODSEL allows you to view the description as an aid to deciding which modules to include. MODSEL requires that the BIOSPARM.PNT and BIOSMODS.PNT files be on the same logical drive (as they would be on a bootable system diskette). It does not require that they be on a particular drive. This allows you to alter a different system diskette than the one from which you loaded the system. For example, even though the system diskette from which you loaded the system may still be mounted on drive A you may select the modules to be loaded on another system diskette merely by mounting it on another drive. Using MODSEL Any time that MODSEL asks a question that requires a yes/no answer, the responses "Y", "y", and "1" will be accepted as an affirmative answer and the responses "N", "n", and "0" will be accepted as a negative answer. The command line to execute MODSEL is shown in Figure 6.1. A>MODSEL Figure 6.1 Command Line to Execute Module Selector The first thing that MODSEL does is ask you on which drive it is to find the module file, BIOSMODS.PNT (Figure 6.2). Note that the file BIOSPARM.PNT must also be on the same disk, as is typically the case. On Line 6.2-13, drive D is specified as the drive on which to find these files. You should insure that the page 6.4 Selecting Modules MOnULARITY P&T CP/M 2 User's Manual appropriate disk is mounted and ready since ManSEL will immediately access the drive after you answer this question. P&T CP/M 2 Module Selection Program - Ver 1.xx 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: Enter drive on which to find BIOSMODS.PNT: D 17: 18: 19: 20: 21: 22: 23: 24: Figure 6.2 Entering Drive on Which to Find Module Library After you have specified the drive, ManSEL will read the existing BIOSPARM.PNT file to determine which modules are already selected for inclusion when the system is loaded. As it does this, it displays the message "reading old system parameter file_" on the console. Once it has done this, ManSEL will begin to present you wi th modules to choose from. The names of the available modules are displayed for you by type grouping. If there is only one available module for one of the required types, ManSEL will automatically select it for you without any action on your part. If there is only one available module for an optional type, ManSEL will present it to you so that you can decide whether you want it included or not. After specifying the drive (Figure 6.2) the next display you see might look like Figure 6.3. This is the general form of the display for selecting one or more modules. On Line 6.3-9, the type of module under consideration is shown. On lines 6.3-11 to 6.3-21, the names of the available modules in this category are displayed. On lines 6.3-22 to 6.3-24 the actions you may take are described. The name(s) of any modules currently included from this group will be highlighted in reverse video and the cursor will be positioned at the first of the names displayed. You may move the cursor from name to name by using the cursor arrow keys on the keyboard. If you press the key, the module at which the cursor is presently positioned will be selected. As you select the module, its name will be highlighted in reverse video. For categories from which only one module may be selected ManSEL will not allow you to select more than one module. If a module is already selected (highlighted) when you press , it will be deselected (returned to normal) before the new one is selected (highlighted). If you press the key, the module at which the cursor is positioned will be deselected. As this is done the reverse video will be removed from the module's name. You may select and deselect modules as many times as you want. The selection does not take effect until you press the key. Upon pressing MODULARITY P&T CP/M 2 User's Manual page 6.5 Selecting Modules any modules whose names are highlighted will be included in the system and MODSEL will move on to the next category of module. Note that no changes are made to the BIOSPARM.PNT file until the very end of MODSEL. You will be given a final chance to review your choices and accept them before any changes are made to the file. 1: P&T CP/M 2 Module Selection Program - Ver l.xx 2: 3: 4: 5: 6: Disk Table Modules 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: lFLOPPY 2 FLOPPY 3FLOPPY 4FLOPPY 20: 21: 22: 23: 24: •••••••• select module ••••••••• remove module •• move cursor Figure 6.3 •••• show description of module •••• display modules already included .include selected modules Selecting a Disk Parameter Module If you press the key, MOnSEL will display all the names of all the modules which have been included in the system up to this point. This list does not include any names from the category currently displayed since selections from it do not take effect until you press . Figure 6.4 shows an example of a display that might be given when is pressed while the display of Figure 6.3 is on the console. Note that STDCOREl and STDCRTl have already been selected; in many cases MODSEL will automatically make these selections (when there is only one available module in a required category). All module names shown in this display will be highlighted since they have all been included. MODULARITY page 6.6 Selecting Modules 1: P&T CP/M 2 User's Manual P&T CP/M 2 Module Selection Program - Ver l.xx 2: 3: 4: 5: 6: 7: 8: 9: Modules Already Included 10: 11: 12: 13: 14: 15: 16: STDCOREI STDCRTI 17: 18: 19: 20: 21 : 22: 23: 24: (press to continue) Figure 6.4 Displaying the Modules Already Included If you press to continue) Figure 6.5 Displaying a Module Description Figure 6.6 shows the display of the utility module names. Note that, since these modules are not required in the system, "(optional)" appears on Line 6.6-10 directly under the description of the module category. This will occur for all optional categories. You may select as many modules from the utility module category as you wish. P&T CP/M 2 User's Manual MODULARITY page 6.7 Selecting Modules 1: P&T CP/M 2 Module Selection Program - Ver l.xx 2: 3: 4: 5: 6: 7: 8: Utility Modules (optional) 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: AUTOKEY SCRNOUMP KEYXLATE 20: 21: 22: 23: 24: •••••••• select module ••••••••• remove module •• move cursor •••• show description of module •••• dlsplay modules already included .lnclude selected modules . Figure 6.6 Selecting Utility Modules After you have gone through all the categories of modules, MODSEL will present you with a display of all their names as shown in Figure 6.7. You are then asked (Line 6.7-23) to verify that these are the modules you want included in the system. A negative response on Line 6.7-23 will cause MODSEL to start over. An affirmative response will cause the BIOSPARM.PNT file to be updated to include the modules displayed. As the file is updated, MODSEL will display the message "writing new system parameter file_" on the console. After the file has been updated, MODSEL will clear the screen and return you to the command level of the system. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: P&T CP/M 2 Module Selection Program - Ver l.xx These modules will be Included In system: STOCOREI STOCRTI 2FLOPPY STOWS 1 SIO PPSTO 20: 21 : 22: 23: Is this correct? Y 24: Figure 6.7 Reviewing Modules Selected AUTOK EY page 6.8 Selecting Modules MODULARITY P&T CP/M 2 User's Manual Possible Error Messages Do you really want to quit (YIN)? This is not really an error message. It appears at the bottom of the screen when you press the key. If you pressed it accidently you can return to the program by giving an negative response. If you do want to abort the program and return immediately to the operating system, enter an affirmative response. Not a valid response, please re-enter This message is given either by itself or in conjunction with another error message. It indicates that the response you just made is not valid for some reason (for example, answering a yes/no question with Q). You should enter another response. No more room for modules in system [module name] not included in system This message is given if you try to select more than the maximum permissible number (31) of modules for inclusion in the system. As long as all the module being selected when this message is given is not a required module, the program will continue to allow you to remove other modules or take other action. No room for essential module, aborting operation If you are selecting a required module and it would exceed the maximum permissible number of modules (31), this message is displayed. The program will immediately return to the operating system if this error occurs• ...... Not enough memory for module selection ***"* This message indicates that there is not enough memory available for workspace for the program. You should not encounter this error unless you have reserved a large amount of memory above the operating system causing the Transient Program Area to be smaller than 48 Kbytes. Enter a drive letter A to P This message is displayed if you have specified an illegal logical drive letter. Drive X does not exist This message is displayed if you enter a logical drive letter for a drive that is not defined on the system. The "X" will be replaced by the letter you specified. Cannot open BIOSMODS.PNT This message indicates that the program was unable to open the file containing the library of modules available to you. This typically is caused by specifying the wrong disk drive on which to look for the file. A [module type] is required This message is given if you attempt to bypass the selection of a module type that is required for the system. You will not be allowed to proceed until you have selected one of the modules whose names are presented on the console display. Unable to find compatible disk parameter module Enter correct driver type for your system This message is given if you attempt to select a hard disk driver module for which there are no compatible disk parameter modules in the library. You should never get this message. If you do, your module library file has probably been P&T CP/M 2 User's Manual damaged in some way. diskette. MOnULARITY page 6.9 Selecting Modules You should get a fresh copy of the file from your master Error opening BIOSPARM.PNT to read old parameters This message is displayed if the program cannot successfully open the parameter file in which the names of the modules to include in the system are kept. It typically results from specifying the wrong drive on which to find the file. The program will return to the system immediately after this message. Error closing BIOSPARM.PNT This message indicates that a disk error occurred when the BIOS parameter file was being closed. This error is very rare and may indicate a hardware problem. You should try making another working system diskette and using MOnSEL on it. Module library damaged_essential module missing This message indicates that, while checking the module library, MOnSEL found that one or more of the required module types were missing. This usually indicates that something has damaged the library file. A [module type] is required and one was not included If MonSEL finds, during its final checking, that a required type of module was not selected for inclusion in the system, it displays this message. You should never see this message. If you do, it may indicate a problem in the module library or the MOnSEL program. page 6.10 Selecting Modules MODULARITY NOTES P&T CP/M 2 User's Manual UTILITY MODULES P&T CP/M 2 User's Manual page 7.1 Introduction 7.1 Introduction The utility modules provide for various useful functions to be loaded with the system. These functions typically take up too much memory to be included in the core since not everyone will want to use them. If you do choose to include a utility module, it essentially becomes part of the system. The following utility modules are available: AUTO KEY Provides 5 programmable function keys. The keys may be programmed directly from the keyboard at any time or by sending a special string to the system console. KEYXLATE Allows you to translate any 16 keys on the console keyboard to other characters. SCRNDUMP Allows you to print the contents of the console display on the system printer by pressing on the system keyboard. ADM3A Makes the console display/keyboard look like an ADM 3A terminal. 7.2 AUTOKEY ModUle The AUTOKEY module provides you with five programmable function keys. Each of the keys can be programmed to generate a string of up to 79 characters with a maximum of 120 characters for all strings. Any characters (including control characters) may be included in a programmed string. The keys may be programmed at any time directly from the console keyboard or by a program using an escape sequence. In addition, the string programmed into any of the keys can be viewed at any time without affecting the console display. The five function keys are accessed by pressing , , , and . This allows the function keys to be supported without conflicting with any other control keys. As an example, the . If would no longer be available (it would generate the same string as . The bottom line of the screen will immediately be cleared and the cursor will be moved to it's beginning. You should then press the key (one of the programming operation will be aborted and the console display will be restored to its previous condition. After pressing and one of , you should enter the string to be programmed into that key. As you type, the characters will be shown on the bottom line of the screen. Typing will end the string, assign it to the specified key, and restore the screen to its previous condition. While you are entering the string, may be used to back up and delete the previous character. page 7.2 AUTO KEY Module UTILITY MODULES P&T CP/M 2 User's Manual You may include most keys just by typing them. If you wish to use a control key, just type the letter while holding down the , , or into the string, you must type the key first. For example to put into the string you must type ; to put into the string, you must type . Since , , and are control characters they will be shown in reverse video. You can program the function keys at any time from the keyboard, even while a program is running. This can be especially useful when editing text that has frequently used words and phrases. You can program the function keys to generate the words and phrases without leaving the editor and you can change them whenever you want without affecting the editor at all. Programming Function Keys from a Program A program may also set up the string for any (or all) of the function keys. To do this, the program must send out an escape sequence of the form shown in Figure 7.1 to the console. string If the fol lowing special characters are to be included in the string, they must be sent as the specified escape sequence: character escape sequence is replaced by 1, 2, 3, 4, or 5 according to the key to be programmed. is the ASCII carriage return character. This is the character generated by the key. Figure 7.1 Escape Sequence to Program a Function Key One escape sequence is required for each function key to be programmed. Figure 7.2 shows an example in Basic of programming to "jumps over the lazy dog. ". 10 PRINT CHR$(27);CHR$(27);"lThe quick brown fox" 20 PRINT CHR$(27);CHR$(27);"2jumps over the lazy dog.";CHR$(27);CHR$(13) Figure 7.2 Example of Programming Function Keys from Basic When programming the AUTO KEY strings from a program, you may run into a problem if the character is included in a string. CP /M 2 provides two ways of sending characters to the system console. The first way automatically expands characters into one or more spaces to move the cursor to the next tab stop. (Tab stops are assumed at every eighth character position.) The second way sends the actual character to the console with no alterations. Most programming languages use the first method of sending characters to the console (some even expand tabs on their own). Since the character gets converted into one or more spaces, you are not really sending the characters you expected to the console. Some languages that have this problem provide an P&T CP/M 2 User's Manual UTILITY MODULES page 7.3 AUTOKEY Module alternate function to send characters directly to the console using the second method. You should check the documentation on the language to see if it has such an alternate function. If you do not have a method of sending characters directly to the keyboard without tab expansion, you can usually send the character code 137 (89h) in place of the character. Although most programs will accept this code as a character, it will usually not be expanded. Displaying Programmed Strings You may display the string programmed into any of the five function keys by pressing followed by one of . After pressing the function key, the bottom line of the console display will be cleared and the string (if any) programmed into that key will be displayed. The next key you press will cause the screen to be restored to its previous condition. Editing Programmed Strings AUTO KEY includes a limited capability to edit a string that has been programmed into a function key. By pressing followed by one of the string will be displayed. If you then press to delete characters back to where you want to make the change. This feature is most useful when you forgot something (like C: MTPLUS B:PROG $TB C: LINKMT B:PROG=B:PROG,PASLIB/S B: PROG The first of these strings invokes the editor to make changes on the program. The second makes drive C the current drive and executes the compiler to compile the program. The third makes drive C the current drive and executes the linker to create an executable file. The fourth string makes drive B the current drive and executes the program for testing. By defining these four function keys, you can save a great deal of typing as you develop the program. 7.3 KEYXLATE Module The KEYXLATE module allows you to translate up to 16 keys on the console keyboard to other characters. This lets you reassign keys for use with various programs. For example, some text editors do not allow you to use the cursor arrow keys on the keyboard. They insist, instead, on using control characters. With KEYXLATE you can translate the arrow keys to the control characters the program expects for cursor movements. The arrow keys will then function just like you would expect them to. When the KEYXLATE module is first included in the system, it is not set up to perform any translations. You may define the translations you want in one of two way~. You may use the KXEDIT utility program to edit the current translations interactively from the keyboard or you can write a program to set the translations by sending an escape sequence to the console. The KXEDIT utility program is described in Section 8.18. Most of the non-alphabetic keys in the central typing area of the keyboard generate special codes when they are pressed in conjunction with the into another character (accent grave, for example). The KXEDIT program will allow you to investigate which keys generate these special codes and assign translations to them. Once you know what the translation is, you can have a program assign the translations (see the example below). Setting the 'l.'ranslations from a Program When the KEYXLATE module is included in the system, a program may set up the translations by sending an escape sequence to the console output. The form of the escape sequence is shown in Figure 7.3.