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 PDF.
Page Count: 354

DownloadPT_CPM_2_TRS-80_II_12_and_16_Users_Manual_1983 PT CPM 2 TRS-80 II 12 And 16 Users Manual 1983
Open PDF In BrowserView 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.
(16 original codes)(16 translated codes)
The first original code will be translated to the first translated code,
the second original code to the second translated code, etc.
All 16 original and translated codes must be sent. If you do not have 16
translations send 128 (80h) for each unused original and translated code.
Figure 7.3

~

Form of the Escape Sequence to Assign Key Translations

Note that you must send all 16 original codes and all 16 translated codes. If you do
not need to use all 16 translations, you should send the character code 128 (80h) for

UTILITY MODULES

P&T CP/M 2
User's Manual

page 7.5
KEYXLATE Module

the original and translated codes you are not using. Figure 7.5 gives an example in
Basic of installing the translations shown in Figure 7.4.
from
 (lCh)
 (lDh)
 (lEh)
 (lFh)
 (A2h)
I

to




, (accent grave)

)

{
}

{
}

I
I

Figure 7.4 Translations Assigned by Example In Figure 7.5

,

10 I Program to assign key translations
20 I
30 I -------- start with 
40 PRINT CHR$(27);CHR$(24);
50 I
60 I -------- send out original codes
70 PRINT CHR$(&H1C);CHR$(&Hl0);CHR$(&H1E);CHR$(&H1F);
80 PRINT CHR$(&HA2);"1 J§t";
90 FOR 1=1 TO 7 : PRINT CHR$(128); : NEXT
' fill unused spaces
100 I
110 I -------- send out translated codes
120 PRINT CHR$(1);CHR$(4);CHR$(23);CHR$(24);
130 PRINT CHR$(96);"§tll";
140 FOR 1=1 TO 7 : PRINT CHR$(128); : NEXT
I fill unused spaces
Figure 7.5

Example of Assigning the Key Translations from Basic

When setting the key translations from a program, you may run into one or two
problems. The first may occur when you want to have the  character involved
in the translation. 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
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, KEYXLATE will recognize the character
code 137 (89h) in an assignment string as a  character.
The second potential problem arises if the programming language you use
automatically sets the high bit of each character to 0 before sending it to the
console. This makes it impossible to send characters whose codes are greater than
127 to the console. Fortunately most languages do not do this. If you are using a
language that does perform this way, you will need to find some alternate means of
sending codes greater than 127 to the console, should you need to do so.
In addition, if you use KEYXLATE in conjunction with AUTOKEY, you will not be
able to translate the keys  , , , , , and .
You can assign translations to these keys if you wish but AUTOKEY will not allow

UTILITY MODULES

page 7.6
KEYXLATE Module

P&T CP/M 2
User's Manual

the translated character through since it uses these keys itself. Similarly, if you
use KEYXLATE with SCRNDUMP, you will not be able to translate .

7.4 SCRNDUMP Module
The SCRNDUMP module allows you to print the current contents of the console
display by pressing . All characters from the display will be printed on the
system printer (the LST: device) except for graphics characters. Any graphics
characters will be replaced by spaces so that the spacing on the printed copy will
be the same as on the screen. Reverse video is ignored during the print process so
characters that are in reverse video will be printed the same as normal characters.

7.5 ADM3A Module
The ADM3A module makes the console display and keyboard emulate an ADM 3A
terminal. With this module included in the system, the display will respond to the
standard ADM 3A cursor positioning codes and the cursor arrow keys will generate
the same codes as an ADM 3A terminal. In some cases, control sequences were
taken from Soroc terminals for functions that are not available with the ADM 3A.
This feature is useful when running programs that make use of cursor addressing
and other terminal features but do not support P&T CP/M 2 directly. If you can
configure the program for P&T CP/M 2 you should do so to insure the maximum use
of the features of the video display. For programs that cannot be configured to
work with P&T CP/M 2, the ADM3A module should allow you to configure them for
an ADM 3A terminal and use them.
Figure 7.6 shows the codes recognized by the ADM 3A terminal emulator module to
perform various functions. Note that these are the codes that would be sent to the
console by a program to accomplish the listed action.
character
sequence





!
+
*
T
Y
(
=rc

numeric codes
(dec)
31
26
8

10
11
12
30
27, 91
27, 93
27, 43
27, 42
27, 84
27, 89
27, 41
27, 40
27,61,r,c

Figure 7.6

numeric codes
(hex)
lFh
lAh
08h
OAh
OBh
OCh
lEh
lBh,5Bh
lBh,5Dh
lBh,2Bh
lBh,2Ah
lBh,54h
lBh,59h
lBh,29h
lBh,28h
lBh,3Dh,r,c

function
new line (same as 




code (dec)
8

12
11
10

page 7.7
ADM3A Module

code (hex)
08h
OCh
OSh
OAh

Figure 7.7 Character Codes Generated by Arrow Keys with ADM3A

With the ADM3A module included in the system, any programs that use the standard
P&T CP1M 2 console control codes (see Chapter 10) will not work properly. There
are two ways to disable the module so that the standard P&T CP/M 2 control codes
will be recognized. Escape sequences, as shown in Figure 7.8, are recognized to
turn the module on and off. Also Special System Function 31 has been included in
P&T CP 1M 2 to enable and disable the ADM3A module and others like it.
character
sequence
 (
]

numeric codes
(dec)
27, 91
27, 93

numeric codes
(hex)
lBh,5Bh
lBh,50h

function
enable emulation
disable emulation

Figure 7.8 Escape Sequences to Enabl.e and Disable AOM3A

Programs that use the standard P&T CP1M 2 console control codes can use these
escape sequences or this special system function to disable the module when they
begin execution and re-enable it before returning to the system. The special system
functions are discussed in Chapter 16. An example of how this can be done from a
Basic program is shown in Figure 7.9. All of the P&T CP/M 2 utility programs that
make use of the console control codes use this special system function to insure
that they will work even when the ADM3A module is included in the system.

10 SYSENT%=&H43
'entry point for special system functions
20 '
30 ' turn off terminal emulator If one Is Installed
40 POKE &H46,0
: POKE &H47,31
'setup registers B & C
50 CALL SYSENT%
'cal I special system function

60000 '
60010' turn terminal emulation back on before exiting program
60020 POKE &H46,&HFF : POKE &H47,31
'setup registers B & C
60030 CALL SYSENT%
'cal I special system function
60040 STOP
Figure 7.9 Using Special System Function to Turn ADM3A Module On and Off

~

,.

page 7.8
ADM3A Module

UTILITY MODULES

NOTES

P&T CP/M 2
User's Manual

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.1
Introduction

8.1 Introduction
P&T CP/M 2 includes a variety of utility programs to perform useful and needed
system functions. These include the standard CP/M 2 utility programs, as well as a
number of special purpose programs developed by Pickles & Trout especially for the
TRS-80 hardware.
Most of the utility programs have an interactive mode of operation in which the
program asks you various questions to determine what you want done. For example
the FORMAT program will ask for the drive on which to format a diskette, the
density at which to format it, whether you want to make a quick check for flaws,
and so forth. When you wish to use the interactive mode of a utility program you
merely type the name of the program at the command level of the system and
answer the questions it asks.
Although we have tried to show as many "screen images" as possible in the
descriptions of the utility programs, it is very difficult to learn how to use a
program just from reading a manuaL We strongly suggest that you actually execute
the programs as you read about them. You will learn faster if you actually see
what happens as the program runs. Note that some programs have the potential for
erasing or altering information on disks. You should make up some "learning'"
diskettes that contain no important information to use while you learn about the
utility programs.

8.2 Command Line Mode
Some of the utility programs have a command line mode. In this mode of operation,
all instructions about what the program is to do are given on the command line
that executes the program. This mode was developed specifically for use in
integrated applications. By using SUBMIT, some sort of menu program, or a chaining
facility, you can organize your system so that a user can perform system functions
(like formatting a diskette, changing the serial port setup, copying diskettes, etc.)
without ever dealing directly with the utility programs involved.
When the command line mode is used, the output from a utility program includes
messages indicating what the program is doing and reporting any errors that occur.
The command line option allows you to direct this output from a program to the
console, a printer, a disk file, or any combination of them. This feature gives you
a way to log exactly what happens when the utility program is executed. It also
allows you to detect errors and deal with them in your own way. You can, for
example, direct the output from a utility program to a disk file and then have your
program look at the contents of the file to check for error messages. When the
output is directed to a disk file, it will not appear on the console unless you
specifically direct it to the console as well.
Since the output from several utility programs may be directed to the same disk
file, the beginning of each program is marked by a line beginning with two asterisks
( **). This allows a program looking at the file to easily find the beginning of the
output from each utility program. Error messages always appear on lines that begin
with four greater than signs ( )>»). A program can check for errors simply by
scanning for lines that begin with »».

page 8.2
Command Line Mode

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Section 8.34 of this chapter gives several examples of using the command line
options.

8.3 List of Utility Programs
The distribution diskette you received should contain the following utility programs:
~

2rofQ:am

8.4

ASM

The standard CP/M 2 assembler.

8.9

ASSIGN

8.13

CLEAN

P&T CP/M 2 utility to quickly change the 1/0 device assignment
(e.g. change the system printer from the parallel port to a serial
port).
P&T CP/M 2 utili,ty for use when cleaning diskette drive heads.

8.15

CLONE

8.27

DATIME

8.29
8.36

Standard CP/M debugger.
DDT
DENSITY P&T CP/M 2 utility to report and, optionally, change the density
flag on a diskette.

8.39

DISKCHK

8.26

8.55

descri2tion

P&T CP/M 2 utility to make an image copy of a diskette. When a
diskette is copied with this program random access files will be
properly copied.
P&T CP/M 2 utility to display the current system date and time.

P&T CP/M 2 utility to check a diskette for flaws. This program
does not affect the data on a diskette and may be used at any
time.
DISKTEST 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 when reusing a diskette.
Standard CP/M 2 program to display a disk file in hexadecimal
DUMP
format.
Standard CP/M 2 line oriented editor.

8.56

ED

8.57

P&T CP/M 2 utility to explain error messages given by the system.
ERROR
FASTCOPY 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. Since it
performs file copies, FASTCOPY may not copy random access files
correctly.

8.58

8.69

FORMAT

P&T CP/M 2 utility to format diskettes.

8.78

KXEDIT

P&T CP/M 2 utility to edit the key translations performed by the
KEYXLATE module when it is included in the system.

8.82

LOAD

8.84

MODSEL

8.85

PATCH
PIP

Standard CP/M 2 utility that creates an executable "COM" file from
the "HEX" file generated by an assembler.
P&T CP/M 2 utility to select the modules that are to be included in
the system when it is loaded.
P&T CP/M 2 utility for installing P&T supplied patches to programs.
Standard CP/M 2 program for file transfer. Since PIP performs a
file copy operation, it may not copy random access files correctly.

8.90

P&T CP/M 2
User's Manual
8.104 SETCCB

UTILITY PROGRAMS

page 8.3
List of Utility Programs

P&T CP/M 2 utility for setting the P&T CCB clock, calendar, and
bell board.

8.108 SETDATE P&T CP/M 2 utility for setting the system date.

8.111 SETMISC

P&T CP/M 2 utility for setting the following miscellaneous I/O
parameters: CRT parameters, floppy drive head step rate, and
parallel printer port options.

8.120 SETTIME
8.122 SETUP

P&T CP/M 2 utility for setting the system time.
P&T CP/M 2 utility for setting the serial port parameters and the
I/O device assignments.

8.130 STAT

Standard CP/M 2 utility for displaying statistics on disk drives and
files.

8.137 SUBMIT

Standard CP/M 2 utility for submitting multiple command lines for
batch processing.

8.140 SYNCRO

P&T CP/M 2 utility for synchronizing the system date and time to
the P&T CCB clock, calendar, and bell board.

8.141 TRS2CPM

P&T CP/M 2 utility to transfer files from a TRSDOS diskette to a
CP /M diskette.

8.149 VERIFY

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.

8.151 XSUB

Standard CP/M 2 utility that allows a submit file to feed console
input into running programs.

page 8.4
ASM

8.4

UTILITY PROGRAMS

Utility name:
Purpose:

P&T CP/M 2
User's Manual

ASM
Translation of 8080 assembly language source files into
object code represented in HEX format.
General Description

ASM is a system utility which reads 8080 assembly language source files and
translates them into 8080 machine language instructions. The resulting machine code
is stored in Intel hex format in a disk file. The HEX file may be read by other
programs (e.g. DDT) or may be converted to an executable COM file by the LOAD
utility. ASM may also generate a PRN file, which contains the original source code
with the assembled machine code. The format of this source file is compatible with
the Intel 8080 assembler, except that no macros are implemented.
A complete discussion of assembly language programming is beyond the scope of this
section. Many books are available on the subject, a few of which are listed in the
references at the end of this section. Note that special steps must be taken to
assemble Z-80 code with ASM. See Appendix B of this manual for details.

Using ASM
There are two forms of command lines which may be used to execute ASM, as
shown below in Figure 8.1. Both specify the primary name of the file containing
the source code to be assembled. ASM requires that the extension of this file name
be "ASM".
1:
2:
3:
Figure 8.1

A>ASM filename
A>ASM fi lename.shp
Command lines for executing ASM

When ASM is executed by the command line shown on Line 8.1-1, it assumes that the
source code file will be found on the current default disk drive and that the HEX
and PRN files are to be saved on that same drive. The second command line,
shown on Line 8.1-3, allows you to specify the drives to be accessed for each of
the three files involved (source, HEX, and PRN). The first letter following the
period (which replaces the "s") indicates the drive from which to get the source
file, the second letter (which replaces the Ithlt) indicates the drive on which to save
the HEX output file, and the third letter (which replaces the "p") indicates the
drive on which to save the PRN output file. The valid drive indicators for each
file are given in Figure 8.2.

page 8.5
ASM

UTILITY PROGRAMS

P&T CP/M 2

User's Manual

position
s
h

valid letters
A, B,
, P

... ,

P

Indicates logical drive on which to save the
HEX file.
Indicates that no HEX file Is to be generated.

A, B, ••• , P

Indicates logical drive on which to save the
PRN file.
Sends the PRN file to the console.
Indicates that no PRN file Is to be generated.

A, B,
or

p

mean I n9
Indicates logical drive on which the source
file resides.

...

Z

or X
or Z

Figure 8.2 Valid drive designations for ASM command line

Figure 8.3 shows a short assembly language program which merely prints a message
to the system console, waits for  to be typed, and then returns to the
system.
~

Program to walt for operator Input

loop:

msg:

org

100h

; locate at beginning of TPA

Ixl
mvl
call

d,msg
c,9
5

;send message to console

mvl
call
cpl
Jnz

c,l
5
Odh
loop

;get char from console

Jmp

0

;return to system on 

db
end

'Press  to contlnue.$'

Figure 8.3

;check for 
;Ioop If not 

~

Source code of sample assembler program

Figure 8.4 shows the console dialog which will assemble (Line
and execute (Line 8.4-15) the sample program shown in Figure
source code file is named "ASMDEMO.A.SM" and is located on
note that the HEX and PRN files are routed to logical drive
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:

D

8.4-1), load (Line 8.4-7),

Note that the
logical drive C. Also
C.
8.3.

A>ASM C:ASMDEMO.CCC
CP/M ASSEMBLER - VER 2.0
0130
OOOH USE FACTOR
END OF ASSEMBLY
A>LOAD C:ASMDEMO
FIRST ADDRESS 0100
LAST ADDRESS 012F
BYTES READ
0030
RECORDS WRITTEN 01
A>C:ASMDEMO
Press  to contlnue.
A>

Figure 8.4 Console dialog to assemble, load, and execute sample program

page 8.6
ASM

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Line 8.4-2 shows ASM's sign-on message, and Line 8.4-3 gives the last address in
memory that was used by the assembled program. In this example, the last address
used is 130h. Line 8.H indicates the amount of symbol table space during the
assembly. The larger the number specified, the more symbol table space that was
used. Since this example uses a very short program, the use factor is shown as o.
When it is finished, ASM displays the message shown on Line 8.4-5 just before
returning to the operating system.
Figure 8.5 shows the PRN file that resulted from the assembly shown in Figure 8.4.
Program to walt for operator Input
0100

org

100h

; locate at beginning of TPA

0100 111501
0103 OE09
0105 CD0500

Ixl
mvl
call

d,msg
c,9
5

;send message to console

mvl
call
cpl
jnz

c, 1
5
Odh
loop

;get char from console

0112 C30000

jmp

0

;return to system on 

01155072657373msg:
0130

db
end

'Press  to contlnue.$'

0108 OEOl
010A CD0500
010D .FEOD
010F C20801

\...

loop:

;check for 
;Ioop If not 

Figure 8.5 PRN file generated by the assembly of the sample program

Possible Error Messages
If an error in the source code is discovered in the course of assembly, the source
line containing the error is displayed .on the system console. A single character
error indicator is shown at the .leftmost end of the displayed line and is also
inserted at the leftmost end of the line in the PRN file (if one is generated). The
assembler will continue execution until the assembly is finished, even when errors
have been reported. In many instances, some of the error messages will be
superfluous. A single error in the source code can cause a large number of errors
to be reported.
Figure 8.6 shows the error indicators used by ASM.

P&T CP/M 2
User's Manual

Indicator

o

UTILITY PROGRAMS

page 8.7
ASM

meaning
Data error: An element In a data statement does not fit In
the specified data area. This typically Is caused by
specifying a 16 bit quantity In a DB statement.

E

Expression error: An expression has been found that does not
conform to the syntax which Is accepted by ASM and hence
cannot be evaluated.

L

Label error: A label Is used In an Illegal context or a
duplicate label exists.

N

Not Implemented: Some features (such as macros) are recognized
by ASM as valid assembly language statements but are not
implemented by the current version of the assembler.

o

Overflow: An expression has been found that Is too complex
(has too many pending operators) to be evaluated.

P

Phase error: A label does not have the same value on two
successive passes through the source code.

R

Register error: A register has been specified that Is not
consistent with the machine Instruction used. For example,
specifying register C In a PUSH instruction~

v

Value error: An operand has been found which is Inconsistent
with Its use.
Figure 8.6 ASM error indicators

Several conditions related to the operating system environment may prevent
continuation of the assembly. If any of these conditions is encountered, one of the
following messages is displayed on the console and the assembly is aborted.
NO SOURCE PILE PRESENT
This message indicates that ASM could not find the source file on the specified
source drive. This is typically caused by one of three errors:
L The file does not exist.
2. You have specified the wrong source drive.
3. The file does exist but does not have the extension "ASM".
NO DIRECTORY SPACE
The directory on the drive(s) specified for the "HEX" and "PRN" files is full,
making it impossible to create the output files.
SOURCE PILE NAME ERROR
The source file name you have given contains invalid characters.
characters are not allowed.

Note: Wildcard

SOURCE PILE READ ERROR
An error was encountered while reading the source file.
OUTPUT PILE WRITE ERROR
An error was encountered while writing to one of the output files.
results from a disk that has become full.

Typically, it

CANNOT CLOSE PILE
One of the output files could not be successfully closed.

Some reference material for assembly language programming is listed in Figure 8.7.

page 8.8
ASM

UTILITY PROGRAMS

CP/M Assembler (ASM) User's Guide, Digital Research
MCS-80/85 Fami Iy User's Manual, Intel Corp.
8080/8085 Reference Card, Intel Corp.
8080/8085 Assembly Language Programming Manual, Intel Corp.
ZI log Z80-CPU Programming Reference Card, ZI log Corp.
Figure 8.7 References for assembly language programming

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

8.5

Utility name:
Purpose:

page 8.9
ASSIGN

ASSIGN
To change the logical to physical 1/0 device
assignments. (See Section 5.7 for an introduction to
device assignments.)
General Description

ASSIGN provides a quick and easy way to change the current logical to physical I/O
device assignments. It has both an interactive mode and a command line mode. In
the interactive mode, ASSIGN shows a visual representation of the current device
assignments and allows you to change them as you wish. The command line mode
provides a quick way of setting the device assignments which can be used directly
from the keyboard, from a submit file, or from a menu program.
Note that ASSIGN allows you to change the physical device assignment for the
CON: logical device. This device is usually set to the CRT which is the built-in
display and standard keyboard. If you change this assignment, some other' physical
device (a serial port, for example) will become the system console. If you have
nothing connected to that device or if that device is connected to an output only
device (like a printer) you will lose control of the system and need to reload the
system to regain controL If you switch the CON: device to a serial port which has
a terminal connected to it, that terminal will become the system console.
The function performed by ASSIGN is also performed by part of SETUP. If all you
want to do is change the I/O assignment, using ASSIGN is easier and quicker than
using SETUP. Note that the changes made to the I/O assignment by ASSIGN are
made in the running system only. They will not remain in effect when the system
is reloaded (RESET). If you want to make them permanent, you must use the FR
option of MENU after running ASSIGN.

Using ASSIGN - Interactive Mode
The command line to execute ASSIGN in the interactive mode is shown in Figure 8.8.
A>ASSIGN
Figure 8.8

Command Line to Execute ASSIGN

When ASSIGN begins execution, it will present a display like the one shown in
Figure 8.9. Lines 8.9-8 through 8.9-11 will show the current I/O assignments for each
of the logical devices CON:, LST:, PUN:, and RDR: by highlighting in reverse video
the physical device assigned to each one. The cursor will be positioned at SIOA in
Line 8.9-8. Line 8.9-15 gives a brief summary of what you can do. (Note: an
average user will never need to bother with the PUN: and RDR: logical devices.)

page 8.10
ASSIGN

UTILITY PROGRAMS

1:

2:
3:
4:
5:
6:
7:
8:
9:

10:
11:

12:
13:
14:
15:

=======

ASSIGN

P&T CP/M 2
User's Manual

=======

I/O Assignment Uti lity - ver 2.3
Copyright 1980,83 Pickles & Trout
CON
LST
PUN
RDR

SIOA
SIOA
SIOA
SIOA

CRT

CRT
UPUN1
URDR1

CENTRON
CENTRON
UPUN2
URDR2

SI08
SI08
SI08
SI08

Arrows move cursor I  - set field I  - accept I  - quit
Figure 8.9

Interactive Mode of ASSIGN

You may move the cursor to any of the physical devices by using the arrow keys on
the keyboard. To make an assignment, move the cursor to the desired physical
device on the line for the logical device and press . The physical device
name will then be highlighted and any othe.r name on that line that had previously
been highlighted reverts to normal characters.
Note that the actual assignment does not take place immediately. The assignment
will take effect only after you press  to accept the assignments. Upon your
pressing  the assignments shown in the display will take effect and you will be
returned to the command level of the system. The assignments will be made in the
system running in memory only; they will not be in effect after the system is
reloaded (RESET). If you decide that you don't want to make any changes in the
assignments, press the  key to return to the command level of the system
with no action being taken.
The meanings of the various physical device names are shown in Figure 8.10.

for the CON: (system console) logical device:
SIOA
Use serial port A for Input and output.
CRT
Use system keyboard for Input and system display for output.
CENTRON Use system keyboard for Input and paral lei printer port for output.
SI08
Use serial port B for Input and output.
for the LST: (system printer) logical device:
SIOA
Use serial port A for output.
CRT
Use system display for output.
CENTRON Use parallel printer port for output.
SI08
Use serial port 8 for output.
for the PUN: (punch) logical device:
SIOA
Use serial port A for output.
UPUN1
User supplied output routine.
UPUN2
User supplied output routine.
SI08
Use serial port 8 for output.
for the RDR: (reader) logical device:
SIOA
Use serial port A for Input.
URDR1
User supp II ed Input rout I nee
URDR2
User supplied Input routine.
SI08
Use serial port 8 for Input.
Figure 8.10 Meanings of Physical Device Names

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.11
ASSIGN

Using ASSIGN· Command Line Mode
The command line mode of ASSIGN allows you to set one or more I/O assignments
by typing a single command line. The general form of the command line is shown
in Figure 8.1L There may be up to four assignments specified on the command line.
The assignments take effect immediately and you are returned to the command level
of the system.

,.
ASSIGN (asslgnment-l) (asslgnment-21 (asslgnment-31 (ass I gn men t-4 I
(required)
(optional)
(optional)
(optional)
each' assignment has the form:
Logical Device Name = Physical Device Name
~

Assignments must be separated from one another by at least one space.
Figure 8.11

Form of Command Line Mode for ASSIGN

For ease of typing, ASSIGN accepts a short synonym for each logical device name
in the command line mode. These synonyms are shown in Figure 8.12.
logical device name
CON:
LST:
RDR:
PUN:
Figure 8.12

synonym
C:
L:
R:
P:

Synonyms Accepted by ASSIGN for Logical Device Names

Several synonyms are recognized for each of the physical device names. You may
use the complete name or any of the synonyms listed in Figure 8.13. See Figure 8.10
for the meaning of each physical device name.
physical device name
SIOA
SlOB
CRT

CENTRON
UPUNl
UPUN2
URDRl
URDR2
Figure 8.13

synonyms
SA, A
SB, B
C

CENT, CE, E
UPl
UP2
URl
UR2

Synonyms Accepted by ASSIGN for Physical Device Names

Examples of using the command line mode of ASSIGN are:
ASSIGN LST:=SIOA

Assigns serial port A to be the system printer.
ASSIGN RDB:=SIOB

Assigns serial port B to the reader device.
ASSIGN B:=SA P:=SB L:=CB

Assigns serial port A to the reader device, serial port B to the punch device,
and the parallel printer port to the system printer.

page 8.12

UTILITY PROGRAMS

P&T CP/M 2

User's Manual

ASSIGN

Possible Error Messages
Invalid Assignment.
This message is given when an assignment is given on the command line. that
cannot be deciphered. You must use only the logical and physical device names
and their valid synonyms as previously described. Note that all valid assignments
appearing on the command line before the invalid assignment will be made.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

8.6

page 8.13
CLEAN

Utility name: CLEAN
Purpose: To load the heads on a floppy drive for cleaning with a
cleaning diskette.
General Description

The CLEAN utility program is designed to provide an easy way to clean the
read/write heads on floppy diskette drives. It will load the heads on the specified
drive and move them around in a random pattern for about 20 seconds. After the
random movements cease, the heads will be unloaded in about 2.5 seconds.
Note that for thinline drives (like those used on the Models 12 and 16), the heads
are loaded as soon as the diskette is inserted and the bar on the front of the drive
rotated (ie. the drive is closed). Since the diskette will remain turning for about 20
seconds after the light on the front of the drive goes out, you should remove the
cleaning diskette as soon as the message instructing you to do so appears on the
console.

Using CLEAN
The CLEAN program has only an interactive mode. Figure 8.14 shows a sample
dialog from using CLEAN.
1:

A>CLEAN

2:
3:

Pickles & Trout Head Cleaning Utility Ver 2.xx
(c) copyright 1982,83 Pickles &Trout
all rights reserved

4:

5:
6:
7:

(Hit  at any time to quit)

8:

9:
10:
11:

12:
13:

14:
15:
16:
17:

Enter drive to clean (0-3 or A-P) : l
Mount the cleaning disk on drive
xx

B

and press  when ready: 

Remove cleaning diskette now, press  : 
A>
Figure 8.14

Example of Using CLEAN

On Line 8.14-1 is the command line which executes the CLEAN program. After
displaying its initial messages (Lines 8.14-3 to 8.14-7) CLEAN asks you for the drive
to clean (Line 8.14-10). Note that you may enter either the physical floppy drive
number or the logical drive letter by which it is referred to with P&T CP/M 2. If
you specify a drive that is not defined for the system, an error message will be
displayed and you will be asked again for the drive to clean.
After entering a valid drive to clean, you will be asked to mount the cleaning
diskette and press  (Line 8.14-12). At this time you should prepare the
cleaning diskette, mount it on the drive and press the  key. Note that on
Line 8.14-12 the drive is always referred to by the logical drive letter. If you have

page 8.14
CLEAN

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

specified a physical drive number, CLEAN will determine the logical drive letter
assigned to it and use that letter for this prompt line.
After you press  on Line 8.14-12, CLEAN will load the heads on the selected
drive and begin to move them in a random pattern. On Line 8.14-13, CLEAN shows
a running time for the cleaning as it proceeds. After 20 seconds, CLEAN will flash
the message shown on Line 8.14-15 indicating that the cleaning operation is complete.
At this time you should remove the diskette from the drive and press .
If a system diskette is required for a warm boot, CLEAN will prompt you to mount

one on the system drive before returning to the system. If you see this prompt,
insure that a system diskette is mounted and press . If a system diskette is
not required for the warm boot, CLEAN will return immediately ,to the operating
system after you press  on Line 8.14-15.

Possible Error Messages
Please respond with A-P or 0-3 only.
This message is· displayed. if.. you ... enter an. illegal character when specifying the
drive to clean. You will then be prompted again for the drive. Use only
characters in the specified range in response to this question.
That drive is not on the system or is a hard disk drive.
This message indicates that you have specified a drive that is not defined for
the system or is a hard disk drive. CLEAN works only with floppy diskette
drives. Double check which drive you want to clean and enter its. physical drive
number (0 -3) or its logical drive letter.

»»

Home error.
This message is given if the CLEAN program encountered an error while
attempting to restore the read/write head to the home position. This can be
caused by too fast a head stepping rate or, in some cases, not closing the drive
door after the· cleaning diskette is mounted.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

8.7

page 8.15
CLONE

Utility name: CLONE
Purpose: To make an image copy of one diskette to another.
General Description

CLONE makes image copies from one diskette to another. An image copy results in
two identical diskettes. CLONE is the fastest way with P&T CP/M 2 to make a
backup CLONE
1D/2D/2S Disk Clone Utility - Ver 1.xxx
(C) copyright 1982,83 Pickles &Trout
al I rights reserved
Caution:
This routine will destroy any & all existing files on the destination disk.
(except If the "System Tracks Only" option Is selected)

12:
13:
14:
15:

Press  at any time to quit.

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:

Enter source drive (A-P or 0-3) : B
NOTE: Logical drive B Is the same as physical drive (1).
Enter destination drive (A-P or 0-3) : 2
NOTE: Logical drive C: Is the same as physical drive (2).
Which
1.
2.
3.
Enter

tracks would you like to copy?
Data tracks only
System tracks only
Data and system tracks
your choice by number : 3

(yIn)

Y

Do you want copying to stop If an empty track Is found? (yIn)

N

Do you want each track verified as It's copied?

Mount source disk on drive B:
Mount destination disk on drive C:
Press  when ready : 
Copying from drive B: to drive C: at Double Density.
++++++++•••
Data and System tracks copied.

41:

42:
43:
44:
45:
46:
47:
48:
49:
50:
51:

52:

Caution:
This routine will destroy any & all existing files on the destination disk.
(except If the "System Tracks Only" option Is selected)
Press  at any time to quit.
Enter source drive (A-P or 0-3)

or (R) to repeat: 

A>
Figure 8.16 Console Dialog for an Example of Using CLONE

On Line 8.16-14 CLONE reminds you that you may abort the program at any time
(even in the middle of copying) by pressing the  key. Note that if you do
press  during the copy process, the copy will not be completed and the state
of the destination diskette will, in general, be unknown. You may CLONE to the
diskette again or erase any files that show up in the directory and use it as an
empty diskette. Attempting to use a partially CLONE'd diskette may cause
unpredictable results.
On Line 8.16-16 CLONE asks you for the source drive. This is the drive on which
you will mount the diskette to be copied. Note that you can enter the drive
specification as either a physical drive number or a logical drive letter. The
physical floppy drive numbers are always 0 - 3 but in a hard disk system the logical
drive letters assigned to the physical drive may change depending on how you

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.17
CLONE

configure the system. You may choose the method of specifying the drive which is
most comfortable for you. In this example, logical drive B is selected for the
source drive. On Line 8.16-17 CLONE shows you that on this system logical drive B
is equivalent to physical drive L
A similar query is made for the destination drive on 8.16-19. The destination drive
is the drive on which you will mount the diskette to which the copy will be made.
In this example the destination drive is specified as physical drive 2. On Line
8.16-20, CLONE shows that logical drive C corresponds to physical drive 2After you have specified the source and destination drives, CLONE will ask you
what sort of copy you would like as shown on Lines 8.16-23 to 8.16-27. Copying the
data tracks only (option 1) will copy all files to the destination diskette but will
leave the system area of the destination diskette unaffected. This can be useful
when you want to copy only the data area from your system diskette to a backup
diskette. Many people do not keep the system on backup diskettes since it then
becomes one more system diskette to keep track of. Remember you are responsible
under the P&T CP/M 2 license to know the whereabouts of ALL system diskettes.
Copying the system tracks only (option 2) is useful when you need to make a double
density diskette into a bootable system diskette. This operation will not affect the
data stored on the destination diskette in any way. Copying all tracks (option 3)
will make a complete image copy of the source diskette on the destination diskette.
The copy will include the operating system if it was present on the source diskette.
This operation is one way to make additional working system diskettes.
In this example, option 3 is chosen to copy all tracks on the diskette.
After specifying the type of copy operation, CLONE asks you if you want the copy
verified as it is made (Line 8.16-29). If you respond with an affirmative answer,
each track will be read back from the destination diskette and checked for errors.
A negative response will omit the verification. When verification is selected, the
copy operation will take about twice as long as when verification is not performed.
In this· example verification is selected.
Next CLONE asks you is you want to stop the copy operation when the first empty
track is found (Line 8.16-31). CLONE considers a track to be empty if all of the
data areas on that track contain E5h bytes (a newly formatted diskette has E5h in
all its data areas). This option is useful in certain copy operations since, by
stopping when it encounters an empty track, it can take noticeably less time than
copying the entire diskette. You might want to use this feature if you are making
copies of programs you have written for distribution. If you copy all the program
files onto a newly formatted diskette with a file copy program such as PIP, they
will fill the data area of the diskette sequentially. If you then use this diskette as
your duplication master and tell CLONE to stop when it finds an empty track, you
will minimize the duplication time.
You should not use this option, however, when you are not certain that all data on
the diskette is at the beginning of the data area. It is possible, in rare
circumstances, for data to be recorded on the diskette in such a manner that a
track is skipped. In this case, if you tell CLONE to stop copying when an empty
track is encountered, it will not copy all of the data on the diskette.
After you have entered all the necessary information, CLONE will ask you to mount
the source and destination diskettes as shown on Lines 8.16-33 to 8.16-35. At this
point you should mount the diskettes and press .

page 8.18
CLONE

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

After you press , CLONE will make a variety of checks on the diskettes to
insure that a copy can be made. It checks that both diskettes are of the same
density since it is not possible to make an image copy of one density diskette onto
a different density diskette. Note: double sided diskettes are considered to be of a
different density than single sided diskettes.
CLONE also checks whether files exist on the destination diskette. If there are
files on the destination diskette, CLONE reports the fact and asks you to verify
that you want to continue with the copy process. This helps to protect you if you
forget to mount the diskettes at the proper time. In addition CLONE checks for
files on the source diskette. If no files are found on the source diskette, CLONE
informs you of the fact and asks· you to confirm that you want to continue with
the copy operation. Mounting the diskettes on the wrong drives or mis-specifying
the source and destination drives are frequent causes of these warnings. If you get
either warning, you should check to insure that you have not made a mistake.
Remember that CLONH'ing a newly formatted diskette onto your source
diskette will irrevocably destroy the information recorded on the source
diskette!!
Once CLONE has made its initial tests, it displays a message to indicate what it is
doing (Line 8.16-38) and begins the copy operation. As each track is read from the
source diskette, CLONE displays a period ( • ) on the console display. As the
tracks are written to the destination diskette, the periods are replaced by plus
signs ( +). Line 8.16-39 shows the copy operation after 11 tracks have been read
and 8 tracks have been written. If an entire diskette is being CLONE'd, the plus
signs will extend across the console display by the time the copy is completed.
When the copy is finally complete, CLONE displays a message indicating what has
been accomplished (Line 8.16-40). CLONE then starts over again as shown in Lines
8.16-43 to 8.16-50. Note that on Line 8.16-50 a new option is available to you. By
entering "R" instead of a drive designation, you may repeat exactly the same copy
operation you just completed. This is useful when making multiple copies in a
production environment. In this example the  key is pressed to return to the
operating system. In this example, the system does not require a system diskette
for a warm boot so CLONE returns immediately to the operating system after the
 key is pressed. If a system diskette were required to accomplish the warm
boot, a prompt to mount a system diskette on the system drive would have been
given before returning to the system command leveL
You may specify the same drive for both the source and destination drives. This
will cause CLONE to issue prompts to mount either the source or destination
diskettes as needed for the copy operation. An example of a prompt for mounting
the source diskette is given in Figure 8.17. Specifying the same drive for source
and destination should be avoided unless there is no other choice (in a single floppy
drive system, for example) since it will require quite a bit of disk swapping. The
periods and pluses are not displayed in the single drive mode of CLONE since they
tend to get lost in the swapping messages.

Mount source disk on drive X: and press  when ready:
Figure 8.17 CLONE Message to Mount Source Diskette

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.19
CLONE

Using CLONE - Command Line Mode
In the command line mode of CLONE, you must specify all of the information
regarding the copy operation you want performed on the command line that you use
to execute CLONE. Note that in the command line mode, the copying normally
begins automatically as soon as CLONE begins execution (except on a single floppy
drive system). You should insure that the source and destination diskettes are
mounted before executing CLONE in the command line mode. (See the PMOUNT
instruction below for an exception to this.)
The general form of the CLONE command line is shown in Figure 8.18.
CLONE (source and dest Inat Ion dr I ves) (output dest I nat Ions I (opt Ions I
(required)
(optional)
(optional)
~

All Instructions on the conmand line must be separated from one another
by a conma and/or one or more spaces.
Figure 8.18 General Form of CLONE Conmand Line

You must specify the source and destination drives when using the command line
option of CLONE. You may use either physical drive numbers or logical drive
letters when specifying the drives. The source drive is specified using an
expression like those shown in Figure 8.19. Note that the drive designation may
come before or after the equal sign.
SOURCE=(drlvel
(drlvel=SOURCE

SRC= ( drive I
(drlvel=SRC

(drivel should be replaced by a logical drive letter
or a physical drive number.
Figure 8.19

Specifying the Source Drive

In a similar manner, the destination drive is specified as shown in Figure 8.20.
DESTINATION=(drlvel
(drlvel=DESTINATION

DEST=(drivel
(drlvel=DEST

DST=(drlvel
(drivel=DST

(drivel should be replaced by a logical drive letter
or a physical drive number.
Figure 8.20 Specifying the Destination Drive

There are also several short forms for specifying both the source and destination
drives in a single statement. Examples of these short forms are given in Figure
8.2L
A>B
B TO C
B D,ALL, V
Copy all tracks from the diskette on drive C to the diskette on drive D. The
diskettes are assumed to be mounted already and the copy will begin
immediately. Messages are sent to the console, verification is performed, and
all tracks are copied regardless of whether they are empty or not. CLONE
will not prompt for a system disk after the copy.
CLONE C:=B: V T
Copy data tracks from the diskette on drive B to the diskette on drive C.
The diskettes are assumed to be mounted already and the c'"'py will begin
immediately. Messages are sent to the console, verification is done, and the
copy will stop when the first empty track is encountered. CLONE will not
prompt for a system disk after the copy.
CLONE C>B,/CON:,/LST:
Copy data tracks from the diskette on drive C to the diskette on drive B.
The diskettes are assumed to be mounted already and the copy will begin
immediately. Messages are sent to the console and the system printer, no

page 8.22
CLONE

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

verification is done, and all data tracks are copied regardless of whether they
are empty or not. CLONE will not prompt for a system disk after the copy.
CLONE A>C,PBOTH,/B:LOG, V
Copy data tracks from the diskette on drive A to the diskette on drive C.
CLONE will prompt for the diskettes to be mounted before beginning the copy.
Messages are sent to a file named LOG on drive B, verification is done, and
all data tracks are copied regardless of whether they are empty or not.
CLONE will prompt for a system disk after the copy if one is required for a
warm boot.
CLONE 1=2,V,T ,/LOG+,/CON:,PSYS
Copy data tracks from the diskette on physical drive 2 to the diskette on
physical drive L The diskettes are assumed to be mounted already and the
copy will begin immediately. Messages are sent to the console and appended
to a file named LOG on the current default drive, verification is done, and
the copy is ended when the first empty track is encountered. CLONE will
prompt for a system disk after the copy.

Possible Warning Messages
Source disk on drive X: has no files.
Do you want to copy from it? (yIn) :
When CLONE checked the source diskette it found that there were no files on
it. This could indicate that you mounted the wrong diskette or specified the
wrong source drive. CLONE issues this message and query to inform you of the
situation and allow you to abort the operation if you have made a mistake. You
should respond affirmatively if you want to continue with the copy and
negatively if you want to stop it.
Destination disk on drive X: is not empty.
Do you want to copy to it? (y In) :
When CLONE checked the destination diskette it found that there was some
information recorded on it. This could indicate that you mounted the wrong
diskette or specified the wrong source drive. Of course this message will be
given any time you CLONE to a diskette that has been used. If you are reusing
a diskette, you will probably want to continue with the copy even if you do get
this message. CLONE issues this message and query to inform you of the
situation and allow you to abort the operation if you have made a mistake. You
should respond affirmatively if you want to continue with the copy and
negatively if you want to stop it.

Possible Error Messages
Please answer with 1, 2 or 3 :
This message is displayed if you did not enter one of the three valid numbers
when specifying what tracks on the disk you want copied. You should re-enter
your choice using one of the indicated numbers.
Non-modular system, not compatible with this program.
You are trying to run this program with a previous version of P&T CP/M 2. The
program makes use of features found only in the modular version of P&T CP/M 2
and hence cannot run on this system.

P&T CP/M 2
User's Manual

»»

UTILITY PROGRAMS

page 8.23
CLONE

Error: Not enough memory to run CLONE
This message is displayed if there is not ,enough memory available for CLONE to
run. It is very unlikely that you will encounter this error. If you do, you
should check the amount of memory reserved above the operating system (MENU
option LA). Reducing this reserved memory should allow CLONE to run.

Copy aborted by user.
This message is displayed if you decide to abort the copy before it starts
(perhaps in response to one of the warning messages).
Verify error on Track XXX
If you requested verification of the copy and you are copying a single sided
diskette, this message is displayed if CLONE finds a discrepancy when it reads
back the destination diskette. This indicated a faulty copy; you should make
another copy on another diskette or reformat the destination diskette and try
again. The "XXX" will be replaced by the track number on which the error was
encountered.
Verify error on Cylinder XXX, Side Y
This message has the same meaning as the previous one except that it is
displayed if a double sided diskette is being copied. The "XXX" will be replaced
by the cylinder number and "Y" will be replaced by the side number on which
the error was encountered.
Read error on Track XXX, Sector YYY
When copying a single sided diskette, an error occurred while reading a diskette.
This usually occurs on the source diskette. It can also occur on the destination
diskette when verification is performed. "XXX" and "YYY" indicate the track
and sector, respectively, at which the error occurred. If a read error occurs on
the source diskette, the sector at which the error occurred may not be copied
properly. In some cases mounting the diskette on a different drive may alleviate
the problem. If a read error occurs on the destination diskette, you should make
another copy to another diskette or reformat the diskette and try again.
Read error on Cylinder xxx, Side y, Sector zzz
This message has the same meaning as the previous one except that it is
displayed if a double sided diskette is being copied. "xxx", "y", and "zzz"
indicate the cylinder, side, and sector, respectively, at which the error occurred.
Write error on Track xxx, Sector yyy
An error occurred while writing to the destination diskette during a copy of a
single sided diskette. If this error occurs, the copy probably will not be valid.
If you requested verification, a verify error will also be reported on this sector.
You should try the copy operation again with another destination diskette or
reformat the destination diskette and try it again. The "xxx" and "yyy" indicate
the track and sector, respectively, at which the error occurred.
Write error on Cylinder xxx, Side y, Sector zzz
This message has the same meaning as the previous one except that it is
displayed if a double sided diskette is being copied. "xxx", "y", and "zzz"
indicate the cylinder, side, and sector, respectively, at which the error occurred.
Bad drive name, please re-enter (A-P or 0-3) :
The logical drive letter you entered was not in the range A to P. Respecify the
drive using one of the valid letters or a physical drive number in the range 0 to
3.

page 8.24
CLONE

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Bad drive number, please re-enter (A-P or 0-3) :
The physical drive number you entered was not in the range 0 to 3. Respecify
the drive using one of the valid numbers or a logical drive letter in the range A
to P.
That drive is not on the system, please re-specify :
The drive you have specified is not available on the system. Re-enter the drive
specificati8n indicating one of the drives that is available.
That drive is a hard disk, please re-specify :
The drive you have specified is assigned to a hard disk. CLONE does not work
with hard disk drives. Re-enter the specification giving a floppy drive. Note
that if you use a physical drive number, it will always refer to a floppy drive.
Please answer with 'yn for yes or 'N' for no :
The response you gave to a yes/no message was not acceptable. Enter your
response again using one of the characters indicated. Note that both upper and
lower case are acceptable.
Found empty track - Copy terminated.
If you instruct CLONE to stop after the first empty track, and the first track it
encounters is empty, this message will be given. In this case no copying was
done.
Copy aborted with .
Last track written = zzz
This message is displayed if you press the  key during a copy. The "zzz"
will be replaced by the number of the last track that was copied before the
operation was aborted. Note that a partially copied diskette may not be usable.
Disks are different formats - cannot copy.
CLONE has found that the diskettes mounted on the source and destination
drives are not of the same format. Since CLONE makes an image copy, it
cannot copy from one format to another. Note that double sided diskettes are
considered to be a different format than single sided even though they may both
be double density. If you wish to copy from one format to another, you must
use a file copy program like PIP or FASTCOPY.
Unable to determine density of disk on drive X:
CLONE could not find the density of the disk on the drive indicated. This may
result from using an unformatted diskette or a diskette with an unsupported
format. Check to see that the diskette is properly formatted The "X" will be
replaced by the logical drive letter of the drive on which the problem occurred.
Disk x: is write protected - cannot copy to it.
CLONE found that the destination diskette is write protected. Since CLONE
must write to the destination diskette, the copy operation cannot proceed. This
may occur if you mount the diskettes on the wrong drives or specify the wrong
drive for source and destination. If the diskettes are mounted on the correct
drives, you must write enable the destination diskette before the copy can be
made. "XU is replaced by the letter of the logical drive on which the protected
diskette was found.
Drive x: is not ready.
When CLONE attempted to access a diskette, it was found not to be ready.
This typically occurs when the diskette is not mounted or the drive door is not
closed.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.25
CLONE

Seek error.
An error occurred when CLONE was moving a read/write head. This may be
caused by an improper drive step rate (see the system MENU, Chapter 4, or the
SETMISC program, Section 8.25 for setting the step rate). It may also be caused
by an unformatted or improperly formatted diskette.
Home error.
An error occurred when CLONE was restoring a read/write head to the home
position. This may be caused by an improper drive step rate (see the system
MENU, Chapter 4, or the SETMISC program, Section 8.25 for setting the step
rate). It may also be caused by an unformatted or improperly formatted
diskette.

»»

Error: Logged-on drive same as destination drive
(Command Line Mode) Since CLONE normally begins the copy immediately when
used in the command line mode, it does not allow you to specify the current
default drive as the destination for the copy operation. It makes the assumption
that the current drive will have valid information on it. You should log on to
another drive before executing CLONE. Note that if you use the PMOUNT
instruction, CLONE will prompt for diskettes to be mounted and you will be able
to specify the current default drive as the destination.

»»

Error: Bad source drive name
(Command Line Mode) CLONE found a source logical drive letter that is not in
the range A to P on the command line.

»»

Error: Bad source drive number
(Command Line Mode) CLONE found a source physical drive number that is not
in the range 0 to 3 on the command line.

»»

Error: Source drive not on system
(Command Line Mode) CLONE found a valid source drive designation on the
command line but that drive is not available on the system.

»»

Error: Bad destination drive name
(Command Line Mode) CLONE found a destination logical drive letter that is
not in the range A to P on the command line.

»»

Error: Bad destination drive number
(Command Line Mode) CLONE found a destination physical drive number that is
not in the range 0 to 3 on the command line.

»»

Error: Destination drive not on system
(Command Line Mode) CLONE found a valid destination drive designation on the
command line but that drive is not available on the system.

»»

Error: Missing drive name
(Command Line Mode) CLONE could not find the designations for one or both of
the source or destination drives.

»»

Error: Source drive is a hard disk drive
(Command Line Mode) The drive you have specified for the source drive is
assigned to a hard disk. CLONE only works with floppy drives. Check the
command line to make sure you entered the drive correctly.

page 8.26
CLONE

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

»»

Error: Destination drive is a hard disk drive
(Command Line Mode) The drive you have specified for the destination drive is
assigned to a hard disk. CLONE only works with floppy drives. Check the
command line to make sure you entered the drive correctly.

»»

Error: Bad output designation
(Command Line Mode) CLONE has detected something wrong with one of the
outputs you have specified for the console output. Check to see that you are
using the proper form of the output direction instruction.

»»

Error: Output-file drive same as source drive
(Command Line Mode) You cannot specify the (optional) file for console output
to be on the same drive that is used for the source of the copy operation.

»»

Error: Output-file drive same as destination drive
(Command Line Mode) You cannot specify the (optional) file for console output
to be on the same drive that is used for the destination of the copy operation.

»»

Error: Output-file cannot be a floppy on a single-floppy system.
(Command Line Mode) If you have a single floppy system, you will be required
to swap the source and destination diskettes on the floppy drive as CLONE
makes the copy. In this case it is unreasonable to direct console output to a
disk file on yet a third floppy. If you have a hard disk on your system, you
may direct console output to a disk file on it otherwise you cannot direct
console output to a disk file.

»»

Error: Output-file drive not on system
(Command Line Mode) The disk drive you specified for the output disk file does
not exist on the system. Check the command line you used to insure that it is
correct.

»»

Error: Bad output-file name
(Command Line Mode) Something is wrong with the output file you specified to
receive console output. This can be caused by invalid characters in the file
name or by specifying a drive for the file with an invalid character.

P&T CP/M 2
User's Manual

8.8

UTILITY PROGRAMS

page 8.27
DATIME

Utility name: DATIME
Purpose: To display the current system date and time.
General Description

DATIME displays the current system date and time. The date is displayed as day of
week, month, day, and year. The time is displayed in hours, minutes and seconds in
a 24 hour format.
DATI ME allows you to direct its output to the system printer and/or a disk file.
This feature can be useful for time stamping printed output, dating backup copies
of files, etc.

Using DATIME
Figure 8.24 shows the general form of the command line to execute DATIME. It is
not necessary that any output destinations be specified on the command line. If
none are specified, the output defaults to the console.
DATIME (output destinations!
(optional>
~

All output destinations must be separated from one
another by a comma and/or one or more spaces.
Figure 8.24 General Form of DATIME Command Line

Figure 8.25 shows the console display which results from running DATIME with no
output destinations specified.
1:
2:
3:
4:
5:

A>DATIME
System date:
System time:

Thursday May 12, 1983
10:09:05

(5/12/83)

6:

7:
8:

A>
Figure 8.25

Example of Using DATIME

The output from DATIME may be directed to the system console, the system printer,
a disk file, or any combination of these. If you specify any destinations, they will
be the only destinations for the output. For example, if you specify /LST: to send
the output to the printer, no output will appear on the console. If you want output
on both the console and the printer you must specify both /LST: and ICON:. The
special destination /NUL: is provided in the (unlikely) event that you want no output
at all from the program. If /NUL: is specified with any other destinations, the
other destinations will supersede /NUL:. Figure 8.26 shows the various command line
instructions that can be used to direct the output of DATIME.

UTILITY PROGRAMS

page 8.28
DATIME

P&T CP/M 2
User's Manual

ICON:

sends output to the console (default if no output
instructions are given).

/LST:

sends output to system printer.

/(valld file name)

sends output to the specified fl Ie. If a file with
the same name already exists, It Is replaced.

/(valld fl Ie name)+

appends output to the specified file. If the file
does not already exist, It Is created. The + may
be preceded by a space or comma.

/NUL: or /NULL:

causes no output to be generated. If any other output
Instructions appear, they wll I supersede /NUL:.

Figure 8.26

Instructions to Direct Console Output

The following examples illustrate using DATI ME in the command mode:
DATIMH ILST:
Prints the system date and time on the system printer.
DATIMH ICON: IA:JOBLOG
Displays the system date and time on the system console and puts it in a file
named JOBLOG on drive A.
DATIMH IA:JOBLOG +
Appends the current system date and time onto the file named JOBLOG on
drive A.

Possible Error Messages

»»

Error: Bad output designation
This message indicates that an instruction you gave on the command line to
redirect the output from DATIME was not valid. This can be caused by ending
the command line with a slash (f).

P&T CP/M 2
User's Manual

8.9

UTILITY PROGRAMS

page 8.29
DDT

Utility name: DDT
Purpose: An interactive debugging tool for programs running
under CP/M 2.

General Description
DDT is an interactive debugging tool for testing and debugging programs written for
the CP/M 2 operating system. It is usually used on assembly language programs, but
it is also effective for programs compiled from a high level language. In addition,
it provides the ability to apply patches to programs and disk files.
DDT is written for the 8080 instruction set only. It can: be used with programs that
make use of Z-80 instructions, but certain precautions must be taken for successful
operation.
The discussion of DDT presented in this manual is of a summary nature.
further information see Chapter 4 of the CP/M Operating System Manual

For

Using DDT
Note: DDT displays and accepts numbers exclusively in hexadecimal representation.
All numbers shown in this section should be interpreted as hexadecimal unless
explicitly stated to be otherwise.
When DDT is executed, it moves itself into the high area of the transient program
area (TPA) just below the beginning of BDOS and overlaying the console command
processor (CCP). The 4 Kbytes of memory required by the core of DDT are
removed from the available TPA when the routine is loaded
Several commands (A, L, T, and X) require DDT to use additional memory from the
TPA. Following anyone of these, DDT will remove an additional 2.75 Kbytes from
the TPA. If a program is loaded which uses some of the additional space required
for these functions, A and L will not be available, and T and X will not display
instructions in mnemonic form.
The command line for the execution of DDT may contain a file name to be loaded
DDT will load any file specified into memory before prompting for commands. If
the file name has the extension HEX, DDT expects to find a standard Intel HEX
file and will attempt to read it as such. HEX files are loaded into memory at the
addresses specified within the file unless specific commands are given to DDT to
load it at another address. Files with other extensions are loaded starting at lOOh
unless DDT is instructed otherwise. Figure 8.27 shows the command line that
executes DDT and causes it to load SUBMIT.COM into memory.

UTILITY PROGRAMS

page 8.30
DDT

P&T CP/M 2
User's Manual

A>DDT SUBMIT.COM
DDT VERS 2.2
NEXT PC
0600 0100

Figure 8.27 Running DDT

After a file is loaded, DDT displays two numbers. NEXT is the address of the next
memory location following the loaded file, indicating where free memory begins. PC
is the current contents of the program counter. It is the memory location at which
execution will begin if the G command is given. PC will typically be set to 100h
when a file is loaded unless the file was a HEX file that specified an execution
address.
Figure 8.28 shows a summary of the DDT commands. Arguments for each command
are shown in parentheses ( ) if they are required and in brackets [ ] if they are
optionaL The first argument must immediately follow the command character. Any
additional arguments must be preceded and followed by one space or one comma.
For some commands, the first argument may be omitted; in this case, a comma must
immediately follow the command letter to indicate the omission.
command

function
Assemble assembly language Instructions entered from the
console and place In memory beginning at location x.·
Dlxl,lyl
Display contents of memory from xto y In hex and ASCII form.
F(x),(y),(z)
FI II memory from location x to location y with byte z.
Glxl,lyl,lzl
Begin execution at location x with breakpoints at y and z.
H(x),(y)
Display x+y and x-y as hexadecimal numbers.
I(fllename.ext) Initialize DDT to read the fl Ie specified.
llxl,lyl
list the Instructions from location x to location y In mnemonic
form.
M(x),(y),(z)
Move the block of memory beginning at location x and ending at
location y to memory beginning with location z.
Rlxl
Read a previously Initialized file Into memory with offset x.
S(x)
Examine and optionally alter the contents of memory starting at
location x.
T[xl
Trace execution for x Instructions.
Ulxl
Execute x Instructions and then return control to DDT.
Xlxl
Examine and optionally alter machine registers.
A~

Figure 8.28 DDT Command Summary

D[x],[y] command
The D command is used to display a section of memory on the console. The
memory is displayed in both hexadecimal and ASCn form with 16 bytes of memory
per line, as shown in Figure 8.29. The D command can have 0, 1, or 2 arguments.
If no arguments are given, 12 lines of 16 bytes are displayed starting at the current
display address. The display address is initialized to the contents of the program
counter but is adv~nced by the D command so that successive D commands will
display successive sections of memory. If a single argument is given with the D
command, it indicates the address in memory at which to begin the display. A
second argument (if present) indicates the last address in memory to be displayed.
If the first argument is omitted, memory is displayed from the current display
address up to the address given by the second argument.

UTILITY PROGRAMS

P&T CP/M 2

page 8.31
DDT

User's Manual

-D
0100 C3 DF
0110 20 31
0120 65 73
0130 20 4F
0140 27 53
0150 6E 74
0160 72 6F
0170 65 72
0180 61 6E
0190 61 6D
01AO 61 6C
01BO 72 61

01
39
65
6E
55
24
72
20
64
65
69
63

20
37
61
20
42
44
24
4F
20
74
64
74

63 6F 70
37 2C 20
72 63 68
4C 69 6E
27 20 46
69 73 69
43 6F 6D
76 65 72
54 6F6F
65 72 20
2043 6F
65 72 24

Figure 8.29

L[x],[y]

79
64
20
65
69
20
6D
66
20
45
6E
44

72
69
OD
20
6C
57
61
6C
4C
72
74
69

69
67
OA
24
65
72
6E
6F
6F
72
72
72

67
69
24
53
20
69
64
77
6E
6F
6F
65

68
74
45
55
50
74
20
24
67
72
6C
63

74
61
72
42
72
65
42
43
24
24
20
74

28
6C
72
4E
65
20
75
6F
50
49
43
6F

63
20
6F
6F
73
45
66
6D
61
6E
68
72

29
72
72
20
65
72
66
6D
72
76
61
79

••• copyright(c)
1977, digital r
esearch •• $Error
On Line $SUBNo
'SUB' File Prese
nt$Disk Write Er
ror$Command Buff
er Overflow$Comm
and Too Long$Par
ameter Error$lnv
alidControl Cha
racter$Directory

Example of Using the D Command of DDT

command

DDT can also display the contents of memory as 8080 instructions if the L command
is used. L can have 0, 1, or 2 arguments. If no arguments· are given, 12 lines of
8080 instructions will be displayed from memory starting from the current
list/assembly address. The list/assembly address is initially set equal to the program
counter but is modified by the L and A commands. If arguments are present, they
specify the beginning and ending addresses of memory to be listed as described for
the D command. Figure 8.30 shows an example of the L command. Note that the
first instruction listed is a jump which is followed by ASCn text. L is used again
to display the listing at the address to which the jump is made. If the first
argument is omitted, the contents of memory are listed from the current
list/assembly address up to the address given by the second argument.
-Ll00
0100 Jt.P
0103 11=
0104 MOV
0105 MOV
0106 MOV
0107 MOV
0108 MOV
0109 MOV
010A MOV
0109 MOV
OlOC MOV
-L1DF
01DF LXI
01E2 DAD
01E3 SHLD
01E6 LXI
01E9 SPHL
OlEA CALL
01ED CALL
01 FO CALL
01F3 CALL
01F6 RET
01F7 LXI
Figure 8.30

OlDF
20
H,E
L,A
M,B
A,C
M,D
L,C
H,A
L,B
M,H
H,OOOO
SP
05FO
H,OE93
02ec
038A
04FE
0587
H,05DD

Example of Using the L Command of DDT

A(x) command
The A command allows you to type in 8080 assembly language statements which will
be converted to machine code. They are placed in memory at the address specified
by the argument in the command. The ·address at which the code is stored is

•

UTILITY PROGRAMS

page 8.32
DDT

P&T CP/M 2

User's Manual

advanced after each instruction so that successive instructions can be entered.
(N ote: If the L command is used after the A command, the listing produced will
begin at the address where the next instruction would have been stored) To return
to the command mode of DDT, merely press  instead of entering an assembly
language instruction. Figure 8.31 gives an example of the A command.
-A800
0800 MVI A,12
0802 STA 810
0805 RST 7
0806 
Figure 8.31

Example of using the A command of DDT

S(x) command
The S command can be used to examine and modify single bytes in memory. It
displays the memory address given by the argument and the contents of memory at
that address. You may enter a new value to be stored at that location, or you may
advance to the next location by pressing . To return to the command mode
of DDT, type a period (.) followed by . In the example of the S command is
shown in Figure 8.32, the 18h at location 301h is replaced by mh.
A>S300
0300 C2 
0301 18~r>
0302 05 4F
0303 00 .
Figure 8.32

Example of using the S command of DDT

G[x],[y],[z] command
The G command causes execution of the instructions at certain locations in memory.
0, 1, 2, or 3 arguments are accepted If no arguments are specified, execution is
started at the address specified by the program counter. The first argument to the
G command specifies the address in memory at which to begin execution. The
.second and third arguments, if given, specify break point locations. Break points
are RST 7 instructions which are placed over the contents of memory at the address
given. If the address of a break point is encountered during execution, the RST 7
instruction will cause control to be returned to DDT. (Note: Break points can also
be inserted manually into the program; see Figure 8.31 for an example.)
If you wish, you may specify break points after omitting the first argument; this

will cause execution of the instructions at the address given by the program
counter. Break points or RST 7 instructions are the only means of returning control
to DDT once the G command is given. When DDT does regain control, it displays
an asterisk followed by the address at which the break point was encountered, and
it clears any break points specified in the G command Figure 8.33 shows the use
of the G command to execute the code assembled in Figure 8.3L

UTILITY PROGRAMS

P&T CP/M 2

page 8.33
DDT

User's Manual

-G800
*0805
Figure 8.33

Example of using the G command of DDT

X[x] command
The X command allows you to examine and modify the contents of the 8080
registers. If the X command is given with no argument, all of the registers and
flags are displayed In addition, the contents of the memory location given by the
program counter is displayed in mnemonic form. An argument in the command
specifies one of the registers or flags as the only one to be displayed. In this
case, its contents may be modified by the user. Figure 8.34 shows the various flags
and registers that may be displayed and modified with the X command, and Figure
8.35 gives an example of its use. In Figure 8.35, all of the registers are displayed,
the program counter is modified (perhaps in preparation for using the G command),
and the registers are redisplayed.
designation
C
Z
M
E
I

A
B

o
H
$

P

meaning
carry flag
zero flag
sign flag
parity flag
half carry flag
accumulator
BC register
DE register
HL register
stack pointer
program counter

•

allowed values
0-1
0-1
0-1
0-1
0-1
o - FF
o - FFFF
o - FFFF
o - FFFF
o - FFFF
o - FFFF

Figure 8.34 Register and Flag Designations for the X Command of DDT

-X
COZOMOEOIO A=12 B=C3C5 0=2446 H=4624 $=0126 P=8000 NOP
-XP
P=8000 100
-X
COZOMOEOIO A=12 B=C3C5 0=2446 H=4624 S=0126 P=0100 JMP

01DF

Figure 8.35 Example of Using the X Command of DDT

F(x),(y),(z)

command

The F command of DDT fills a section of memory with a particular byte. Three
arguments are required. The first two specify, respectively, the beginning and
ending addresses of the section of memory to be filled The third gives the byte to
be used. In Figure 8.36 the F command is used to fill memory from 100h up to and
including 8000h with the byte "OOh".
-F100 8000 O
Figure 8.36 Example of Using the F Command of DDT

UTILITY PROGRAMS

page 8.34
DDT

P&T CP/M 2
User's Manual

M(x),(y),(z) command
The M command of DDT is used to copy the contents of one section of memory to
another. It also requires three arguments. The first two are, respectively, the
beginning and ending addresses of the section of memory to be copied. The
contents of that section are copied byte-by-byte into successive memory locations
starting at the address given by the third argument. Figure 8.37 shows the use of
the M command to copy the 512 (decimal) bytes of memory from 100h through 2FFh
to 8000h through 81FFh.
-M100 2FF 8000
Figure 8.37 Example of Using the M Command of DDT

T[x] and U[x] commands
The T and U commands allow you to execute a program while retaining control from
DDT. The T command displays the machine registers and instructions as they are
executed, while the U command displays nothing at all. With the T command, the
registers and machine instructions are displayed together before execution of the
instructions begins. During T or U commands, you may regain control of the
computer by typing a DEL character «ctl-minus». Figure 8.38 shows the use of
both commands. Note the action of DDT when it regains control: it displays an
asterisk followed by the address of the next instruction in memory to be executed.
-T5
COZOMOEOIO
COZOMOEOIO
COZOMOEOIO
COZOMOEOIO
COZOMOEOIO
-U5
COZOMOEOIO

A=12
A=12
A=12
A=12
A=12

B=C3C5
B=C3C5
B=C3C5
B=C3C5
B=C3C5

0=2446
0=2446
0=2446
0=2446
0=2446

H=4624
H=4624
H=ooOO
H=0126
H=0126

5=0126
5=0126
5=0126
5=0126
S=0126

P=0100
P=010F
P=OlE2
P=01E3
P=01E6

JMP
LXI
DAD
SHLO
LXI

A=12 8=0081 0=2446 H=OE93 S=OE8F P=0200 MVI

Figure 8.38

010F
H,OOOO
SP
05FO
H,OE93*01E9
E,7F*02D2

Example of Using the T and U Commands of DDT

I(fllename.ext) and R[x] commands
It is possible to load disk files into memory for examination while DDT retains

control. A two-step procedure using the I and R commands of DDT is required.
First, the I command inserts a file name into the system default file control block
at 5Ch. The command may also be used to initialize the default file control block
for a program being tested. This action is very similar to that taken by the
console command processor (CCP) in loading and executing a COM file. Unlike the
CCP, however, the I command can accept only one file name and does not set up a
command line at location 80h.
Next, the R command is used to read the file into memory. If the file name
specified in the I command has the extension HEX, DDT tries to read it as an Intel
hex format file. The hex file is converted to binary and is loaded into memory at
the addresses specified in the hex format. Files with other file name extensions
are loaded at lOOh.
An optional argument in the R command specifies an offset to be added to the
address at which a file would normally be loaded That number is added to the

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.35
DDT

normal load address, and any overflow past the 16th bit is ignored. Using an
appropriate argument, a file can be loaded to any location in memory. For
example, to load a HEX file whose internal load address is 8000h into memory
starting at 9180h, you would give an offset of 1180h. To load the same file into
memory at 100h, the needed argument is 8100h.
Figure 8.39 shows examples of the I and R commands.
-ISUBMIT.COM
-R
NEXT PC
0600 0805
Figure 8.39

H(x),(y)

Example of Using the I and R commands of DDT

command

DDT provides a simple hexadecimal calculator mode for computing offsets and other
hex numbers. Two numbers to be added and subtracted are entered as the two
required arguments in the command. DDT then displays their sum and difference
(argument 1 minus argument 2). All carries and borrows beyond the 16th bit are
ignored. Figure 8.40 shows the H command used to compute the sum and difference
of ECOOh and 100h.
-HECOO 100
EDOO EBOO
Figure 8.40 Example of Using the H Command of DDT

Since DDT is designed for the 8080 only, care must be taken in running it with Z-80
programs. In particular, if breakpoints are used in the G command, it is essential
that one does not fall on a Z-80 instruction. It is not possible to use a T and U
command with Z-80 instructions, so the command must be stopped before a Z-80
instruction is encountered. The G command could then be used to proceed past the
Z-80 code. Also, the L command will not be able to decipher the Z-80 instructions
and may be confused by them.

Possible Error Messages
DDT has only one error indicator. If it cannot decode a command or if the
command cannot be executed, it displays a question mark on the console.

page 8.36
DENSITY

8.10

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Utility name: DENSITY
Purpose: To display and optionally alter the density flag on a
diskette.
General Description

Whenever a floppy diskette is formatted by the P&T CP/M 2 FORMAT utility, a
density flag is set. This flag is then used by the operating system in determining
the density at which the diskette was formatted. The DENSITY program allows you
to inspect the density flag and modify it if' necessary.
Normally, there is no need to alter the density flag on a diskette. The FORMAT
routine automatically sets the flag to agree with the actual formatting procedure.
However, it is possible that a diskette formatted by another system will be
inadvertently flagged at the wrong density. Since most interchange between systems
takes place on single density diskettes, the most likely error is a single density
diskette flagged as double density or double sided. (Even this case should be
extremely rare.) If you are having trouble reading a diskette and you are certain
of its actual density, you should use the DENSITY program to check the flag. If it
is set incorrectly, DENSITY can reset it according to your instructions.

Using DENSITY
A sample running of the DENSITY program is shown in Figure 8.41. The program is
executed by the command on Line 8.41-L After displaying its opening message
(Lines 8.41-4 to 8.41-6), it reminds you that pressing the  key will terminate
the program (Line 8.41-8).
On Line 8.41-10, DENSITY requests the drive on which the test is to take place.
Note that you may specify the drive by either a logical drive letter or a physical
drive number. After you enter the drive specification (drive B in this case),
DENSITY checks that the drive is actually on the system and is a floppy drive. If
it is not on the system or is not a floppy drive, an error message will be displayed
and you will be asked to specify the drive again. If the specified drive is a valid
floppy drive, DENSITY will display the correspondence between the logical and
physical drive designations as shown on Line 8.41-11.
Next, you are asked to mount the diskette to be tested (Line 8.41-13). At this time
the diskette in the selected drive may be changed if desired.
After----y-ou press  (Line 8.41-13), DENSITY will read the density flag and report
its value. In our example, a double density value is found (Line 8.41-15). You will
then be asked if you want to change the flag (Line 8.41-17). If you answer
negatively, DENSITY will start over, allowing you to check the flag on another
diskette. If you answer affirmatively, as in this example, you will be asked to
specify the new density setting (Line 8.41-19). After you enter the type of flag,
DENSITY will modify it accordingly and start over.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

1:
2:
3:
4:
5:
6:
7:
8:

page 8.37
DENSITY

A>DENSITY
Disk density test routine. Ver 2.xxx
Copyright 1980,82,83 by PICKLES & TROUT
All rights reserved
Hit BREAK to quit.

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:
41:
42:
43:
44:
45:
46:
47:

Enter drive on which to test (0-3 or A-P) : B
NOTE: Logical drive B: Is the same as physical drive (1).
Mount disk to test on drive B and hit ENTER when ready :

~

The disk Is tagged double density
Do you want to change the disk tag1 Y
Tag disk as Single or Double density or 2-slded double density (S,D,2)1

S

Disk density test routine. Ver 2.xxx
Copyright 1980,82,83 by PICKLES & TROUT
All rights reserved

•

Hit BREAK to quit.
Enter drive on which to test (0-3 or A-P) : B
NOTE: Logical drive B: Is the same as physical drive (1).
Mount disk to test on drive B and hit ENTER when ready: 
The disk Is tagged single density
Do you want to change the disk tag1 Y
Tag disk as Single or Double density or 2-slded double density (S,0,2)1

O

Disk density test routine. Ver 2.xxx
Copyright 1980,82,83 by PICKLES & TROUT
All rights reserved
Hit BREAK to quit.
Enter drive on which to test (0-3 or A-P) :
A>
Figure 8.41

~

Example Console Dialog for Using DENSITY

In this example, the flag is changed to single density and then back to double
density (Lines 8.41-22 to 8.41-37). After you have finished checking and possibly
changing density flags, you should press  when asked for a drive
specification as shown on Line 8.41-46. DENSITY will then return you to the
command level of the system. If your system requires a system diskette for a warm
boot, DENSITY will prompt you to mount a system diskette before returning to the
system.

Possible Error Messages
Bad drive name, please re-enter (0-3 or A-P) :
The letter you entered to specify the logical drive on which to test was not in
the range A - P. You should re-specify the drive using a valid logical drive
letter or a physical drive number.

page 8.38
DENSITY

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Bad drive number, please re-enter (0-3 or A-P) :
The number you entered to specify the physical drive on which to test was not
in the range 0 - 3. You should re-specify the drive using a valid physical drive
number or a logical drive letter.
That drive is not on the system, please re-specify :
You have specified a valid drive designation but the drive is not available on
your system. For example, you might have specified drive D on a two-drive
system. Re-enter a drive designation using one of the drives that is available on
your system.
That drive is a hard disk drive, please re-specify :
The drive you have specified is a hard disk drive. DENSITY can work only on
floppy disk drives. You should re-enter a drive designation for one of the floppy
drives on the system. If you do not know which logical drives are assigned to
the physical floppy drives on the system you can specify a physical drive
number.
Please re-enter specifying D for double density, S for single density,
or 2 for 2-sided double density:
You have not entered a valid selection for the new density flag after electing
to change it. Re-enter your selection using one of the three characters D, S, or
2.

BDas error while reading first sector on track O.
DENSITY could not read the sector on the diskette that contains the density
flag. This may indicate that the diskette is not formatted on track 0, is
incorrectly formatted on track 0 (ie. it might have been formatted by another
operating system), or track 0 has been damaged in some way. All diskettes used
with P&T CP/M 2 must be formatted at single density on track 0 of side 0
regardless of the density at which the rest of the diskette is formatted.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

8.11

page 8.39
DISKCHK

Utility name: DISKCHK
Purpose: To perform a non-destructive test for flaws on a diskette.
General Description

DISKCHK performs a non-destructive test of the information recorded on a diskette.
It reads all of the sectors on each track of the diskette and reports any errors

that occur. This test is by no means comprehensive; it is intended merely as a
quick check on the current state of a diskette. However, it is a good idea to
replace a diskette if DISKCHK starts to report a significant number of soft errors.
Frequently, the errors can be eliminated by erasing and reformatting the diskette,
but, of course, all data on it would then be lost.
Figure 8.42 shows how long it takes to perform a check on each format of diskette.

,.
"'-

format
single density
double density
doubl e sided

time
19 sec
19 sec
33 sec

~

~

Figure 8.42 Testing Times for DISKCHK

The command line mode of DISKCHK allows you to execute it from a SUBMIT file
or a menu program. This will allow you to embed DISKCHK in an integrated system
of programs and execute it several times a day. Since DISKCHK takes relatively
little time, the user of the system need not even know that DISKCHK is being used.
Such a system could automatically keep track of the state of each diskette and
suggest that the user make backups should soft errors begin to occur. See the
examples at the end of this chapter for a simple approach to doing this.
The DISKCHK test is very simple, and it may miss problems that occur in normal
(more complicated) usage. Remember to keep adequate backups at all times, even if
DISKCHK reports no errors on the diskette.

Using DISKCHK - Interactive Mode
Figure 8.43 shows a typical console dialog that might take place when using
DISKCHK.
DISKCHK is executed by the command line shown on Line 8.43-L After displaying
its sign-on messages (Lines 8.43-4 to 8.43-6), DISKCHK reminds you that it performs a
non-destructive test and that you may press the  key at any time to abort
the program and return to the operating system (Lines 8.43-9 and 8.43-10).
DISKCHK then asks you for the drive on which the test is to be performed (Line
8.43-12). Note that you may specify the drive as either a physical drive number or
a logical drive letter. After you have entered the drive (B in this example),
DISKCHK checks that it is a valid floppy drive on the system. It then shows you
the correspondence between the logical drive letter and the physical drive number
(Line 8.43-13). It is not necessary that the diskette to be tested be mounted on the
drive at this time. If the drive you specify is not a floppy drive or is not defined

page 8.40
DISKCHK

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

for the system DISKCHK will display an error message and ask you again for the
drive.
1:

A>DI5KCHK

2:
3:
4:
5:
6:
7:
8:

10/20/25 Disk Check Utility - Ver 2.xxx
copyright (C) 1980,82,83 Pickles & Trout
all rights reserved
This Is a non-destructive disk check routine.
Press  at any time to quit.

9:

10:
11:

12:
13:

14:
15:

Enter drive to check (A-P or 0-3) : B
NOTE: Logical drive B: Is the same as physical drive (1).
Mount disk to check on drive B: and press  when ready to start: 

16:

17:

18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:

Checking Double-density disk In drive B:
Checking complete.
This Is a non-destructive disk check routine.
Press  at any time to quit.
Enter drive to check (A-P or 0-3)

or (R) to repeat : 

A>
Figure 8.43

Example Console Dialog for Using DISKCHK

After you have specified the drive, DISKCHK asks you to mount the diskette to be
tested on the drive and press the  key (Line 8.43-15). At this time you may
change diskettes, if you wish, before pressing . After you press  the
test will begin.
As the test begins, DISKCHK checks the density of the diskette and reports it as
shown on Line 8.43-17. As the test proceeds a dot is displayed on the console

display for each track tested (Line 8.43-18). Note: if a double sided diskette is
being tested, DISKCHK first checks side 0 and then side 1 at the same head
location (cylinder). It displays a dot as side 0 is tested and then replaces it with a
colon ( : ) as side 1 is tested. When the test of a double sided diskette is
completed, a row of colons will appear on Line 8.43-18 instead of dots.
After the test is completed, DISKCHK starts over again as shown in Lines 8.43-23 to
8.43-26. Note that the prompt for the drive is slightly different now. You have the
option of entering "R" to repeat exactly the same test again. This is useful when
you want to test several diskettes. DISKCHK begins the test immediately after you
enter an "R" on Line 8.43-26 so you should mount the diskette to be tested before
entering the "R". With the "R" option you can easily test several diskettes by
merely mounting them on the drive you initially specified and repeating the test.
When you have finished testing, press the  key when asked for a drive, as
shown on Line 8.43-26. Pressing the  key at other times during the test will
cause DISKCHK to abandon the test in progress and return to the beginning (it does
not return to the system).
For systems that require a system diskette for warm booting, DISKCHK will prompt
you to mount a system diskette on the system drive before returning to the system

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.41
DISKCHK

command leveL If you encounter this prompt, insure that a system diskette is
mounted on the system drive and press .

Using DISKCHK - Command Line Mode
In the command line mode of DISKCHK, you must specify all of the information
regarding the test you want performed on the command line that you use to
execute DISKCHK. Note that in the command line mode, the test normally begins
.automatically as soon as DISKCHK begins execution (except on a single floppy drive
system). You should insure that the diskette to be tested is mounted before
executing DISKCHK in the command line mode. (See the PMOUNT instruction below
for an exception to this.)
The general form of the DISKCHK command line is shown in Figure 8.44.
DISKCHK (drive to test) (output destinations) (options)
(required)
(optional)
(optional)

~

All Instructions on the command line must be separated from
one another by a comma and/or one or more spaces.

~

Figure 8.44 General Form of DISKCHK Command Line

You must specify the drive on which the test is to be made when using the
command line option of DISKCHK. You may use either a physical drive number or a
logical drive letter when specifying the drives. The drive is specified using an
expression like those shown in Figure 8.45. Note that the drive designation may
come before or after the equal sign.
DRIVE=(drlve)
(drlve)=DRIVE

DRV=(drlve)
(drlve)=DRV

DR=(drlve)
(drlve)=DR

(drive) should be replaced by a logical drive letter
or a physical drive number.
Figure 8.45 Specifying the Drive on Which to Test

The command line mode of DISKCHK allows you to direct the console output from
the program to the console, system printer, or a disk file. The output defaults to
the console if no output direction is specified. You may direct the output to any
combination of these three destinations. Any destination(s) you specify will be the
only destination(s) for the console output. For example, if you specify a disk file
for the destination, no output will appear on the console. If you want output to
both a disk file and the console you must specify both as output destinations. A
special output destination (NUL:) is provided for cases where you want no output at
all from the program. An output destination is specified by a slash ( / ) fOllowed
by the destination name. Examples are given in Figure 8.46.

•

page 8.42
DISKCHK

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

ICON:

sends output to the console (default If no output
Instructions are given).

/LST:

sends output to system printer.

/(valld file name)

sends output to the specified fl Ie. If a file with
the same name already exists, it Is replaced.

/(valld file name)+

appends output to the specified fi Ie. If the fl Ie
does not already exist, it is created. The + may
be preceded by a space or comma.

/NUL: or /NULL:

causes no output to be generated. If any other output
instructions appear, they will supersede /NUL:.

Figure 8.46

Instructions to Direct Console Output

There are several additional instructions that can appear on the command line of
DISKCHK. They are listed in Figure 8.47. In the command line mode, DISKCHK
normally does not prompt for disks to be mounted; it immediately begins the test.
When it is finished, it does not prompt for a system diskette to be mounted either.
If you wish for DISKCHK to prompt for a diskette to be mounted, you may use the
"PMOUNT" instruction (or one of its synonyms) on the command line. This can be
useful when DISKCHK is used from a SUBMIT file because it eliminates the need for
a separate program to prompt for a diskette to be mounted. If you want DISKCHK
to prompt for a system diskette at the end of the test you should include the
"PSYS" instruction on the command line. This instruction causes DISKCHK to issue
a prompt for the system diskette if one is required for a warm boot operation. No
prompt will be issued for systems that do not require a system diskette for a warm
boot. You may instruct DISKCHK to prompt both for a diskette to test and for the
system diskette by using the "PBOTH" instruction on the command line.
DISKCHK will always issue prompts for a diskette to test and for the system
diskette (if one is needed for a warm boot) if the system has only a single floppy
drive and no hard disk drives.
PMOUNT or PM

causes DISKCHK to prompt for a diskette to be mounted
before beginning the test.

PSYS or PS

causes DISKCHK to prompt for a system diskette to be
mounted after the test is completed.

PBOTH or PB

causes DISKCHK to prompt both a diskette to be tested
and for a system diskette after the test is completed.

Figure 8.47

~

Additional Command Line Instructions for DISKCHK

The following examples show command lines that could be used with· DISKCHK:
DISKCHK DRIVH=B
Tests the diskette mounted on drive B. The diskette is assumed to be
mounted already and the test will begin immediately. Messages are sent to
the console. DISKCHK will not prompt for a system disk after the test.
DISKCHK DR=C PSYS
Tests the diskette mounted on drive C. The diskette is assumed to be
mounted already and the test will begin immediately. Messages are sent to
the console. DISKCHK will prompt for a system disk after the test if one is
required for a warm boot.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.43
DISKCHK

DISKCHK DR=B,/A:LOG,PMOUNT
Tests the diskette on drive B. DISKCHK will prompt for the diskette to be
mounted before the test begins. Messages are sent to a disk file named LOG
on drive A. DISKCHK will not prompt for a system disk after the test.
DISKCHK DRV=B,/CON:,/LST:
Tests the diskette on drive B. The diskette is assumed to be mounted already
and the test will begin immediately. Messages are sent to the console and the
system printer. DISKCHK will not prompt for a system disk after the test.
DISKCHK DR=C,/LOG+
Tests the diskette on drive C. The diskette is assumed to be mounted already
and the test will begin immediately. Messages are appended to a file named
LOG on the current default drive. DISKCHK will not prompt for a system disk
after the test.

Possible Error Messages
Non-modular system, not compatible with this program.
You are trying to run this program with a previous version of P&T CP/M 2. The
program makes use of features found only in the modular version of P&T CP/M 2
and hence cannot run on this system.
Bad drive name, please re-enter (0-3 or A-P) :
The letter you entered to specify the logical drive on which to test was not in
the range A - P. You should respecify the drive using a valid logical drive
letter or a physical drive number.

»»

Error: Bad drive name
Same meaning as the previous message but given in the command line mode only.

Bad drive number, please re-enter (0-3 or A-P) :
The number you entered to specify the physical drive on which to test was not
in the range 0 - 3. You should respecify the drive using a valid physical drive
number or a logical drive letter.

»»

Error: Bad drive number
Same meaning as the previous message but given in the command line mode only.

That drive is not on the system, please re-specify:
You have specified a valid drive designation but the drive is not available on
your system. For example, you might have specified drive D on a two-drive
system. Re-enter a drive designation using one of the drives that is available on
your system.

»»

Error: Drive not on system
Same meaning as the previous message but given in the command line mode only.

That drive is a hard disk drive, please re-specify:
The drive you have specified is a hard disk drive. DENSITY can work only on
floppy disk drives. You should re-enter a drive designation for one of the floppy
drives on the system. If you do not know which logical drives are assigned to
the physical floppy drives on the system you can specify a physical drive
number.

page 8.44
DISKCHK

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

»»

Error: Test target drive is a hard disk drive
Same meaning as the previous message but given in the command line mode only.

»»

Error: Missing drive name
Given in the command line mode if the program could not find a specification on
the command line of the drive on which to perform the test. Recheck the
command line you used to be sure you specified the drive.

»»

Error: Bad output designation
Given in the command line mode if you attempted to redirect the console output
but the program could not figure out where you wanted it sent. This can be
caused by an illegal character in a file name or by ending the command line
wi th a slash (f).

»»

Error: Output-file drive same as test target drive
Given in the command line mode if you directed the console output to a disk
file on the same drive that is being tested. This is not allowed because it
interferes with the test.

»»

Error: Bad output-file drive name
Given in the command line mode if you directed console output to a disk file
and used an illegal character (ie. not A - P) to specify the drive on which to
place the file.

»»

Error: Output-file drive is not on system
Given in the command line mode if you directed console output to a disk file on
a drive that is not present on the system. Recheck the command line you used
to make sure you specified the correct drive.

»»

Error: Output-file drive cannot be a fioppy on a single-fioppy system
Given in the command line mode if you directed console output to a disk file on
a floppy diskette on a system that has a single floppy drive. This is not
allowed even if disk swapping is in effect to make the single floppy drive
appear as if it were multiple drives. Swapping diskettes during the test would
not only be tedious but also would interfere with the test.

»»

Error: Drive X: is not ready.
When the program started the test, it found that the drive specified for the test
was not ready. This is usually caused by not having a diskette mounted when
the test begins. The "X" will be replaced by the logical drive letter of the
drive that was found not to be ready.

»»

Error: Home error.
A disk error occurred when the program attempted to restore the read/write
head to the home position. This can be caused by an unformatted or improperly
formatted diskette or an improper drive step rate.

»»

Error: Seek error.
A disk error occurred when the program was moving the read/write head to a
particular location. This can be caused by an unformatted or improperly
formatted diskette or an improper drive step rate.

»»

Error: Unable to determine density of disk.
The program was unable to determine the density of the diskette being
formatted. Although it is rare to see this error, it can be caused by an
unformatted or improperly formatted diskette.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.45
DISKCHK

»»

Error: Check aborted with  key while
the test is running.

»»

Error: xx Soft error(s): Track yy, Sector zz
This message is given when soft errors are encountered Whenever a sector on
the disk cannot be read successfully, the program will attempt to read it again.
If a subsequent attempt is successful, each previous failure is called a soft
error. In the error message, "xx" would be replaced by the number of times the
attempt failed before a successful read was performed "yy" and "zz" would be
replaced by the track and sector numbers, respectively, where the soft errors
occurred

»»

Error: xx Soft error(s): Cylinder yy, Side s, Sector zz
Same meaning as the previous message except that it is used when a double
sided diskette is being tested In the error message, "xx" would be replaced by
the number of times the attempt failed before a successful read was performed
"yy" , "s", and "zz" would be replaced by the cylinder, side and sector numbers,
respectively, where the soft errors occurred

»»

Error: Permanent error: Track yy, Sector zz
A permanent error has been encountered A permanent error is a failure to read
a sector on the disk successfully in 10 consecutive attempts. The message
reports the track and sector number at which the error took place.

»»

Error: Permanent error: Cylinder yy, Side s, Sector zz
Same meaning as the previous message except that it is used when a double
sided diskette is being tested In the error message, "yy", "s", and "zz" would
be replaced by the cylinder, side and sector numbers, respectively, where the
permanent error was found

»»

Error:
Time-out error: Track yy, Sectorzz
In some cases, when reading a diskette, if the desired sector cannot be found,
the disk controller circuit will try to locate it on several successive revolutions
of the diskette before reporting an error. If the sector could not be found on
the very first attempt, a problem could exist on the diskette. This message is
given if too much time elapses from when the "read" command is given to the
disk controller to when the sector was actually read This indicates that the
controller required more than one revolution to find the sector meaning that the
sector was missed at least once. This may indicate the very early stages of
degradation of a sector.

»»

Error:
Time-out error: Cylinder yy, Side s, Sector zz
Same meaning as the previous message except that it is used when a double
sided diskette is being tested In the error message, "yy", "s", and "zz" would
be replaced by the cylinder, side and sector numbers, respectively, where the
error was found

UTILITY PROGRAMS

page 8.46
DISKTEST

8.12

P&T CP/M 2
User's Manual

Utility name: DISKTEST
Purpose: To test a diskette for flaws. (Note: this test destroys any
data on the diskette.)
General Description

DISKTEST performs a media test on diskettes. The complete test writes and then
reads back three different data patterns to each of the sectors on each track of
the diskette and reports any errors that occur. You may optionally select a short
test which writes and reads back only one data pattern. The single data pattern
used is a "worst case" pattern for double density formats.
DISKTEST is intended asa check of the media prior to use and before reuse.
NOTE: DISKTEST WILL BRASE ALL INFORMATION FROM THE DISKETTE DO NOT USE IT ON A DISKETTE THAT HAS IMPORTANT INFORMATION
STORED ON IT.
Errors reported by DISKTEST may be caused either by the media or by the disk
system hardware. If only on an occasional diskette shows errors, the diskettes
themselves are probably bad But if errors are reported for most of the diskettes
tested, it is possible that a hardware problem exists. In this case, you should first
try cleaning the read/write heads on your disk drives. You can also try bulk
erasing the diskettes before formatting them (a bulk tape eraser works just fine for
this), or even try a different brand of diskette. If none of these actions eliminates
the errors, a hardware problem is very likely.
Any diskette showing a permanent error should be replaced, but a few soft errors
may be tolerated. Deciding on an acceptable level of soft errors requires a
personal decision. If a diskette shows any soft errors, you would be wise not to
use it for very important information. For less important data and/or scratch
usage, a few soft errors are usually tolerable. In addition, a diskette that is not
satisfactory at double density will often perform perfectly at single density.
The approximate times to complete the long and short disk tests for each of the
diskette formats is shown in Figure 8.48.
format
single density
double density
double sided
F i gu re 8.48

full test
3 min, 16 sec
3 min, 23 sec
6 min, 43 sec

short
1 min,
1 min,
2 min,

test
5 sec
8 sec
16 sec

Copy i ng Ti mes for D I SKTEST

DISKTEST also has a command line mode so that you can use it from SUBMIT files
and menu programs.

Using DISKTEST - Interactive Mode
Figure 8.49 shows a typical console dialog that might take place when using
DISKTEST.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

1:

page 8.47
DISKTEST

A>DI5KTE5T

2:
3:
4:
5:

10/20/25 Disk Test Uti Iity - Ver 2.xxx
copyright (C) 1980,82,83 Pickles & Trout
al I rights reserved

6:

7:
8:
Caution:

9:

10:

This test destroys any data on the disk.
Press  at any time to quit.

11:

12:
13:
14:
15:
16:

Enter drive to test (A-D or 0-3) : B
NOTE: Logical drive B: Is the same as physical drive (1).
This test normally makes 3 passes.
Do you want the single-pass option? (y/n) : N

17:

18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31 :
32:
33:
34:
35:
36:
37:
38:
39:

Mount disk to test on drive B: and press  when ready to start: 
Testing Double-density disk In drive B:
Beginning pass with pattern

= 00

Beginning pass with pattern

= FF

Beginning pass with pattern

= DBB6

Testing complete.
Caution:

This test destroys any data on the disk.
Press  at any time to quit.

Enter drive to test (A-D or 0-3)

or (R) to repeat: 

A>
Figure 8.49

Example Console Dialog for Using DISKTEST

DISKTEST is executed by the command line shown on Line 8.49-L After displaying
its sign-on messages (Lines 8.49-4 to 8.49-6), DISKTEST reminds you that the test it
performs will destroy any data already on the diskette and that you may press the
 key at any time to abort the program and return to the operating system
(Lines 8.49-9 and 8.49-10).
DISKTEST then asks you for the drive on which the test is to be performed (Line
8.49-12). Note that you may specify the drive as either a physical drive number or
a logical drive letter. After you have entered the drive (B in this example),
DISKTEST checks that it is a valid floppy drive on the system. It then shows you
the correspondence between the logical drive letter and the physical drive number
(Line 8.49-13). It is not necessary that the diskette to be tested be mounted on the
drive at this time. If the drive you specify is· not a floppy drive or is not defined
for the system DISKTEST will display an error message and ask you again for the
drive.
DISKTEST then reminds you that the test normally makes three passes over the
entire diskette and asks if you want the short (single pass) test (Lines 8.49-15 and
8.49-16). In this example, a negative response was entered to indicate that the long
test should be used.

UTILITY PROGRAMS

page 8.48
DISKTEST

P&T CP/M 2
User's Manual

DISKTEST then asks you to mount the diskette to be tested on the drive and press
the  key (Line 8.49-18). At this time you may change diskettes, if you wish,
before pressing . After you press  the test will begin.
As the test begins, DISKTEST checks the density of the diskette and reports it as

shown on Line 8.49-20. As the test proceeds each data pattern is announced and a
dot is displayed on the console display as each track is tested with that pattern
(Lines 8.49-22 to 8.49-29). Note: If a double sided diskette is being tested, DISKTEST
first tests side 0 and then side 1 at the same head location (cylinder). It displays a
dot as side 0 is tested and then replaces it with a colon ( : ) as side 1 is tested
When the test of a double sided diskette is completed, rows of colons will appear
on Lines 8.49-23, 8.49-26, and 8.49-29 instead of dots.
After the test is completed, DISKTEST starts over again as shown in Lines 8.49-34 to
8.49-37. Note that the prompt for the drive is slightly different now. You have the
option of entering "R" to repeat exactly the same test again. This is useful when
you want to test several diskettes. DISKTEST begins the test immediately after you
enter an "R" on Line 8.49-37 so you should mount the diskette to be tested before
entering the "R". With the ''H'' option you can easily test several diskettes by
merely mounting them on the drive you initially specified and repeating the test.
When you have finished testing, press the  key when asked for a drive, as
shown on Line 8.49-37. Pressing the  key at other times during the test will
cause DISKTEST to abandon the test in progress and return to the beginning (it
does not return to the system).
For systems that require a system diskette for warm booting, DISKTEST will prompt
you to mount a system diskette on the system drive before returning to the system
command leveL If you encounter this prompt, insure that a system diskette is
mounted on the system drive and press .

Using DISKTEST - Command Line Mode
In the command line mode of DISKTEST, you must specify all of the information
regarding the test you want performed on the command line that you use to
execute DISKTEST. Note that in the command line mode, the test normally begins
automatically as. soon as DISKTEST begins execution (except on a single floppy drive
system). You should insure that the diskette to be tested is mounted before
executing DISKTEST in the command line mode. (See the PMOUNT instruction below
for an exception to this.)
The general form of the DISKTEST command line is shown in Figure 8.50.
DISKTEST (drive to test) (output destinations) (options)
(required)
(optional)
(optional)
~

AI I Instructions on the command line must be separated from
one another by a comma and/or one or more spaces.
Figure 8.50 General Form of DISKTEST Command Line

You must specify the drive on which the test is to be made when using the
command line option of DISKTEST. You may use either a physical drive number or
a logical drive letter when specifying the drive. The drive is specified using an
expression like those shown in Figure 8.5L Note that the drive designation may
come before or after the equal sign.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

DRIVE=(driveJ
(driveJ=DRIVE

DRV=(driveJ
(driveJ=DRV

page 8.49
DISKTEST

DR=(driveJ
(driveJ=DR

(drivel should be replaced by a logical drive letter
or a physical drive number.
Figure 8.51

Specifying the Drive on Which to Test

The command line mode of DISKTEST allows you to direct the console output from
the program to the console, system printer, or a disk file. The output defaults to
the console if no output direction is specified. You may direct the output to any
combination of these three destinations. Any destination(s) you specify will be the
only destination(s) for the console output. For example, if you specify a disk file
for the destination, no output will appear on the console. If you want output to
both a disk file and the console you must specify both as output destinations. A
special output destination (NUL:) is provided for cases where you want no output at
all from the program. An output destination is specified by a slash ( / ) followed
by the destination name. Examples are given in Figure 8.52.
ICON:

sends output to the console (default If no output
instructions are given).

/LST:

sends output to system printer.

/(valid file name)

sends output to the specified file. If a fi Ie with
the same name already exists, it is replaced.

/(valid file name)+

appends output to the specified fi Ie. If the fi Ie
does not already exist, it is created. The + may
be preceded by a space or comma.

/NUL: or /NULL:

causes no output to be generated. If any other output
instructions appear, they will supersede /NUL:.

Figure 8.52

Instructions to Direct Console Output

There are several additional instructions that can appear on the command line of
DISKTEST. They are listed in Figure 8.53. In the command line mode, DISKTEST
normally does not prompt for a diskette to be mounted; it immediately begins the
test. When it is finished, it does not prompt for a system diskette to be mounted
either.
If you wish for DISKTEST to prompt for a diskette to be mounted, you may use the
"PMOUNT" instruction (or one of its synonyms) on the command line. This can be
useful when DISKTEST is used from a SUBMIT file because it eliminates the need
for a separate program to prompt for a diskette to be mounted. If you want
DISKTEST to prompt for a system diskette at the end of the copy operation you
should include the "PSYS" instruction on the command line. This instruction causes
DISKTEST to issue a prompt for the system diskette if one is required for a warm
boot operation. No prompt will be issued for systems that do not require a system
diskette for a warm boot. You may instruct DISKTEST to prompt both for a
diskette to test and for the system diskette by using the "PBOTH" instruction on
the command line.
DISKTEST will always issue prompts for a diskette to test and for the system
diskette (if one is needed for a warm boot) if the system has only a single fioppy
drive and no hard disk drives.

UTILITY PROGRAMS

page 8.50
DISKTEST

P&T CP/M 2
User's Manual

The Q instruction tells DISKTEST to perform the short one pass test. If the Q
instruction does not appear on the command line, DISKTEST will perform the long
three pass test.
PMOUNT or PM

causes DISKTEST to prompt for a diskette to be mounted
before beginning the test.

PSYS or PS

causes DISKTEST to prompt for a system diskette to be
mounted after the test is completed.

PBOTH or PB

causes DISKTEST to prompt both a diskette to be tested
and for a system diskette after the test is completed.

Q

causes DISKTEST to perform the short one pass test instead
of the standard three pass test.
Figure 8.53 Additional Command Line Instructions for DISKTEST

The following examples show command lines that could be used with DISKTEST:
DISKTBST DmVB=B
Tests the diskette mounted on drive B with the full three pass test. The
diskette is assumed to be mounted already and the test will begin immediately.
Messages are sent to the console. DISKTEST will not prompt for a system
disk after the test.
DISKTBST DR=C,Q
Tests the diskette mounted on drive C with the short one pass test. The
diskette is assumed to be mounted already and the test will begin immediately.
Messages are sent to the console. DISKTEST will not prompt for a system
disk after the test.
DISKTBST DR=C PSYS
Tests the diskette mounted on drive C with the full three pass test. The
diskette is assumed to be mounted already and the test will begin immediately.
Messages are sent to the console. DISKTEST will prompt for a system disk
after the test if one is required for a warm boot.
DISKTEST DR=B,/A:LOG,PBOTH
Tests the diskette on drive B with the full three pass test. DISKTEST will
prompt for the diskette to be mounted before the test begins. Messages are
sent to a disk file named LOG on drive A. DISKTEST will prompt for a
system disk after the test if one is required for a warm boot.
DISKTEST DRV=B,/CON:,/LST:
Tests the diskette on drive B with the full three pass test. The diskette is
assumed to be mounted already and the test will begin immediately. Messages
are sent to the console and the system printer. DISKTEST will not prompt for
a system disk after the test.
DISKTBST DR=C,/LOG+,Q
Tests the diskette on drive C with the short one pass test. The diskette is
assumed to be mounted already and the test will begin immediately. Messages
are appended to a file named LOG on the current default drive. DISKTEST
will not prompt for a system disk after the test.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.51
DISKTEST

Possible Error Messages
Non-modular system, not compatible with this program.
You are trying to run this program with a previous version of P&T CP/M 2. The
program makes use of features found only in the modular version of P&T CP/M 2
and hence cannot run on this system.
Bad drive name, please re-enter (0-3 or A-P) :
The letter you entered to specify the logical drive on which to test was not in
the range A - P. You should respecify the drive using a valid logical drive
letter or a physical drive number.

»»

Error: Bad drive name
Same meaning as the previous message but given in the command line mode only.

Bad drive number, please re-enter (0-3 or A-P) :
The number you entered to specify the physical drive on which to test was not
in the range 0 - 3. You should respecify the drive using a valid physical drive
number or a logical drive letter.

»»

Error: Bad drive number
Same meaning as the previous message but given in the command line mode only.

That drive is not on the system, please re-specify:
You have specified a valid drive designation but the drive is not available on
your system. For example, you might have specified drive D on a two-drive
system. Re-enter a drive designation using one of the drives that is available on
your system.

»»

Error: Drive not on system
Same meaning as the previous message but given in the command line mode only.

That drive is a hard disk drive, please re-specify:
The drive you have specified is a hard disk drive. DISKTEST can work only on
floppy disk drives. You should re-enter a drive designation for one of the floppy
drives on the system. If you do not know which logical drives are assigned to
the physical floppy drives on the system you can specify a physical drive
number.

»»

Error: Test target drive is a hard disk drive
Same meaning as the previous message but given in the command line mode only.

»»

Error: Missing drive name
Given in the command line mode if the program could not find a specification on
the command line of the drive on which to perform the test. Recheck the
command line you used to be sure you specified the drive.

»»

Error: Bad output designation
Given in the command line mode if you attempted to redirect the console output
but the program could not figure out where you wanted it sent. This can be
caused by an illegal character in a file name or by ending the command line
wi th a slash (f).

»»

Error: Output-file drive same as test target drive
Given in the command line mode if you directed the console output to a disk
file on the same drive that is being tested. This is not allowed because it
interferes with the test.

iii

page 8.52
DISKTEST

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

»»

Error: Bad output-file drive name
Given in the command line mode if you directed console output to a disk file
and used an illegal character (ie. not A - P) to specify the drive on which to
place the file.

»»

Error: Output-file drive not on system
Given in the command line mode if you directed console output to a disk file on
a drive that is not present on the system. Recheck the command line you used
to make sure you specified the correct drive.

»»

Error: Output-file drive cannot be a noppy on a single-noppy system
Given in the command line mode if you directed. console output to a disk file on
a floppy diskette on a system that has a single floppy drive. This is not
allowed even if disk swapping is in effect to make the single floppy drive
appear as if it were multiple drives. Swapping diskettes during the test would
not only be tedious but also would interfere with the test.

»»

Error: Logged-on drive same as test target drive
This message is given in the command line mode if the program is instructed to
test the drive which is the current default drive when the program was
executed The program assumes that the current default drive contains
important files and should not be tampered with. This message is not given,
however, if the PMOUNT instruction is given on the command line so that the
program prompts for a diskette to be mounted before beginning testing. If you
get this message and are sure that you are specifying the correct drive to be
tested, make another drive the current default drive before executing the
program or use the PMOUNT instruction.

Disk to test on drive X: is not empty.
Do you want to continue with ·the test? (yin) :
When the program started to test the diskette, it found that the diskette had
files on it. Since this test is destructive, the program warns you that you are
about to destroy all information on the diskette and asks you whether you want
to continue. This is done as a protective measure to help you to avoid erasing
an important diskette. Check whether the diskette is really the one you want to
test and respond accordingly. The "X" is replaced by the logical drive letter of
the drive being used for the test.

»»

Error: Test aborted by user.
This message is displayed if you respond negatively to the question in the
previous message.

Please answer with (Y) for yes or (N) for no :
This message is displayed if you answer a yes/no question with an invalid
response. Enter your response again using one of the letters specified

»»

Error: Disk on drive X: is write protected - cannot test.
When the program checked the diskette on the specified drive, it found that the
diskette was write protected Since this test involved writing to the diskette,
the test could not proceed Check that the diskette is really the one you want
to test and, if it is, cover the write protect notch and try again. The "X" is
replaced by the logical drive letter of the drive being used for the test.

»»

Error: Drive X: is not ready.
When the program started the test, it found that the drive specified for the test
was not ready. This is usually caused by not having a diskette mounted when

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.53
DISKTEST

the test begins. The "X" will be replaced by the logical drive letter of the
drive that was found not to be ready.

»»

Error: Home error.
A disk error occurred when the program attempted to restore the read/write
head to the home position. This can be caused by an unformatted or improperly
formatted diskette or an improper drive step rate.

»»

Error: Seek error.
A disk error occurred when the program was moving the read/write head to a
particular location. This can be caused by an unformatted or improperly
formatted diskette or an improper drive step rate.

»»

Error: Unable to determine density of disk.
The program 'was unable to determine the density of the diskette being tested.
Although it is rare to see this error, it can be caused by an unformatted or
improperly formatted diskette.

»»

Error: Check aborted with  key while
the test is running.

»»

Error: xx Soft read error(s): Track yy, Sector zz
This message is given when soft errors are encountered. Whenever a sector on
the disk cannot be read successfully, the program will attempt to read it again.
If a subsequent attempt is successful, each previous failure is called a soft
error. In the error message, "xx" would be replaced by the number of times the
attempt failed before a successful read was performed. "yy" and "zz" would be
replaced by the track and sector numbers, respectively, where the soft errors
occurred.

»»

Error: xx Soft read error(s): Cylinder yy, Side s, Sector zz
Same meaning as the previous message except that it is used when a double
sided diskette is being tested. In the error message, "xx" would be replaced by
the number of times the attempt failed before a successful read was performed.
"yy" , "s", and "zz" would be replaced by the cylinder, side and sector numbers,
respectively, where the soft errors occurred.

»»

Error: Permanent read error: Track yy, Sector zz
A permanent error has been encountered. A permanent read error is a failure to
read a sector on the disk successfully in 10 consecutive attempts. The message
reports the track and sector number at which the error took place.

»»

Error: Permanent read error: Cylinder yy, Side s, Sector zz
Same meaning as the previous message except that it is used when a double
sided diskette is being tested. In the error message, "yy" , "s", and "zz" would
be replaced by the cylinder, side and sector numbers, respectively, where the
permanent error was found.

»»

Error: Permanent write error: Track yy, Sector zz
Same as a permanent read error except caused by a failure to write a sector on
the disk successfully in 10 consecutive attempts. The message reports the track
and sector number at which the error took place.

»»

Error: Permanent write error: CyUnder yy, Side s, Sector zz
Same meaning as the previous message except that it is used when a double
sided diskette is being tested. In the error message, "yy", "s", and "zz" would

page 8.54
DISKTEST

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

be replaced by the cylinder, side and sector numbers, respectively, where the
permanent error was found.

»»

Error: Compare error: •••• Track yy, Sector zz
This error message is displayed when no read or write errors have occurred yet
the data written out to the diskette does not agree with the data read back.
This usually is not due to a disk media problem. It might be due to hardware
problems with the disk system but it is more likely a problem with the memory
used to store the two sets of data before they are compared. The "yy" and
"zz" will be replaced by the track and sector numbers, respectively, at which
the error occurred.

»»

Error: Compare error: •••• Cylinder yy, Side s, Sector zz
Same meaning as the previous message except that it is used when a double
sided diskette is being tested. In the error message, "yy", "s", and "zz" would
be replaced by the cylinder, side and sector numbers, respectively, where the
permanent error was found.

»»

Error: Read Time-out error: Track yy, Sector zz
In some cases, when reading a diskette, if the desired sector cannot be found,
the disk controller circuit will try to locate it on several successive revolutions
of the diskette before reporting an error. If the sector could not be found on
the very first attempt, a problem could exist on the diskette. This message is
given if too much time elapses from when the "read" command is given to the
disk controller to when the sector was actually read. This indicates that the
controller required more than one revolution to find the sector meaning that the
sector was missed at least once. This may indicate the very early stages of
degradation of a sector.

»»

Error: Read Time-out error: Cylinder yy, Side s, Sector
Same meaning as the previous message except that it is used when
sided diskette is being tested. In the error message, "yy", "s", and
be replaced by the cylinder, side and sector numbers, respectively,
error was found.

»»

Error: Write Time-out e17ror: Track yy, Sector zz
Same meaning as a Read Time-out error except that it occurred while writing to
a diskette.

»»

Error: Write Time-out error: Cylinder yy, Side s, Sector zz
Same meaning as the previous message except that it is used when a double
sided diskette is being tested. In the error message, "yy", "s", and "zz" would
be replaced by the cylinder, side and sector numbers, respectively, where the
error was found.

zz
a double
"zz" would
where the

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

S.13

page 8.55
DUMP

Utility name: DUMP
Purpose: To display a disk file in hexadecimal form.

General Description
DUMP is a very simple program that reads a disk file and displays it on the console
in hexadecimal format. The file is displayed in lines of 16 hex numbers, each
.representing one byte of the file. The number (relative to the beginning of the
file) of the first byte of each line is shown at the beginning of the line. The
source code of DUMP is supplied with the system (filename: DUMP.ASM) as an
example of an assembly language program.

Using DUMP
Figure 8.54 shows a sample running of the DUMP program. The name of the file to
be displayed is specified on the command line that executes DUMP. Line 8.54-1
shows the command line which will cause DUMP to display the file DATIME.COM on
the console in hexadecimal form. The resulting output is shown on Lines 8.54-3 to
8.54-15. After displaying the file, DUMP returns to the operating system.
1:

2:
3:
4:
5:
6:

7:
8:

A>OUMP OATIME.COM
0000
0010
0020
0030

18
20
6F
33

02AO
0280
02CO
0200
02EO
02FO

03
03
00
00
00
00

9:

10:
11:

12:
13:
14:
15:
16:
17:

32
62
75
2F

.

51
85
00
00
00
00

43
79
74
38

6F
20
20
30

70
50
20
ED

79
69
72
73

72
63
65
C2

69
68
76
03

67
6C
69
31

68
65
73
08

74
73
65
04

20
20
64
06

31
26
20
18

39
20
31
CD

38
54
30
40

30
72
2F
00

.03 60 03. 66 03 6A. 03 6F.03 74 03. 78

03 5A
0380
00 00
00 00
00 00
00 00

03
00
00
00
00

96
00
00
00
00

03
00
00
00
00

00
00
00
00
00

00
00
00
00
00

00
00
00
00
00

00
00
00
00
00

00
00
00
00
00

00
00
00
00
00

00
00
00
00
00

00
00
00
00
00

00
00
00
00
00

A>
Figure 8.54

Example of using DUMP

Possible Error Messages
NO INPUT FILE PRESENT ON DISK
DUMP could not locate the file name specified on the command line.

page 8.56
ED

8.14

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Utility name: ED
Purpose: A line oriented text editor.
General Description

ED is a general purpose, line oriented text editor which is a part of the Digital
Research standard release of CP/M 2. Since ED is line oriented (rather than screen
oriented), it is somewhat harder to use than more modern text editors. ED is
adequate for small jobs, such as creating SUBMIT files or making small changes to
programs. If you intend to do a lot of text editing, however, a more powerful,
screen oriented editor is highly recommended.

Using ED
Chapter 2 of CP/M Operating System Manual gives full instructions on the use of
ED. The limited discussion below touches mainly on points not mentioned in that
manual or ones that deserve emphasis.
One characteristic of ED is frequently overlooked. When ED is first executed with
an existing file, none of the file is read into ED's memory buffer. It is necessary
to use the append command (A) to "append" lines from the file into the empty
buffer. If you do not use the A command, it will appear that nothing exists in the
file you are edi ting.
Another noteworthy feature of BD is that it responds differently to commands
entered in upper and lower case letters. When commands are given in upper case
letters, ED converts all text inserted into the file to upper case, so the U command
will have no effect. If lower case letters are used in commands, lower case
characters will not be converted to upper case unless a +U command is given.
The type command (T) does not advance the character pointer, so repetitions of the
command simply display the same lines of the file. One way to display. successive
lines is to change the pointer's position with the L command before each new T
command. Alternately, parameters can be included with the T command when the
line numbers are known. For example, the command 43::62T will move the character
pointer to line 43 and then type lines 43 through 62.
The "sleep" command (nZ) causes ED to suspend operation (go to sleep) for a period
of time. The number "n" specifies the number of time periods (each about .3
seconds on a 4 Mhz Z-80) to pause. This command can be used in a macro that
prints the entire edit buffer in successive groups of lines, with ED pausing after
each group. For example, the macro #m20t20l50z will type 20 lines, advance the
character pointer 20 lines, and wait for about 15 seconds. This action will be
continued until the end of the edit buffer is reached.

Possible Error Messages
See pp. 43,44 of the CP/M Operating System Manual for an explanation of the error
messages.

P&:T CP/M 2
User's Manual

8.15

UTILITY PROGRAMS

page 8.57
ERROR

Utility name: ERROR
Purpose: To explain the error codes displayed by the BIOS
portion of the system.
General Description

The BIOS portion of P&:T CP/M 2 reports errors that occur when performing various
disk functions. In addition to a descriptive name for the message (e.g. Read error)
an error code is also given. This error code provides more detailed information
about the error that occurred. It is very difficult to present in a manual an
explanation of all the error codes that might occur.
The ERROR program is provided to interpret the error codes and give you a more
detailed explanation of them.

Using ERROR
ERROR is very easy to use. All you need to do is type ERROR followed by a space
followed by the error code you want explained. Figure 8.55 shows an example of
using ERROR.
1:

2:

3:
4:

5:
6:

7:
8:
9:
10:
11 :
12:

Read error, code = R08
Bdos Err on B: Bad Sector 
A>ERROR R08
A disk error occurred while trying to read a floppy diskette.
The fol lowing error conditions were detected:
A CRC error was reported. This Is typically due to a bad spot on the disk.
It may also occur If the disk has been abused. In some cases it may be caused
by hardware problems.
A>
Figure 8.55 Example of Using ERROR

Possible Error Messages

»»

No error code specified
This message is displayed if you did not type an error code on the command line
of ERROR. You will be returned to the command level of the system
immediately following this message.

[err code] ?
If you ask ERROR to explain an error code that it does not know about, it will
display the code on the console followed by a question mark. You will be
returned to the command level of the system immediately following this message.
This is usually caused by mis-typing the error code.

page 8.58
FASTCOPY

8.16

Utility name:
Purpose:

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

FASTCOPY
To copy all files on one or more user numbers from one
disk to another while maintaining file attributes.
General Description

FASTCOPY is a file transfer program designed to copy all files on one or more user
numbers from one disk to another in a rapid and efficient manner. Unlike PIP,
which transfers only one file at a time, FASTCOPY reads files from the source disk
until the memory available for temporary storage is full. Only then does FASTCOPY
begin to write the file out to the destination disk. Transferring files in this way is
especially advantageous on a single-drive system, as it limits the number of tiJIles
the diskettes will need to be swapped.
Since FASTCOPY does a file-by-file copy, copying files to an empty disk will
eliminate any file fragmentation that may exist on the source disk.
It is important to note that FASTCOPY treats all files as being sequential and may
not properly transfer random access files.
FASTCOPY will optionally transfer files of zero length (i.e. files whicb have been
created but have never had data written to them). It will also optionally read back
the files from the destination diskette to verify that they were copied. properly.
FASTCOPY will transfer ALL files on the selected user number(s) from the source
disk to the destination disk. All file attributes such as SYS, DIR, R/W, and R/O
will be maintained. Any file on the destination disk having the same name as one
on the source disk will be deleted before the transfer is made. You should assure
that none of these files has important information stored in it. Other files on the
destination disk will not be disturbed. FASTCOPY will continue until all files have
been copied or until available space on the destination disk is exhausted.

Using FASTCOPY - Interactive Mode
FASTCOPY's interactive mode of operation prompts you for all the information
necessary to specify the copy operation to be performed. It also provides the
option of performing the same operation repetitively without re-entering the
information. Figure 8.56 shows a typical console dialog for using FASTCOPY in the
interactive mode.
On a single drive system, you must make use of the system's disk swapping to use
FASTCOPY (see Section 3.3 for an explanation of disk swapping). You would use
FASTCOPY as shown in the example below (where a multiple drive system is
assumed) but would specify two logical drives that are assigned to the single floppy
drive. The system will then automatically flash messages on the console asking you
to mount the different diskettes as they are needed.
Note that if you need to copy files from one diskette to another on a hard disk
system with a single floppy drive, it is usually easier to copy all files from the
source diskette to the hard disk and then back to the destination diskette than it is
to use disk swapping. This assumes that at least one of the following is true:

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.59
FASTCOPY

L You have an empty logical drive on the hard disk.
2.

You have an empty user area on one of the logical drives on the hard disk. In
this case you should use the PIP program with the G option to transfer the files
to the empty user area and then back to the new diskette.

3. The names of the files are all similiar enough so that you can transfer them
with a wildcard file name using PIP. This assumes that there are no files with
names that also match the wildcard name on the hard disk drive being used
Line 8.56-1 shows the command line that will execute FASTCOPY in the interactive
mode. After FASTCOPY displays its opening messages (Lines 8.56-4 to 8.56-6) it
reminds you (Lines 8.56-8 to 8.56-9) of the type of copy operation it performs.
On Line 8.56-11 FASTCOPY reminds you that the  key will abort the copy
process. If you press the  key while FASTCOPY is copying files, it will stop
as soon as it has finished reading or writing the current file.
On Line 8.56-13 FASTCOPY asks you for the source drive. This is the drive on
which you will mount the disk to be copied. Note that you can enter the drive
specification as either a physical drive number or a logical drive letter. The
physical drive numbers always refer to the floppy disk drives. The logical drive
letters can refer either to a floppy drive or a hard disk drive. You may choose the
method of specifying the drive which is most comfortable for you. In this example,
logical drive D is selected for the source drive. On Line 8.56-14 FASTCOPY shows
you that on this system logical drive D is equivalent to physical drive 3. If the
logical drive you specify is a hard disk drive, the message displayed on Line 8.56-14
will indicate that this is the case.
A similar query is made for the destination drive on 8.56-16. The destination drive
is the drive on which you will mount the disk to which the copy will be made. In
this example the destination drive is specified as logical drive C. On Line 8.56-17,
FASTCOPY shows that logical drive C corresponds to physical drive 2. If the
logical drive you specify is a hard disk drive, the message displayed on Line 8.56-17
will indicate that this is the case.
After you have specified the source and destination drives, FASTCOPY asks you for
the user areas to transfer (Line 8.56-19). In response you can enter a list of user
area numbers separated by a comma and/or one or more spaces. Only files in the
specified user areas will be transferred. If you want to transfer files from all user
areas, you may enter "ALL" or "all" instead of a list of user numbers. If you want
to transfer files from the current user area only, you need merely press  as
shown on Line 8.56-19. Note that files are always copied to the same user area on
the destination drive as they came from on the source drive.
If you do not understand user areas and/or are not using them merely press 
on Line 8.56-19.
Next FASTCOPY asks you if you want to transfer zero length files. A file that has
zero length is one that was created but never had any data written to it. Some
sloppy programs create files on a disk but never use them (for example if the
program is aborted before it finishes) and never delete them. Usually these files
are just a nuisance so you do not want them copied In some cases, however, the
zero length files are actually required by the programs. In these cases you would
want them transferred. On Line 8.56-21 this example elects not to have zero length
files transferred.

•

UTILITY PROGRAMS

page 8.60
FASTCOPY
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:

P&:T CP/M 2
User's Manual

A>FASTCOPY
1D/2D/2S Fastcopy Utility - Ver 2.xxx
copyright (C) 1980,82,83 Pickles & Trout
all rights reserved

This program copies all flies from specified user areas on the source
disk to the destination disk while maintaining all file attributes.
(Press  at any time to quit)
Enter source drive (A-P or 0-3) : D
NOTE: Logical drive D: Is the same as physical drive (3).
Enter destination drive (A-P or 0-3) : C
NOTE: Logical drive C: Is the same as physical drive (2).
Enter user areas to transfer «ENTER> for current area only) : 
Do you want to transfer zero-length files? (yin) : N
Do you want each file verified as It's written? (yin) : N
Once copying has started,

you may abort It at any time by pressing .

27: Mount source disk on drive D:
28: Mount destination disk on drive C:
Press  when ready :
29:
30:
31: Copying from drive D: to drive C:
32:
33:
Reading SOURCE .ASM RIW, DIR, user= 0
34:
35:
Writing SOURCE .ASM RIW, DIR, user= 0
36:
Reading SOURCE .ASM RIW, DIR; user= 0
37:
38: Reading PROGRAM .ASM RIW, DIR, user= 0
39:
40:
Writing SOURCE .ASM RIW, DIR, user= 0
41 :
Writing PROGRAM .ASM RIW, DIR, user= 0
42:
43:
Reading PROGRAM .ASM RIW, DIR, user= 0
44:
Reading PROGRAM • HEX RIW, DIR, user= 0
45:
Reading PROGRAM .COM RIW, DIR, user= 0
46:
Reading ARRAY .L1B RIW, DIR, user= 0
47:
Reading SCRN
.L1 B RIW, DIR, user= 0
48:
Reading STRCONVT.LIB R/W, DIR, user= 0
49:
Reading PIP
.COM RIW, DIR, user= 0
50:
51:
Writing PROGRAM • ASM RIW, DIR~ user= 0
52:
Writing PROGRAM • HEX RIW, DIR, user= 0
Writing PROGRAM .COM RIW, DIR, user= 0
53:
54:
Writing ARRAY .L1B RIW, DIR, user= 0
55:
.L1B RIW, DIR, user= 0
Writing SCRN
56:
Writing STRCONVT.LIB RIW, DIR, user= 0
57:
Writing PIP
.COM RIW, DIR, user= 0
58:
.COM RIW, DIR, user= 0
59: Reading PIP
60:
61:
.COM RIW, DIR, user= 0
Writing PIP
62:
63:
(Press  at any time to quit)
64:
65:
66: Enter source drive (A-P or 0-3) or (R) to repeat: 
67:
68: A>

Figure 8.56 Example Console Dialog for Using FASTCOPY

On Line 8.56-23, FASTCOPY asks you if you want each file verified as it is written.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.61
FASTCOPY

If you respond affirmatively, FASTCOPY will read back each file to check for

errors. This verification slows down the copy process but it does provide checking
for errors in the copy. In this example a negative response is given indicating that
no verification is to be done.
After you have entered all the necessary information, FASTCOPY will ask you to
mount the source and destination disks as shown on Lines 8.56-27 to 8.56-29. At this
point you should mount the disks (if necessary) and press . If diskettes are
involved in the copy operation, they need not be of the same density. However,
you must be sure that enough space is available on the destination disk to hold all
of the transferred files. After you have mounted the disks and pressed the 
key, the copying will begin.
FASTCOPY reports each file name on the console as it is being read or written. If
several files will fit into the available memory at one time, they will all be read
before writing them to the destination disk. If FASTCOPY runs out of memory in
the middle of reading a file, it stops reading the file and begins to write out to
the destination disk. After the file data stored in memory is written out,
FASTCOPY resumes reading the file where it left off. Each time FASTCOPY
switches between reading and writing, it displays a line of dashes on the console.
In this example, the file SOURCE.ASM is larger than the available memory so only
part of it is read at first (Line 8.56-33). After that part is written (Line 8.56-35) the
remainder of the file is read and FASTCOPY begins reading PROGRAM.ASM (Lines
8.56-37 and 8.56-38). These are then written out (Line 8.56-40 and 8.56-41) and
FASTCOPY continues reading and writing files until all of the files in the specified
user areas have been transferred. In Lines 8.56-43 to. 8.56-49 several shorter files are
read into memory at once and are then written out on Lines 8.56-51 to 8.56-57.
When the copy is finally complete, FASTCOPY starts over again as shown in Lines
8.56-64 to 8.56-66. Note that onLine 8.5366 a new option is available to you. By
entering "R" instead of a drive designation, you may repeat exactly the same copy
operation you just completed. This is useful when making multiple copies. In this
example the  key is pressed to return to the operating system. In this
example, the system does not require a system diskette for a warm boot so
FASTCOPY returns immediately to the operating system after the  key is
pressed. If a system diskette were required to accomplish the warm boot, a prompt
to mount a system diskette on the system drive would have been given before
returning to the system command level
If you request that FASTCOPY verify the files that are written to the destination

drive, the console display during the copy operation will behave a little differently.
As a file is written to the destination drive, the message "Writing _" will be
displayed as shown on Line 8.56-35. As FASTCOPY is verifying the file, the word

"Writing" will be replaced by "Verifying". When the verification is completed, the
word "Verifying" will be replaced by "Verified". If the example shown in Figure 8.56
had specified verification, the display would look exactly the same except that
everywhere "Writing" appears, "Verified" would appear instead.

Using FASTCOPY • Command Line Mode
In the command line mode of FASTCOPY, you must specify all of the information
regarding the copy operation you want performed on the command line that you use
to execute FASTCOPY. Note that in the command line mode, the copy normally
begins automatically as soon as FASTCOPY begins execution (except on a single
floppy drive system). You should insure that the source and destination disks are

UTILITY PROGRAMS

page 8.62
FASTCOPY

P&T CP/M 2
User's Manual

mounted before executing FASTCOPY in the command line mode. (See the PMOUNT
instruction below for an exception to this.)
The general form of the FASTCOPY command line is shown in Figure 8.57.
FASTCOPY (src and dest drives) luser numbers I loutput destlnatlonsl loptlonsl
(required)
(optional)
(optional)
(optional)
All Instructions on the command line must be separated from one another
by a comma and/or one or more spaces.
Figure 8.57 General Form of FASTCOPY Command Line

You must specify the source and destination drives when using the command line
option of FASTCOPY. You may use either physical drive numbers or logical drive
letters when specifying the drives. The source drive is specified using an
expression like those shown in Figure 8.58. Note that the drive designation may
come before or after the equal sign.
SOURCE=ldrlvel
ldrlvel=SOURCE

SRC=ldrivel
ldrlvel=SRC

ldrivel should be replaced by a logical drive letter
or a physical drive number.
Figure 8.58

Specifying the Source Drive

In a similar manner, the destination drive is specified as shown in Figure 8.59.
DESTINATION=ldrivel
ldrlvel=DESTINATION

DEST=ldrlvel
ldrlvel=DEST

DST=ldrlvel
ldrivel=DST

ldrlvel should be replaced by a logical drive letter
or a physical drive number.
Figure 8.59 Specifying the Destination Drive

There are also several short forms for specifying both the source and destination
drives in a single statement. Examples of these short forms are given in Figure
8.60.
~

III.

A>B
B TO C
BD,Z,V
Copy all files from the current user area on drive C to the current user area
on drive D. The disks are assumed to be mounted already and the copy will
begin immediately. Messages are sent to the console. Verification is
performed. Zero length files are copied. FASTCOPY will not prompt for a
system disk after the copy.
PASTCOPY C:=B: V U 0,1,9
Copy all files from user areas 0, 1, and 9 on drive B to the same user areas
on drive C. The disks are assumed to be mounted already and .the copy will
begin immediately. Messages are sent to the console. Verification is done.
FASTCOPY will not prompt for a system disk after the copy.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.65
FASTCOPY

PASTCOPY C>B,/CON:,/LST:
Copy all files from the current user area on drive C to the current user area
on drive B. The disks are assumed to be mounted already and the copy will
begin immediately. Messages are sent to the console and the system printer.
No verification is done. FASTCOPY will not prompt for a system disk after
the copy.
P ASTCOPY A>C,PBOTH,/B:LOG,V,Q
Copy all files from the current user area on drive A to the current user area
on drive C. FASTCOPY will prompt for the disks to be mounted before
beginning the copy. Beginning and error messages only are sent to a file
named LOG on drive B. Verification is done. FASTCOPY will prompt for a
system disk after the copy if one is required for a warm boot.
P ASTCOPY 1=2,V,/LOG+ ,/CON:,PSYS,USER ALL
Copy all files from all user areas of the diskette on physical drive 2 to the
same user areas of the diskette on physical drive L The diskettes are
assumed to be mounted already and the copy will begin immediately. Messages
are sent to the console and appended to a file named LOG on the current
default drive. Verification is done. FASTCOPY will prompt for a system disk
after the copy if one is required for a warm boot.

Possible Error Messages
N on-modular system, not eompatible with this "program.
You are trying to run this program with a previous version of PM' CP/M 2. The
program makes use of features found only in the modular version of P&T CP/M 2
and hence cannot run on this system.
Bad drivename,"pleasere--enter:
The logical drive letter you entered was not in the range A to P. Respecify the
drive using one of the valid letters or a physical drive number in the range 0 to
3.

Bad drive number, pleaser"e-enter:
The physical drive number you entered was not in the range 0 to 3. Respecify
the drive using one of the valid numbers or a logical drive "letter in the range A
to P.
That drive is "not on the system, pleasere-speeify :
The drive you have specified is not available on the system. Re-enter the drive
specification indicating one of the drives that is available.
Source and destinatioileannot be the same logieal drive.
Please re-speeify.
If you have more that one physical drive on your system, FASTCOPY will not
allow you to specify the same drive for both source and destination. To do so
would cause you to do a lot of disk swapping. FASTCOPY will prompt you again
for the source and destination drives; specify different drives for each.

»»

Error: Source drive same as destination drive
Same "meaning as previous message but given in the command line mode.

page 8.66
FASTCOPY

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Please answer with 'yn for yes or 'N' for no :
The response you gave to a yes/no message was not acceptable. Enteryour
response again using one of the characters indicated. Note that both upper and
lower case are acceptable.

»»

Error: Missing drive name
(Command Line Mode) This message indicates that FASTCOPY could not find
either the source drive or destination drive designation.

»»

Error: Bad source drive name
(Command Line Mode) This message is displayed if the letter you used on the
command line to specify the source drive was not in the range A - P. This
might be caused by an improper command line that causes FASTCOPY to
interpret the wrong character as a drive letter.

»»

Error: Bad destination drive name
(Command Line Mode) Same as previous message except for destination drive.

»»

Error: Bad source drive number
(Command Line Mode) This message is displayed if the number you used on the
command line to specify the source drive was not in the range 0 - 3. This
might be caused by an improper command line that causes FASTCOPY to
interpret the wrong number as a drive number.

»»

Error: Bad destination drive number
(Command Line Mode) Same as previous message except for the destination
drive.

»»

Error: Source drive not on system
(Command Line Mode) This message indicates that you have used a proper letter
or number to specify the source drive but that drive does not exist on the
system. Check that you are really specifying the drives you want to use for the
copy.

»»

Error: Destination drive not on system
(Command Line Mode) Same as previous message except for the destination
drive.

»»

Error: Logged-on drive same as destination drive
(Command Line Mode) In the command line mode, FASTCOPY usually begins the
copy operation immediately upon execution. In this case, it does not allow the
current default drive to be the destination of the copy operation under the
assumption that there are files on the drive that should not be disturbed. You
should log on~o a drive other than the destination before executing FASTCOPY
in the command line mode. This message will not be given if you instruct
FASTCOPY to prompt for the source and destination diskettes to be mounted
(see the npMOUNTn command).

»»

Error: Output-file drive same as source drive
(Command Line Mode) FASTCOPY does not allow you to direct console output to
a disk file on the source· drive since doing so can interfere with the copy
operation. You should direct console output to a disk file on another drive.

»»

Error: Output-file drive same as destination drive
(Command Line Mode) FASTCOPY does not allow you to direct console output to
a disk file on the destination drive since doing so can interfere with the copy
operation. You should direct console output to a disk file on another drive.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.67
FASTCOPY

»»

Error: Bad output designation
(Command Line Mode) The destination you specified for the console output is
not valid. This can be caused by ending the command line with a slash ( / ).

»»

Error: Output-file drive not on system
(Command Line Mode) You attempted to direct console output to a disk file but
the drive specified with the output file name does not exist on the system.
Check that you are specifying the correct drive.

»»

Error: Bad output-file drive name
(Command Line Mode) Something is wrong with the drive designation you gave
for the output file you specified to receive console output. This can be caused
by specifying a drive for the file with an invalid character.

»»

Error: Bad user number designation
(Command Line Mode) This message indicates that you specified a number
outside of the range 0 - 15 in the list of user numbers to copy from the source
to the destination drive. Check the command line you gave for errors in
specifying the user number.

»»

Error: Too many files for available memory
This message is given if insufficient memory is available to hold information
about all the files being transferred and leave enough workspace for making the
transfers. It is very unlikely that you will encounter this error. If you do,
check the amount of reserved memory above the operating system. Reducing this
amount may allow FASTCOPY to run. Alternately you should transfer files from
fewer user numbers at one time.

»»

Error: 110 files found on specified user(s)
This message indicates that FASTCOPY could find no files to copy on the user
numbers you sp.ecified. Check that you specified the correct user numbers.

»»

Error: Cannot open input file - skipping iL
When FASTCOPY went to open a file for input, it could not be found. This
indicates that the file disappeared from the disk directory between the time that
FASTCOPY first found it and when it tried to start reading it. This error is
very rare and, should it occur, it may indicate a hardware problem.

»»

Error: Direct~ry full on destination volume - aborting.
The directory on the destination disk filled up while FASTCOPY was in the
process of copying file to it. This can be caused by copying to a disk that
already has files on it. It can also be caused by copying to a disk with a
smaller directory than the source disk (e.g. from a double density to a single
density diskette). When this error occurs, FASTCOPY immediately returns to the
operating system. All files transferred prior to the error will remain intact on
the destination disk.

»»

Error: Destination disk full - aborting.
The available space on the destination disk has been exhausted. This situation
can arise when copying to a disk which already has some files on it or when
copying to a disk with a smaller capacity than the source disk (e.g. from a
double density to a single density diskette). When this error occurs, FASTCOPY
immediately returns to the operating system. All files transferred prior to the
error will remain intact on the destination diskette.

»»

Error: Error while closing file - aborting.
BDOS has detected an error in its attempt to close a disk file. This message

page 8.68
FASTCOPY

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

may indicate that diskettes were not properly swapped when usingF ASTCOPY in
a single drive system. FASTCOPY immediately retums to the operating system
upon this error. All files transferred prior to the error will remain intact oil
the destination diskette.
-

»»

Error: Unexpected end of file during file verify - aborting.
This message indicates that, while FASTCOPY wasre-reading the destination file
for verification, the end of file was encountered before it should have been.
This is a very rare error and you should never see this message. If you dO f it
could'indicate hardware problems. FASTCOPY immediately retums to the
operating system upon this error. All files transferred prior to the error will
remain intact on the destination diskette•.

»»

Error: Compare error during file verify - aborting.
.
This message indicates that the data FASTCOPY read back from the destination
file does not match what was written. In addition, the disk system did not
report an error. This is also a very rare error. Most typically this error occurs
after a disk error was reported and you pressed the  key. Recall that
pressing the  key after a disk error instructs the system to proceed .as if
no error had occurred. In this case FASTCOPY has no means of knowing that
the data read is in error. If you get this error message without an
accompanying disk error, as just described, it probably indicates a pl'oblem with
the RAM in your system. FASTCOPY immediately retums to the operating system
upon this error. All files transferred prior to the error will remain intact on
the destination diskette (including any portion of the file containing the errol'
that has already been copied).
I

»»Error: Directory update error during file verify - aborting.
A disk system error occurred when FASTCOPY attempted to close the destination
file before verifying it. This close is done to insure that the directory on the
destination disk is completely up to date before beginning to verify 'a file. This
is a relatively rare error; its most common cause is impropel' diskette swapping
on a single floppy drive system. FASTCOPY immediatelyretums to the operating
system upon this error. All files transferred prior to the error will remain
intact on the destination diskette.

»»

Error: Re-opening error during file verify - aborting.
A disk system error occurred when FASTCOPY attempted to reopen the
destination file to verify it. This should not occur in a properly functioning
system. FASTCOPY immediately retums to the operating· system upon this error.
All files transferred prior to the error will remain intact on the destination
diskette.

»»

Errol': F ASTCOPY aborted.itb .
This message is displayed if you press the  key while the copy operation
is in progress. FASTCOPY will not stop until it has finished reading or writing
the file on which it is currently working. Note that the last file transferred to
the destination disk may be incomplete if. you abort the copy by pressing
.

Bdos Err on x: Read Only
This error message actually comes from aDOS rather than FASTCOE-Y. It should
occur only when runningFASTCOPY on a single drive system, and it almost
certainly indicates that you have made an error in diskette swapping. If you
should encounter this message, the best course of ac,tion is to mount your system
disk and hit the RESET switch.
-

UTILITY PROGRAMS

P&T CP/M. 2
User's Manual

8.17

page 8.00
FORMAT

Utility name: FORMAT
Purpose: To format (prepare) diskettes for use.
General Description

Before a disk can be used to store data, certain information must be written on it.
This function, called formatting, is the task of the FORMAT program.
FORMAT can format single sided diskettes at single or double density and double
sided diskettes at double density. Formatting a diskette at double density does not
require one that is certified at double density. However, using one certified as a
double density diskette is highly recommended to avoid potential loss of data due to
diskette failure.
Since the single density format is standardized, most single density diskettes may be
used with P&T CP/M 2 exactly as purchased from the manufacturer. However, all
diskettes used at double density must be reformatted to be compatible with P&T
CP/M 2.
The capacities and number of directory entries for each of the formats is shown in
Figure 8.64.
format
single density
doubl e dens Ity
double sided

usable storage
243 Kbytes
596 Kbytes
1210 Kbytes

Directory Entries
64
128
192

Figure 8.64 Capacities and Number of Directory Entries for Disk Formats

FORMAT can perform an optional verification pass on a diskette after it is
formatted. This verification consists of reading all sectors from all tracks on the
diskette and reporting any errors that are encountered. This is the same test that
is performed by the DISKCHK program. The amount of time to format diskettes in
each of the. supported formats is shown in Figure 8.65.
format
sing Ie· density
double density
double sided

no verification
29 sec
29 sec
54 sec

Figure 8.65

with verification
47 sec
47 sec
86 sec

Format Times for FORMAT

FORMAT also has a command line mode so that it can be executed from a SUBMIT
file or a menu system and not require any user input.
NOTE: FORMAT WILL ERASE ALL INFORMATION FROM THE DISKETTE - DO
NOT USE IT ON A DISKETTE THAT HAS. IMPORTANT INFORMATION
STORED ON IT.

page 8.70
FORMAT

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Using FORMAT - Interactive Mode
Figure 8.66 shows an example running of the FORMAT program.
1:

A>FORMAT

2:
3:
4:
5:
6:
7:
8:

10/20/25 Disk Format Utility - Ver 2.xxx
copyright (C) 1980,82,83 Pickles & Trout
all rights reserved
Press  at any time to quit.

9:

11:

Enter drive to format (A-P or 0-3) : B
NOTE: Logical drive B: Is the same as physical drive (1).

12:
13:

Enter '5' for Single-density or

10:

14:

15:
16:
17:
18:
19:
20:
21 :
22:
23:
24:
25:
26:

for Double-density: D

Do you want a fast check performed after the disk Is formatted? (y/n) : 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.

27:

28:
29:
30:
31:
32:

'0'

Press  at any time to quit.
Enter drive to format (A-P or 0-3)

or (R) to repeat: 

A>
Figure 8.66

Example Console Dialog for Using FORMAT

The command which will execute FORMAT is given on Line 8.66-1. FORMAT signs on
with the messages shown in Lines 8.66-4 to 8.66-6. On Line 8.66-8 FORMAT reminds
you that you can abort the program by pressing the  key. On Line 8.66-10
FORMAT asks for the drive on which the format operation is to take place. Note
that you can specify the drive as either a logical drive letter or a physical drive
number. After you enter a drive specification (B in this example), FORMAT checks
that the drive exists on the system and is a floppy diskette drive. If it does not
exist or is not a floppy drive, an error message is displayed and you will be asked
again to specify the drive. If the drive exists and is a floppy drive, FORMAT will
show you the logical to physical drive assignment for that drive (Line 8.66-11).
FORMAT next asks you whether you want the diskette formatted at single or double
density (Line 8.66-13). In this example, double density was selected. FORMAT then
asks if you want the quick verification to be done after the diskette is formatted
(Line 8.66-15). In this example an affirmative answer is given to indicate that the
verification should be done.
FORMAT then prompts you to mount the diskette to be formatted on the specified
drive and press  (Line 8.66-17). At this time you may change diskettes, if you
wish, before pressing . After you press  the format will begin.
REMEMBER: FORMAT WILL ERASE ALL INFORMATION FROM A DISKETTE MAKE SURE THE PROPER ONE IS MOUNTED BEFORE PRESSING .
When FORMAT begins to format the diskette, it determines whether the diskette is
double sided or not. FORMAT will automatically format single and double sided

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.71
FORMAT

diskettes accordingly when double densi ty is specified. A double sided single density
format is not supported; hence FORMAT will give an error message if a double sided
diskette is mounted when single density is specified. In this example, a single sided
diskette was mounted. On Line 8.66-19 FORMAT reports the result of its test for
number of sides and begins the format operation.
As each track is formatted, a dot is displayed on the console (Line 8.66-20).

After
the format is completed, the quick verification pass is made (Lines 8.66-23 to 8.66-25).
As with the format, a dot is displayed as each track is verified.
For a double sided diskette, a dot is displayed as side 0 is formatted or verified.
The dot is replaced by a colon (:) as side 1 is formatted or verified. When
formatting a double sided diskette, the console display will end up with lines of
colons instead of dots on Lines 8.66-20 and 8.66-24.
After the formatting and optional verification are completed, FORMAT starts over
again as shown in Lines 8.66-28 to 8.66-30. Note that the prompt for the drive is
slightly different now. You have the option of entering "R" to repeat exactly the
same format operation again. This is useful when you want to format several
diskettes. FORMAT begins the format immediately after you enter an ''R'' on Line
yy49-31 so you should mount the diskette to be formatted before entering the ''R''.
With the "Rn option you can easily format several diskettes by merely mounting
them on the drive you initially specified and repeating the format operation.
When you have finished formatting, press the  key when asked for a drive,
as shown on Line 8.66-30. Pressing the  key at other times during the test
will cause FORMAT to abandon the format in progress and return to the beginning
(it does not return to the system).
For systems that require a system diskette for warm booting, FORMAT will prompt
you to mount a system diskette on the system drive before returning to the system
command leveL If you encounter this prompt, insure that a system diskette is
mounted on the system drive and press .

Using FORMAT - Command Line Mode
In the command line mode of FORMAT, you must specify all of the information
regarding the format operation you want performed on the command line that you
use to execute FORMAT. Note that in the command line mode, the format
operation normally begins automatically as soon as FORMAT begins execution (except
on a single floppy drive system). You should insure that the diskette to be
formatted is mounted before executing FORMAT in the command line mode. (See
the PMOUNT instruction below for an exception to this.)
The general form of the FORMAT command line is shown in Figure 8.67.
~

FORMAT (drive to format) (density) [output destinations) [options)
(required)
(required)
(optional)
(optional)

~

All instructions on the command line must be separated from
one another by a comma and/or one or more spaces.

,
~

Figure 8.67 General Form of FORMAT Command Line

You must specify the drive on which the format operation is to be made when using
the command line option of FORMAT. You may use either a physical drive number
or a logical drive letter when specifying the drive. The drive is specified using an

UTILITY PROGRAMS

page 8.72
FORMAT

P&T'·CP/M 2
Manual

User~s·

expression like those shown in Figure 8.68.
come before or after the equal sign.
DRIVE=(drivel
(drivel=DRIVE

Note that the drive designation may'

DRV=(drivel
(drivel=DRV

DR=(drivel
(drivel=DR

(drivel should be replaced by a logical drive letter
or a physical drive number.
Figure 8.68

Specifying the Drive on Which to Format

The density at which the diskette is to be formatted is specifiedby on~'of the
instructions shown in Figure 8.69.
SO or 1D
DO or 2D
Figure 8.69

for single density
for double density

Specifying the Density at Which to Format

The command line mode of FORMAT allows you to direct the console output from
the program to the console, system printer, or a disk file. The output defaults to
the console if no output direction is specified .You may direct the output to any
combination of these three destinations. Any destination(s) you specify will be the
only destination(s) for the console output. For example, if you specify a disk file
for the destination, no output will appear on the console. If you want output to
both a disk file and the console you must specify both as output· destinations. A
special output destination (NUL:) is provided for cases where you want no, output at
all from the program. An output destination is specified bya slash ( /) followed
by the destination name. Examples are given in Figure 8.70.
ICON:

sends output to the console (default if no output
instructions are given).

/LST:

sends output to system'printer.

/(valid file name)

sends output to the specified fi Ie. I fa fi Ie wi,th
the same name already exists, it Is replaced.

/(valid fi Ie name)+

appends output to the specified file. If the fi Ie
does not already exist. it is created. The + may
be preceded by a space or comma.

/NUl: or /NUlL:

causes no output to be generated. If any other output
Instructions appear, they wll I supersede /NUl:.

Figure 8.70

Instructions to Direct Cons?le Output

There are several additional instructions that can appear on the command 1ine of
FORMAT. They are listed in Figure 8.7L In the command line mode, FORMAT
normally does not prompt for a diskette to be mounted; it immediately begins the
format operation. When it is finished, it does not prompt for a system diskette to
be mounted either.
.
If you wish for FORMAT to prompt for a diskette to be mounted, you may use the
"PMOUNT" instruction (or one of its synonyms) on the command line. ThIs can be
useful when FORMAT is used from a SUBMIT file because it eliminates the need for
a separate program to prompt for a diskette to be mounted. If you want FORMAT
to prompt for a system diskette at the end of the format operation you should
include the "PSYS" instruction on the command line. This instruction causes
FORMAT to issue a prompt for the system diskette if one is required for a warm
boot operation. No prompt will be issued .for systems that do not require a system

UTILITY PROGRAMS

P&T CP/M 2

User's Manual

page 8.73
FORMAT

diskette for a warm boot. You may instruct FORMAT to prompt both for a diskette
to format and for the system diskette by using the "PBOTH" instruction on' the
command Une.
FORMAT will always issue prompts for the source and destination diskettes and for
the system diskette (if one is needed for a warm boot) if the system has only a
single fioppy drive and no hard disk drives.
The V instruction tells FORMAT to perform the verification pass.
PMOUNT or PM

causes FORMAT to prompt for a diskette to be mounted
before beginning the format.

PSYS or PS

causes FORMAT to prompt for a system diskette to be
mounted after the format Is completed.

PBOTH or PB

causes FORMAT to prompt both a diskette to be formatted
and for a system diskette after the format Is completed.

v

causes FORMAT to make a verification pass after formatting
the diskette.
Figure 8.71

Additional Command Line Instructions for FORMAT

The following examples show command lines that could be used with FORMAT:
l'OllMAT DRlVB;::::B,DD

Formats the diskette mounted on driveB at double density. The diskette is
assumed to be mounted already and the format operation will begin
immediately. Messages are sent to the console. No verification is done.
FORMAT will not prompt for a system disk after the format operation.
l'OBMAT DR=C SD V PSYS

Formats the diskette mounted on drive C at single density. The diskette is
assumed to be mounted already and the format operation will begin
immediately. Messages are sent to the console. A verification pass is
performed. FORMAT will prompt for a system disk after the format operation
if one is required for a warm boot.
PORMAT DR=B,DD,/A:LOG,PMOUNT

Formats the diskette on drive B at double density. FORMAT will prompt for
the diskette to be mounted before the, format operation begins. Messages are
sent to a disk file named LOG on drive A. No verification is done. FORMAT
will not prompt for a system disk after the format operation.
l'ORMAT DRV=B,DD,/CON:,V,/LST:

Formats the diskette on drive B at double density. The diskette is assumed to
be mounted already and the format operation will begin immediately. Messages
are sent to the console and the system printer. A verification pass is
performed. FORMAT will not prompt for a system disk after the format
operation.
l'OBMAT DB::;C,SD,/LOG+,V

Formats the diskette on drive C at single density. The diskette is assumed to
be mounted already and the format operation will begin immediately. Messages
are appended to a file named LOG on the current default drive. A
verification pass is performed. FORMAT will not prompt for a system disk
after the. format operation.

page 8.74
FORMAT

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Possible Error Messages
Non-modular system, not compatible with this program.
You are trying to run this program with a previous version of P&T CP/M 2. The
program makes use of features found only in the modular version of P&T CP/M 2
and hence cannot run on this system.
Bad drive name, please re-enter (0-3 or A-P) :
The letter you entered to specify the logical drive on which to format was not
in the range A - P. You should respecify the drive using a valid logical drive
letter or a physical drive number.

»»

Error: Bad drive name
Same meaning as the previous message but given in the command line mode only.

Bad drive number, please re-enter (0-3 or A-P) :
The number you entered to specify the physical drive on which to format was
not in the range 0 - 3. You should respecify the drive using a valid physical
drive number or a logical drive letter.

»»

Error: Bad drive number
Same meaning as the previous message but given in the command line mode only.

That drive is not on the system, please re-specify:
You have specified a valid drive designation but the drive is not available on
your system. For example, you might have specified drive D on a two-drive
system. Re-enter a drive designation using one of the drives that is available on
your system.

»»

Error: Drive not on system
Same meaning as the previous message but given in the command line mode only.

That drive isa hard disk drive, please re-specify:
The drive you have specified is a hard disk drive. FORMAT can work only on
floppy disk drives. (Use HFORMAT for hard disks.) You should re-enter a drive
designation for one of the floppy drives on the system. If you do not know
which logical drives are assigned to the physical floppy drives on the system you
can specify a physical drive number.

»»

Error: Pormat target drive isa hard disk drive
Same meaning as the previous message but given in the command line mode only.

»»

Error: Missing drive name
Given in the command line mode if the program could not find a specification on
the command line of the drive on which to format. Recheck the command line
you used to be sure you specified the drive.

»»

Error: Bad output designation
Given in the command line mode if you attempted to redirect the console output
but the program could not figure out where you wanted it sent. This can be
caused by an illegal character in a file name· or by ending the command line
wi th a slash (/).

»»

Error: Output-file drive same as format target drive
Given in the command line mode if you directed the console output to a disk
file on the same drive that is being formatted This is not allowed because it
interferes with the format.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.75
FORMAT

»»

Brror: Bad output-file drive name
Given in the command line mode if you directed console output to a disk file
and used an illegal character (ie. not A - p) to specify the drive on which to
place the file.

»»

Error: Output-file drive not on system
Given in the command line mode if you directed console output to a disk file on
a drive that is not present on the system. Recheck the command line you used
to make sure you specified the correct drive.

»»

Error: Output-file drive cannot be a Ooppy on a single-Ooppy system
Given in the command line mode if you directed console output to a disk file on
a floppy diskette on a system that has a single floppy drive. This is not
allowed even if disk swapping is in effect to make the single floppy drive
appear as if it were multiple drives. Swapping diskettes during the format
operation would not only be tedious but also would interfere with the operation.

»»

Error: Not enough memory to run FORMAT
This message is displayed if there is not enough memory available
to run. It is very unlikely that you will encounter this error. If
should check the amount of memory reserved above the operating
option LA). Reducing this reserved memory should allow FORMAT

for FORMAT
you do, you
system (MENU
to run.

Please answer with 'Y' for yes or 'N' for no:
This message is displayed if you answer a yes/no question with an invalid
response. Enter your response again using one of the letters specified.

»»

Brror: Drive X: is not ready - cannot format.
This message indicates that FORMAT found the specified drive not to be ready.
This can be caused by the diskette not being mounted, the diskette being
mounted backwards, or mounting a double sided diskette on a single sided drive.
Correct the problem and run FORMAT again. The "X" is replaced by the logical
drive letter of the drive being used for the operation.

»»

Brror: Disk is write protected - cannot format.
When the program checked the diskette on the specified drive, it found that the
diskette was write protected. Since a format operation involves writing to the
diskette, the format could not proceed. Check that the diskette is really the
one you want to test and, if it is, cover the write protect notch and try again.

»»

Brror: Home error.
A disk error occurred when the program attempted to restore the read/write
head to' the home position. This can be caused by an improper head step rate.

»»

Error: Seek error.
A disk error occurred when the program was moving the read/write head to a
particular location. This can be caused by an improper' head step rate.

»»

Brror: Density not specified
The command line that executed FORMAT in the command line mode did not
specify the density at which the diskette was to be formatted. Check your
command line to be sure that you specified a density properly.

•

UTILITY PROGRAMS

page 8.76
FORMAT

P&T CP/M 2
User's Manual

»»

Error: Format aborted with  key while the diskette is
being formatted Note that if you interrupt the format operation the diskette
probably will not be usable until it is reformatted.

»»

Error: Check aborted
This message is issued if
pressing the  key
the diskette to interrupt
verified

»»
»»

Error: Double-sided disk detected on drive X:
Should be formatted at Double-density.
This message is displayed if you attempt to format a double sided diskette at
single density. Either format it at double density or mount a single sided
diskette. The "X" will be replaced by the logical drive letter of the drive on
which the format was to have been performed.

»»

Error: Format error, Code = N
This message indicates that a disk error occurred while attempting to format a
track on the diskette. The "N" will be replaced by a single digit number which
indicates what type of error occurred. The codes have the following meanings:

»»

with KXEDI T
Figure 8.72 Command Line to Execute KXEDIT

When KXEDIT begins execution, it shows an editing display as depicted in Figure
8.73. The display shows the translations that are currently in effect. The "FROM"
column shows the key codes from the keyboard that are being translated and the
"TO" column shows the codes which are substituted for them. In this case, no
translations are in effect.
r

It..

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21 :
22:
23:
24:

1/

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:

-----

------hex

I
" FRO M "
asci i dec
I key-name

I
I

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

I
I
I
I
I
)

I
I
I
I
I
I
I
)

I
I

-------

I
" TO"
asci I
I key-name

.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

.,
--------dec hex

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
)

I
I

Use "UP" and "DOWN" arrow keys to choose selection.
DIRECT mode
Press ESC to edit selection.
Press ENTER for more options.
Figure 8.73

Editing Console Display of KXEDIT

The "FROM" and "TO" columns both consist of four columns, each displaying the key
code in a different form. The key name column shows the character or the key
that is pressed to generate the key code. The "ascii" column shows the ASCn
character, if it is a displayable (ie. non-control) character. The "dec" column shows

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.79
KXEDIT

the numeric value of the key code in decimal and the "hex" column shows the
numeric value of the key code in hexadecimaL
When the program starts a special reverse video cursor will be positioned at the
first of the translations. You may select the translation you wish to edit by using
the  and  keys to position the special cursor at anyone of
the translations. After positioning the special cursor at the translation you want to
edit, you should press the  key to start editing. The special cursor will then
move to the "FROM" column to indicate that you should enter the key code which
is to be translated.
You may enter key codes in three forms. In the "DIRECT" mode, you need merely
press the key on the keyboard. This is usually the easiest way to specify the key.
In some cases, you may wish to actually enter the numeric code of the key rather
than pressing the key. In some cases this is merely a convenience but in some
cases (when entering codes in the "TO" column that cannot be generated by the
keyboard), it is a necessity. The "DECIMAL" and "HEX" modes allow you to enter
the key codes as decimal or hexadecimal numbers, respectively.
When you are entering a code in the direct mode, the bottom five lines of the
display are changed as shown in Figure 8.74. Note that you may press  to
switch modes. Because of this use of  you may not enter  in the direct
mode; you must switch to "DECIMAL" or "HEX".
1:
2:
3:
4:
5:

DIRECT mode
<-- (press ESC to switch modes)
Press desired "FROM" key:
Figure 8.74

Editing in DIRECT Mode

In the "DECIMAL" mode, the bottom five lines of the display will appear as shown
in Figure 8.75.
r

I

1:

2:
3:

DECIMAL mode
<-- (press ESC to switch modes)
Enter desired "FROM" byte in DECIMAL form:
(enter 128 to delete)
Figure 8.75

~I
~

Editing in DECIMAL Mode

In the "HEX" mode, the bottom five lines of the display will appear as shown in
Figure 8.76.
~

~

1:

~

2:
3:
4:
5:

HEX mode
<-- (press ESC to switch modes)
Enter desired "FROM" byte in HEX form:
(enter 80 to delete)
~

Figure 8.76

Editing in HEX Mode

After you enter the "FROM" code, the special cursor will move to the
You should now enter the key code that you want to replace the code
in the "FROM" column. Note that if you want to remove a code from
"FROM" or "TO" column, you must switch to the "DECIMAL" mode and
to the "HEX" mode and enter 80.

"TO" column.
you entered
either the
enter 128 or

UTILITY PROGRAMS

page 8.80
KXEDIT

P&T CP/M 2
User's Manual

Figure 8.77 shows the KXEDIT display after five translations have been specified In
this example,  (holding down the control key while pressing apostrophe) has
been translated to the accent grave character which is not generated by the
keyboard Also the left and right brackets and braces have been interchanged
This makes the brackets unshifted and the braces shifted (the opposite of the
keyboard). You might make this swap if you frequently work on another system
where the brackets are lower case or if you use brackets more frequently than
braces.
~

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:

I ----- " FRO M " ------- )
I key-name
asci I dec hex )

II

1:
2-- ,
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:

I CTRL
{
I
}
I
I
I
I
J
I
[
[
[
[
[

I
[

I
[
[

,

{
}

I
)

162 A2h
123 7Bh
125 7Dh
91 5Bh
93 5Dh

)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)

I ------- " TO"
asci I
I key-name

.....

.....
.....
.....
.....
.....
.....
.....
.•...
.....
.....
.....
.....
.....
.....
.....

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

"

--------dec hex

,

I

I

)
{
}

)
{
}

Use "UP" and "DOWN" arrow keys to choose selection.
DIRECT mode
Press ESC to edit selection.
Press ENTER for more options.

96
91
93
123
125

60h
5Bh
5Dh
7Bh
7Dh

)
)

"

)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)

...

Figure 8.77 KXEDIT Display After 5 Translations are Specified

After you have finished making all the changes you want, you should press the
 key and KXEDIT will present a display as shown in Figure 8.78. In order for
KXEDIT to make the translations permanent, it must write them into the
BIOSPARM.PNT file that is used when the system is loaded It looks for this file
on logical drive that is the current drive when KXEDIT was executed For
example, if KXEDIT is on logical drive A but logical drive D is the boot drive (this
can happen in a hard disk system), you should log onto drive D and then execute
KXEDIT from drive A by typing the command "A:KXEDIT". If the BIOSPARM.PNT
file cannot be found, Option 2 as shown in Figure 8.78 to make the changes
permanent will be omitted from the display and the "Exit" option will become
Option 2.
If you choose option 1, you will be returned to the editing display (Figure 8.73) so

that you can make additional changes. If you choose option 2, KXEDIT will install
the translations in the BIOSPARM.PNT file so that they will be in effect the next
time the system is loaded. If you choose option 3, the translations will be installed
in the system in memory and you will be returned to the system command leveL
NOTE: if you want the translations to be permanent you must choose option 2
before exiting with option 3. If you press the  key, the program will return
to the system command level without installing the translations in the system in
memory.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.81
KXEDIT

,.
1
2
3

4
5

OPTIONS:

6

1 - Do some more editing

7

8
9

2 - Make changes permanent on System Disk

10

3 - Exit

11
12
13

Please enter your choice here:
Figure 8.78 KXEDIT Options

Possible Error Messages
No key translator residing in system.
This message is displayed if you execute KXEDIT on a system that does not
include the KEYXLATE module. If you want to use KEYXLATE you should use
the MODSEL utility program (see Section 6.3) to select the KEYXLATE module
for inclusion in the system.

»»

Error: Unable to make changes permanent.
This message is displayed if a disk error occurred while attempting to store the
current key translation table in the BIOSMODS.PNT file.

page 8.82
LOAD

8.19

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Utility name: LOAD
Purpose: To convert an Intel HEX format file into an object code
file.
General Description

The output from ASM and some compilers is an Intel hex format file consisting only
of AScn characters which represent the actual machine language. Because this
format was originally intended for use with paper tape, some error detection
information is included. In order to execute a program, it is necessary to convert
this hex format to normal object code (machine language). LOAD performs this
function.

Using LOAD
Figure 8.79 illustrates the use of LOAD. The command that executes the routine
includes the name of file to be converted, as shown on Line 8.79-L Note that the
extension ".HEX" is assumed and should not be given on the command line. In this
example, the command instructs LOAD to load the file named SETTIME.HEX. (The
source file SETTIME.ASM must have been previously assembled to generate the hex
file).
1:
2:
3:
4:
5:
6:

7:

8:
9:

A>LOAD SETTIME
FIRST ADDRESS 0100
LAST ADDRESS 029C
BYTES READ
0173
RECORDS WRITTEN 04
A>

Figure 8.79 Example of Using LOAD

LOAD displays four numbers on the console which provide statistics about the file
that was loaded. The first number (Line 8.79-3) gives the first address in memory at
which information from the hex file appears. Inmost cases this number will be
lOOh, since the loading of all transient programs begins at that address. The second
number (Line 8.79-4) shows the last address in memory at which information from the
hex file appears. Note that the hex file need not specify information for all of
memory between the first and last addresses.
The third number (Line 8.79-5) gives the number of bytes of data that were
converted from hex format to binary. In this example, there were 173h bytes of
object code in the program. The fourth number (Line 8.79-6) gives the number of
logical sectors (128 bytes) written to the output file.
Output from LOAD is stored in a disk file with the same primary name as the one
specified on the command line and is given a ".COM" extension. It is assumed that
the object code files generated by LOAD will be used primarily as transient
programs, so they will be loaded into memory starting at lOOh. If the first load
address in the hex file is larger than lOOh, LOAD adds enough filler to the
beginning of the ".COM" file so that the resulting object code will appear at the

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.83
LOAD

correct address when the ".COM" file is loaded. For example, if the lowest load
address is 4100h, LOAD will output 16 Kbytes at the beginning of the file.

Possible Error Messages
DISK READ ERROR

An error occurred while reading the input file. It probably indicates a bad file
on the disk.
DISK WRlTB BRROR
An error occurred while writing to the output file. It usually indicates that

space has been exhausted on the disk to which the output file is being written.
INVALID HBX DIGIT

LOAD has found a character in the input file that is not a valid hex digit or
one of the delimiters used in a hex file. This error commonly occurs because of
an input file that does not contain hex format data.
CHECK SUM BRROR

A check sum error was found in the hex format file as it was being converted
to binary format. It probably indicates a bad copy of the hex file.
CARNOT OPBN SOURCB

The source file specified in the command line that executed LOAD cannot be
found on the specified disk.
NO MORE DIRBCTORY SPACB

The directory on the disk to which the output file is to be written cannot
accommodate another needed directory entry. This can occur when the file is
first created or as it grows so large that another physical extent is needed in
the directory.
CARNOT CLOSB PILB
An error has prevented the output file from being properly closed. This is an
unusual error. If it occurs it may indicate a hardware problem. Transfer the

needed files to another disk and try again.
INVERTED LOAD ADDRBSS

LOAD has found a record in the hex file specifying a load address less than the
highest load address used to that point. Load addresses within a hex file must
be in strictly ascending order.

Ell

page 8.84
MODSEL

8.20

UTILITY PROGRAMS

f&T CP/M 2

User's Manual

Utility name: MODSEL
Purpose: To select the modules that are to -be included in the
system when it is loaded.

Gene..al Description
MODSEL allows you to select the modules that are to be included in the system
when it is loaded. This allows you to easily include portions of the system you
need (the serial port interface, for example) and leave out thO$e you do not need
(perhaps the parallel printer port interface).
.
MODSEL is described fully in Section 6.3 of this manuaL - Please refer to that
section for details.

P&T .CP/M 2 .
User's· Manual

8.21

UTILITY PROGRAMS

page 8.85
PATCH

Utility name: PATCH
Purpose: To install P&T supplied patches to disk files.
Ge~eral

Description

The PATCH program provides an easy means of installing corrections and
modifications to programs supplied with P&T CP/M 2. PATCH accepts simple patch
codes and uses them to· make changes to a particular program file. When changes
are necessary toaP&T CP/M 2 program, you will receive a written copy of the
codes which should be entered into PATCH to make the changes.
The patch codes used by PATCH consist of groups' of three letters with several of
the groups on each line. Since the codes contain letters only they are easy to type
and they contain internal checks to insure you type them into PATCH properly.
Should an error be discovered in a line you enter, PATCH will report it and ask
you to enter it again.
PATCH makes changes "in place" on a disk file. This means that the copy of the
file you are working on will be changed. You should always make a backup copy of
the file before patching it just in case something goes wrong.

Using PATCH
Figure 8.80 shows the command line that executes PATCH.
A>PATCH
Figure 8.80 Command Line to Execute PATCH

soon as PATCH begins execution, it will clear the screen and ask you for the
name of the file to be patched as shown on Line 8.81-5 of Figure 8.81. You should
enter the name of the file you are patching. In this case a file named PGM.COM is
specified.

As

1:

2:
3:

Patch Utility - ver 3.xxx
copyright 1983 Pickles & Trout, al I rights reserved

4:

5:

Enter name of fl Ie to be patched: PGM.COM

6:

7:
8:
9:

10:
11:

Enter name of fl Ie containing patch-codes
- or Just press  to type patch-codes in by hand
Patch-codes file: 
Figure 8.81

Entering the File to be Patched

In many cases there will be only a limited number of patch codes so there is no
trouble entering them directly to PATCH. In some cases, however, the changes may
be fairly extensive and you might want to use an editor to create a text file

UTILITY PROGRAMS

page 8.86
PATCH

P&T CP/M 2
User's Manual

containing the patch codes. This allows you to check the codes yourself before
having PATCH install them. In addition, this allows you to easily and quickly install
the patches on different copies of the file being patched. Lines 8.81-7 to 8.81-11
allow you to enter the name of a text file containing the patch codes. If you have
created such a file, you should enter its name on Line 8.81-11. In this example, the
patch codes will be entered directly to PATCH so just  is pressed.
Figure 8.82 shows the console display presented by PATCH while you enter the patch
codes. Line 8.82-5 shows the name of the file being patched. Lines 8.82-7 to 8.82-10
remind you of how to enter the patch codes. Starting on Line 8.82-12, PATCH
prompts you for the patch codes one line at a time. While you are entering the
patch codes, all non-alphabetic characters are ignored. Lower case letters are
automatically converted to upper case and PATCH automatically inserts a space
after every three characters.
1:
2:
3:
4:
5:

Patch Utility - ver 3.xxx
copyright 1983 Pickles & Trout, al I rights reserved
Fi Ie being patched: PGM.COM

6:

7:
8:
9:
10:

11:
12:

13:
14:
15:
16:

17:
18:

Type in appropriate patch-codes at each Line prompt.
Press  at the end of each Line.
Each Line of patch-codes is checked for typo's when  is pressed.
If any errors are detected you wil I be re-prompted for that Line.
Line 1 --> TAC VAB RAC AAD BDC DHD
ok ••
Line 2 --> DDE QAD AAE BEC EDE ELN
•• ok ••
Line 3 --> EFE GZU PIC BEP
•• ok ••
Patch successfully instal led in

PGM.COM

A>
Figure 8.82

Entering Patch Codes by Hand

When you have entered all the patch codes for one line, press the  key.
PATCH will then check the line for errors and display and, if none are found, will
display "00 ok 00" at the end of the line. If an error is found, PATCH will display an
error message and prompt you to enter the line again. You should double check the
characters you entered against the patch notice you are working from to find the
errors.
After you enter the last line of the patches, PATCH will install the changes in the
specified file. It displays the message shown on Line 8.82-13 after the changes have
been made and then returns to the command level of the system.
Figure 8.83 shows the console display while PATCH reads the patch codes from a
text file. In this example, the text file PGM.PAT contains the patch codes. Note
that there is no user interaction while PATCH reads the patch code file; everything
proceeds automatically.

P&T CP/M 2
User's Manual

1:
2:
3:
4:
5:
6:
7:

UTILITY PROGRAMS

page 8.87
PATCH

Patch Utility - ver 3.xxx
copyright 1983 Pickles & Trout, all rights reserved
File being patched: PGM.COM
Reading in patch-codes file PGM.PAT

8:

9:
10:
11:

Line 1 --> TAC VAB RAC AAD BDC DHD
ok ••
Line 2 --> DDE QAD AAE BEC EDE ELN
•• ok ••
Line 3 --> EFE GZU PIC BEP •• ok ••

12:

13:

Patch successfully Instal led In

PGM.COM

14:
It..

15:

A>

Figure 8.83 Reading Patch Codes from a FI Ie

Possible Error Messages
xxxxxxxx was originally named yyyyyyy
Is this the right file to patch? (yIn) :
This is not strictly an error message. It is displayed if the file you are trying
to patch has been renamed. The "xxxxxxxx" in the message will be replaced by
the current file name and the "yyyyyyyy" will be replaced by the original file
name. Since patch notices will refer to the original name of the file, this
message gives you a chance to check that you are installing the patch on the
correct file.
Press  to quit, press any other key to try again
This message is displayed after other error messages to give you the option of
exiting the program or re-entering the information that resulted in an error.
Exit here? (yIn) :
This message is displayed when you press the  key (except in response to
the previous message). An affirmative response will return you to the command
level of the system while a negative response will return you to PATCH at the
point you pressed .
<- Bad file name
This message is displayed if a file name you specified is invalid. This can be
caused by a file name that contains illegal characters or an illegal drive
specification (ie. not in the range A - P).
<- Error in this Line.
This message is displayed at the right end of a line of patch codes in which an
error was detected.
Something is wrong with the patch codes you have entered.
One or more of the lines has an error that went undetected earlier.
Please check each line carefully.
Although it is very unlikely, it is possible that the line-by-line checking that is
done on the patch codes will miss a typing error. To guard against this, PATCH
makes a check encompassing all of the patch codes that have been entered. If
this check fails, at least one error slipped through the line-by-line checking.

page 8.88
PATCH

UTILITY ,PROGRAMS

P&T~CP/M!2

User's Manual

After this message has been displayed, PATCH will show you each of the'lines
you' have entered and ask you if it is OK., Carefully check each line against the
patch notice you are working from. If you indicate that a line is not OK/{ie.
respond negatively), PATCH will prompt you to re-enter the line. You may press
 during this process to abort PATCH and return to the command le·v:eb of
the system.
Can't find file to be· 'patched ffffffff.eee
PATCH displays this message if it cannot find the file you specified as the file
to be patched. "ffffffff.eee" will be replaced by the name you specified. Check
that you entered the name correctly and specified the correct drive.
ffffffff.eee is an empty file: Can't install patch.
This message indicates that you have asked PATCH to make changes to a file
that has zero length. There is something wrong with the file you specified.
ffffffff.eee has internal error(s): Can't install patch.
If the file being patched has been set up to be verified with the VERIFY
program, PATCH first verifies that the file has no errors before making changes.
This message indicates that errors were detected in the file. Getting another
copy of the file from the master disk should solve the problem.
This patch is not meant to be installed in ffffffff.eee
PATCH has discovered something amiss with the file that you are attempting to
modify. This usually indicates that you are trying to patch the wrong file or
that the file has been corrupted in some way. "ffffffff.eee" will be replaced by
the name of the file you are trying to patch.
This patch is already installed in ffffffff.eee
If PATCH finds that the changes specified by the patch codes have already been
made to the file, it will display this message. "ffffffff.eee" will be replaced by
the name of the file you are trying to patch.
Patchs n, n, n must be installed
before this patch can be installed.
Each patch is given a number which is recorded in a file when the patch is
applied to the file. In some cases the order in which patches are installed may
be important. For this reason, PATCH has the ability to check for other
patches already having been installed. This message is given if certain patches
are required to have already been installed but were not present in the file.
The "nllls will be replaced by the numbers of the patches that are required. You
should install these patches before attempting to install the patch you have just
entered.
Error while closing ffffffff.eee
This message indicates that an error occurred when the file being patched was
closed. The "ffffffff.eee" will be replaced by the file name. The file mayor
may not still be usable after this error occurs.
Error in Line nn of patch-codes file.
This message is displayed if PATCH finds an error in one of the lines of patch
codes read from a text file containing patch codes. The "nn" will be replaced
by the number of the line on which the error was detected.
Previously undetected error(s) somewhere in patch-codes file.
Although it is very unlikely, it is possible that the line-by-line checking that is
done on the patch codes will miss a typing error. To guard against this, PATCH

P&T CP/M 2

UTILITY PROGRAMS

User's Manual

page &89

. PATCH

makes a check encompassing all of the patch codes that have been read from
the file. If this check fails, at least one error slipped through the line-by-line
ehecking. You should double check the entire file to find the. error.
Unexpected. end of patoh-eodes

tne.

This message is given if the end of the text file containing the patch codes
encounteted belote aU of the patch codes are read. This typically results from
not entering all C)f the lines of patch code in the text file.

•

page 8.90
PIP

8.22

UTILITY PROGRAMS

P&T CPIM 2

User's Manual

Utility name: PIP
Purpose: 1b transfer (copy) information between peripherals on
the system.
General Description

PIP is a utility program for transferring data from one peripheral device to another.
Virtually all of the peripheral devices on the system may be accessed by PIP, but
the routine is most commonly used for transfers from disk to disk or disk to printer.
Some processing may be performed on the data as it is transferred, including
concatenation of two or more files.

Using PIP
There are two types of command lines for executing PIP, as illustrated in Figure
~ommands for PIP
operations on a single line. Line 8.84-2 shows the second type, which causes PIP to
prompt you for further commands by displaying an asterisk (*). In this mode of
Gperation, PIP will continue to accept commands either until a blank command line
is entered or the  key (or (ctl-C» is pressed.

8.84. The first type, shown on Line 8.84-1, allows you to enter all

1:
2:

A>PIP (commands)
A>PI P

Figure 8.84 Command lines to Execute PIP

The PIP commands have the general form shown in Figure 8.85. Note that the
spaces shown in Figure 8.85 (e.g. between "dest" and "=") are for clarity only; they
are not required. In an actual command, "dest" would be replaced by the
destination of the PIP operation, which may be either a disk file or non-disk output
device. "sreA," "srcB," etc., would each be replaced by a source of the data to be
transferred. Each of these would be a disk file or non-disk input device.
Additional processes to be performed may be specified optionally following each
source indication by enclosing the option letters in square brackets.

I

dest· srcA(optAJ , srcB(optBJ , ••• , srcz(optzJ

'1

fbr example: lST:=FllE1(NJ,FllE2
Figure 8.85 General Form of PIP Commands

It should be noted that no PIP operations literally "move" a file from one disk to
another. When the source of data in a PIP operation is a disk file, the original file
will be left unchanged. In other words, PIP will simply ~ its contents to the
specified destination. However, if "dest" names a disk file and a file by that name
already exists (on the destination drive), the previously existing file will be removed
upon the suceessful completion of the transfer. This removal is automatic in most
cases. You will be prompted for permission to remove it only if the file is marked
as "read only" (RIO) and you have NOT specified PIP's W option (discussed below).
The W option causes PIP to make the deletion without asking permission.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.91
PIP

The "src" and "dest" parameters in the PIP commands may be disk files, logical I/O
devices, physical I/O devices, or certain special I/O devices. A unique file name
(unqfn) may be used for any "src" or "dest". In some cases, a wildcard file name
(wcfn) may be used as a "src".
In addition to the general form of PIP commands shown in Figure 8.85, several
shorthand forms of PIP commands are allowed, as illustrated in Figure 8.86.

-...

1:
2:
3:
4:
5:
6:

drl :=wcfn
drl:=dr2:wcfn
drl:=unqfn
drl:=dr2:unqfn
unqfn=dr2:
drl:unqfn=dr2:

..II

Figure 8.86 Shorthand Forms of PIP Commands

Line 8.86-1 shows a shorthand form that will transfer all files matching the wildcard
file name from the current default disk to the disk specified by "drl". (Note: "dr1"
would be replaced by a single letter drive name in an actual command line.) The
shorthand form in Line 8.86-2 will transfer all files matching the wildcard file name
from "dr2" to "dr1". Neither "dr1" nor "dr2" are required to be the current default
drive. These are the only two forms of PIP commands that allow wildcard file
names. Note that no file names are specified for the "dest" parameter; the
transferred files will be stored with the same name they had on the source disk.
Lines 8.86-3 to 8.86-6 show shortened PIP commands that transfer a specific file from
one disk to another. Note that the file name must be specified only once, since it
will be stored on the destination drive under the same name. The commands on
Lines 8.86-3 and 8.86-4 are similar to those on Lines 8.86-1 and 8.86-2 except that they
specify a particular file to be transferred. In fact, these commands are simply
special cases of the other two, because a wildcard file name can always be
replaced by a unique file name.
A unique file name may also be specified as the "dest" in shortened PIP commands,
as shown in Lines 8.86-5 and 8.86-6. The command on Line 8.86"":5 will transfer the
file named by the "unqfn" from the drive specified by "dr2". to the curren~ default
drive. A similiar command on Line 8.86-6 will transfer the specified file from "dr2"
to "dr1".
With one exception, you cannot specify the same file. name on the same drive for
both source and destination in a PIP command. Doing so will cause PIP to report
an "INVALID FORMAT" error. The exception is that files may be transferred
between users on the same disk, as explained below under the G option.
Any of the CP/M non-disk logical I/O devices may be specified as a source or a
destination. In this case, the· logical device's input or output is directed to the
physical device assigned to it by the operating system. This assignment may be
changed by the ASSIGN, SETUP and STAT utilities,asde$cribed in Sections 8.5, 8.27,
and 8.28 of this manual, or by programs. The logical device names recognized by
PIP are shown in Figure 8.87.
.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.92
PIP

'II

The currently assigned console device; typically
the system keyboard and video display.
The currently assigned system printer.
The currently assigned reader device.
The currently assigned punch device.
Logical I/O Devices Available to PIP

PIP can also reference non-disk physical I/O devices directly. Unfortunately, the
physical device names recognized by PIP have little correspondence to the actual
physical devices available on the TRS-80 Model n/12/16. (PIP recognizes only the
physical device names of generalized CP/M. Many of the other utilities of P&T
CP/M 2 recognize names that have been customized to the Model ll/12/16, as
discussed in Section 5.7.) Figure 8.88 shows the physical device names that PIP
recognizes and their corresponding devices on the Model ll/12/16.
name used
~
TTY:

CRT:

UC1:
UR2:
UP2:
UL1:
LPT:

PTR:
UR1:
PTP:
UP1:

actual physical device
serial port A (Input and output)
system keyboard and vIdeo display (Input
serial port B (Input and output)
serial port B (Input on Iy)
serial port B (output only)
serial port B (output only)
centronics port (output only)
user reader dev Ice 1 If Insta II ed (1 nput
user reader device 2 If Installed (Input
user punch device 1 If Instal led (output
user punch device 2 If Installed (output

and output)

on Iy)
only)
only)
on Iy)

Figure 8.88 Physical I/O Device Names Used by PIP

Additional capabilities of the PIP routine are provided by access to special I/O
devices. In this way, PIP can perform functions and/or access I/O devices that are
not available with the standard system configuration. The names of these special
devices are shown in Figure 8.89. More information on the patching of user supplied
input and output routines into PIP is presented later in this section.
~

function

NUL:

Sends 40 NUL characters (ASCII code 0) to the destination. It was
implemented primarily for use w.lth paper tape punches for generating
leader and trailer sections. NUL: may be used as a source only.

EOF:

Sends a CP/M end of file character (  ) to the destination.
Note that PIP automatically sends a  to the destination at the
end of any ASCII transfer. EOF: may be used as a source only.

PRN:

Sends characters to the system printer (LST: logical device). As the
file Is transferred, tabs.areexpanded to every eighth column, all
II nes are numbered, and form feeds are I nserted after every 60 lines.
A form feed Is sent to the printer before the transfer to position the
paper to. the top of a new page. The furictlon of PRN: .Is the same as
LST: with the [t8npl options. PRN: may be used as a destination only.

INP:

Accepts characters from a user supplied Input routine that Is patched
Into PIP. INP: may be used as a source only.

OUT:

Sends characters to a user supplied output routine that has been
patched Into PIP. OUT: may be used as a destination only.
Figure 8.89 PIP Special I/O Devices

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.93
PIP

Figure 8.90 gives several examples of PIP commands with a brief explanation of
each.
~

B:=*.COM

Transfers all files with the extension COM from the
current default drive to drive B.

A:=C:INVTORY.*

Transfers all files with the primary name INVTORY from
drive C to drive A.

B:=PIP.COM

Transfers the file PIP.COM from the current default
drive to'drlve B.

LST:=FILE1.TXT

Transfers the file FILE1.TXT from the current default
drive to the system printer (logical device LST:). Note
that no special processing (such as tab expansion) Is
performed on the file unless options are specified.

TTY:=B:FILE1.TXT

Transfers the file FILE1.TXT from drive B to serial
port A.

UC1:=FILE1.TXT,NUL:

Transfers the fl Ie FILE1.TXT from the current default
drive to serial port B and appends 40 nulls to it.

~

Figure 8.90 Examples of PIP Commands

The example in Figure 8.91 shows the use of PIP to transfer several files. First
(Line 8.91-1) PIP is executed with a command line which includes the PIP command
to concatenate (append one to another) two files and place them in a file on disk B
called TEST.1. PIP is then executed again (Line 8.91-3) but with no PIP commands
on the command line. In this case PIP prompts for commands and three separate
command lines are entered from the console (Lines 8.91-4 to 8.91-6). Since a
wildcard file specification is used on Line 8.91-6, PIP reports the filenames of that
match the specification as it copies the files (Lines 8.91-8 to 8.91-11). Finally the
 key is pressed to return to the operating system.
1:
2:

3:
4:
5:
6:

7:
8:
9:
10:

11:
12:
13:

14:

A>PIP B:TEST.l=SETUP.COM,SETMISC.COM[V)
A>PIP
*B:=SETUP.COM[V) 
*B:TEST.l=SETUP.COM,SETMISC.COMIV)
*B:=*.ASMIV) 
COPYINGDUtoP.ASM
SETTIME.ASM
TlME.ASM
*
A>
Figure 8.91

Example of Using PIP

Processing Options of PIP
PIP provides several processing options that may be used to modify the data being
transferred. These are specified by single option characters enclosed wi thin square
brackets on the command line (see Figure 8.85). When arguments are needed, they
immediately follow the option character. Any numeric arguments are always entered
as decimal numbers. Also, several options may be specified within one set of
brackets. In this case, the arguments may be separated from each other by spaces
if desired, even though spaces are not necessary. Figure 8.92 gives a summary of
the options available in PIP.

page 8.94
PIP

UTILITY PROGRAMS

P&T CP/M 2

User's Manual

Use block transfer mode.
Delete characters which extend past column n on each line.
Echo all characters transferred to the console.
Remove all form feeds from the data as It Is transferred.
Get the fl Ie from user number n.
Transfer a hex format file whl Ie checking for errors.
Ignore :00 records In a hex format fl Ie (automatically sets H option).
Convert upper case characters to lower case during transfer.
Prefix each line transferred by Its line number. Leading zeroes are
suppressed and the number Is fol lowed by a colon.
Prefix each line transferred by Its line number. Leading zeroes are
printed and the number Is fol lowed by a tab character.
Binary fl Ie transfer - Ignore  as end of file mark.
Insert a form feed after every n'th line with an Initial form feed.
Stop the transfer operation when the string "s" Is encountered.
Read files with the SYS attribute set. Unless thl~ option Is used
PIP wll I not find files wil I the SYS attribute set.
Begin transferring when the string "s" Is found In the source data.
Expand tab characters to every n'th column with spaces.
Convert lower case letters to upper case during transfer.
Read back data from the destination to verify that there were no
errors In the copy operation. Destination must be a disk file.
Do not request permission to delete disk files which are set to RIO
and have the same name as the speci fled dest I nat i on f I Ie.
Clear (set to 0) the high order (parity) bit of each byte transferred.
Figure 8.92 Summary of PIP Options

B option
This option causes PIP to store data from the source device and save it in a
memory buffer until a  character is received from the source. Upon receiving
the , PIP will transfer the data to its destination (typically a disk file) and
begin to accept characters from the source again. (Note: There is no interaction
between PIP and the source device; the source device must wait until PIP has
completed the transfer to the destination before beginning to send data again.) The
amount of data which can be buffered in memory depends on the size of the system
in which PIP is operating.

Dn option
The Dn option causes PIP to truncate all lines after the "nth" column. All
characters of any line that fall beyond the specified column will be ignored. This
function is useful in transferring a file with long lines to a device (such as a
printer) that cannot handle them.

P&T CP/M 2
User's Manual

E

UTILITY PROGRAMS

page 8.95
PIP

option

This option causes all data bytes transferred to be echoed to the system console.
is useful as a monitor of activity as the transfer takes place. However, care
should be taken not to use the E option when transferring binary data, since it may
cause strange things to happen on the console display. Also note that using the E
option will slow down the transfer somewhat due to the time required for the
display.

It

F

option

The F option causes PIP to remove all form feeds from the data as it is
transferred. This function is most useful when transferring files containing form
feeds to a printer. The F and P options may be used in combination to remove
existing form feeds and insert new ones at different locations within the file. (This
action may be needed, for example, to print a file on a different sized paper.)

G option
Usually, PIP permits only the disk files under the current user number to be
involved in data transfer (as source or destination). The G option allows a file to
be retrieved from another user number and stored under the current user number.
A transfer of this type is the one case where PIP will let you specify the same
disk drive for both the source and destination files.
Note that PIP has no option Which allows files to be stored under a specific user
number. This implies that PIP itself must already be resident under the user
number to which the files are to be transferred. Immediately, the question of how
to store PIP under a new user number presents itself. There is only one answer:
read PIP into memory, switch to the new user number, and then save it back on
the disk (under the new number). This procedure requires the USER and SAVE
commands of CP/M as well as the DDT program.
In the example shown in Figure 8.93, PIP is transferred to users 3 and 5. In other
situations, PIP can be transferred to as many users as desired merely by repeating
Lines 8.93-7 and 8.93-8 for each user number. You should keep in. mind, however,
that a new copy of PIP is stored and more disk space is taken up each time you
perform this operation. Clearly, the need to maintain separate copies of commonly
used programs can limit the usefulness of user numbers on floppy disk based
'
systems.
Note that the Pickles & Trout Advanced Command Processor (P&T ACP) for CP/M 2
can eliminate many of the problems involved in using the different user areas on a
disk. The P&T ACP is available as a separate product; contact your dealer or
Pickles & Trout for further details.

page 8.96
PIP

UTILITY PROGRAMS

1:

2:
3:
4:

5:
6:
7:

8:
9:

10:
11:
12:

P&T CP/M 2
User's Manual

A>USER O
A>DDT PIP.COM
DDT VERS 2.2
NEXT PC
lEOO 0100
-
A>liSER'3
A>SAVE 31 PIP.COM
A>USER 5
A>SAVE 31 PIP.COM
A>USER O
A>

Figure 8.93 Example of Transferring PIP to Other User Numbers

H

option

The H option informs PIP that an Intel hex format file is being transferred. PIP
then checks all records within the file for errors and determines whether they have
the proper hex format. Any non-essential characters between records are removed
during the transfer. If PIP should find an error, it will report it on the system
console and wait for operator action.
If an error is reported while a disk file is being transferred, only two option are

open to you. By pressing the  key, you will cause PIP. to continl.le with the
next record in the source. Or, you can type  to abort the transfer. If you
continue the transfer, the record containing the error will not be transferred to the
destination.
In a few cases, it is possible to "rewind" the source device to a location previous
to the error and try again. This is a holdover from the days of paper tape (perish
the thought) when reading errors were all too common. After the source device is
rewound and  is pressed, PIP will begin reading again. If the error was a
transitory one, the transfer might be successfully completed.
Error checking is not automatically performed on files whose names have the
extension "HEX". If you want the format of a hex file checked, you must use the
H option. A simple way to perform this operation is to use the H option while
transferring the file to the CON: logIcal device. Since the console is made the
destination of the transfer, another disk file is not created.

I

option

This option causes PIP to assume that the file being transferred is· a hex file and
to remove any :00 records (since they contain no meaningful data) from it. In doing
so, it automatically turns on the H option (described above).

L

option

The L option causes all upper case letters to be converted to lower case as the
transfer is made.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.97
PIP

Nand N2 options
Both cause PIP to number the lines of a file as it is transferred. The five-digit
line numbers are placed at the beginning of each line starting at one and
incrementing by one for each line transferred. These options can be useful when
using an editor (such as ED) that uses line numbers in the editing process.
If the N option is specified, the leading zeroes of the line numbers are replaced by
spaces and the line number is followed by a colon and a tab character. The
characters on the line immediately follow the tab. If the N2 option is specified,
the leading zeroes of the line number are printed and a tab character (only)
separates the line number and the characters on the line.

o

option

The 0 option forces PIP to treat the file as a binary (object) file. PIP will not
stop transferring data upon finding a  character, as it would with an AScn
file; it will continue until encountering the physical end of file. All files with the
"COM" extension are automatically treated as binary files.

Pn option
The P option causes PIP to insert a form feed character into the file after every
"nth" line as it is being transferred. A form feed character is also inserted as the
first character sent to the destination. If n is specified as 1 or is not given, form
feeds are inserted after every 60 lines. If the P option is used in combination with
the F option, the form feeds are removed from the source data before new ones
are inserted by the P option.

Qs(ctl..z) option
The Q option causes PIP to stop the transfer of data after encountering a specified
string (denoted by "s"). A  character must be entered to terminate the
string, and the string will be included in the data transferred. If the Q option is
included in a command line that executes PIP (as shown on Line 8.84-1), all of the
characters in the string will be converted to upper case. If the Q option is used
while PIP is prompting for commands, the string will not be converted to upper
case.

R option
PIP normally does not access files that have been marked with the system attribute
(SYS). If such files (which would not be included in directory listings) are to be
transferred, the R option allows PIP to access them.

Ss(ctl-z) option
The S option causes PIP to search the source data for the string specified (denoted
by "S"). When the string is found, PIP will begin to transfer data, with the string
included, to the destination. A  character must be entered to terminate the
string. If the S option is included in a command line that executes PIP (as shown
on Line 8.84-1), all of the characters in the string will be converted to upper case.

•

page 8.98
PIP

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

If the S option is used while PIP is prompting for commands, the string will not be
converted to upper case.
The Sand Q options can be used together to extract a section of a file by
specifying both the starting and ending strings.

Tn option
The T option causes PIP to expand tab characters into multiple spaces so that the
effective tab stops occur in every "nth" column. This option is particularly useful
when transferring a text file to a printer or other device that does not know how
to handle tabs.

U

option

The U option causes PIP to convert all lower case letters into upper case as the
data is transferred.

V

option

The V option may be used only when the destination is a disk file. It causes PIP
to read back the data written to the file and check that it was written correctly.
If a discrepancy is found in the re-reading of the data, an error is reported.
Transfers with the V option require somewhat more time than those without it due
to the extra steps involved.
W

option

When the destination for a transfer is a disk file and there is a file of the same
name already on the destination disk, PIP will ordinarily delete the existing file.
However, if that file's "read only" attribute has been set, PIP will prompt you for
permission before making the deletion so long as the W option is not used. If you
do not grant permission, PIP will abort the transfer and then return to the
operating system or prompt for another command. If permission is granted, the
existing file will be deleted and replaced by the result of the transfer.
The W option causes PIP to ignore the "read only" attribute of files on the
destination disk and delete ~ files whose names have been duplicated by a
transferred file. In other words, PIP will not request your permission to make the
deletion; it will occur regardless of whether the file is set to "read only" or not.
This action can be useful in transferring a number of files without operator
interaction, but it can also be risky to use. Files are usually set to "read only"
status to prevent their modification. Since the W option removes this protection, it
should be used sparingly and carefully.
Z

option

The Z option instructs PIP to clear the high order bit (bit 7; sometimes called the
parity bit) on each data byte as it is transferred. This can be useful when
transferring a file that might contain non-ASCII characters to a device (such as a
printer) that might not understand them.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.99
PIP

Special Notes About PIP
 is the standard CP/M end of file mark for all files containing ASCn
characters. PIP always looks for a  to mark the termination of AScn data,
even when the source is a non-disk device. For example, if the CON: device is
used as a source, any characters typed on the console keyboard will be transferred
to the destination device. PIP will continue to wait for more characters from the
console until a  is typed, which PIP recognizes as the end of the· data.
When using the RDR: device as a source, it is possible to terminate the reading of
data by typing a  at the system console. Unfortunately, this feature has
some limitations. PIP checks the console keyboard for a character between the
reading of any two characters from the RDR: device. If a character is available
from the keyboard, PIP reads it and checks for . If it is a , PIP acts
as if it had read a  from the RDR: and stops reading data from it.
However, when PIP requests a character from the RDR: device, the system will not
return control to PIP until a character from the RDR: device is available. When no
characters are coming in from the RDR: device, PIP will lose control of the
computer as soon as it requests a character from the RDR: device. Since PIP loses
control of the computer under this circumstance, it will not be able to check the
console for characters. As a result, input from the RDR: device can be interrupted
from the console only if data is actually being received If reception of data has
stopped, the system will wait forever for the next byte to arrive from the RDR:.
To overcome this, you must append a  to the end of the file being
transferred. It the file is coming from another computer, you may append a 
by using the EOF: special I/O device. Figure 8.94 shows a command line that
executes PIP to transfer a file to the PUN: device and append a .
(

Figure 8.94

PIP PUN:=FILE.TXT,EOF: )

Example of Appending  to a File

When files are concatenated (more than one source file is specified in the PIP
command), PIP ordinarily assumes that they contain AScn characters and that each
file is terminated with a . When PIP encounters the first  in a file, it
stops reading. If non-ASCn files are being concatenated, the 0 option should be
used As noted above, it forces PIP to ignore 's and continue to the physical
end of file for each file in the list.
When transferring data to a non-disk I/O device with PIP, any character typed at
the console keyboard will abort the transfer. Obviously, this action prevents you
from entering more PIP commands during the transfer by typing ahead. However,
when PIP is transferring to a disk file, it cannot be interrupted until the transfer
is completed, so it is possible to type ahead during disk transfers.
When PIP discovers an error and aborts an operation, it will also erase any $$$.sUB
file on drive A. This has the effect of terminating a SUBMIT file that is in
operation.

User Supplied 1/0 Routines for PIP
PIP provides space from l03h to
patched in. When PIP wants to
routine (INP:), it makes a CALL
expects the input data to be in

IFFh for special user-supplied I/O routines to be
read a character from the user-supplied input
to location l03h. After making this CALL, PIP
location l09h when it regains control from the

UTILITY PROGRAMS

page 8.100
PIP

P&T CP/M 2
User's Manual

user's routine. Note: the data should have its high order bit set to zero. When PIP
sends a character to the user-supplied output routine (OUT:), it makes a CALL to
location l06h with the character residing in register C.
The user-supplied I/O routines can be inserted into PIP by using the assembly
feature of DDT or by writing a small assembly language program and patching it
into PIP with DDT. Figure 8.95 shows such an assembly language program for a
hypothetical I/O device.

,

example user I/O routines for PIP
stat
data
statin
statout

equ
equ
equ
equ

40h
stat+l
1
2

istatus port for I/O device
idata port for I/O device
imask for data input ready bit
imask for data output ready bit

org
jmp
jmp

103h
input
output

ijump to input routine
ijump to output routine

retbyt: db

0

iplace to return input data

input:

stat
statin
input
data
7th
retbyt

iread device status
icheck for data ready

stat
statout
output
a.c
data

iread device status
icheck if can send data out

in
ani
jz
in
ani
sta
ret

output: in
ani
jz
mov
out
ret

iread input character
iclear the high order bit
isave in return area
ireturn to PIP

iget the data byte
ioutput it
i return to PIP

end
Figure 8.95

.,

~

Example of User Supplied I/O Drivers for PIP

Figure 8.96 shows the steps taken to assemble the I/O routines shown in Figure 8.95
and install them into PIP. This example assumes that the routines shown in Figure
8.95 are stored in a file named PIPIO.ASM on drive A. It also assumes that the
programs PIP, ASM, and DDT are also available on drive A. Note that the patched
version of PIP is saved in a file named PIPP.COM. In this way, the original version
of PIP is not erased and will be available if needed.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.101
PIP

A>ASM PIPIO.AAA
CP/M ASSEMBLER - VER 2.0
0124
OOOH USE FACTOR
END OF ASSEtlBLY
A>DDT PIP.COM
DDT VERS 2.2
NEXT PC
lEOO 0100
-IPIPIO.HEX
-R
NEXT PC
lEOO 0100
-
A~l PIPP.COM
A>
Figure 8.96 Example of Installing User I/O Routines In PIP

Possible Error Messages
DISK READ ERROR
An error has occurred during the reading of a disk file. This message is
encountered very rarely, and it may indicate a hardware problem.
DISK WRITE ERROR
An error has occurred while data was being written to a disk file. It most
commonly indicates that available space has run out on the destination disk.
When this message is encountered, check the available space with STAT. If it is
low or zero, delete unwanted files from the disk or move to another disk and
try again.
VERIFY ERROR
If the V option is specified for a disk to disk copy, PIP rereads the destination
file and checks for errors. This message indicates that PIP has found a
discrepancy while performing this check. PIP will abort the transfer if a verify
error occurs.
NOT A CHARACTER SOURCE
An "output only" logical or physical device (such as PUN: or PTP:) has been
specified as a source.
INVALID USER NUMBER
In using the G option, a user number has been specified which is not in the
range of 0 to 15.
RECORD TOO LONG
A record that is too long has been found within a hex file whose contents are
being checked by the H option of PIP. (Any single record within a hex file can
represent no more than 255 bytes of binary data.)
INVALID DIGIT
In processing a file with the H option, PIP has found a character that is not a
valid hex digit (0-9 and A-F) in one of its records. Most often, this error occurs
because the processed file does not contain hex format data or it contains a

page 8.102
PIP

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

corrupted record (possibly caused by an attempt to patch the file with a text
editor).
CHECKSUM ERROR
In processing a file with the H option, PIP has found a discrepancy between the
checksum of a record and the checksum computed from the record's data.
CORRECf ERROR, TYPE RETURN OR CfL-Z
In processing a file with the H option, PIP has found an error of some kind and
is waiting for you to specify its next action. If you press the  key on
the console, PIP will continue the transfer with the next record from the source;
it will not transfer the record in which the error was found. If you type
, PIP will immediately end the transfer.

In the (unlikely) event that the source device you are using can be rewound to a
location prior to the record in which the error was found, you may rewind it
and press . PIP will resume reading data from the source device, ignoring
any records it has already correctly received. If the error was of a transitory
nature, PIP may read the data record properly the second time.
INVALID PORMAT
You have made some error in the command line. It is likely that you used a
wild card file name illegally or that you specified an invalid file or drive name.
(An invalid drive name is given, for example, if you inadvertently type a semicolon in place of a colon after a drive designation.)
NO DIRECfORY SPACE
In attempting to write to a disk, PIP has found that the directory was full.
Typically, this will occur when PIP is trying to open a file, but it may also
arise when PIP needs to extend the length of a file (thus causing a need for
another directory entry).
NO PILE
PIP could not find the file of the specified file name on the drive designated.
START NOT POUND
PIP could not find the string that was specified with the S option in the source
data. Check the option specification to be sure the string is correct.
QIDT NOT POUND
PIP could not find the string that was specified with the Q option in the source
data. Check the option specification to be sure the string is correct.
CANNOT CLOSE DESTINATION PILE
An error has occurred as PIP attempted to close an output disk file.
message is somewhat unusual and may indicate hardware problems.

This

DESTINATION IS RIO, DELETE (YIN)?
A file already exists on the destination drive with the name that was specified
for the destination file, and it is set to "read only" status. If you respond with
Y, PIP will delete the file and replace it with the one being transferred. If you
respond with N, PIP will not make the requested transfer. The W option of PIP
allows you to override the sending of this message, so that you will not be
asked for permission to delete "read only" files whose names have been
duplicated. (The deletion will then occur automatically.)

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.103
PIP

REQWRES CP/M 2.0 OR NEWER POR OPERATION
The version of PIP supplied with P&T CP/M 2 must be used with CP/M 2.
are trying to use it on an older version of the operating system.

You

CANNOT WRITE
The command line you have entered into PIP is invalid because it instructs PIP
to write to an "input only" device, such as RDR:.
CANNOT READ
The command line you have entered into PIP is invalid because it instructs PIP
to read from an "output only" device, such as LST:.

page 8.104
SETCCB

8.23

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Utility name: SETCCB
Purpose: To set the date and time of the P&T CCB clock calendar
board if one in installed in the system.

General Description
The function of the SETCCB program relates entirely to the P&T CCB board, which
provides a clock, calendar, and audio alarm (bell) when installed in a TRS-80 Model
n/12/16. If this board is not installed in your system, the SETCCB utility is of no
use to you.
When a· CCB board is installed, a number of convenient functions are available. The
clock and calendar of the CCB are powered by a lithium pacemaker battery when
the computer is turned off, thus allowing accurate date and time to be constantly
maintained. P&T CP/M 2 reads this information automatically when the system is
loaded, so the user is freed from the necessity to enter it at the console. In
addi tion, P&T CP/M 2 will sound the audio alarm on the board whenever an ASCn
BEL character is sent to the system video display, and the board may be accessed
directly by programs as needed.
SETCCB allows you to set the date and time of the calendar and clock on the CCB.
Although the battery allows the clock to continue operation when the computer is
turned off, some periodic correction of the time reading may be necessary. Also,
you may want to change the clock setting to reflect the changes between daylight
and standard time. The CCB will automatically correct for the extra day in
February of a leap year provided that P&T CP/M 2 is loaded at least once between
January 1 and February 28 of that same year. If the system is not loaded in this
period, you will need to correct the date manually using SETCCB.

Using SETCCB
SETCCB is executed by the command line shown in Figure 8.97.
A>SETCCS
Figure 8.97 Command to Execute SETCCS

SETCCB first clears the console display and displays the current date and time
settings of the CCB; as shown below in Figure 8.98 (Lines 8.98-1 to 8.98-8). Note
that the time shown on Line 8.98-6 will be running, i.e. it will be updated as the
time reading of the CCB clock changes.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

CCB Time and Date Set Utility - ver l.xxx
Copyright (c) 1983 Pickles & Trout
all rights reserved

1:

2:
3:
4:
5:
6:
7:

page 8.105
SETCCB

CCB date Tuesday January 9, 1908
CCB time 14:28:21

( 1/9/OS)

Press BREAK to Quit

8:
9:

10:
11:

12:
13:
14:
15:
16:
17:

Do you want to change the date? Y
Enter date as MM/DD/YY
1/6/82
Enter day of week (0=Sun,I=Mon,2=Tue,3=Wed,4=Thu,5=Frl,6=Sat): 3
The date you have entered Is
Is this correct (Y/N)? Y
Figure 8.98

Wednesday

January 6, 1982

( 1/6/82)

Example of Setting the CCB Date with SETCCB

SETCCB will then ask you if you want to change the date setting of the CCB (Line
8.98-11). If you answer affirmatively (as shown in Figure 8.98), SETCCB will ask you
to enter the date (Line 8.98-13). As illustrated in the example, you do not have to
enter two digits where one will suffice. In addition, any non-numeric character
(such as a space, period, or comma) may be used to separate the numbers of the
date. However, only one separating character is allowed. Note: SETCCB does not
check the maximum day number for each month. It will, for example, accept
February 30 as a valid day.
After the date has been entered, SETCCB will ask you for the day of the week
(Line 8.98-14). Enter the number corresponding to the desired day which is given on
the display. SETCCB will then report back to you the date you have entered (Line
8.98-16) and ask you to confirm that it is correct (Line 8.98-17). If you respond with
an "N" on Line 8.98-17, SETCCB will ignore the date information you have just
entered and start over again on Line 8.98-11. If you respond with a "Y", SETCCB
will set the CCB calendar to the date you have specified, update the date shown at
the top of the screen, and return to Line 8.98-11. In either case, you are asked
again if a date change is desired. If your response is negative, SETCCB will ask if
you want to change the time setting of the CCB clock.
Figure 8.99 shows how the CCB time is set.
CCB Time and Date Set Utility - ver l.xxx
Copyright (c) 1983 Pickles & Trout
all rights reserved

1:

2:
3:
4:
5:
6:

CCB date Wednesday
CCB time 13:28:42

January 6, 1982

( 1/6/82)

7:

8:

Press BREAK to Quit

9:

10:
11:

12:
13:
14:
15:
16:
17:

Do you want to change the date? N
Do you want to change the time? Y
Enter current time In 24 hour format (hh:mm)
NOTE: seconds are always set to 0
13:32
Hit enter to set clock. 
Figure 8.99 Example of Setting the CCB Time with SETCCB

•

UTILITY PROGRAMS

page 8.106
SETCCB

P&T CP/M 2
User's Manual

As in this example, the time setting may be changed without altering the date

merely by responding negatively to the query on Line 8.99-11. SETCCB then asks
you to enter the time in 24 hour format and reminds you that the seconds are
always set to 0 when the time is revised (Lines 8.99-14 and 8.99-15). In our example,
1:32 PM is entered as "13:32" (Line 8.99-16). Once again, either the hour or the
minute may be entered as a single digit number if the value is in the range of 0 to
9. Also, any non-numeric character may be used to separate the two numbers.
If you are synchronizing the CCB to another time source, you should enter the next
minute. For example, if the current time is 10:02 and :r1 seconds, you should

indicate the time of 10:03. Once your response is entered, SETCCB will prompt you
to press the  key again, and the clock will not be set until you do so. Now
you can wait until the precise moment to establish the synchronization (press
 at precisely 10:03). SETCCB will then update the time shown at the top of
the screen and return to Line 8.99-11.
Figure 8.100 shows the exit from the SETCCB program. After all desired settings
have been made, simply depress the  key when asked again if you wish to
change the date (Line 8.100-11). SETCCB will ask you if you want the system time
synchronized to the CCB (Line 8.100-13). If you respond with a negative answer,
SETCCB will return immediately to the operating system without affecting the
system date and time. (The CCB will retain the values you entered, however.) If
you respond affirmatively on Line 8JOO-13 (as shown in the example), SETCCB will
set the system date and time to agree with the current settings of the CCB before
returning to the system.

CCB Time and Date Set Utility - ver l.xxx
Copyright (c) 1983 Pickles & Trout
al I rights reserved

1:

2:
3:

4:
5:
6:
7:
8:

9:
10:

CCB date Wednesday
CCB time 13:32:33

January 6, 1982

( 1/6/82)

Press BREAK to quit

11:

Do you want to change the date? 

12:
13:
14:

Do you want the system time synchronized to the CCB?
A>

Y

Figure 8.100 Example of Returning to P&T CP/M 2 from SETCCB

Possible Error Messages
There is no CCB installed in this computer
or you have not used SETMISC to set the CCB-port address
This error message indicates that the port number for the CCB board has not
been changed from its default value of 254, which informs SETCCB (and the rest
of the system) that no CCB board is installed in the system. If one is installed,
you need to use the SETMISC utility program (see Section 8.25) or system MENU
option CA (see Chapter 4) to set the port number appropriately. Also, you will
need to make the change permanent by using system MENU option FR. See the
CCB manual to determine which port number to use.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.107
SETCCB

Day of month is out of range
The day of the month you have specified is not in the range of 1 to 3L Note:
SETCCB does not check the maximum day number for each month. It will, for
example, accept February 30 as a valid day.
Month of year is out of range
The number you have entered for the month of the year is not in the range of 1
- 12.

Year is out of range
SETCCB will accept years in the ranges 0 - 99 and 1900 - 1999. The number you
have entered is not in these ranges.
You have not entered all 3 numbers
You have not entered all three of the numbers reqJ,lired to specify the date.
This message may occur if all three numbers are entered but are separated by
more than one non-numeric character.
Day of week is out of range
The number you have entered to indicate the day of the week is not in the
range of 0 - 6.
Hours must be less than 24, please re-enter:
The number you have entered for the hour of the time is not in the range 0 23. Note that midnight is "00" hours, not "24" hours. Re-enter the entire time,
specifying the hour with a valid number.
Minutes must be less than 60, please re-enter:
The number you have entered for the minute in the time setting is not in the
range 0 - 59. Re-enter the entire time, specifying the minutes with a valid
number.
Seconds must be less than 60, please re-enter:
The number you have entered for the seconds in the time setting is not in the
range 0 - 59. Note that although SETCCB will ignore any number you enter for
seconds since it always sets the seconds to 0, it will allow you to enter a
non-zero number for seconds. Re-enter the entire time, specifying the seconds
with a valid number.
You must enter the time, press  to quit
Once you have told SETCCB that you want to enter the time, you must enter it.
If you really do not want to enter the time, press  to about the program.
You can then run it again and respond negatively when it asks if you want to
set the time.
Y or N only:
You have responded to a yes/no question with a letter other than "Y", "y", "N",
"n". Re-enter your response using one of these letters. (Note: If you enter
several characters, only the first one is considered. For example, "ycrud" will
be interpreted as an affirmative response.)

UTILITY PROGRAMS

page 8.108
SETDATE

8.24

P&T CP/M 2
User's Manual

Utility name: SETDATE
Purpose: To set the system date from the console.

General Description
SETDATE allows you to set the system date from the console keyboard. If no P&T
CCB poard is installed in your computer, the system will load with the date set to
00/00/00. When the correct system date is of importance to you (i.e. used by one of
your programs), it must then be set by SETDATE or by a program. (The special
system function which performs this task is discussed in Chapter 16 of this manuaL)
SETDATE has no effect on a CCB board which is installed in the computer; it may
be used to set the system date to an incorrect value for testing or other purposes
without modifying the date kept by the CCB. The next time the system is loaded
or the utility program SYNCRO is run, the system date and time will again be set
to the CCB.

Using SETDATE - Interactive Mode
The example in Figure 8.101 illustrates the use of SETDATE.
1:
2:
3:
4:
5:
6:

7:
8:

A>SETDATE
Uti Iity to Set System Date - Ver 2.xxx
copyright 1980,83 (c) Pickles & Trout
all rights reserved
Enter date: Jan 4, 1983

9:

10: The date you have entered Is
Tuesday January 4, 1983
11: Is this correct (Y/N)? N
12:
13: Enter date: 1/2/83
14:
Sunday January 2, 1983
15: The date you have entered Is
16: Is this correct (Y/N)? Y
17: A>
Figure 8.101

(1/4/83)

(1/2/83)

Example of Using SETDATE

SETDATE is executed by the command line given on Lines 8.101-L After it displays
its opening messages (Lines 8.101-4 to 8.101-6) it asks you for the date (Line 8.101-8).
You may enter the date in a fairly free form. You may specify the date as all
numbers (e.g. 12/5/82) or you may type out the name of the month.
If you enter the date as all numbers, you must enter it in the following order:
month, day, year. The year may be entered as two digits or four digits. If you

enter it as 4 digits, only years between 1900 and 1999 are accepted. Entering the
date with the name of the month gives you have a little more latitude. In this
case, you may enter the date with either the month or the day first. Figure 8.102
shows some examples of forms in which the date may be entered.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

May 13, 1972
13 May 1972
5/13/1972
5/13/72

page 8.109
SETDATE

13 May 72

5 13 72

5,13,72
5:13:1972

All of these are valid designations
"- for May 13, 1972.
Figure 8.102 Examples of Forms In Which Dates can be Entered to SETDATE

On Line 8.101-8 the date Jan 4, 1983 is entered SETDATE includes a 20th century
calendar which allows it to find out that this date falls on a Tuesday. On Line
8.101-10 SET DATE shows you the date you entered and the day of the week it falls
on and, on Line 8.101-11, asks you to verify that the date is correct.
If you respond affirmatively, SETDATE will set the system date accordingly and

return you to the command level of the system. If you respond negatively, as
shown on Line 8.101-11, SET DATE will ask you again for the date. This example
shows a second date entered as 1/2/83 (Line 8.101-13) and its being verified as
correct (Line 8.101-16).
Since SET DATE has a built in calendar, you may use it to find the day of the week
for any day in the 20th century. If you have entered a date just to find out the
day of the week and do not want the system date set, just press  to return
to the system command level with no action.

Using SETDATE - Command Line Mode
SET DATE also has a command line mode where you specify the date to which the
system date is to be set on the command line that executes SET DATE. The form
of the command line for SETDATE is shown in Figure 8.103.
(

SETDATE (date) )

Figure 8.103 General Form of Command Line for SETDATE

The date specified on the command line may be in any of the forms that can be
entered in the interactive mode. Figure 8.104 shows some examples of command
lines that might be used with SETDATE.
SETDATE OCT 12, 1978
SETDATE 11/18/82
SETDATE 5 DEC 72
Figure 8.104 Examples of Command Lines for SETDATE

Possible Error Messages

»»

Error: Day of month is out of range.
The day of the month you have specified is not valid for the month specified
Remember 30 days hath September_

»»

Error: Month of year is out of range.
The number you have entered for the month of the year is not in the range of
1-12.

page 8.110
SETDATE

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

»»

Error: Year is out of range.
SET DATE will accept years in the ranges 0 - 99 and 1900 - 1999. The number
you have entered is not in one of these ranges.

»»

Error: Invalid entry.
The line you have entered for the date does not make sense for some reason.
Perhaps you mis-spelled the month or left out part of the date.

P&T CP/M 2
User's Manual

8.25

UTILITY PROGRAMS

page 8.111
SETMISC

Utility name: SETMISC
Purpose: To set miscellaneous 1/0 parameters from the console.

General Description
SETMISC provides a means of altering a number of I/O parameters of P&T CP/M 2
directly from the console keyboard. These parameters take effect immediately and
will remain in effect until further modification by SETMISC or until the system is
reloaded. In order to make the parameters permanently resident on the system
diskette, System MENU option FR should be used (see Chapter 4 of this manual).
SETMISC has both an interactive and a command line mode. In the interactive
mode, you will be shown the current values of the parameters that SETMISC can
alter and allowed to change them at wilL The command line mode of SETMISC
accepts instructions from the command line that executes SETMISC and changes the
I/O parameters accordingly. The command line mode is useful when you know
exactly what you want to do and don't want to be bothered with prompts. It also
allows SETMISC to be used from a SUBMIT file or a menu system.

Using SETMISC - Interactive Mode
When entering responses into SETMISC, you may hit the  key at any time to
bring an immediate return to the operating system. If you press only the 
key as a response, it will be interpreted as a "0".
SETMISC is executed by the command line shown in Figure 8.105.
A>SETMISC
Figure 8.105 Command Line to Execute SETMISC

SETMISC begins by clearing the console display and showing the first set of
parameters available for modification, as shown in Figure 8.106. Note that the line
shown as Line 8.106-14 will actually appear at the bottom of the console display.
Miscellaneous System Parameter Setup Program - ver 3.xxx
Copyright 1980,82,83 by Pickles & Trout - al I rights reserved
At any time this program may be aborted by pressing the  key

1:
2:
3:
4:
5:
6:

7:

1.

8:
9:

2.
3.

10:

4.

11:

12:
13:
14:

CRT Parameters
Line wrap =
disabled
First line of cursor = 5
Cursor blink =
slow
P&T Clock/Calendar Board port number = 254

Enter number of Item to change (0 If no changes): l
Figure 8.106 Display of CRT Parameters in SETMISC

The first five lines shown in Figure 8.106 will remain on the screen at all times
While SETMISC is running. The remaining lines on the display will change as various
sets of parameters are inspected and/or modified.

page 8.112
SETMISC

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

As the figure indicates, the CRT parameters are the first to be displayed

The
current value of each parameter is shown (Lines 8.106-7 to 8.106-10), and you are
prompted for the number of an item that you want to change (Line 8.106-14). If you
enter "0" (or just press no change, l->dlsable, 2->enable 2
Figure 8.107

Prompt Line for Altering Line Wrap Option,

Entering a "2" on Line 8.106-14 indicates your wish to modify the type of cursor that
is used on the video display. Each character on the video display is composed of 10
rows of dots (numbered 0 at the top to 9 at the bottom). To form the cursor, one
or more of these rows are displayed in reverse video. You may modify the number
of rows which are used by the cursor by specifying the line on which the reverse
video will begin. The reverse video portion will always begin on the line you
specify and end on the bottom line (line 9) of the character cell. You may modify
the cursor from a single underscore (starts on line 9) to a' complete block (starts on
line 0). (Note: The system's default setting begins the cursor on line 5.) The
change in the cursor is made immediately so you can see the result of the choice
you have made. If you do not like it, you may choose a different cursor size.
After entering "2" on Line 8.106-14, the bottom line of the console display will be
replaced with the one shown in Figure 8.108. In response, you should enter the
number of the line on which you want the cursor to begin. The cursor size will
then be changed, Line 8.106-8 will be updated to reflect the new value, and you will
be prompted for a new item number.
Enter character line on which cursor should begin (0-9): 8
Figure 8.108 Prompt Line for AIterl ng Cursor Size

Entering a "3" on Line 8.106-14 indicates that you wish to mOdify the cursor blink'
rate. You may turn the cursor off entirely, cause it not to blink, or set it to blink
at a slow or fast rate. (The system defaults to the slow rate, which is about half
as fast as the fast rate.)
After entering "3" on Line 8.106-14, the bottom line of the console display will be
replaced by the one shown in Figure 8.109. In response, you may enter a zero (or
press no change, l->cursor off, 2->no blink, 3->slow blink, 4->fast blink: O
Figure 8.109 Prompt Line for Altering Cursor Blink

Entering a "4" on Line 8.106-14 indicates your desire to modify the port number at
which a P&T CCB clock/calendar/bell board is addressed. All CCB's are shipped
with their base address set to port 190. You may change the port setting by means
of a DIP switch on the CCB board (see the CCB manual for details). If the CCB
port number is set to 254 (the system default value), the system assumes that no
CCB is present. Any other port number will indicate that a CCB is installed in the
computer at the base port number specified. If you have a CCB you must use
SETMISC to change this parameter so that the system can access it.
After entering a "4" on Line 8.106-14, the bottom line of the display will be replaced
with the one shown in Figure 8.110. You should respond by entering the base port
number at which your CCB is addressed. The number will then be installed in the
system I/O drivers, Line 8.106-10 will be updated to reflect your entry, and you will
be prompted for a new item.
Enter base port number for the CCB board (254->no board present): 190
Figure 8.110 Prompt Line for Altering CCB Base Port Address

If you enter a "0" (or press  key

1:

2:

3:

4:
5:
6:
7:

8:
9:
10:
11:
12:
13:

14:

1.
2.
3.
4.

drive
drive
drive
drive

A:
B:
C:
D:

10
10
10
10

Drive step rates In ml II Iseconds

Enter number of Item to change (0 If no changes): 2
Figure 8.111

Display of Drive Step Rates In SETMISC

The rate at which the computer attempts to move the read/write head of a diskette
drive is referred to as the drive step rate. The floppy disk controller in the
computer is capable of step rates of 15, 10, 6, and 3 milliseconds, and SETMISC
allows you to choose a step rate individually for each diskette drive on the system.
The system defaults to 10 msec step rates for each of the diskette drives (as
specified by Tandy). A faster rate results in faster operation, and it frequently
reduces the noise as head is moved. However, not all drives are capable of a step
rate faster than 10 msec. It is your responsibility to determine if your drive will
operate at the rate which you specify. The thinline drives used in the Models 12
and 16 will run at 3 msec, the fastest rate. If you set the step rate too fast, you
will typically start getting SEEK errors.

UTILITY PROGRAMS

page 8.114
SETMISC

P&T CP/M 2
User's Manual

To change the stepping rate of a disk drive, enter the number corresponding to the
drive as given on the display (Line 8.111-14). The bottom line of the display will
then be replaced by the one shown in Figure 8.112. Now enter a "0" (or press
no change, 1->3ms, 2->6ms, 3->10ms, 4->15ms): 2
Figure 8.112 Prompt Line for Altering Drive Step Rate

If you enter a "0" (or press  key

1:

2:
3:
4:
5:
6:
7:
8:
9:

10:
11:
12:
13:
14:
15:

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

Enter number of Item to change (0 If no changes): l
Figure 8.113 Display of Paral lei Port Options In SETMISC

Entering a "1" on Line 8.113-14 indicates your desire to modify the line feed
suppression option of the parallel printer port driver software. When enabled, this
option attempts to produce normal printed output on Radio Shack printers by
removing unnecessary line feeds. (Radio Shack printers automatically advance the
paper when sent a carriage return character.) When disabled, all line feeds are
sent to the port.
After entering "1" on Line 8.113-14, the bottom line of the display will be replaced
by the one shown in Figure 8.114. You may now enter "0" (or press no change, l->dlsable, 2->enable 2
Figure 8.114

Prompt Line for Altering Items 1,2, and 3 of Parallel Port Options

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.115
SETMISC

Entering a "2" on Line 8.113-14 indicates your wish to modify the form feed
emulation option of the parallel printer port driver software. This option is needed
with printers that do not respond to a form feed character (as is the case with
some Radio Shack printers). When enabled, this option attempts to keep track of
the current paper location. Upon receiving a form feed character, it then sends
what it considers to be the exact number of line feed characters to the port that
will cause the paper to advance to the next page. Since this option requires the
software to keep track of the current location on the page, it is possible for it to
be fooled in some cases (like sending an escape sequence containing a line feed
character). When the option is disabled, all form feed characters are sent directly
to the port.
After entering "2" on Line 8.113-14, the bottom line of the display will be replaced
by the one shown in Figure 8.114. You may now enter "0" (or press 
Figure 8.115 Prompt Line for Altering Parallel Port Page Length

You would enter a "5" on Line 8.113-15 if you wish to modify the number of lines
printed before a form feed character is inserted by the auto form feed option
(when enabled). The line shown in Figure 8.116 will then appear at the bottom of
the display, and you may enter the desired number of lines. (The default setting is
60.) After your number is entered, it will be installed, Line 8.113-11 will be updated,
and you will be prompted for a new item.
Enter number of lines to print before auto form feed (0-254): 30
Figure 8.116 Prompt Line for Changing Number of Printed Lines per Page

Finally, you should enter a "0" (or press 
Figure 8.117 Prompt Line for Returning to Command Level of System

Using SETMISC - Command Line Mode
In the command line mode, all instructions are given to SETMISC on the command
line which executes the program. SETMISC accepts a wide variety of instructions in
an attempt to provide fairly free form input. In most cases there is a long form of
the instruction and one or more short forms. If you use a certain instruction
frequently, you will probably want to learn one of the short forms since they
usually involve considerably less typing. The long form of the instructions is fairly
English-like and should be easy to remember.
You may type as many instructions as you like on a command line
normal command line .limitation of 128 characters).

(~ubject

to the

In the following descriptions of the instructions, the general form of each
instruction is shown as well as some specific examples. In describing the general
form, these conventions are used:
1. When one of several words must be used, the words will be enclosed in angle
brackets. For example  indicates that one of the
words "OFF", "ON", "SLOW", or "FAST" should be used.
2.  indicates that a decimal number should be entered.
3.  is equivalent to  is· equivalent to  meaning that one of

the words "DISABLED", "DIS", "OFF", "-", "0" should be used.
5. The space between a word or phrase (e.g. FLC) and the following number is
required.
LINE WRAP 
LW 
Figure 8.118

Instructions for Setting Console Line Wrap

Some examples are:
LINE WRAP ENABLED -enaples line wrap.
LINE WRAP OFF - disables line wrap.
LW ON - enables line wrap.

page 8.117
SETMISC

UTILITY PROGRAMS

P&T CP/M 2

User's Manual

CURSOR 
CB 
Figure 8.119

Instructions for Setting Console Cursor Blink

Some examples are:
CURSOR ON - sets a steady cursor (no blink).
CURSOR SLOW - sets the cursor to slow blink.
CB SLOW - sets the cursor to slow blink.
~

Figure 8.120

FIRST LINE OF CURSOR 
FIRST LINE CURSOR 
FLC 
FL 

~

Instructions for Setting First Line of Console Cursor

Some examples are:
FIRST LINB OF CURSOR 0 - sets first line of cursor to 0 (full block).
FIRST LINB CURSOR 9 - sets first line of cursor to 9 (underscore).
FLC 5 - sets first line of cursor to 5 (half block).
FL 8 - sets first line of cursor to 8 (two line cursor).

CCB PORT 
CCB 
Figure 8.121

Instructions for Setting COB Port Number

Some examples are:
CCB PORT 190 - sets the CCB port number to 190.
CCB 16 - sets the CCB port number to 16.

Figure 8.122

Instructions for Setting Drive

S~ep

Rates

Some examples are:
STBP RATBS A 3,B 6,C 10 - sets A to 3 msec, B to 6 msec, C to 10 msec.
STBPRATB A 6,B 6,C 6,D 6 - sets drives A, B, C, and D to 6 msec.
RATB B 3 - sets drive B to 3 msec.
SR C 15 D 15 - sets drive C and D to 15 msec.

UTILITY PROGRAMS

page 8.118
SETMISC

lit.

P&TCP/M 2
User's Manual

SUPPRESS EXTRA LINE FEEDS 
SUPPRESS LINE FEEDS 
SUPPRESS XLF 
SXLF 
SELF 

Figure 8.123

Instructions for Setting Line Feed Suppression

Some examples are:
SUPPRESS BXTRA LINB FBBDS BNABLBD - enables line feed suppression.
SUPPRBSS LINB FBBDS OFF - disables line feed suppression.
SUPPRBSS XLF BN - enables line feed suppression.
SXLF DIS - disables line feed suppression.
SBLF + - enables line feed suppression.

lit.

EMULATE FORM FEEDS 
EMULATE FORMFEEDS 
EFFS 
EFF 

Figure 8.124

"II

Instructions for Setting Form Feed Emulation

Some examples are:
BMULATB FORM FBBDS BNABLBD - enables form feed emulation.
BMULATB FORMFBBDS ON - enables form feed emulation.
BFFS OFF - disables form feed emulation.
BFF ON - enables form feed emulation.

AUTO FORM FEEDS 
AUTO FORMFEEDS 
AUTO FFS 
AUTO FF 
II... AFF 
Figure 8.125

"'

Instructions for Setting Auto Form Feed

Some examples are:
AUTO FORM FBBDS DISABLBD - disables auto form feed.
AUTO FFS ON - enables auto form feeds.
AFF OFF - disables auto form feeds.

,

~

PAPER LENGTH 
PAGE LENGTH 
PPL 
II... PL 

Figure 8.126

Some examples are:

Instructions for Setting Paper Length

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.119
SETMISC

PAPER LENGTH 66 - sets paper length to 66 lines.
PAGE LENGTH 88 - sets paper length to 88 lines.
PL 33 - sets paper length to 33 lines.
~

NUMBER OF LINES PER PAGE 
NUMBER OF LINES/PAGE 
LINES PER PAGE 
LINES/PAGE 
NL 
Figure 8.127

,

Instructions for Setting Printed Lines per Page

Some examples are:
NUMBER OF LINES PER PAGE 58 - sets auto form feed after 58 lines.
LINES/PAGE 60 - sets auto form feed after 60 lines.
NL 30 - sets auto form feed after 30 lines.

Some examples of command lines for SETMISC .that use several instructions follow:
SETMISC FLC 8, CURSOR SLOW, LINE WRAP OFF
Sets the first line of the cursor to line 8 (a double underscore cursor), sets
the cursor to slow blink, and disables the line wrap on the console display.
SETMISC STEPRATE:A 3,B 3,C 6 ; SUPPRESS LFS ON
Sets the step rate on drives A and B to 3 msec, the step rate on drive C to 6
msec, and enables line feed suppression on the parallel printer port.

Possible Error Messages
Non-modular system, not compatible with this program.
You are trying to run this program with a previous version of P&T CP/M 2. The
program makes use of features found only in the modular version of P&T CP/M 2
and hence cannot run on this system.
Number was out of range, please re-enter.
This message is displayed in the interactive mode if the number you entered is
not in the range of valid responses to the prompt. Re-enter your response using
a number from the specified range.
--?
In the command line mode, if an instruction on the command line does not make
sense to SETMISC, it will display the word it could not understand followed by a
question mark. In this case none of the instructions on the command line will
take effect. You should correct the mistake and type the line again.

»»

Error: No parallel printer module in system.
This message indicates that you have attempted to set parameters associated
with the parallel printer module when such a module has not been included in
the system. If you want to use the parallel printer port you should run the
MOnSEL program (Section 6.3) and select one of the available parallel printer
modules for inclusion in the system.

•

UTILITY PROGRAMS

page 8.120
SETTIME

8.26

P&T CP/M 2
Us.er's Manual

Utility name: SETTIME
Purpose: To set the system time-of-day clock from the console.

General Description
SETTIME allows you to set the system time of day clock from the console keyboard.
The clock is kept by the system and must be set each time the system is loaded
(RESET), either by SETTIME or by a program using a special system function (as
discussed in Chapter 16 of this manual) if you wish to make use of it. SETTIME has
no effect on a P&T CCB clock/calendar board installed in the system, so temporary
changes can be made in the system time while the CCB maintains its timekeeping.
If you have a Pickles & Trout CCB clock board installed in your system, P&T CP/M
2 will automatically read the board and set the system time of day when the system
is loaded

Using SETTIME - Interactive Mode
The use of SETTIME is illustrated in Figure 8.128. The program is executed by the
command given on Line 8.128-L After displaying its opening messages (Lines 8.128-4
to 8.128-6), it prompts you for the new time setting (Line 8.128-8). You should enter
the time in hours:minutes:seconds format using 24 hour time. The numbers specifying
the hours, minutes, and seconds may each consist of one or two digits, and they
may be separated by commas, colons, and/or one or more spaces.
After you have entered the time, SETTIME will prompt you to press the  key
to set the clock (Line 8.128-9). The clock will not be set until you press ,
thus allowing you to synchronize the system clock to an external time source.
SETTIME then returns directly to the operating system. (Note: Pressing the
 key at any time will abort SETTIME without affecting the system time of
day clock.)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:

A>SETTIME
Utility to Set System Time - Ver 2.xxx
copyright 1980,83 (c) Pickles & Trout
al I rights reserved
Enter current time (hh:mm:ss): 17:39:10
Hit enter to set clOCk.
A>
Figure 8.128 Example of Using SETTIME

Using SETTIME - Command Line Mode
In the command line mode of SETTIME you specify the time to which the system
clock is to be set on the command line that executes the program. SETTIME sets
the system time to the specified time immediately after it begins execution. Note
that, since it may take a few seconds to load and execute SETTIME, close

UTILITY PROGRAMS

P&T CP/M 2

User's Manual

page 8.121
SETTIME

synchronization with an external time source is more difficult than in the
interactive mode.
Figure 8.129 shows the general form of the command line to set the system clock
with SETTIME.
(
Figure 8.129

SETTIME (time) )

Form of the Command Line for SETTIME

The following examples show command lines that might be used with SETTIME.
SETTIME 9:30:00 - sets the system clock to 9:30 AM.
SETTIME 15:4:25 - sets the system clock to 3:04:25 PM.

Possible Error Messages

»»

Error: Hours out of range (0-23)
Given when the hours of the time you specified are not acceptable. Note that
midnight is 0 hours.

»»

Error: Minutes out of range (0-59)
Given when the minutes of the time you specified are not acceptable. Re-enter
the time using a value for minutes in the range 0 to 59.

»»

Error: Seconds out of range (0-59)
Given when the seconds of the time you specified are not acceptable. Re-enter
the time using a value for seconds in the range 0 to 59.

-=.
~

page 8.122
SETUP

8.27

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Utility name: SETUP
Purpose: To alter the serial port configuration and the IOBYTE
assignments.

General Description
The SETUP utility program provides a visual representation of the current state of
the serial port configurations and the system IOBYTE assignments. It also allows
you to change the serial port configurations (for their use with different peripheral
devices) and the logical-to-physical I/O device assignments which are controlled by
the IOBYTE. Note that these assignments can also be changed with the ASSIGN
utili ty program.
SETUP includes a command line mode that allows you to change the serial port
configurations by typing a single command line. This feature may be useful if you
frequently change the serial port configurations or need to change them from a
SUBMIT file or a menu system.

U sing SETUP - Interactive Mode
Figure 8.130 shows the command line which will execute the SETUP program.
A>SETUP
Figure 8.130 Command Line to Execute SETUP

SETUP first clears the screen and displays the available serial port configurations
and logical-to-physical device assignments, as shown in Figure 8.131. Those which
are currently in effect are highlighted in reverse video.
When SETUP first begins, the cursor will be located at the upper leftmost option
available (110 baud on port A). To change a particular option, merely move the
cursor (using the cursor arrow keys right, left, up,or down) to the desired value and
press . The previous value for that option will be returned to normal video
and the value you have selected will be changed to reverse video. The cursor can
only be positioned to locations on the screen where valid option selections are
shown.
When you are finished, simply press  to exit the program. Any changes you
have specified will not take effect until this time. If you want to abort the
program without making any changes, type .
Each serial port has 6 lines of parameters displayed. The first line (Lines 8.131-3
and 8.131-11) shows the baud rates that may be selected for the port. This should
be set to agree with the peripheral which is connected to the port. The second
line (Lines 8.131-4 and 8.131-12) shows the number of stop bits that are transmitted at
the end of each character. This setting should also agree with the peripheral
device connected to the port, but it is always acceptable to specify a greater
number of stop bits than the peripheral expects. For example, all serial peripherals
should be operable if 2 stop bits are specified. However, data transmission will be
slowed by about 10% if an unneeded stop bit is transmitted.

UTILITY PROGRAMS

P&T CP/M 2

User's Manual

1:

2:
3:
4:
5:
6:

7:
8:
9:

10:
11:

12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:

page 8.123
SETUP

10 SETUP PROGRAM v3.xxx Copyright 1980.83 by PICKLES &TROUT
SERIAL PORT A
baud rate:
110
134.5 150 300 600
1200 2400 4800 9600
/I stop bits:
1
1.5 2
DTR:
high low
RTS: high low
word length:
6
7
5
8
bits
parity:
on
off even odd
xmlt on char:
17
xmlt off char: 19
SERIAL PORT 8
baud rate:
110
134.5 150 300 600
/I stop bits:
1
1.5 2
DTR:
high low
RTS: high
word length:
6
7
8
5
bits
parity:
on
off
even odd
xmlt on char:
17
xmlt off char: 19
CON:
LST:
PUN:
RDR:

SIOA
SIOA
SIOA
SIOA

CRT
CRT
UPUN1
URDR1

CENTRON
CENTRON
UPUN2
URDR2

1200 2400 4800 9600
low

SI08
SI08
SlOB
SlOB

Arrows move cursor I  - set field I  - accept I  - quit
Figure 8.131

SETUP Display for Default Parameters

The third line of parameters for each port (Lines 8.131-5 and 8.131-13) shows the
signal levels which will be placed on the Data Terminal Ready (DTR) and Request
To Send (RTS) status lines on the RS-232 connector. The available choices for each
of these parameters, "high" and "low", refer to the voltage present at the status
line. "High" indicates a positive voltage and "low" indicates a negative voltage.
Often, the status lines will not be used, so these parameters may be ignored. They
must be set appropriately, however, when they provide needed signals to a
peripheral device. Using the lines in this way will probably require special cabling
and a thorough understanding of the device. Programs may also manipulate the
status lines directly to send various instructions to a peripheral device.
The fourth line (Lines 8.131-6 and 8.131-14) of the serial port parameters shows the
various word lengths available. Once again, this setting should agree with the
peripheral device connected to the port.
The fifth line (Lines 8.131-7 and 8.131-15) shows the various options for parity. A
pari ty bit is used by some devices for the detection of errors. When the parity
option is "on", a parity bit is added to the ASCII code for each character sent.
This bit is set so that either an even or odd number of bits in the character are
"1". If the "on" and "even" options are selected for parity, the parity bit will be
"1" if an odd number of bits in the character are "1" (resulting in an even number
for the character and parity bit). Likewise, selecting the "on" and "odd" options
will cause the parity bit to be "1" if an even number of bits in the character are
"1". If the "off" option is selected, no parity bit will be sent and the specification
of "even" or "odd" will have no effect. In general, parity should be avoided for the
most common uses of the serial ports, such as running a printer, since it slows the
transmission rate by about 10%.
The sixth line of parameters for each port (Lines 8.131-8 and 8.131-16) indicates the
type of handshaking to be performed by the serial port I/O driver. The selection is
made by the value assigned to the "xmit on" character, as shown in Figure 8.132.

UTILITY PROGRAMS

page 8.124
SETUP
xmlt on

--01

2
3-255

xmlt off
n/a
n/a
nfa

0-255

P&T CP/M 2
Userts Manual

type of handshaking
none
ETX/AC<
RS-232 status line
XON/XOFF type

Figure 8.132 Types of Serial Port Handshaking

When no handshaking (xmit on = 0) is specified, all characters sent to the serial
port are transmitted at once. The serial port is essentially invisible to the program
in this case. This option should be selected when a program uses a serial port but
perform its own handshaking with the peripheral device.
When the BTX/ACK handshaking (xmit on = 1) is selected, the serial port driver
will transmit an ASCn ETX character to the peripheral device after every 128 or so
characters. After the EXT character is sent, all output to the peripheral device to
be suspended until an ASCn ACK character is received from the device. This type
of handshaking is performed by some printers (older Diablo's, for example). In'
general, ETX/ACK is less efficient than either RS-232 status line or XON/XOFF
handshaking. Therefore, if you have a choice, avoid using ETX/ACK handshaking.
The RS-232 Status Line handshaking (xmit on = 2) causes the serial port to monitor
the Clear To Send (CTS) and the Device Carrier Detect (DCD) input status lines of
the serial port. Data will not be transmitted to the peripheral device unless the
crs line is high (positive voltage). If the CTS line goes low (negative voltage)
during the transmission of a character, further transmission will be halted at the
end of that character until the CTS line is high again. The DCD line must be high
in order for the serial port to accept incoming characters. If the DCD line is low,
no incoming characters on the serial port will be recognized RS-232 status line
handshaking is probably the most efficient of the handshaking methods provided and
should be used if the peripheral device supports it. Among others, the TRSDOS
system uses this type of handshaking to access the serial ports.
The XON /XOFF type of handshaking causes the serial port software to monitor the
peripheral device constantly for incoming characters. Any character which is
received is read by the software and checked to determine if it is the "xmit on"
character or the "xmit off" character. All other characters are discarded. If the
"xmit off" character is received, the serial port ceases to transmit data until an
"xmit on" character is received from the peripheraL
If the port is set for 8-bit words, all 8 bits of the incoming characters are used

when comparing to the "xmit on" and "xmit off" characters. Some peripheral
devices always set the eighth bit to a "1", making it necessary (in some cases) to
add 128 to the actual value of the "xmit on" and ttxmit off" characters in order for
the handshaking to work properly. For example, it is very common to have a value
of 17 (ASCn XON) for the "xmit on" character and 19 (ASCn XOFF) for the "xmit
off" character. For some peripheral devices, then, it may be necessary to set the
"xmit on" character to 145 and the "xmit offn character to 147.
To change the value of the "xmit on" or "xmit off" character for a port, move the
cursor to the current value of the character on the display and press the  .
key. The last line of the display will then be replaced with the line shown in
Figure 8.133. You may now enter the new value and press the  key.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.125
SETUP

Enter the numeric value of the character: 2
Figure 8.133 Prompt Line for Entering "xmit on" and "xmit off" Values

Lines 8.131-18 to 8.131-21 show the current logical to physical I/O device assignments.
The four CP/M logical I/O devices are displayed in the left column, and the
physical I/O devices that may be assigned to each are shown on the same line.
Figure 8.134 explains the symbols which denote the physical I/O devices. The I/O
device assignments are changed in the same manner as the serial I/O parameters (ie.
use the arrow keys to move the cursor to the desired assignment and press  - set field I  - accept I  - quit
Figure 8.136

SETUP Display After Setting Parameters for Serial Printer

UTILITY PROGRAMS

page 8.126
SETUP

P&T CP/M 2
User's Manual

Using SETUP - Command Line Mode
The command line mode of SETUP allows you to set the serial port parameters by
typing a single command line. You may set up either port A or port B or both of
them by a single command line. The command line has the form shown in Figure
8.137. If both ports are being configured with a single command line, either port's
parameters may appear first on the command line. Only the parameters appearing
on the command line will be affected; all others will remain at their previous
values.

,.

SETUP (port letter) [port options)

(port letter) [port options)

(port letter) is replaced by A or B.
(port options) is replaced by one or more instructions for
setting parameters for the port.
Figure 8.137

Form of the Command Line for SETUP

When specifying parameters on the command line, they must be separated from each
other by one or more delimiting characters. The delimiting characters that are
recognized are shown in Figure 8.138. Note that due to the variety of delimiting
characters you can type exactly the same commands in a large variety of ways.
For example "BAUD RATE=9600" has identical effect as "BAUD RATE 9600".
(

space , : •

=)

Figure 8.138 Delimiter Characters that can be Used on SETUP Command Line

There are several ways of specifying each of the parameters. In the following
descriptions, when there are several words or characters to· choose among in a
particular place, the choices will be shown enclosed in angle brackets, e.g. <5, 6, 7,
8>.

WORD LENGTH <5, 6, 7, 8>
WORD <5, 6, 7, 8>
Figure 8.139

Instructions for Setting Word Length

Some examples are:
WORn LENGTH '1 - set the word length to 7 bits.
WORn ·8 - sets the word length to 8 bits.

STOP BIT <1, 1.5, 2>
STOP <1, 1.5, 2>
SB <1, 1.5, 2>
Figure 8.140

Instructions for Setting Number of Stop Bits

Some examples are:
STOP BIT 1 - sets one stop bit.
SB 2 - sets two stop bits.

page 8.127
SETUP

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

DTR 
RTS 
Figure 8.141

Instructions for Setting Port Status Line Outputs

Some examples are:
DTR HIGH - sets a high voltage on the DTR output.
RTS LO - sets a low voltage on the RTS output.
DTR H - sets a high voltage on the DTR output.

.

PARITY 
PAR 
P 
Figure 8.142

~I

Instructions for Setting Parity

Some examples are:
PARITY ODD - sets odd parity.

PAR BV - sets even parity.

P OFF - sets no parity (parity off).

XMIT ON 
XON 
XMIT OFF 
XOFF 
XOF 
Figure 8.143

Instructions for Setting XMIT ON and OFF Characters

Some examples are:
XMIT ON 0 - sets xmit on character to O.
XON 1'1 - sets xmit on character to 17.

XOFF 19 - sets xmit off character to 19.

UTILITY PROGRAMS

page 8.128
SETUP

P&T CP/M 2
User's Manual

BAUD RATE 
BAUD 
BR 
where the baud rate number is chosen from the fol lowing:
baud rate
. 110

134.5
300
600
1200
2400
4800
9600
Figure 8.144

numbers

"TIo,1T

134.5, 13
300, 30
600,60
1200, 12
2400, 24
4800, 48
9600, 96

Instructions for Setting Baud Rate

Some examples are:
BAUD RATE 9600 - sets baud rate to 9600.
BAUD 1200 - sets baud rate to 1200.
DR 48 - sets baud rate to 4800.

Some examples of command lines that might be used with SETUP are:
SETUP A BAUD=9600,SD=I,WORD=8,PARITY OFF ,XON=2
Sets up serial port A for 9600 baud, 1 stop bit, 8 bit data, no parity, and
hardware handshaking. The status line outputs are left in their previous state.
SETUP B BAUD=12oo SB=1 WORD=8 PARITY ODD XON=O
Sets up serial port B for 1200 baud, 1 stop bit, 8 bit data, odd parity, and no
handshaking. The status line outputs are left in their previous state.
SETUP A BR 1200 ; D BR 9600 XON 17 XOFF 19
Sets up serial port A for 1200 baud; all other parameters of serial port A are
left unchanged. Also sets up serial port B for 9600 baud and XON/XOFF
handshaking with the standard ASCn XON and XOFF characters. All other
parameters of serial port B are left unchanged.

Possible Error Messages
Bad value, please re-enter:
Displayed in the interactive mode if the value you have entered for either the
"xmit on" or "xmit off" character was not in the acceptable range of 0 to 255.
No serial port driver in the system.
This message is displayed if you execute SETUP on a system that does not have
a serial port driver. If you want to use the· serial ports you should use the
MOnSEL utility program (see Section 6.3) to select a serial port module to be
included with the system.
Command line error with SUBMIT in progress.
Do you want to continue with the SUBMIT file? (Y/N) :
(Command line mode) When SETUP detects an error in its command line it
checks for a SUBlVlIT file in progress. If it finds one, it asks you whether you

P&T CP/M 2

UTILITY PROGRAMS

User's Manual

page 8.129
SETUP

want to continue with it. If you respond affirmatively, the SUBMIT file will
continue. If you respond negatively, the SUBMIT file will be aborted. If you
are using the command line mode of SETUP from a SUBMIT file, any error on
the command line may cause the rest of the SUBMIT file to misbehave. This
message allows you the option of terminating the SUBMIT file if you wish.

Port not seleeted.
(Command line mode) This message indicates that SETUP could not find a port
indicator ("A" or "B") on the command line.
Invalid Command.
(Command line mode) This message is displayed if SETUP cannot recognize an
instruction given on the command line.
Bad Stop-Bit value.
(Command line mode) Displayed if the number of stop bits specified is not valid.
Bad DTR value.
(Command line mode) Displayed if the level to set the DTR output status line is
not properly specified.
Bad RTS value.
(Command line mode) Displayed if the level to set the RTS output status line is
not properly specified.
Bad Word-Length value.
(Command line mode) Displayed if the number of bits specified for a data word
is invalid.
Bad Parity value.
(Command line mode) Displayed if the parity is improperly specified.
Bad Xmit-on value.
(Command line mode) Displayed if the Xmit-on character is not specified with a
number in the range 0 - 255.
Bad Xmit-off value.
(Command line mode) Displayed if the Xmit-Off character is not specified with
a number in the range 0 - 255.
Bad Baud-Rate value.
(Command line mode) Displayed if the value specified for the baud rate is
invalid.

page 8.130
STAT

8.28

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Utility name: STAT
Purpose: To display various system statistics on the console.
General Description

STAT provides a means of displaying various system statistics and parameters at the
system console. In addition, STAT can be used to modify the system's
logical-to-physical I/O device assignments and the disk file attributes. STAT may be
executed from a SUBMIT file but it does not contain any of the output redirection
capabilities available in some P&T CP/M 2 utility programs.

Using STAT
The parameters specified on the command line that executes STAT entirely control
the operation of the program. In other words, STAT does not prompt for commands;
it performs the functions specified on the command line and then returns to the
operating system. It is also important to note that. all of STAT's commands (except
USB:) pertain only to the current user area. If no parameters are specified when
STAT is executed, STAT will report the amount of available space on each of the
active drives, as shown in Figure 8.145. In this example, only drive A was active.
(Remember: Only those drives which have been accessed since the last warm boot
are active.)
A>STAT
A: RIW, Space: 50k
A>
Figure 8.145 Example of Using STAT with no Parameters

In order to show the available space on a particular drive (whether it is active or
not), the logical drive letter may be specified in the command line, as shown in
Figure 8.146. In this case, STAT will show the available space on the specified
drive only.
A>STAT B:
Bytes Remaining On B: 27k
A>
Figure 8.146 Using STAT to Display Available Space on a Particular Drive

It is also possible to have STAT show statistics about a specific disk file.
8.147 shows the Use of STAT to display the statistics of PIP.COM.

Figure

page 8.131
STAT

UTILITY PROGRAMS

P&.T CP/M 2
User's Manual

A>STAT PIP.COM
Recs Bytes Ext Acc
58
8k
1 R/W A:PIP.COM
Bytes Remaining On A: 50k
A>
Figure 8.147 Displaying Statistics for a Particular Fi Ie Using STAT

When displaying file statistics, STAT uses the form shown in Figure 8.148. The first
column of the display, labeled "Recs", shows the number of logical sectors (128
bytes) that have been written to the file. The most accurate estimate of the
actual amount of information stored in the file is obtained by multiplying the
number of logical records by 128. This number is still an estimate, however, since
there is no way to determine how many bytes of actual data are present in the last
sector.
~

1:
2:
3:
4:
5:
6:

7:
8:

Recs Bytes Ext Acc
58
8k
1 R/W A:PIP.COM
58

8k

1 RIO A:PIP.COM

58

8k

1 R/W (A:PIP.COM)

58

8k

1 RIO (A:PIP.COM)

~

Figure 8.148 Forms of FI Ie Statistics Display

The second column, labeled "Bytes", shows the number of bytes of disk space
allocated to the disk file. This number is always given in Kbyte (1024 byte) units.
Since disk space is allocated in blocks of 1, 2, 4, 8, or 16 Kbytes, the space
allocated will frequently be larger than the space required by the number of logical
sectors (also called records, 128 bytes each) in the file. As a result, the amount of
disk space allocated to a disk file gives only a rough estimate of the actual size of
the file. For diskettes, the allocation block size is 1 Kbyte for single density and 2
Kbytes for double density.
The third column, labeled 'Ext', shows the number of directory entries used by the
file. As a file grows it uses more disk space than can be represented in one
directory entry. In order to represent this additional space, another directory entry
is used as an extension of the first entry. These "extensions" are called extents.
The process is repeated as the file grows. Thus, a number of extents may be
required for a large file. For example, the storage capacity on a single sided
double density diskette is 596 Kbytes, and 16 Kbytes can be stored under each
directory entry. If a file were to use the entire diskette, it would then require 38
directory entries.
The fourth column, labeled "Acc", shows the access attribute for the file. If the
attribute is shown as "R/W", the file is available for both reading and writing. If it
is shown as "R/O", the file is available for reading only, and any attempt to write
to it or erase it will cause an error. Lines 8.148-2 and 8.148~ show files tagged as
"read/write", while Lines 8.148-4 and 8.148-8 show "read only" files.
The fifth column of the STAT display, which is not labeled, shows the file name
and the drive on which the file was found. If the file has the $DIR attribute set
(so that it will be displayed in directory listings), the name is listed normally. If
the file has the $SYS attribute set (so that it will not be displayed in directory

•

page 8.132
STAT

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

listings), its name will be shown in parentheses. Lines 8.148-2 and 8.148-4 show $DIR
files, and Lines 8.148-6 and 8.148-8 show $SYS files.
If a wild card file name is used on the command line, STAT can show the statistics
on a group of files. Figure 8.149 shows the use of STAT to list all file names from
the current default drive with the extension "ASM". The wild card file name ''*.*''
will cause statistics of all files on the current default drive to be listed.
A>STAT *.ASM
Recs Bytes Ext Acc
33
6k
1 R/W
27
4k
1 R/W
16
2k
1 R/W
Bytes Remaining On A:

A: (DUMP.ASM)
A: (SETTIME.ASM)
A: (TI ME.ASM)
50k

A>
Figure 8.149 Displaying Statistics for all Fi les with ASM Extension

In order to have STAT change disk file attributes, merely specify the new value of
the attribute following the file name on the command line. In Figure 8.150, STAT is
used to set PIP.COM to "read only" status. Note that the "$" on the command line
is part of the instruction to set a file to read only and must be included.
A>STAT PIP.COM $R/O
PIP.COM set to R/O
A>
Figure 8.150 Using STAT to set a File to R/O

The attributes of a group of files may be changed with a single command by
specifying a wild card file. In response to the command in Figure 8.151, STAT will
set the $SYS attribute of all files having an extension of "ASM".
A>STAT *.ASM $SYS
DUMP.ASM set to SYS
SETTIME.ASM set to SYS
TIME.ASM set to SYS
A>
Figure 8.151

Using STAT to set all Files with Extension ASM to SYS

Figure 8.152 shows the various different indicators recognized by STAT for changing
file attributes.

,

$SYS

sets a file to system status. The name of aSYS file will not be
listed in a directory display.

$DIR

sets a file to non-system status. The names of non-system files
are listed In a directory display.

$R/O

sets a file to read only status.
fi Ie will result in an error.

Any attempt to write to such a

$R/W

sets a file to read/write status.
to such a file are allowed.

Both reading from and writing

Figure 8.152

Indicators Used by STAT for Setting File Attributes

,

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.133
STAT

In addition to setting file attributes, STAT can set a disk drive to read/only status.
Any attempt to write to that drive will then result in an error. However, setting a
drive to read/only status has limited usefulness. Since the status is maintained
only until a program resets the disk system or a warm boot is performed, it can be
dangerous to try to protect data in this way. After all, a warm boot usually occurs
at the end of every program, and a program may reset the disk system at times
which the user may not be able to predict. It is much safer to protect the data by
physically write protecting the diskette by uncovering its write protect notch.
Figure 8.153 illustrates the use of STAT to set drive A to read only status.
A>STAT A:=R/O
A>
Figure 8.153

Using STAT to Set Drive A to Read/Only Status

As shown in Figure 8.154, the DSK: command causes STAT to display the

configuration of the drives that are currently logged on.
1:

2:
3:
4:
5:
6:

7:
8:
9:

10:
11:

12:
13:
14:
15:
16:
17:

18:
19:
20:
21:
22:
23:

A>STAT DSK:
A:
4800:
600:
128:
128:
128:
16:
64:
2:

Drive Characteristics
128 Byte Record Capacity
Kilobyte Dr I ve Capac Ity
32 Byte Directory Entries
Checked Directory Entries
Records/ Extent
Records/ Block
Sectors/ Track
Reserved Tracks

B:
1944:
243:
64:
64:
128:
8:
26:
2:

Drive Characteristics
128 Byte Record Capacity
Kilobyte Drive Capacity
32 Byte Directory Entries
Checked Directory Entries
Records/ Extent
Records/ Block
Sectors/ Track
Reserved Tracks

A>

Figure 8.154 Displaying Drive Parameters with STAT

In this example, only drives A and B are currently logged on. Drive A has a double
density diskette mounted on it, while drive B has a single density diskette. The
first line of the parameters given for each drive (Lines 8.154-3 and 8.154-14) shows
the total number of logical sectors .in the data area of the disk drive. (Note: the
data area includes the disk directory, so some of these sectors are not available for
data storage.) The second line (Lines 8.154-5 and 8.154-15) shows the size of the data
area of each diskette in Kbytes. Once again, this number includes the directory
area of the disk.
The third line (Lines 8.154-6 and 8.154-16) of the parameters shows the number of
directory entries allocated to the disk. Since each directory entry requires 32 bytes
of storage, the available storage of the disk can be calculated by the formula
shown in Figure 8.155.

UTILITY PROGRAMS

page 8.134
STAT

available storage
Figure 8.155

= (drive

P&T CP/M 2
User's Manual

cap In Kbytes) - [(D dlr entries) /321

Formula for Calculating Available Storage

The fourth line (Lines 8.154-7 and 8.154-17) of the parameters shows the number of
directory entries that are checked to test for disk changes. When P&T CP/M 2
accesses a disk, it may perform a check to determine whether the disk has been
changed since the last access. It checks by comparing the contents of the
directory with information previously derived from the directory. If the two do not
match, the system assumes that the disk has been changed without a disk system
reset. If the system determines that a disk has been changed, it will mark it as
"read only". Any subsequent attempt to write to it will then cause a BDOS "disk
R/O" error.
The numbers shown on Lines 8.154-7 and 8.154-17 will be non-zero if checking for
changed disks is being performed and zero if it is not. When checking is performed,
the parameter will be set equal to the number of directory entries. Diskettes are
always checked since they can be changed so easily. For hard disk drives you get
to specify (with the HDCONFIG program supplied with hard disk systems) whether
the checking should take place. In the case of a fixed hard disk, it is conventional
not to perform checking since the disk cannot be changed.
The fifth line (Lines 8.154-8 and 8.154-18) of the parameters shows the number of
logical sectors that can be represented by a single directory entry. If a disk file
contains more than that number of logical sectors, it will require more than one
directory entry.
The sixth line (Lines 8.154-9 and 8.154-19) of the parameters shows the number of
logical sectors in each allocation block for the disk. An allocation block is the
minimum amount of disk storage that can be assigned to a disk file. In other
words, a file with only a single byte of data in it will still use an entire allocation
block of disk storage.
The seventh line (Lines 8.154-10 and 8.154-20) of the parameters shows the total
number of logical sectors per track on the disk drive. This number has very little
importance to the average user of the system.
The eighth (and last) (Lines 8.154-11 and 8.154-21) line of the parameters shows the
number of tracks that are reserved for system usage. Diskettes will always have
two tracks reserved regardless of whether a system resides on it.
In response to the command given in Figure 8.156, STAT will display the current user
and all user numbers under which files are stored on the disk.
A>STAT USR:
Active User: 0
Active Files: 035
A>
Figure 8.156 Displaying User Information with STAT

It is generally more convenient to use ASSIGN or SETUP rather than STAT to

manipulate the assignment of phySical I/O devices to logical I/O devices. In some
cases, however, the use of STAT may be necessary. Unfortunately, STAT recognizes
only the standard physical I/O device names of generalized CP/M, which have little
relationship with the actual devices available on the computer. Figure 8.157 shows

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.135
STAT

the correspondence between the physical I/O device names used by STAT and SETUP
or ASSIGN.
~

-...

~

STAT

~

TTY:
CRT:
BAT:
UC1:
PTR:
UR1:
UR2:
PTP:
UP1:
UP2:
LPT:
UL1:

SIOA
CRT
CENTRON
SlOB
URDR1
URDR2
SlOB
UPUN1
UPUN2
SlOB
CENTRON
SlOB

.~

Figure 8.157 Correspondence of Physical Device Names Between STAT and SETUP

The "DEV:" command causes STAT to display the current I/O device assignment as
shown in Figure 8.158.
A>STAT DEV:
CON: is CRT:
RDR: Js TTY:
PUN: is TTY:
LST: is LPT:
A>
Figure 8.158 Displaying I/O Device Assignments with STAT

Figure 8.159 shows the form of the command which changes the assignments. This
particular example assigns serial port B, UR2: to the RDR: logical device.
A>STAT RDR:=UR2:
A>
Figure 8.159 Setting Device Assignments with STAT

Finally, Figure 8.160 illustrates how the "VAL:" command causes STAT to display a
listing of the various commands it accepts as well as the physical I/O devices that
can be assigned to each logical I/O device.
A>STAT VAL:
Temp R/O Disk: d:=R/O
Set Indicator: d:fllename.typ $R/O $R/W $SYS $DIR
Disk Status : DSK: d:DSK:
User Status : USR:
Iobyte Ass I gn:
CON: = TTY: CRT: BAT: UC1:
RDR: = TTY: PTR: UR1: UR2:
PUN: = TTY: PTP: UP1: UP2:
LST: = TTY: CRT: LPT: UL1:
A>
Figure 8.160 Displaying a Summary of STAT Commands and I/O Devices

page 8.136
STAT

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Possible Error Messages

**

Aborted **
A character has been typed at the console keyboard while STAT was changing
file attributes, which causes STAT to abort the command and return immediately
to the operating systeITL

Bad Delimiter
You have used a bad delimiter between the logical I/O device name and the
physical I/O device name when specifying an I/O assignment.
File Not Found
The file you have specified in the STAT command could not be found on the
specified drive.
Invalid Assignment
While making an I/O device assignment, you have specified an invalid physical
I/O device for the logical device. Use the VAL: command to display the valid
assignments for each logical device.
Wrong CP1M Version (Requires 2.0)
This version of STAT will run only with version 2.0 or greater of CP/M. You are
attempting to use it with a previous version.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

8.29

Utility name:
Purpose:

page 8.137
SUBMIT

SUBMIT
To batch together a series of commands to be
automatically executed by the system.
General Description

SUBMIT provides a means of executing a sequence of commands (which would
normally be entered one at a time) automatically without operator intervention.
The user first creates a text file (with the extension "SUB") containing the
prototype commands. When SUBMIT is invoked, the commands will then be fed into
the Console Command Processor (CCP) in place of keyboard input. In addition, a
general SUB file can be used for different purposes by the substitution of
parameters.
The commands in a SUBMIT file can perform any operation that you can do by
typing a command into the system. In particular, you might use a SUBMIT file and
the command line modes of some P&T CP/M 2 utility programs to format, test, and
copy data to a new diskette with a single user command.

U sing SUBMIT
In order to use the SUBMIT utility, you first must prepare a SUB file with a text
editor. This file contains the command lines that will be fed into the Console
Command Processor (CCP). Figure 8.161 shows a sample SUB file.
:

This Is a demonstration of the use of SUBMIT

asm $1.aaa
load $1
$1 $2
Figure 8.161

Sample SUB FI Ie

Note that all characters appearing after a colon (except when used for a drive
designation) on a line in the SUB file are ignored. As in our example, this feature
can be used to insert comment lines in the file. These lines will be displayed on
the console as the SUB commands are executed but will cause no action to be
taken by the CCP.
Parameters to be inserted in the prototype commands are specified in the SUB file
by a dollar sign followed by a number (e.g. $1). The number indicates the position
on the SUBMIT command line of the parameter to be substituted. In order to
specify an actual dollar sign in the SUB file, use two dollar signs ("$$"). Notice
that two parameters ($1 and $2) are used in the SUBMIT file shown in Figure 8.16L
This example assembles a file specified by the first parameter on the SUBMIT
command line, loads it, and then executes it according to the second parameter on
the SUBMIT command line.
Assume that the SUB file shown in Figure 8.161 is stored on drive A with the name
TEST.8UB. Figure 8.162 shows the console display which results when this SUB file
is used to assemble the DUMP utility and to display its object code.

page 8.138
SUBMIT

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

A>SUBMIT TEST DUMP DUMP.COM
A>: THIS IS A DEMONSTRATION OF THE USE OF SUBMIT
A>:
A>ASM DUMP.AM
CP/M ASSEMBLER - VER 2.0
0257
001H USE FACTOR
END OF ASSEMBLY
A>LOAD DUMP
FIRST ADDRESS 0100
LAST ADDRESS 0212
BYTES READ
0113
RECORDS WRITTEN 03
A>DUMP DUMP.COM
0000 21 00 00 39 22 15 02 31 57 02 CD Cl 01 FE FF C2
0010 lB 01 11 F301 CD 9C 01 C3 51 01 3E 80 32 13 02

.

.

.

0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
A>
Figure 8.162

Example of Submitting the FI Ie Shown In Figure 8.161

In processing the SUB file, the SUBMIT program generates a temporary file named
$$$.SUB on logical drive.A. $$$eSUB contains the processed commands ready to be
read by' the CCP. As the CCP processes the commands, it modifies th $$$.SUB file
to remove the processed commands. Therefore, drive A cannot be write protected
while a SUB file is being executed.
The execution of a submitted file may be aborted by typing any character at the
console while the next command is being read from the temporary SUB file.
Note: SUBMIT will ignore all lines preceding a blank line in a SUB file, so no lines
should be left blank. The most common problem in using the SUBMIT utility occurs
because one or more blank lines are left at the end of the SUB file. This causes
the entire SUB file to be ignored, giving the appearance that SUBMIT is not
working.
Note that SUBMIT sends commands to the CCP only; it does not allow you to
specify input which is to be provided to a program while it is running. This
capability is available, but it requires the use of XSUB in conjunction with SUBMIT.
See the discussion of XSUB in Section 8.33 for details.
A SUB file may invoke the SUBMIT program to begin the execution of another SUB
file, but this causes the first SUB file to disappear from memory. The second SUB
file cannot "return" to the point in the first where it was invoked. As a result, a
SUB file may even invoke execution of itself. A useful application of this technique
is the generation of "circular" SUB files, which cause a series of commands to be
endlessly repeated until the user intervenes. For example, it is often very
convenient to have the system switch automatically between a text editor and the
assembler when you are writing an assembly language program. Figure 8.163 shows a
SUB file, named ASMBL.SUB, which performs this task.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.139
SUBMIT

ed $l.asm
asm $l.aaa
submit asmbl $1
Figure 8.163

Example of a Circular SUB File

When ASMBL.8UB is submitted, it first invokes the text editor, allowing the user to
write and/or modify the new program. An exit from the editor causes execution of
the SUB file to resume, which immediately invokes the assembler. As soon as the
assembler returns to the system, the SUB file invokes its own re-execution (by
SUBMIT), thus bringing back the text editor. This "tail-chasing" continues until you
abort the SUB file by typing a character at the keyboard between execution of its
commands.

Possible Error Messages
Error On Line nnn,
This message is used as a lead-in to most of the other error messages. It
indicates which line ("nnn") of the SUB file the SUBMIT program was processing
when the error occurred.
No 'SUB' File Present
SUBMIT could not find a file with the specified primary name and an extension
of "SUB" on the specified drive.
Disk Write Error
A error has occurred while SUBMIT was writing its output file to the disk. This
message most often indicates that the disk is full.
Command Buffer Overflow
The internal buffer that SUBMIT uses in processing the SUB file has been filled
to capacity. This indicates that the SUB file is too long (has too many
commands) to be processed by SUBMIT. The solution is to break the SUB file
into two or more parts. Each part is then stored as a separate file, and all but
the last should end with a command to execute SUBMIT on the succeeding file.
Command Too Long
The maximum length of a command line after all parameter SUbstitution is 127
characters. The indicated line has exceeded this length.
Parameter Error
A dollar sign which is not followed by a number or another dollar sign appears
in the SUB file and cannot be interpreted. If you want a dollar sign in the SUB
file, you should represent it by two dollar signs (ie. "$$").
Invalid Control Character
Control characters cannot be imbedded in the temporary SUB file regardless of
what the standard CP/M documentation states.
Directory Full
SUBMIT has found that the directory on the current default drive was already
full when it attempted to create its output file.

page 8.140
SYNCRO

8.30

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Utility name: SYNCRO
Purpose: To synchronize the system date and time to a P&T CCB
board.
General Description

SYNCRO reads the date and time from a P&T CCB clock/calendar board (if one is
installed in the computer) and sets the system date and time to agree with it. It
may be used to restore the correct date and time when they have been altered by
a program or by the SETTIME and/or SETDATE utility programs. Also, SYNCRO may
be used periodically to correct any inaccuracy in timekeeping during extended
system operation. Normally, the system clock loses about 5 seconds per hour of
operation.

Using SYNCRO
SYNCRO produces no output on the system console in execution, so it may be used
within SUBMIT files or with other program chaining techniques. The example in
Figure 8.164 shows SYNCRO being run from the console.
A>SYNCRO
A>
Figure 8.164 Example of Using SYNCRO

Possible Error Messages
SYNCRO produces no error messages.

P&T CP/M 2
User's Manual

8.31

UTILITY. PROGRAMS

page 8.141
TRS2CPM

Utility name: TRS2CPM
Purpose: To transfer disk files from a TRSDOS diskette to a CP/M
disk.

General Description
The TRS2CPM utility routine
to files on a CP/M diskette.
source Gode created by, for
most object code files, they
are designed to be executed

allows the user to convert files on a TRSDOS diskette
It was designed primarily to transfer programs in
instance, TRSDOS Basic. Although it can also transfer
will be of limited usefulness under CP/M, since they
in a TRSDOS environment.

Data Files
TRSDOS data files contain text, program source code, and information stored on the
diskette by programs. TRS2CPM transfers a data file from a TRSDOS diskette to a
CP/M diskette on a byte-for-byte basis. It does not translate or interpret the data
in any way. For text files, however, TRS2CPM does provide an option for inserting
a line feed character after each carriage return in the TRSDOS data. Most CP/M
programs expect both a carriage return and a line feed at the end of a line, while
lines of a text file under TRSDOS end with a carriage return only. Also, the CP/M
file will be terminated with a , the standard CP/M "end of file" mark for a
text file. These actions will make a TRSDOS text file usable by most CP/M
programs.
Some programs (nota~IY. RSCOBOL) under TRSDOS store textual material in the
TRSDOS variable record length format. These files do not have a have a carriage
return at the end of each line, but rather have a character count at the beginning
of each line. Transferring such a file to CP/M and attempting to use it (say edit it
with a text editor) will cause problems. TRS2CPM provides an option for modifying
variable record length files as they are transferred so that they will appear as a
normal text file to CP/M programs. This is accomplished by removing the record
length count from the beginning of each record and inserting a carriage return and
line feed at the end of each record. Of course, you may still transfer the files
unmodified (byte-for-byte) if you are writing programs under CP/M that can deal
with the TRSDOS variable record length directly.
Once a TRSDOS data file has been moved to CP/M, the different file structures
used by the two systems may require that changes be made before the file can be
used. In general, the file structure of CP/M is less involved. A CP/M program
always writes 128 bytes (a logical sector) of data, and it must keep track of the
beginnings and endings of records within the file. A TRSDOS program may write
out any number of bytes to a data file, and the file itself maintains information
indicating where each record begins and ends.
One result of this difference can be found in the last logical sector of the CP/M
file generated from TRSDOS by TRS2CPM, which may contain up to 127 bytes of
garbage. (C:P/M can detect an "end of file" condition only when the last logical
sector is reaa.) However, the  that TRS2CPM inserts at the end of the file
will always be placed immediately following the last valid byte of data as defined
by the TRSDOS "end of file" pointer. In most cases, this will allow an editor or

page 8.142
TRS2CPM

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

other program to detect the "end of file" properly, assuming that the transferred
file does contain text.
Non-text data files generated by programs under TRSDOS may also be transferred
by TRS2CPM, but they may not be directly useful under CP/M. A CP/M program
could successfully access the data only by reading it in the same manner as the
TRSDOS program which originally wrote the file. Writing such a CP/M program
obviously requires a thorough understanding of the original storage mechanisms and
considerable programming ability. Moreover, files created by different TRSDOS
programs may require different CP/M programs to read them correctly. In some
cases, it may be necessary to write a program that converts the data file from its
original format to one which can be read the CP/M program.
When TRS2CPM is used to transfer a random access data file, it may not transfer
the entire file. The transfer is performed sequentially from the beginning of the
file and will terminate when the first empty record is encountered.

Load Files
After the source code of a program (in TRSDOS Basic, for instance) is transferred
to a CP/M disk it can often be modified somewhat and used under CP/M. This, of
course, requires that a similiar language be available for use with CP/M. A
TRSDOS program in executable machine code may be transferred to a CP/M disk but
it will most likely not be usable. This is especially true of Radio Shack programs
such as Scripsi t and Profile II.
A TRSDOS load file contains program code to be loaded into memory and possibly
executed. Each load file contains a load address indicating where it is to be
placed in memory. It may also contain an execution address indicating where
execution of the program contained in the file is to begin. As a load file is
transferred from the TRSDOS diskette to the CP/M diskette, it is converted to an
Intel Hex file. (This is the only common type of file under CP/M that can contain
both types of addresses.) The load addresses in the hex file are set to the load
address specified within the TRSDOS file. Loading of a hex file under CP/M is
most commonly performed by the DDT or LOAD utilities.
Since the hex format file represents each byte of the file by two ASCII characters
and adds load addresses, checksums, and other overhead, it will be about 2.5 times
larger than the file from which it was generated. For long files, the conversion
time can be appreciable. The hex file is terminated by a , as is true for
most ASCn files under CP/M.
Some load files cannot be transferred by TRS2CPM because they specify multiple
load addresses that are meaningless under CP/M. Since these files are uniquely
associated with the TRSDOS operating system, their transfer should be of no
interest. All program load files (generated by a compiler or assembler) should be
transferable by TRS2CPM.

Using TRS2CPM
It is very difficult to give detailed and exhaustive written instructions for the

TRS2CPM utility. Only a few of the program's many options are involved in a given
transfer, and it would be practically impossible to cover every combination.
However, every effort has been made to make the program self-prompting and easy
to use. By reading the information in this section carefully, you should be able to

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.143
TRS2CPM

learn enough about TRS2CPM to make use of it, even if your situation varies from
the ones in the examples.
To execute the program, type in the line shown in Figure 8.165 while in the
command mode of CP/M.
(

Figure 8.165

1,

A>TRS2CPM )

Command Line to Execute TRS2CPM

If your computer system has more than one floppy disk drive, the initial dialog with

TRS2CPM be similar to that shown in Figure 8.166.
1:
2:
3:

4:
5:
6:

7:
8:

TRS to CP/M Transfer Uti Iity
Version 2.xxx
Copyright 1980,81,83 by Pickles &Trout
TRS Is a trademark of Tandy Corp.
CP/M Is a trademark of Digital Research
Enter source drive (8 through C) :C

9:

10:
11:
12:

13:

Enter destination drive (A through C) :8
Mount TRSDOS source disk on drive C
and the CP/M destination disk on drive 8

14:

15:

Press ENTER when disks are mounted 
Figure 8.166 Opening Dialog for TRS2CPM on a Multiple Drive System

On Line 8.166-8, TRS2CPM asks for the source drive. This is the floppy
on which the TRSDOS diskette will be mounted. In this example, drive
specified. Because of restrictions of CP/M, drive A (the built-in drive)
the source drive in a multiple-drive system. For a single drive system,
prompts you to mount diskettes in an order that avoids the problem.

disk drive
C is
cannot be
TRS2CPM

On Line 8.166-10, TRS2CPM shows you the CP/M logical drives that may be used as
the destination drive. The transfer of TRSDOS files will be made to the CP/M
diskette mounted on the drive which you specify. In this case, the built-in floppy
disk drive is available, although the example shows the selection of drive B. It is
also possible to specify the same floppy disk drive for both the source and
destination (not drive A, of course), as is illustrated below in Figures 8.168 and 8.169.
Once your selections are entered, TRS2CPM will prompt you to mount the TRSDOS
diskette and the CP/M diskette on the drives you have specified and then press
 (Lines 8.166-12 to 8.166-15). If the destination drive is the built-in floppy disk
drive, it is permissible to remove the system diskette and mount another CP/M
diskette at this time. TRS2CPM will prompt you to mount a system diskette before
attempting to return to the operating system, so there in no risk of an attempted
warm boot from a non-system diskette. The destination diskette may be either
single or double density, regardless of the drive on which it is mounted.
After you have pressed  (Line 8.166-15), TRS2CPM will flash the message
"Drive not Ready" at the bottom of the screen (as shown in Line 8.167-19) if this
condition is detected at the source drive. The message will continue to flash until
you press the  or  key. Either action will cause TRS2CPM to return
to the initial drive specification dialog. If the destination drive is not ready, the
standard BIOS error message ("Drive X not ready - please check it") will be flashed

page 8.144
TRS2CPM

UTILITY PROGRAMS

P&T CP/M·'2
User's· Manual

in the center of the display. When it is made ready, the program will continue
automatically.
TRS to CP/M Transfer Utility
Version 2.xxx
Copyright 1980,81,83 by Pickles &Trout

1:

2:
3:
4:
5:
6:
7:
8:

TRS is a trademark of Tandy Corp.
CP/M is a trademark of Digital Research
Enter source drive (B through C):C

9:

10:
11:
12:

Enter destination drive (A through C) :B

13:

Mount TRSDOS source disk on drive C
and the CP/M destination disk on drive B

14:
15:
16:

Press ENTER when disks are mounted 

17:
18:
19:

Drive not Ready
Figure 8.167

Example of Message Given When Source Drive is not Ready

If you specify the same physical floppy disk drive for both the source and

destination diskettes, TRS2CPM. will prompt you to exchange diskettes at the
appropriate times as it switches between reading and writing. For example, it will .
flash the message "Mount CP/M disk then press ENTER" at the bottom left of the
screen when access to that disk is needed. (See Figure 8.168.) Similarly, the
message "MountTRSDOS disk then press ENTER" will be flashed at the bottom right
of the screen when TRS2CPM is ready to access that disk. (See Figure 8.169.)
Obviously, the time and human interaction involved in this procedure weigh heavily
against its use on a multiple-drive system, and it is hard to conceive of a situation
when it might be needed.

1:

2:
3:
4:
5:
6:

7:
8:
9:
10:

TRS to CP/M Transfer Utility
Version 2.xxx
Copyright 1980,81,83 by Pickles &Trout
TRS Is a trademark of Tandy Corp.
CP/M is a trademark of Digital Research
Enter source drive (B through C) :C
Enter destination drive (A through C) :C

11:
12:

13:
14:
15:
16:

17:
18:
19:

Mount CP/M disk then press ENTER
Figure 8.168 TRS2CPM Prompt for Mounting the CP/M Disk

UTILITY PROGRAMS

P&'l' CP/M 2

User's Manual

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:

page 8.145
TRS2CPM

TRS to CP/M Transfer Utility
Version 2.xxx
Copyright 1980,81,83 by Pickles & Trout
TRS Is a trademark of Tandy Corp.
CP/M is a trademark of Digital Research
Enter source drive

(B

through C) :C

Enter destination drive (A through C) :C

11:

12:
13:

14:
15:

16:
17:
18:
19:
20:

Mount TRSDOS disk then press ENTER
Figure 8.169 TRS2CPM

Pro~t

for Mounting the TRSDOS Diskette

If your computer system has a single floppy drive, TRS2CPM will automatically
initiate the disk-swapping procedure described above. Since there is no choice of
the source or destination drives, TRS2CPM will omit the prompts for your selections
and will proceed immediately to the first mount request, as illustrated in Figure
8.170.
1:

2:

3:
4:
5:
6:
7:

TRS to CP/M Transfer Utility
Version 2.xxx
Copyright 1980,81,83 by Pickles &Trout
TRS is a trademark of Tandy Corp.
CP/M Is a trademark of Digital Research

8:

9:
10:
11:

12:
13:

14:
15:

16:
17:
18:
19:

Mount CP/M disk then press ENTER
Figure 8.170 TRS2CPM Opening Dialog for a Single Drive System

After the drive specifications (if any) are made and the diskettes are mounted,
TRS2CPM will read the directory from the TRSDOS diskette and display it as shown
in Figure 8.17L

UTILITY PROGRAMS

page 8.146
TRS2CPM

,

1:

2:

3:

4:
5:
6:
7:

SYSTEM .SYS
XFERSYS •
MEMTEST •
PRTBKSP •
COMSUB32.
BASCOM64.

SYSRES .SYS
FORMAT
BASIC
SYSTEM32.
EXDATM32.
COMSUB64.

··

·

BACKUP
SYSTEM64.
HERZ50
DOC0M32 •
DATM32
EXDATM64.

·
·

P&T CP/M 2
User's Manual

·
·

PATCH
TERMINAL.
LPlI
BASCOM32.
DOC0M64 •
DATM64

·

8:
9:

by

10:

Pickles & Trout
all rights
reserved

11 :

12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:

TRS to CP/M
Utility
Version 2.xxx
(c) 1980,81,83

.

·

ESC for new TRSDOS disk

T to transfer a file

Figure 8.171

·

BREAK to quit

Display of TRSDOS Diskette Directory

The cursor will be positioned at the beginning of the first file name displayed on
the screen, and a summary of the actions you may take will appear on the bottom
line of the display. If you want to mount a different TRSDOS diskette, press the
 key on the console keyboard. This will cause TRS2CPM to start over from the
beginning. Pressing the  key will cause TRS2CPM to return to CP/M.
To transfer a file, move the cursor to the beginning of the file name using the
cursor arrow keys on the keyboard. The cursor will move one complete file name
for each press of an arrow key. (If it cannot move in the direction specified, the
cursor will not move at alL) When the cursor is positioned at the name of the
desired file, press the "T" key on the console keyboard. TRS2CPM will read the
TRSDOS directory to find out what type of file is being transferred, and will
display its findings on the right side of the screen (Figure 8.172).
1:

2:
3:
4:

5:
6:

SYSTEM .SYS
XFERSYS •
MEMTEST •
PRTBKSP •
COMSUB32.
BASCOM64.

SYSRES .SYS
FORMAT
BASIC
SYSTEM32.
EXDATM32.
COMSUB64.

··

7:
8:

·
·
·

BACKUP
SYSTEM64.
HERZ50
DOC0M32 •
DATM32
EXDATM64.

·
·

PATCH
TERMINAL.
LPII
BASCOM32.
DOCOM64 •
DATM64

·

by

9:

P1ckles & Trout
all rights
reserved

10:
11:

12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:

TRS to CP/M
Utility
Version 2.xxx
(c) 1980,81,83

PRTBKSP.
SIZE:1
Data File

.

.

.

.

Do you want a LINE FEED appended after each CARRIAGE RETURN? (Y/N):N
Figure 8.172 Selecting a Data FI Ie for Transfer

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.147
TRS2CPM

When a data file is transferred, TRS2CPM will give you one of two options
depending on whether the file has a fixed or variable record length. If the file has
fixed record length, you have the option of having a line feed inserted after every
carriage return in the file. The prompt for your response will appear as shown on
Line 8.172-24. In most cases, you should specify "Y" if you are transferring a text
file and "N" for some other type of file. In the example shown in Figure 8.172, the
user elected not to have line feeds inserted. After your response is entered,
TRS2CPM will clear Line 8.172-24 and proceed to transfer the file.
If the file has variable length records, TRS2CPM will give you the option of having
each record end with a carriage return and line feed. The console display will
appear as shown in Figure 8~72 except that the bottom line of the display will be
replaced by the line shown in Figure 8.173. If you respond affirmatively to this
question, TRS2CPM will remove the record length count from the beginning of each
record and add a carriage return and line feed to the end of each record as it is
transferred. You will probably want to respond affirmatively if you are transferring
files containing text. If you respond negatively, the file will be transferred on a
byte-for-byte basis with no changes being made.
Do you want each variable length record to end with CRLF1 (Y/N)
Figure 8.173 Option Prompt for Variable Length Record Data Files

If you have selected a load file for transfer, the load address and execute address
(if defined) will be displayed as illustrated in Figure 8.174. Note that the file being
transferred in this example has no defined execute address. If one were specified,
it would appear immediately below the load address on the display. Since load files
are always converted to hex format files on the CP/M disk, the transfer will take
considerably longer than for a data file of the same size. In addition, the file
generated on the CP/M diskette will be longer than the original file. The last line
of the display will be cleared when TRS2CPM begins to transfer the file.
1
2
3
4

5
6
7
8
9

SYSTEM .SYS
XFERSYS •
MEMTEST •
PRTBKSP •
COMSUB32.
BASCOM64.

..

SYSRES .SYS
FORMAT
BASIC
SYSTEM32.
EXDATM32.
COMSUB64.

·
·
·

BACKUP
SYSTEM64.
HERZ50
DOC0M32 •
DATM32
EXDATM64.

·
·
·

PATCH
TERMINAL •
LPII
BASCOM32.
DOCOM64 •
DATM64

10
11

12

TRS to CP/M
Utility
Version 2.xxx
(cl 1980,81,83
by
Pickles & Trout
all rights
reserved

13

14
15
16
17
18
19
20
21
22

23
24

DATM64.
SIZE:4
LOAD:EC60

.

ESC for new TRSDOS disk

·

T to transfer a file

·

BREAK to quit

Figure 8.174 Selecting a Load File for Transfer

page 8.148
TRS2CPM

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

Possible Error Messages
TRS2CPM can display several different error messages during operation. The general
form of these messages is a line at the bottom of the display screen with the
message flashing between normal and reverse video. If your computer has a Pickles
& Trout Clock/Calendar/Bell board (CCB) installed, the bell will beep as the message
is flashed. The message will continue to flash until you press the  or
 key on the keyboard. TRS2CPM will then return to its opening dialog in
most cases, since an error could cause it to malfunction.
Drive not Ready
The source drive is not ready. Neglecting to mount the TRSDOS diskette when
requested is the usual cause of this error.
READ ADDR ERROR
A problem has been encountered in reading the TRSDOS diskette. This message
usually indicates a bad spot on the diskette.
SEEK ERROR
An error has occurred during the attempt to position the read/write head at a
specific location on the TRSDOS diskette.
READ ERROR
An error was encountered while reading information from the TRSDOS diskette.
It usually indicates a bad spot on the diskette.
TRANSFER ABORTED: THIS SPECIAL SYSTEM FILE CANNOT BE
TRANSFERRED
You have attempted to transfer a load file containing load addresses that cannot
be meaningfully represented in an Intel hex format file.
Not a valid TRSDOS disk
The diskette mounted on the source drive is not a TRSDOS diskette.
The operating system may also display error messages if an error occurs while the
destination diskette is being accessed. A system message will appear on the bottom
line of the display, and it may be incomplete. Since the first 23 lines of the
display are locked into place during the execution of TRS2CPM, the display can
show only the last line of a multiple-line message issued by the system.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

8.32

page 8.149
VERIFY

Utility name: VERIFY
Purpose: To verify that a copy of a P&T CP/M 2 utility program
has not been altered.
General Description

Most of the utility programs supplied with P&T CP/M 2 have internal codes to allow
you to determine if the copy you are using is valid. The VERIFY program checks
these codes and reports to you whether the copy is correct or not. VERIFY can
also report the patch numbers of the patches that have been installed on a program
using the PATCH utility program.
You can run VERIFY on a program file as many times as you wish; it will not
damage or alter the file in any way. If a program file does not verify, it indicates
that something has been altered since it was copied from the master diskette. If a
program has been altered, it may not perform properly. Changes made by the
PATCH program will not affect VERIFY.
Note: VERIFY will only work on utility programs supplied with P&T CP/M 2. In
particular, it is not a file comparison program that allows you to compare a
working copy of any file with another copy (say on a master disk).

Using VERIFY
Figure 8.175 shows the general form of the command line that is used to verify a
program file. You may specify either a unique file name (as shown) or a wild card
file name. If you specify a wildcard file name, all files matching the name will be
verified.
VERIFY (fl Ie name) (PI
(file name) Is the name of the fl Ie to be verified.
(PI Is optional and. If present. causes VERIFY to
list the patCh numbers of all patches that have
been Insta I led
Figure 8.175 General Form of VERIFY Command Line

Figure 8.176 shows an example of using VERIFY on the PATCH.COM program file and
Figure 8.177 shows an example of using VERIFY with the P option. If patches had
been installed in the program file, their numbers would have been reported on Line
8.177-5.
1:
2

A>VERIFY PATCH.COM

3

PATCH.COM verified.

4

5

A>

Figure 8.176 Example of Using Verify

page 8.150
VERIFY

UTILITY PROGRAMS

1
2
3

P&T CP/M 2
User's Manual

A>VERIFY PATCH.COM P
PATCH.COM

verified.

4

5

Patches Installed: None.

6

7
Figure 8.177

A>
Example of Using Verify with the P Option

Possible Error Messages
No files found.
VERIFY could not find any files on the disk that match the file name (either
unique or wild card) that you gave on the command line. This can be caused by
omitting the file name altogether.
filename.ext not found.
"filename.ext" will be replaced by the name of the program file you specified on
the command line. This message is given if the file cannot be found on the
specified disk. Check to see that the program is actually on the disk and run
VERIFY again. This error can be caused by mis-typing the file name.
filename.ext is not setup for use with VERIFY.
"filename.ext" will be replaced by the name of the program file you specified on
the command line. This message indicates that you have tried to run VERIFY on
a program file with which it cannot work. Most programs that are distributed
with P&T CP/M 2 have been prepared for VERIFY. VERIFY will not work with
programs from other sources
filename.ext has internal error(s), doesn't verify.
"filename.ext" will be replaced by the name of the program file you specified on
the command line. This message indicates that VERIFY has found one or more
errors in the program file. You should make another copy of the file from your
master diskette.
filename.ext read error.
A disk error occurred while reading the file named "filename.ext" to perform the
verification.
Not enough memory for all files specified.
This message is given if insufficient memory is available to hold information
about all the files being verified. It is very unlikely that you will encounter
this error. If you do, check the amount of reserved memory above the operating
system. Reducing this amount may allow VERIFY to run. Alternately you can
specify a more restrictive wild card file name so that VERIFY will check fewer
files.

P&T CP/M 2
User's Manual

8.33

Utility name:
Purpose:

UTILITY PROGRAMS

page 8.151
XSUB

XSUB
To allow SUBMIT files to provide console input to some
programs.
General Description

The standard SUBMIT utility of P&T CP/M 2 can provide the automatic execution of
a series of programs. However, it does not provide a means of input to a program.
Once a program is running, any console input it requires must be typed in from the
console unless SUBMIT is run in conjunction with XSUB.
XSUB allows a SUBMIT file to supply input to programs that use the CP/M buffered
console input function (BDOS function 10). It causes the next line from the SUB
file to be returned any time that a program calls BDOS function 10.
Although XSUB greatly enhances the capabilities of SUBMIT, a thorough
understanding of its limitations is necessary to make effective use of it. In
particular, you may not have a control character in a command line nor an empty
command line (the result of pressing  by itself). Unfortunately, these
restrictions prevent the complete use of some programs. For example, some
programs return to the system only after a blank command line or a 
«break» is entered. Since neither of these can be present in a SUB file, a SUB
file which executes such a program and then feeds it commands cannot provide a
return to the operating system.
The next most severe limitation of XSUB is that it can feed input into programs
only through the buffered console input function. With more and more interactive
programs being written, the use of buffered console input is declining. Some
programs use both buffered and direct console input. If XSUB is used with these
programs, the buffered input will come from the SUB file, but the direct input will
have to come from the console.

UsingXSUB
To use XSUB, a SUB file should be prepared exactly as it was for the standard
SUBMIT program, except that the first program executed should be XSUB. The rest
of the SUB file may include commands which execute programs interspersed with
separate lines of data to be fed into them. Once executed, XSUB relocates itself
just under the CCP in memory and makes appropriate patches to the system to
avoid being over-written by other programs. As a result, there is somewhat less
memory available to transient programs while XSUB resides there.
Figure 8.178 gives an example of a SUB file named "TEST.sUB" which makes use of
XSUB. The SUB file creates a disk file containing a form feed character followed
by three  characters. Such a "form feed file" is useful when transferring
(iles to the printer using PIP. It can be sent between the other files to advance
the paper to the top of the next page.

UTILITY PROORAMS

page 8.152
XSUB
~

1
2
3
4
5
6

7
8
9
10
11
~

12

:
:

This Is a demonstration of the use of SUBMIT with XSUB

P&T CP/M 2
User's Manual
'"4

xsub
ddt
5100
Oc
la
la
la

.gO

save 1 ff

..

FI gure 8.178 Example of a SUB File that uses XSUB

To create the disk file, the SUB file inserts the characters into the beginning of
the transient program area (TPA) by means of the DDT program. It then saves the
first page (256 bytes) of the TPA on disk as a file named FF.
Lines 8.178-1 and 8.178-2 are merely comment lines, since they start with a colon.
Line 8.178-3 executes the XSUB program, which allows the SUB file to provide input
into the DDT program. Line 8.178-4 executes DDT. Lines 8.178-5 through 8.178-10 use
the "s" command of DDT to insert the characters into memory. Line 8.178-11 uses
the "0" command of DDT to cause a warm boot and hence a return to the
operating system. Finally, Line 8.178-12 uses the CCP SAVE command to save the
first page of the TPA as a disk file named FF. Note that Lines 8.178-1 through
9.178-4 and Line 8.178-12 are all command lines to the CCP. Lines 8.178-5 through
8.178-11 are command lines to the DDT program.
Figure 8.179 shows the console display that results when "TEST.SUB" is submitted.
Notice that XSUB displays the message "(xsub active)" whenever a warm boot occurs
as long as it is in memory. XSUB is automatically de-activated after the last
command of a SUB file is processed.
A>SUBMIT TEST
A>: THIS IS A DEMONSTRATION OF THE USE OF SUBMIT WITH XSUB
A>:
A>XSUB
A>DDT
DDT VERS 2.2
-S100
0100 01 OC
0101 BC lA
0102 OF lA
0103 C3 lA
0104 3D •

-GO
(xsub active)
A>SAVE 1 FF
A>
Figure 8.179 Console Display from Running the SUB FI Ie of Figure 8.178

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.153
XSUB

Possible Error Messages
Xsub Already Present
This message indicates that XSUB was already resident in memory before the
command for its execution. No action is taken and the SUB file continues with
the next command.
Requires CP1M Version 2.0 or Later
You are trying to use XSUB with an older version of CP/M or a non-CP/M
opera ting system.

page 8.154
Command Line Mode Examples

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

8.34 Examples of Using the Command Line Mode
The command line mode of the various utility programs is a very useful and
powerful tool. This is especially true when you are setting up a system of
programs for a non-technical user. It is possible to insulate the user from the
details of the various utility programs (like FORMAT and DISKCHK) by making them
appear as a normal part of the system. Of course the command line mode is also
quite useful if you frequently perform certain operations and want to use a single
command line rather than being prompted for information.
The following examples show how the command line mode of the utility programs
might be used to automate some functions. Since they are intended to be
illustrative, only the parts dealing with the utility programs is shown in detaiL
There are many other ways that the command line mode can be used.

Example 1 - Using a SUBMIT File in Software Production
If you have written software that you are distributing, you need some method of
duplicating it. The following example assumes that there are three operations to
perform to generate a distribution diskette: 1) format the diskette, 2) copy the
programs to the diskette, and 3) serialize the programs.
You could start with a stack of blank diskettes and format them alL Then you
could copy the programs to each diskette and finally perform the serialization. This
technique means that you must make three passes through all of the diskettes. This
involves a lot of handling and the associated chance of mistakes. Figure 8.180 shows
a submit (named PRODUCE.SUB) file that can be used to perform all three
operations on a diskette before moving on to the next diskette.
"II

1:
2:
3:
4:
5:
6:

: Submit file to FORMAT -> COpy -> SERIALIZE
format dr=d sd v pmount
clone e>d v t
serlallz
submit produce

Figure 8.180 Example Production SUB File that Uses Utility Programs

Lines 8.180-1 and 8.180-2 are merely comment lines that will be displayed on the
console as the submit file begins operation. This submit file assumes that the
master diskette from which the distribution diskettes are to be made is mounted on
drive C and that the diskettes to be produced will be mounted on drive B.
Line 8.180-3 executes the FORMAT program to format the new diskette at single
density. Single density should always be used for software distributed on 8 inch
diskettes since there is only one single density format used with CP/M but there is
a multitude of double density formats. The "V" instruction is used so that FORMAT
will make a verification pass on the diskette after it is formatted. The "PMOUNT"
instruction is given to FORMAT so that it will prompt for a diskette to be mounted
before the format operation begins. This eliminates the need to explicitly prompt
the user to mount a diskette.

UTILITY PROGRAMS

P&T CP/M 2
User's Manual

page 8.155
Command Line Mode Examples

Line 8.180-4 executes the CLONE program to copy from the master diskette on drive
C to the newly formatted diskette on drive B. The "V" instruction causes CLONE
to verify each track after it is copied and the ''T'' instruction is given so that
CLONE will stop when it encounters the first empty track on the source diskette.
Line 8.180-5 executes a program named serialize that installs the serial number in
the newly copied diskette on drive B. It is assumed here that you would write this
program to perform whatever serialization operations are needed.
Finally, on Line 8.180-6, the submit file resubmits itself. The production process will
continue until you abort it. To abort the process, you need merely press the
 key while the initial messages from the submit file are being displayed on
the console.
Figure 8.181 shows the console display that results from running the PRODUCE
submit file. Note that the only user input is the initial execution of the submit
file (Line 8.181-1) and pressing  on Line 8.181-7 after the new diskette is
mounted. All other lines of the display come from either the programs that are
executed or the submit file itself. Note that on Line 8.181-30, PRODUCE re-invokes
itself which will start the process over again at line 8.181-2.

1

2
3
4
5
6
7
8
9

A>SUBMIT PRODUCE
A>: SUBMIT FILE TO FORMAT -> COpy -> SERIALIZE
A>:
A>FORMAT DR=B SO V PMOUNT
Mount disk to format on drive B: and press  when ready to start: 

10

** FORMAT **
Formatting disk in drive B: at Single-density.

11
12

Format complete.

13
14

Checking disk on drive B:

15

.............................................................................
.............................................................................

16
17

Checking complete.

18

A>CLONE C>B V T

19

20
21

22
23
24
25

26
27

28

29
30

** CLONE **
Copying from drive C: to drive B: at Single Density.
+++++++++++++++++++++++++++++
Found empty track -- Copy terminated after track 30
A>SERIALIZ
Serial number 00005 - successful
A>SUBMIT PRODUCE
Figure 8.181

Console Display when Using PRODUCE.SUB

page 8.156
Command Line Mode Examples

UTILITY PROGRAMS

P&:T CP/M 2
User's Manual

Example 2 - Periodic Checking of a Diskette
In some cases it is desirable to use DISKCHK on a diskette from time to time to
check for errors. If soft errors begin to show up, you have a chance to replace
the diskette before any permanent errors occur and data is lost.
The following example uses the submit file (named JOBLSUB) shown in Figure 8.182
to execute two programs and then use DISKCHK to check the diskette for errors.
Lines 8.182-1 and 8.182-2 execute two programs named PROG1 and PROG2,
respectively. These might be text editing, data base, accounting, or some other
kind of programs. The submit file then displays a comment on the console (Line
8.182-4) to indicate that the data diskette is about to be checked.

III..

1:
2:
3:
4:
5:
6:
7:
8:

Figure 8.182

: prog1
: prog2
: Error checking the data diskette
dlskchk dr=d /a:dchk.err
mbaslc dchk
sutmlt Job1

~

Example of Sutmlt FI Ie that Uses DISKCHK

On Line 8.182-6, the submit file executes the DISKCHK utility program to check the
diskette mounted on drive D. All console output is directed to a disk file named
DCHK.ERR on drive A; no messages appear on the console while the program is
running. The user is not bothered by the messages coming from DISKCHK.
On Line 8.182-7, the submit file executes a Basic program that checks the output
file ereated by DISKCHK for error messages. If any error messages are detected,
the user is informed and is given a suggested course of action. Finally, the submit
executes itself again (Line 8.182-8) and the whole process starts over. Figure 8.183
shows the source code of the Basic program.

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.157
Command Line Mode Examples

.'

10 'This program reads the file A:Oa-lK.ERR which is created by
20 'running DISKCHK. It scans the file for errors and, if it
30 'finds any, it will print an appropriate message on the
40 'console advising the user what action to take
50 '
55 FLAG=O
.60 OPEN "I ", 1, "A:Oa-lK.ERR'i
70 ON ERROR GOTO 1000
'go to 1000 when get to end of file
80 LINE INPUT 11,TEMP$
90 IF INSTRerative that you replace It at once."
130 PRINT "Use the system menu to format a new diskette and"
140 PRINT "copy your working files to it."
150 KILL "A:$$$.SUB"
160 SYSTEM
200 '
500 FLAG=l : PRINT
505 PRINT "Your data diskette has developed a soft error."
510 PRINT "It is recommended that you replace It as soon as possible."
520 PRINT "Do you want to stop now to replace It (yIn)?";
530 RESP$=INPUT$(l)
540 IF RESP$<>!'y", AND RESP$<>"Y" THEN 80 ELSE 150
600 '
1000 IF FLAG<>O THEN SYSTEM
1010 PRINT: PRINT "Your data diskette checks out OK."
1020 SYSTEM
Figure 8.183 Basic Program to Check for Errors from DISKCHK

Lines 10-50 of the program are comments. On Line 55 the program sets a flag
variable to O. This flag is used to keep track of any soft errors that are detected.
On Line 60 the program opens the file it is to read to check for errors. Line 70
directs any errors to line 1000 so that when all of the file is read, control will pass
to the exit code in lines 1000-1020. Lines 80 and 90 form a loop that reads lines
from the file until the end of the file occurs or a line containing ''>>>>'' (denoting
an error) is encountered
If an error line is found, Line 100 checks it for the word "Soft". If the word "Soft"
is found in the line, Lines 500-540 are executed to notify the user of the soft error
and to find out what he wants to do about it. If "Soft" is not found on the error
line, it is assumed to be a permanent error. In this case the user is not given a
choice. The program automatically aborts the submit file that is in progress (Line
150) and returns to the system command leveL

Assuming that the program is not terminated by an error, control finally passes to
Line 1000 when the end of the input file is reached If no soft errors had been
encountered, the program displays a message indicating that the diskette is OK and
returns to the system leveL
Obviously much more involved error checking could be performed and another
language might be preferable but this example does illustrate the kinds of checking
that can be done. Figure 8.184 shows the console output from running the submit
file shown in Figure 8.182.

page 8.158
Command Line Mode Examples

1:
2:
3:
4:
5:

UTILITY PROGRAMS

A>SUBMIT JOB1
-----> PROG1 is executed here
-----> PROG2 is executed here

6:

7:
8:
9:

A>:
A>: ERROR CHECKING THE DATA DISKETTE
A>:
A>DISKCHK DR=D /A:DCHK.ERR

10:
11:
12: A>MBASIC DCHK
13: BASIC-80 Rev. 5.21
14: (CP/M Version)
15: Copyright 1977-1981 (C) by Microsoft
16: Created: 28-Jul-81
17: 27704 Bytes free
18:
19: Your data diskette checks out OK.
20:
21: A>SUBMIT JOB1
Figure 8.184 Example of Console Display when Using JOB1 Submit File

P&T CP/M 2

User's Manual

P&T CP/M 2
User's Manual

UTILITY PROGRAMS

page 8.159
Command Line Mode Examples

Example 3 - Using Utility Programs from Dbase n
Dbase II (and other languages) allows you to execute a series of programs from a
single command line within the Dbase command file. Figure 8.185 shows a skeletal
Dbase command file (named MAIN.CMD) that has an option to format and test a new
diskette.

,
1:

2:
3:
4:
5:
6:
7:
8:

*

Example of using P&T utility programs from a Dbase I I program
store '0' to funct

do while val (funct)<>99
erase
? "Functions:"
? "1. Enter new data"
? "2. Print data"

9:
10:

11:
12:
13:
14:

15:

.

? "85. Format and test a new diskette"
? "99. Exit to system"

accept "Enter function number" to funct

16:

17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:

32:
33:
34:
\.. 35:

do case
case val (funct)=l
do entdat
case val (funct)=2
do prndat

.

case val (funct)=85
?

11 "Mount a new diskette on drive D and press "

walt to tell1>
quit to "format dr=d,dd","dlsktest dr=d","dbase main"
end case
enddo
quit

Figure 8.185 Example CMD file for Using Utility Programs from Dbase I I

Lines 8.185-4 to 8.185-15 display a menu of functions on the console and ask the
user to enter the one to be performed. This menu would be expanded to include all
the various functions that you have included in the program. Lines 8.185-17 to
8.185-32 execute one set of instructions according to the function number entered in
response to the menu. In particular, Lines 8.185-26 to 8.185-30 handle function number
85, "Format and test a new diskette".
Line 8.185-28 prompts the user to mount a new diskette on drive D and press the
 key. Line 8.185-29 waits for the . Line 8.185-30 exits Dbase II and
starts a sequence of three command lines. The first one "format dr=d,dd" executes
the FORMAT program to format the diskette mounted on drive D at double density.
The second command line, "disktest dr=d" executes the utility program DISKTEST to
make a thorough test of the diskette just formatted. The thi~d command line
"dbase main" re-executes the command file shown in Figure 8.185 so that the user
finds himself back at the menu presented by the command file. All messages from
the utility programs are displayed on the console so that the user can take
appropriate action should a error occur.

page 8.160
Command Line Mode Examples

UTILITY PROGRAMS

P&T CP/M 2

User's Manual

Figure 8.186 shows the console output when the user selects function 85. Note that
after Dbase is executed again on Line 8.186-39, it will clear the display and start
over with the menu as shown on Lines 8.186-1 to 8.186-6.

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:

Functions:
1. Enter new data
2. Print data
85. Format and test a new diskette
99. Exit to system
Enter function number :85
Mount a new diskette on drive D and press 
WAITING
*** END RUN
dBASE I I
***

A>FORMAT DR=D,DD

**

FORMAT **
Formatting Single-sided disk In drive D: at Double-density.

.............................................................................

Format complete.
A>DISKTEST DR=D

** DISKTEST **
Testing Double-density disk In drive D:
Beginning pass with pattern = 00

.............................................................................

Beginning pass with pattern = FF

••....••.....•.•...•••.....••.....•....••..•••.•..•••••....••..•..•.••••••...

Beginning pass with pattern = DBB6
Testing complete.
A>DBASE MAIN
Figure 8.186 Example of Using CMD File of Figure yy98

SYSTEM ERROR MESSAGES

P&T CP/M 2
User's Manual

page 9.1
Introduction

9.1 Introduction
P&T CP/M 2 will issue error messages when various system errors occur. The most
commonly encountered messages have to do with disk related errors. Other
messages deal with problems related to the parallel printer port. These messages
depend on the parallel printer port module (if any) that is included in the system
when it is loaded. The messages given by the standard parallel printer port module
are described in Chapter 13 on the parallel printer port.
There are two types of disk error messages given by P&T CP/M 2: BDOS messages
and BIOS messages. BDOS error messages are generated by the portion of P&T
CP/M 2 that was written by Digital Research. They are usually very general in
nature, and they do not indicate the cause of hardware errors. In order to provide
more detailed information on hardware errors, P&T CP/M 2 has implemented several
BIOS error messages which include an error code that supplies additional
information. A BIOS and a BDOS error message will usually be displayed together
when a disk error occurs.
If you have a large number of disk errors and contact Pickles & Trout for
assistance, please have the exact error messages available so that we can help you.
If you do not have these messages, we usually cannot do more than give very
general suggestions. You might consider keeping a log containing the error message
and other information such as how long the machine had been on and what you
were doing when the error occurred.
There is one disk related message that, while not strictly resulting from an error,
will be discussed here. This message results from the system attempting to access
a floppy diskette drive which is not ready. When P&T CP/M 2 attempts to access a
diskette drive, a check is made to see that a diskette is mounted on the drive, the
door is closed, and the diskette is up to speed. If one of these conditions is not
met the drive is said to be "not ready". When a drive is found to be not ready,
P&T CP/M 2 flashes the message shown in Figure 9.1 in the center of the console
display.
(

Drive X is not ready - please check it. )

Figure 9.1

Message Flashed When a Drive is Not Ready

The "x" in Figure 9.1 will be replaced with the letter of the logical drive which is
not ready (e.g. A, or B, or C, _). When you see this message flashing, you have
three options available to you.
1. You may make the drive ready (this typically means mounting the diskette or
closing the drive door). As soon as the drive is ready, the flashing message will
be removed and the screen will be restored to its appearance before the
message was displayed. Operation will then resume automatically.
2. You can press the  key.

This will abort any program that is running and
return to the command level of the system by performing a warm boot. When
you are returned to the command level, you will return to the same drive that
was the current default drive the last time you were at the command leveL

page 9.2
Introduction

SYSTEM ERROR MESSAGES

P&T CP/M 2
User's Manual

3. You can press the , pressing  is pressed, the bad sector is ignored and
operations continue. If  or  is pressed, the operation {and the
program} is aborted, a warm boot is done, and the system returns to the command
leveL NOTE: In some cases, pressing  can jeopardize the integrity of data
on the diskette being accessed.
The "Select" BDOS message is given when an attempt is made to select a drive
which is not valid on the system. After the message is given, any console input
will result in a warm boot and a return to command leveL
The "Read Only" BDOS message is given when an attempt is made to write on a
disk that the system has set to "read only" status. As noted earlier, the system
keeps a check on each disk for changes which may have occurred since it was last
accessed. Actually, the check is based on information which the system keeps on
the disk's directory. When this information does not agree with the directory itself,
the system assumes that disks have been exchanged without an intervening warm
boot or disk system reset. Consequently, the system sets the disk to "read only"
status, thus protecting your files from possible damage. A disk can also be set to
"read only" status with the STAT utility program or a standard system calL After a
"Read Only" error message is given, any console input will cause a warm boot.
{NOTE: After the warm boot, the disk will be reset to "read/write" status.}
The "File R/O" BDOS message is given when an attempt is made to write to,
rename, or erase a file that is marked as "read only". Once the message is given,
the system waits for input from the console. If the next character entered is
, the system will ignore the attempted write and continue. If  or
 is entered, the system will abort the current operation, perform a warm
boot, and return the user to the system command leveL {NOTE: A warm boot has
no effect on a file that has been tagged as "read only".}

P&T CP/M 2
User's Manual

SYSTEM ERROR MESSAGES

page 9.3
BIOS Error Messages

9.3 BIOS Error Messages
The BIOS portion of P&T CP/M 2 displays several additional error messages to
describe the nature of disk errors more specifically. The general form of these
messages is shown in Figure 9.3.
(

xxxxxx error, code

= cccc

)

Figure 9.3 General Form of BIOS Error Messages

In the BIOS error messages, "xxxxxx" is a word or phrase indicating the type of
error, and "cccc" is an error code which gives more details of the error being
reported. Figure 9.4 shows the various words and phrases that can appear in the
place of the "xxxxxx".
Track
Lock-out
Hard disk
Hard disk
Hard disk
Hard disk

read
write
not ready
write protect

~

Figure 9.4 Words and Phrases Used In BIOS Error Messages

The error code consists of from three to five characters. Since there are a very
large number of possible error codes, it is impossible to try to describe them all in
a manual like this. For this reason, the ERROR utility program has been supplied
with the system. If you want a further explanation of a particular error code, you
need merely execute the ERROR program using a command line like that shown in
Figure 9.5. Further information on the ERROR program is given in Section 8.15 of
this manuaL
ERROR code
"code" Is replaced by the error code for which
you wish an explanation.
Figure 9.5 General Form of Command Line to Execute ERROR

9.4 Warm Boot Error Message
Another type of error message that may be given by the BIOS occurs when a warm
boot operation is attempted from an improperly set up system diskette. During the
warm boot operation on some systems, a portion of the operating system (the CCP
and BDOS) must be read in from the system diskette. During the system loading
operation, the copy of these parts of the system that are kept on the diskette were
set up to run at a particular location in memory. The location is determined by
the combination of modules you selected for inclusion in the system.
If, when a warm boot is attempted, the system finds that these portions of the

system are not on the diskette or they have not been properly set up to run with
the system in memory, the error message shown in Figure 9.6 is displayed on the
console. If this error should occur, you have two possible actions. You can mount
another diskette with (hopefully) a correct copy of the CCP and BDOS and press
any key to attempt the warm boot from it. Alternatively, you can RESET the
computer to reload the system from the currently mounted system diskette.

page 9.4
Warm Boot Error Message

SYSTEM ERROR MESSAGES

P&T CP/M 2
User's Manual

Mismatched system disk - please try another.
Figure 9.6

Error Message Flashed for Warm Boot Error

This type of error may occur if you change diskettes on the system drive and then
attempt to perform a warm boot. You may change diskettes on the system drive as
long as the diskette mounted when a warm boot is performed has the CCP and
BnOS properly modified. You can insure that they have been properly modified in
two ways:
L You can use CLONE to copy the system tracks from the diskette used to
initially load the system to the other diskettes that you will be using on the
system drive.
2. You can create identical working system diskettes with exactly the same

BIOSPARM.PNT and BIOSMOnS.PNT files and then load the system at least once
from each of them. The process of loading the system from each system
diskette will insure that the copies of CCP and BnOS on each of them are
properly modified. Since the same modules are included in the system loaded
from each of the diskettes, the CCP and BnOS will be identically modified on
each one.

9.5 System Load Error Messages
If an error occurs while the system is being loaded from disk, an error message of
the general form shown in Figure 9.7 is displayed on the console. After this
message is displayed, the machine will stop. In order to continue, you must remedy
the problem and RESET the computer to load the system again. The error message
includes a numeric code (shown by "XX") which indicates what caused the error.
(
Figure 9.7

Load Error xx )
Form of Loader Error Message

The error codes that might appear in the loader error message are as follows:
1

An error occurred while attempting to restore the system boot drive. This
can be caused by a hardware problem or by setting the drive step rate to
an improper value.

2

An error occurred while attempting to move the disk head to a specific
track on the disk. This is usually caused by setting the drive step rate
to an improper value but also can be caused by a bad spot on the disk.

3

An error occurred while reading from the disk. This is usually indicative
of a bad spot on the disk.

4

An error occurred while writing to the disk. This happens when the
loaded tries to write the set up copy of CCP and BnOS back to the
system disk. It is usually caused by a write protected system diskette.

10

The BIOSPARM.PNT file cannot be found on the disk. Check that it is a
system disk.

SYSTEM ERROR MESSAGES

P&T CP/M 2
User's Manual

page 9.5
System Load Error Messages

11-39

The BIOSPARM.PNT file is incorrect or incomplete. It may have been
accidently modified by some program or damaged in some other way.
Getting a new copy of this file from another disk will usually solve the
problem.

40

The BIOSMODS.PNT file cannot be found on the disk. Check that it is a
system disk.

41-49

The BIOSMODS.PNT file is incorrect or incomplete. It may have been
accidently modified by some program or damaged in some other way.
Getting a new copy of this file from another disk will usually solve the
problem.

9.6 Module Error Messages
If you or a program attempt to access a system function that requires a module

that was not included in the system when it was loaded, the error message shown
in Figure 9.8 is flashed on the screen.
(
Figure 9.8

Modu Ie Absent)

Error Message If a Module Is not Present When Accessed

When this message is displayed, you have two options:
1. Press the  key to continue as if nothing happened.

Note that if another
attempt is made to perform the same function, the error message will be
displayed again.

2.

Press the  key to return to the command level of the system by
performing a warm boot. This will abort any program that is running at the
time.

page 9.6
Module Error Messages

SYSTEM ERROR MESSAGES

NOTES

P&T CP/M 2
User's Manual

P&T CP/M 2
User's Manual

CONSOLE DISPLAY

page 10.1
General Comments

10.1 General Comments
The TRS-80 Model ll/12/16 has a built-in video display capable of displaying 24 rows
of 80 characters. It can display in normal and reverse video and has a limited set
of graphics characters. Through the video display handler of P&T CP/M 2, programs
have access to these capabilities and to many powerful display control functions.
The display may be accessed by either the CON: or LST: logical devices. The
physical device name used by P&T CP/M 2 for the built-in display is "CRT". If the
CRT physical device is assigned to either CON: or LST:, all output to either of
these logical device will be sent to the video display.
The standard video display handler does not emulate anyone video terminaL When
P&T CP/M 2 was first introduced, there were no common terminals that could be
emulated and still retain access to all the features of the video display. Although
terminals have become available which have very similar features, the methods of
accessing the various functions with our standard handler have not been changed in
order to remain compatible with previous versions of P&T CP/M 2. Some features
have been added but they do not affect the functions available in previous versions.
In the current version of P&T CP/M 2, a module is available that will emulate an
ADM-3A terminal (see Section 7.5). When this module is included in the system, the
console and keyboard will appear (as much as possible) like an ADM-3A terminaL If
you are using software that must be customized to the terminal and it does not
provide a customization for P&T CP/M 2, you can customize it for an ADM-3A
terminal if you include the ADM3A module in the system. Note: If possible, it is
usually better to customize the software (using its customization procedure) to use
the standard P&T CP/M 2 console display functions. This will result in more
efficient use of memory and slightly faster operation.

10.2 Display Control Codes
Most of the special functions of the video display are executed by sending control
codes to the display driver. (A few of them are accessed by the special system
functions, and one is accessed by an escape sequence.) Since control codes are
ASCll characters, most programs that can output to the console can perform display
control functions. Figure 10.1 lists all the special functions that can be executed by
a single control character.

IDI

CONSOLE DISPLAY

page 10.2
Display Control Codes

numeric
code (dec)

control

2
4
6
7
8

numeric
code (hex)
01
02
04
06
07
08

9
10
11
12
13

09
OA
OB
OC
OD







14
15
17
20
22
23
25
26
28
29
30
31
127

OE
OF
11
14
16










17

19
lA
lC
lD
IE
IF
7F
Figure 10.1

P&T CP/M 2
User's Manual

~








function
clear from cursor to end of line
clear from cursor to end of screen
Insert line
home cursor without clearing screen
ring bell (with P&T CCB or Model 12)
non-destructive backspace (move
cursor left)
tab cursor
line feed (move cursor down)
delete line
clear screen and home cursor
carriage return (move cursor to left
end of line)
begin reverse video
end reverse video
begin graphics
end graphics
set display to wrap mode
set display to non-wrap mode
turn off cursor
turn on cursor
move cursor left
move cursor right
move cursor up
move cursor down
destructive backspace

Control Character Functions of the Video Display

Further description of these functions is given below:
 - clear to end of line
The line containing the cursor is filled with blanks from the current cursor
position to the end of the line. The cursor position does not change.
 - clear to end of screen
The entire display is filled with blanks from the present cursor position to the
bottom rightmost character location. The cursor position does not change.
 - insert line
The line containing the cursor's position and all lines below it on the display
move down by one line, a new line filled with blanks is inserted to contain the
unmoved cursor, and the cursor moves to the left of that line. If the cursor is
on the last line of the display, all lines of the display move up one line, the
last line is filled with blanks, and the cursor moves to the left end of it.
 - home cursor
The cursor moves to the upper leftmost position on the display.
position is changed; no characters on the display are altered.

Only the cursor

 - bell
If the P&T CCB clock/calendar/bell board is installed in the computer, the bell
is rung for about 0.3 seconds. If the board has not been installed, no action is
taken. If the system is used with a Model 12 computer, the internal bell of the
Model 12 will be sounded for about 0.3 seconds.

P&T CP/M 2
User's Manual

CONSOLE DISPLAY

page 10.3
Display Control Codes

 - back space
The cursor moves one position to the left of its current position. If the cursor
is in column 0 (the leftmost column) and the display is in wrap mode, the cursor
moves to the rightmost position of the previous line. If the display is in
non-wrap mode, no action is taken. In no case will action be taken if the
cursor is at the home position (upper leftmost position). Only the cursor position
is changed; no characters on the display are altered
 - line feed
The cursor moves down one line on the display while remaining in the same
column. If the cursor is on the last line of the display, all lines of the display
move up by one line, the last line is filled with blanks, and the cursor is not
moved
 - delete line
The line containing the cursor's current position is deleted, all lower lines move
up one line, and the last line of the display is cleared. The cursor moves to
the beginning of the line which replaced the deleted line. If the cursor is on
the last line, the last line is cleared (filled with blanks) and the cursor moves to
it's beginning.
 - clear screen and home cursor
The entire display is cleared (filled with blanks) and the cursor moves to the
upper leftmost character posi tion.
 - carriage return
The cursor moves to the leftmost character position of the line on which it is
posi tioned. Only the cursor position is changed; no characters on the display are
altered.
 - begin reverse video
All characters sent to the display following this character are displayed in
reverse video (black characters on a white background) until a  is sent.
 - end reverse video
All characters following this one return to normal video (white characters on a
black background).
 - begin graphics
All characters sent to the display following this character will be displayed as
graphics characters until a  is sent. See below for further information on
using graphics characters.
 - end graphics
All succeeding characters are displayed as normal characters.

IDI

page 10.4
Display Control Codes

CONSOLE DISPLAY

P&T CP/M 2
User's Manual

 - set display to wrap mode
Wrap mode is enabled. In wrap mode, the cursor automatically advances to the
beginning of the next line when it reaches the en~ of a display line. For
reverse cursor movement, the cursor will automatically move to the end of the
previous line when it reaches the beginning of a line.
 - set display to non-wrap mode
Wrap mode is disabled. In non-wrap mode, cursor movement control characters
will not cause the cursor to move past the end of a line f or forward movement
or the beginning of a line for reverse movement.
 - turn off the cursor
Upon receipt of  the cursor is made invisible. While invisible, the cursor
can still be positioned and it does move normally as characters are sent to the
display; it is just not displayed.
 - turn on the cursor
Upon receipt of  the cursor is made visible again. If the cursor was
already visible,  has no effect.
(lCh) - move cursor left
The same action as that of the backspace, .
(lDh) - move cursor right
The cursor moves one position to the right of its current position. If the cursor
is in column 79 (the rightmost column) and the display is in the wrap mode, the
cursor moves to the leftmost position of the next line. If the cursor is in
column 79 of the last line and the display is in wrap mode, all lines on the
display move up one line, a blank line is inserted at the bottom of the display,
and the cursor moves to the leftmost position of the last line. If the cursor is
in column 79 of any line and the display is in the non-wrap mode, no action is
taken.
(lEh) - move cursor up
The cursor moves up one line while maintaining the same column position. If the
cursor is on the top line of the display, no action is taken. Only the cursor
posi tion is changed; no characters on the display are altered.
(lPh) - move cursor down
Same action as that of the line feed, .
(7Ph) - destructive backspace
The cursor moves one position to the left and any character at that location
will be replaced with a blank. If the cursor is in the upper leftmost position of
the display, no action is taken. If the cursor is in the leftmost position of any
other line and the display is in the wrap mode, the rightmost position of the
previous line will be replaced by a blank and the cursor will move there. If the
display is in non-wrap mode and the cursor is in the leftmost position of a line,
no action is taken.

10.3 Cursor Addressing
An escape sequence of 4 characters allows programs to move the cursor to any
specific location on the display. Reference to the location is made by giving a row
and column number. The row numbers start from 0 at the top of the display and
progress to 23 at the bottom. The column numbers start with 0 at the leftmost end

CONSOLE DISPLAY

P&T CP/M· 2
User's Manual

page 10.5
Cursor Addressing

of a line and progress to 79 at the rightmost end of a line. Figure 10.2 diagrams
this scheme.
o

column

1 2 3 4 •••••••••••• ~ •••••• 77 78 79

+-------------------------------------+
01- - - - - ••••••••••••••••••• - - 11- - - - - ••••••••••••••••••• 21- - - - - ••••••••••••••••••• -

row:

-

.1
•I
• I
• I

.

display area

221- - - - - ••••••••••••••••••• 231- - - - - ••••••••••••••••••• -

+-------------------------------------+

Figure 10.2 Row and Column Positions on the Video Display

The escape sequence for cursor positioning is shown in Figure 10.3.
ESC Y rowaddr coladdr
row address code = (row number) + 32
column address code = (column number) + 32
Figure 10.3 Cursor Positioning Escape Sequence

The first member of the escape sequence is the ASCll escape character (27 decimal,
1B hex), which is generated by the  key. The second is upper case Y.
Completing the sequence are, respectively, the row address code and the column
address code. To determine the cQrrect code for a particular location, you would
first determine the desired row and column numbers and add 32 to each. For each
resulting number, you would send out the ASCll character which has that number as
its binary code. These codes are given in Appendix A of this manual, but it may
not be necessary to refer to them. There are functions in many languages (such as
the CHR$ function in Basic-80) which directly send out the binary code (character)
corresponding to a given decimal number.
As an example, suppose that your program needs to position the cursor in row 10,

column 38. You would then need to send out the character codes for the numbers
42 and 70, which happen to be the asterisk (*) and upper case F. The complete
escape sequence would consist of the characters: Y*F. As noted above, the
program may be able to utilize functions that will send out a character code
directly. For example, this program line in Basic-80 could be used to position the
cursor at row 10, column 38: PRINT CHR$(27);"Y";CHR$(42);CHR$(70).
Adding 32 to the row and column numbers insures that the needed codes are printing
characters and not control characters. Control characters are avoided because they
can be modified by certain languages as they are sent to the console. Several
languages, for example, expand any tab character with spaces. Obviously, a problem
would arise with such a language if a tab character were part of an escape
sequence.
The escape sequence described above only affects the position of the cursor.
other changes will be made to the display or the operating mode.

No

IDI

page 10.6
Graphics Mode

CONSOLE DISPLAY

P&T CP/M 2
User's Manual

10.4 Graphics Mode
When the display is in the graphics mode, all ASCn characters starting with space
(20h) and continuing through tilde (7Eh) are interpreted as graphics characters.
These characters are fully described the TRS-80 Model n/12/16 documentation.
The conversion used in the display handler of P&T CP/M 2 causes several regular
ASCII characters to be mapped to each graphics character. Figure lOA gives a
complete table of this correspondence. Internal limitations prevent some programs
from sending out certain characters. The multiple choices for each graphics
character allow such programs ample alternatives so that the full range of graphics
is available.
To send out a graphics character, merely shift to graphics mode by sending ,
send any of the characters corresponding to the desired graphics character (using
Figure 10.4), and then send  to return to normal. All of the graphics
characters may be displayed in reverse or normal video by means of the video mode
functions described above.
While in the graphics mode, all other control characters (such as  to erase to
the end of the line) and the cursor positioning escape sequence are fully operational
and may be used at any time. The example given later in this chapter shows the
use of cursor positioning while in the graphics mode.
To get this
graphics char
as shown In
the TRS-80
documentation

Send one of these
characters whl Ie
In the graphics
display mode

To get this
graphics char
as shown In
the TRS-80
documentation

00
01

space, @, accent grave
!, A, a

10
11

02
03

04
05

06
01
08
09

OA
OB
OC

OD
OE
OF

", B, b

12
13

$, D, d
%, E, e
&, F, f
" G, g
(, H, h
), I, I
*, J, j

14

II, C, c

+, K, k
comma, L, I

-, M, m
period, N, n

I,

0,

0

Send one of these
characters whl Ie
In the graphics
display mode

15
16

0, P, P
1, Q, q
2, R, r
3, S, s

4, T, t

5, U, u
6, V, v

18

1, W, w
8, X, x

19

9, Y, Y

11
1A

:, Z, z

1B

;, [, {
<, \, I
=, J, }

1C
10
1E

1F

>, " , '"
1, _

Figure 10.4 Graphics Mode Character Correspondence

10.5 Languages with Auto New Line
The video control functions described in this section are usually incorporated into
programs when complete control over the console display is desired. As an example,
a program may use the cursor addressing and graphics characters to draw a form on
the display and then move to each location of the form to request information. In
cases like this, the program is taking complete responsibility for the console display
and does not want interference from any source.
Several languages send a carriage return and line feed to the console display after
a certain number of characters have been sent to it. This can result in utter chaos
when a program begins to manipulate the display, since the language may be doing

P&:T CP/M 2
User's Manual

CONSOLE DISPLAY

page 10.7
Languages with Auto New Line

things the program does not expect. Fortunately, most of the languages that
incorporate this feature also include a method for defeating it. In particular, there
is a command called WIDTH in some versions of Basic which sets the number of
characters which are sent to the console before an automatic carriage return and
line feed are sent. Frequently, there is one value of WIDTH that will entirely
disable the automatic carriage return and line feed. If you should need to defeat
auto new line, you should see the documentation for the language you are using.

10.6 Languages with Buffered Output
Buffered output to the console can also cause trouble with the video display
functions. A language that performs buffered output to the console saves up all the
characters that are being sent to the console until the end of a line is reached.
Then, the entire line is sent to the console at once. Typically, the end of a line is
not equated to the end of a program source code line; it is usually signalled by the
sending of a carriage return and line feed to the console.
It is common for a program to move the cursor to a particular location on the

display and wait for user input. To move the cursor, the program must send an
escape sequence to the console. With languages that use buffered output, the
escape sequence will go into a buffer, and it will not reach the console until the
program sends out a carriage return and line feed. But the carriage return and line
feed defeat the purpose of the escape sequence. The result is that the cursor is
moved to the desired spot on the display and immediately returned to the beginning
of the next line!
The problem persists even if the language in question has a mechanism for
outputting characters without a carriage return and line feed (e.g. ending a PRINT
statement with a semicolon in Basic). The characters are still held by the language
until the end of a line, which generally consists of a carriage return and a line
feed. Usually, there is no way to defeat this form of operation in a language. The
only sure solutions involve going outside the language (for example, to a special
assembly language routine), changing to another language without buffered output,
or (hopefully) finding a newer version of the language that does not incur the
problem.

10.7 Converting TRS Basic Programs
The utility program TRS2CPM allows programs that have been written under TRSDOS
to be transferred over to P&T CP/M 2. (See Section 8.31 for full details on
TRS2CPM.) Under CP/M, Microsoft Basic-SO is the most similar of all languages to
TRSDOS Basic, but there are still a few conversions that must be made.
The most common conversion is the "PRINT@ " capability of TRSDOS Basic.
Standard Basic-80 does not support this function, but it may be emulated quite
easily by a user-defined function. The technique is to define a function which has
two arguments (one for row number and the other for column number) and which
returns the appropriate 4-character escape sequence for P&:T CP/M 2's console
display. With this function defined, "PRINT@ (x,y)" becomes "PRINT FNAT$(x,y)".
Figure 10.5 shows a small Basic-80 program that defines the function and uses it.
Note the use of the WIDTH command, mentioned above, to defeat the automatic
carriage return and line feed. Also notice that row and column numbers are
entered directly into the FNAT$(x,y) function; the function itself adds 32 to each
number and returns the resulting character codes.

IDJ

page 10.8
CONSOLE DISPLAY
Converting TRS Basic Programs

100
110
120
130
140
150
160
170
lS0
190
200

P&T CP/M 2
User's Manual

WIDTH 255
'first inhibit auto CRlF on console output
'
' now define the function to generate cursor addressing strings
'
DEF FNAT$ (ROW,COL) =CHR$ (27) +"Y"+CHR$ (ROW+32) +CHR$ (COL+32)
'
' now make use of the function to print at specific locations
'
PRINT FNAT$(2,5)i"Thls string begins at row 2, col 5."
PRINT FNAT$(20,20)i"Thls string begins at row 20, col 20."
END

Figure 10.5 Definition and Sample Usage of FNAT$ Function in Baslc-80

10.8 Using Console Functions
Figure 10.7 offers a more complex utilization of the console display functions. This
program, written in Basic-SO, clears the display, draws a box using the graphics
characters, and alternates between normal and reverse video as it repeatedly writes
a message in the box. In Basic-80, control characters are sent to the console by
printing the result of a CHR$ function. Figure 10.6 shows the control characters
tha t are used in Figure 10.7.

CHR$(12)
CHR$(17)
CHR$(27)
CHR$(S)
CHR$(30)
CHR$(10)
CHR$(20)
CHR$(14)
CHR$(15)
CHR$(6)

is
is
is
is
Is
is
is
is
is
is

a clear screen and home cursor command «ctl-l»
a begin graphics character «ctl-Q»
the escape character
a backspace command «ctl-H»
a move cursor up command
a move cursor down command «ctl-A»
an end graphics command «ctl-T»
a begin reverse video command «ctl-N»
an end reverse video command «ctl-O»
a home cursor command «ctl-F»

"Figure 10.6 Using CHR$ In Basic-SO to Generate Control Characters

~

~

P&T CP/M 2

page 10.9
Using Console Functions

CONSOLE DISPLAY

User's Manual

This program Illustrates some of the display control functions
100 '
first It draws a box on the screen using the graphics characters
110 '
then It repeatedly writes a message In the box alternating
120 '
130
between normal and reverse video
140
150 WIDTH 255
'inhibit auto CRLF on console output
160 '
170'
define the cursor addressing function
180 DEF FNAT$(ROW,COL>=CHR$(27)+IIY"+CHR$(ROW+32)+CHR$(COL+32)
190 '
200 PRINT CHR$(12);
'clear screen
210 '
220'
put In the box
230 PRINT CHR$(17);
'switch to graphics
240 '
250'
message wll I appear at row 10, column 30 so start drawing the box
260'
at row 10, column 29 First move the cursor there
270 PRINT FNAT$(10,29);
280 '
290'
the next statement puts in a vertical I ine, backspaces the cursor and
300'
moves It up one line, then puts in the upper left corner of the box.
310 PRINT 14 1;CHR$(8);CHR$(30);" II;
320 '
330 FOR 1=1 TO 19
340 PRINT "6";
'put In top line
350 NEXT
360
370
The next statement puts In the upper right corner, backspaces the
380'
cursor, moves it down a line, puts in a vertical line, backspaces the
390'
cursor, moves It down a line, then puts In the lower right corner
400 PRI NT "! II ;CHR$ (8) ;CHR$ ( 10); 114 11 ;CHR$ (8) ;CHR$ (10); "8 11 ;
410 '
420 PRINT FNAT$(11,29); 'move to beginning of bottom line of box
430 '
'put in lower left corner of box
440 PRINT "C"·
450 FOR 1=1 TO 19
460 PRINT "6".
'put in bottom I I ne
470 NEXT
'
480'
box Is finished now.
490 '
500 PRINT CHR$(20);
'go back to non-graphics
510 RV=15
'initialize to normal video
520 '
530'
the next line moves to the beginning of the message, prints the
540'
character given by RV to set for reverse/normal, prints the message,
550'
returns to normal mode, and moves the cursor to the home position
560 PRINT FNAT$(10,30);CHR$(RV);"This Is the message";CHR$(15);CHR$(6);
570 '
580 IF RV=15 THEN RV=14 ELSE RV=15
'swap video mode
590 FOR 1=1 TO 500:NEXT
'delay a bit so bl ink isn't to fast
600 GOTO 560
Figure 10.7

Example of Using the Display

Co~trol

Functions

10.9 Special System Functions
P&T CP/M 2 uses several special system functions in order to provide additional
video display features. (See Chapter 16 of this manual for full details.) These
functions are accessible from most high level languages and supply the features
listed in Figure 10.8.

page 10.10
Special System Functions

CONSOLE DISPLAY

function
number
-1-718
19
20
21
22
23
31
32
33
34

P&T CP/M 2
User's Manual

function performed
read XY position of cursor
read character at current cursor location
set size and blink of cursor
set cursor blink and on/off
enable direct access to screen memory
disable direct access to screen memory
set split screen mode
enable or disable terminal emulation
set up message to be flashed on screen
flash message if enough time has elapsed
restore screen to state before flashing message

Figure 10.8 Special System Functions for the Video Display

The "split screen" feature of the video display software allows you to set a number
of lines at the top of the video display to be non-scrolling. In effect, this feature
allows you to partition the display into two areas, a fixed area at the top of the
display and a scrolling area at the bottoniof the display. As information is
displayed, the bottom portion will fill up and begin to scroll as usual, but the upper
portion will remain in place. Although the information: in the non-scrolling area
remains on the display, it is not protected. You may address the cursor into that
area and change the information in a normal manner. In addition, the clear screen
code will clear both the non-scrolling and scrolling portions. Special System
Function 23 invokes the "split screen" feature. See Chapter 16 of this manual for
further details.
Special System Functions 32 through 34 may be used by a program .to flash a
message in the center of the screen and then restore the screen to its previous
condition when the message is no longer needed. This can be particularly useful for
reporting errors or alerting the user to various important conditions. Since the
console display is fully· restored . after the message is removed, the program need not
be concerned about the display being modified when such a message is given.
Chapter 16 of this manual gives further information about the use of these
functions. Figure 10.9 shows an example of the use of these functions in a Basic
program.
""I

10 'Example of using the Flashing Message Routines From Basic-80
20 '
30 SYSENT=&H43
40 ON ERROR GOTO 10000

.

~

10000 MSG$="Error II n+STR$(ERR)+" occurred on line "+STR$(ERL)+
n -  to quit,  to continue"
10010 POKE &H47, 32
10025 I%=VARPTR(MSG$)
10027 POKE &H46, PEEK(I%)
10030 POKE &H4A, PEEK(I%+I)
10040 POKE &H4B, PEEK(I%+2)
10050 CALL SYSENT
10060 POKE &H47, 33 : CALL SYSENT : C$=INKEY$
10065 IF LEN(C$)=O THEN 10060
10070 IF (ASC(C$)<>27) AND (ASC(C$)<>13) THEN 10060
10080 POKE &H47, 34 : CALL SYSENT
10090 IF ASC(C$)=27 THEN SYSTEM ELSE RESUME

~

Figure 10.9 Sample Basic-80 Program Using a Flashing Message

Line 30 of the program sets up a variable named SYSENT to be used when calling
the special system functions. Line 40 tells Basic to transfer control to Line 10000 if

P&T CP/M 2
User's Manual

CONSOLE DISPLAY

page 10.11
Special System Functions

an error should occur. The routine starting on Line 10000 flashes the message
"Error # n occurred on line nnn -  to quit,  to continue" in the
center of the screen and waits for input from the console.
First, the entire message string is assembled in the string variable MSG$ (Line
Pseudo register B is loaded with the number of the special system function
(32) which is used to set up the message to be flashed on Line 10010. Next the
address of MSG$ is stored in 1% (Line 10020). Due to the way Basic-80 works, 1%
actually contains the address of a three byte "string descriptor" rather than the
string itself. This "string descriptor" consists of one byte containing the number of
characters in the string followed by two bytes containing the address of the string.

10000).

Line 10025 transfers the length of the string into pseudo register C. Lines 10030 and
10040 transfer the low and high bytes of the address of the string into pseudo
registers Land H, respectively. Finally on Line 10050, the special system function
is called to set up the message to be flashed. On Line 10060, Special System
Function 33 is called to allow the message to be flashed and the console is checked
for a character. This is repeated until a character arrives from the console. Line
10070 causes any characters except  and  to be ignored. If  or
 is received, Line 10080 calls Special System Function 34 to restore the
console display and line 10090 takes the appropriate action based on the character.

10.10 Line Wrap
Some programs expect that the cursor of the console display will advance
automatically to the next line after a character is displayed in the last column.
Other programs assume that the cursor will remain at the last position on the line.
The video display software in P&T CP/M 2 allows you to specify either of these
actions. If a program you are using is producing unexpected results at the ends or
beginnings of lines, it may expect a different behavior than the system is currently
providing. For programs that expect the cursor to move to the next line, the wrap
mode of the video display should be enabled. For programs that expect the cursor
to remain at the end of the line, the wrap mode should be disabled. The wrap
mode can be set by the control codes  and , the system MENU option
CP, or by the SETMISC utility program. (See Section 8.25 for full details on the
SETMISC utility.)
It might not be totally obvious from what appears on the console display that a

problem is due to the display being set to non-wrap mode. When some programs
want to fill the entire display, they position the cursor to the upper left-most
corner of the display and then send 1919 characters to the console. Such programs
assume that the console will wrap to the next line after filling any given line. If
you run such a program when the display driver is in the non-wrap mode, the first
79 characters will be displayed properly on the first line of the display and the
next 1840 will be displayed in the last column of the first line!! If you run a
program and it seems to place information only on the first line of the console
display when you expect it to fill the entire screen, it is very likely that you will
need to place the display in the wrap mode.
It is very poor design for a program to assume that a console display device is

always in the wrap (or non-wrap) mode. If you are writing a program, a much
better programming technique it to allow for an initialization string that can be
sent to the console to enable or disable wrapping as necessary. It is even better
to avoid the entire problem by positioning the cursor to the beginning of each line
before sending out the characters to that line. Note that on the last line of the

IDJ

page 10.12
Line Wrap

CONSOLE DISPLAY

P&T CP/M 2
User's Manual

display you should send out only 79 characters (one less than the maximum) so that
the display will not ,scroll up,one.Jine if the display is in the wrap mode.

10.11 Direct Display Access
The video display in the TRS-80 Model n/12/16 is accessed as if it were memory. In
other words, all display characters simply reside for the time in a special area of
memory. In order to provide maximum memory space for. programs, the computer
provides a means for alternating the video display memory with regular memory.
The video display is made available only when it is accessed; at other times, normal
memory takes its place. This action is commonly called "bank switching," because
the video display memory bank is switched in and out of the accessible memory
space.
P&T CP/M 2 takes full advantage of the ,video memory bank switching. Video
memory, when it is enabled, resides in the 2 Kbyte block of memory beginning at
location F800h. When it is .disabled, that region of memory is used by a portion of
the operating system. Since some programs' need to access the video display
memory directly, P&T CP/M 2 provides Special System Functions 22 and 23 for
enabling and disabling access to the video memory. It is very important to use
these special system functions when directly accessing the video display.
The operating system must keep track of the current state of the video memory so
that it may take appropriate steps if it needs the memory that is alternated with
the video memory. Special System Functions 22 and 23 allow the system to keep
track of the state of the video memory even when another program is accessing it.
There are some cases where the system cannot take corrective action even if it
knows the current -state' of the video memory. For this reason, it is essential
that no operating system ; functions be used while the video memory is
enabled for direct access. A' program should enable the video memory, make any
necessary access to it, and then disable access to the video memory before
attempting to use any system function (such as console input or printer output).
Figure 10.10 shows the use of direct video memory access in a Basic-80 program.
This program reads the entire video display into a large array and then sends it out
to the system printer. Because this program is written for the Basic-80 interpreter,
all access to the display must take place entirely within one line of the program.
The Basic-80 interpreter checks the console status at the end of each line, which
involves an operating system function, so the access to the display must be disabled
by the end of each line.

CONSOLE DISPLAY

P&T CP/M 2
User's Manual

10
20
30
40
50
60
70
80
90
100
110
120
130
140

page 10.13
Direct Display Access

Program to Illustrate the use of direct access to the video memory

' First set a constant to the location In memory to call to Invoke the
' special system functions - see the section on the special system
' functions for full details
SYSENT%· &H43
SPF%· &H47
'location to poke special system function number
'
' Dimension an array to receive the contents of the video memory
DIM SCR%(1919)
'
' Now read the screen Into the array - note this Is all done on one line
' of the program
POKE SPF%,21 : CALL SYSENT% :
FOR 1%=0 TO 1919 : SCR%(I%)=PEEK(&HF800+1%): NEXT:
POKE SPF%,22: CALL SYSENT%
150 '
160 ' Now print the contents of the array out to the printer
170 J%=O
180 FOR 1%=1 TO 24
'print 24 lines
190 FOR K%=l TO 80
'print 80 characters on each line
200
LPRINT CHR$(SCR%(J%»;
J%=J%+l
210 NEXT
220 LPRINT
'fol low by CR,LF
230 NEXT
Figure 10.10 Example of Using Direct Video Memory Access

10.12 SCRNDUMP Module
If you include the SCRNDUMP utility module in the system, it allows you to print
the current contents of the console display by pressing . All characters from
the display will be printed on the system printer (the LST: device) except for
graphics characters. Any graphics characters will be replaced by spaces so that the
spacing on the printed copy will be the same as on the screen. Reverse video is
ignored during the print process so characters that are in reverse video will be
printed the same as normal characters.

lID

page 10.14
SCRNDUMP Module

CONSOLE DISPLAY

NOTES

P&T CP/M 2
User's Manual

page 11.1
General Comments

THE KEYBOARD

P&T CP/M 2

User's Manual

11.1 General Comments
The keyboard is the principle means of user input to the computer. It has keys for
generating all the normal typing characters, some special keys, and a numeric key
pad for easy entry of numbers. When the power is turned on, the keyboard is
initialized to the normal lower case state. To produce upper case letters, or the
upper case symbols shown on the key legends, the action is like that of a
typewriter: either  key is depressed before the key is struck.
There are two forms of shift lock on the keyboard. The  key turns on and
off a lock that causes all alphabetic letters to be shifted to upper case. All other
keys are not shifted. When the red light in the  key is on, this function is
enabled. The caps shift is turned off by pressing the  key again. The other
shift lock has the same function as the one on most typewriters, as it causes all
keys to be shifted. This lock is enabled by pressing the  key on the
keyboard; pressing either of the  keys disables it. The  key also has a
red light which comes on when the function is enabled.
Any character on the keyboard can be repeated about 3 times per second by holding
down its key and pressing the  key.
In addition to the normal alphabetic, numeric, and special characters, the full set of
ASCII control characters can be generated. To generate a control character, use
the  key: hold down the 
(numeric code = 4), hold down the 

Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.3
Linearized                      : No
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37
Create Date                     : 2013:05:06 11:51:57-08:00
Modify Date                     : 2013:05:06 12:10:54-07:00
Metadata Date                   : 2013:05:06 12:10:54-07:00
Producer                        : Adobe Acrobat 9.53 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:c4bf3b07-11c2-470a-bbb3-1a4c0b2adec6
Instance ID                     : uuid:b5933981-4b06-4780-9ca3-6bc7d504db10
Page Layout                     : SinglePage
Page Mode                       : UseOutlines
Page Count                      : 354
EXIF Metadata provided by
EXIF.tools

Navigation menu