CPM System Guide Screen
CPM System Guide Screen
(CP/M® Version 3)
Operating System
System Guide
COPYRIGHT
Copyright (C) 1983 Digital Research Inc. All rights reserved. No part of this publication may be
reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language
or computer language, in any form or by any means, electronic, mechanical, magnetic, optical,
chemical, manual or otherwise, without the prior written permission of Digital Research Inc.,
60 Garden Court, Box DRI, Monterey, California 93942.
DISCLAIMER
DIGITAL RESEARCH INC. MAKES NO REPRESENTATIONS OR WARRANTIES
WITH RESPECT TO THE CONTENTS HEREOF AND SPECIFICALLY DISCLAIMS
ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY
PURPOSE. Further, Digital Research Inc. reserves the right to revise this publication and to
make changes from time to time in the content hereof without obligation of Digital Research
Inc. to notify any person of such revision or changes.
NOTICE TO USER
From time to time changes are made in the filenames and in the files actually included on the
distribution disk. This manual should not be construed as a representation or warranty that
such files or facilities exist on the distribution disk or as part of the materials and programs
distributed. Most distribution disks include a “README.DOC” file. This file explains varia-
tions from the manual which do constitute modification of the manual and the items included
therewith. Be sure to read this file before using the software.
TRADEMARKS
CP/M and Digital Research and its logo are registered trademarks of Digital Research Inc.
CP/M Plus, DDT, LINK-80, RMAC, SID, TEX, and XREF are trademarks of Digital Research
Inc. Altos is a registered trademark of Altos Corporation. IBM is a registered trademark of
International Business Machines. Intel is a registered trademark of Intel Corporation. Microsoft
is a registered trademark of Microsoft Corporation. Zilog and Z80 are registered trademarks of
Zilog Inc. The CP/M Plus (CP/M Version 3) Operating System System Guide was prepared
using the Digital Research TEX™ Text Formatter and printed in the United States of America.
ii
Foreword
The appendixes contain tables, and sample BIOS modules you can
use, or study and modify. Appendix A discusses removable media drives.
Appendix B discusses automatic density support. Appendix C describes
how CP/M 3 differs from CP/M 2. Appendix D shows the format of
the CPM3.SYS file.
iv
Table of Contents
System Generation
GENCPM Utility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
vi
Customizing the CPMLDR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-19
CPMLDR Utility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22
Booting CP/M 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23
Appendixes
Removable Media Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Auto-density Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1
Modifying a CP/M 2 BIOS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1
CPM3.SYS File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1
Root Module of Relocatable BIOS for CP/M 3 . . . . . . . . . . . . . . . . E-1
System Control Block Definition for CP/M 3 BIOS. . . . . . . . . . . . F-1
Equates for Mode Byte Bit Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-1
Macro Definitions for CP/M 3 BIOS Data Structures . . . . . . . . . H-1
ACS 8000-15 BIOS Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I-1
Public Entry Points for CP/M 3 Sample BIOS Modules. . . . . . . . . . J-1
Public Data Items in CP/M 3 Sample BIOS Modules. . . . . . . . . . . K-1
CP/M 3 BIOS Function Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . L-1
vii
List of Tables
CP/M 3 Operating System Memory Requirements. . . . . . . . . . . . . 1-9
CP/M 3 BIOS Jump Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
CP/M 3 BIOS Functions Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Initialization of Page Zero. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
CP/M 3 Logical Device Characteristics. . . . . . . . . . . . . . . . . . . . . . . . 2-7
BDOS Calls to BIOS in Nonbanked and Banked Systems. . . . . . . 2-9
Multiple Sector I/O in Nonbanked and Banked Systems. . . . . . . 2-10
Reading Two Contiguous Sectors in Banked System. . . . . . . . . . . 2-11
System Control Block Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
Disk Parameter Header Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13
Disk Parameter Block Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18
BSH and BLM Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
Maximum EXK Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
BLS and Number of Directory Entries. . . . . . . . . . . . . . . . . . . . . . . . 3-22
PSH and PHM Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23
Buffer Control Block Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24
Functional Organization of BIOS Entry Points. . . . . . . . . . . . . . . . 3-29
CP/M 3 BIOS Function Jump Table Summary. . . . . . . . . . . . . . . . 3-30
I/O Redirection Bit Vectors in SCB. . . . . . . . . . . . . . . . . . . . . . . . . . 3-36
CP/M 3 BIOS Module Function Summary. . . . . . . . . . . . . . . . . . . . 4-2
Public Symbols in CP/M 3 BIOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Global Variables in BIOSKRNL.ASM. . . . . . . . . . . . . . . . . . . . . . . . .4-8
Public Utility Subroutines in BIOSKRNL.ASM . . . . . . . . . . . . . . . 4-9
Public Names in the BIOS Jump Vector. . . . . . . . . . . . . . . . . . . . . . . . 4-9
BOOT Module Entry Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
Mode Bits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12
Baud Rates for Serial Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12
Character Device Labels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Fields of Each XDPH. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
Subroutine Entry Points. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
viii
Move Module Entry Points. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21
Sample CP/M 3 System Track Organization . . . . . . . . . . . . . . . . . . 5-19
CP/M 3 BIOS Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1
CPM3.SYS File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1
Header Record Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1
Public Entry Points for CP/M 3 Sample BIOS Modules. . . . . . . . . . J-1
Public Data Items. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K-1
BIOS Function Jump Table Summary . . . . . . . . . . . . . . . . . . . . . . . . . L-1
Figures
General Memory Organization of CP/M 3 . . . . . . . . . . . . . . . . . . . . 1-5
Memory organization for Banked CP/M 3 System. . . . . . . . . . . . . . 1-6
Memory Organization with Bank 1 Enabled in Banked System . . 1-7
Memory Organization in Nonbanked CP/M 3 System. . . . . . . . . . 1-8
Memory Organization in Banked CP/M 3. . . . . . . . . . . . . . . . . . . . 1-10
Memory organization in Nonbanked CP/M 3. . . . . . . . . . . . . . . . 1-11
CP/M 3 System Disk Organization . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12
CP/M 3 System Tracks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
Disk Data Structures in a Banked System . . . . . . . . . . . . . . . . . . . . . 3-11
Disk Parameter Header Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13
Disk Parameter Block Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18
AL0 and AL1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21
Buffer Control Block Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23
XDPH Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
ix
Listings
SCB.ASM File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Sample Character Device Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Equates for Mode Byte Bit Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
Root Module of Relocatable BIOS for CP/M 3 . . . . . . . . . . . . . . . . E-1
System Control Block Definition for CP/M 3 BIOS. . . . . . . . . . . . F-1
Equates for Mode Byte Fields: MODEBAUD.LIB. . . . . . . . . . . . . G-1
Macro Definitions for CP/M 3 BIOS Data Structures . . . . . . . . . H-1
Boot Loader Module for CP/M 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I-1
Character I/O Handler for Z80 Chip-based System . . . . . . . . . . . . . I-5
Drive Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I-10
Z80 DMA Single-density Disk Handler . . . . . . . . . . . . . . . . . . . . . . I-11
Bank and Move Module for CP/M 3 Linked BIOS. . . . . . . . . . . . I-21
I/O Port Addresses for Z80 Chip-based System . . . . . . . . . . . . . . . I-23
Sample Submit File for ASC 8000-12 System . . . . . . . . . . . . . . . . . I-26
x
xi
xii
CP/M System Guide Introduction to CP/M 3
Section 1
CP/M 3 Operating System
Overview
DIGITAL RESEARCH™
1-1
CP/M 3 System Components CP/M System Guide
The CCP is a program that provides the basic user interface to the
facilities of the operating system. The CCP supplies six built-in com-
mands: DIR, DIRS, ERASE, RENAME, TYPE, and USER. The CCP
executes in the Transient Program Area (TPA), the region of memory
where all application programs execute. The CCP contains the Program
Loader Module, which loads transient (applications) programs from
disk into the TPA for execution.
The BDOS is the logical nucleus and file system of CP/M 3. The
DIGITAL RESEARCH™
1-2
CP/M System Guide Communication Between Modules
The BDOS and the BIOS modules cooperate to provide the CCP
and other transient programs with hardware-independent access to
CP/M 3 facilities. Because the BIOS is configured for different hard-
ware environments and the BDOS remains constant, you can transfer
programs that run under CP/M 3 unchanged to systems with different
hardware configurations.
The BDOS contains a set of functions that the CCP and applications
programs call to perform disk and character input and output operations.
The BIOS contains a Jump Table with a set of 33 entry points that
the BDOS calls to perform hardware-dependent primitive functions,
such as peripheral device I/O. For example, CONIN is an entry point of
the BIOS called by the BDOS to read the next console input character.
Similarities exist between the BDOS functions and the BIOS func-
tions, particularly for simple device I/O. For example, when a transient
program makes a console output function call to the BDOS, the BDOS
makes a console output call to the BIOS. In the case of disk I/O, however,
DIGITAL RESEARCH™
1-3
Communication Between Modules CP/M System Guide
this relationship is more complex. The BDOS might make many BIOS
function calls to perform a single BDOS file I/O function. BDOS disk
I/O is in terms of 128-byte logical records. BIOS disk I/O is in terms
of physical sectors and tracks.
Note that the SCB contains critical system parameters which re-
flect the current state of the operating system. If a program modifies
these parameters, the operating system can crash. See Section 3 of this
manual, and the description of BDOS Function 49 in the CP/M Plus
Programmer’s Guide for more information on the System Control Block.
DIGITAL RESEARCH™
1-4
CP/M System Guide Banked and Nonbanked Systems
HIGH MEMORY:
BIOS: BASIC INPUT/OUTPUT SYSTEM
BIOS_BASE:
BDOS: BASIC DISK OPERATING SYSTEM
BDOS_BASE:
LOADER: PROGRAM LOADER MODULE
COMPONENT OF CCP
LOADER_BASE:
TPA: TRANSIENT PROGRAM AREA TPA
Note that all memory regions in CP/M 3 are page aligned, which
means that they must begin on a page boundary. Because a page is defined
as 256 (100H) bytes, a page boundary always begins at a hexadecimal
address where the low-order byte of the hex address is zero.
DIGITAL RESEARCH™
1-5
Banked and Nonbanked Systems CP/M System Guide
Figure 1-2 shows the memory organization for the banked version
of CP/M 3.
TOP OF MEMORY
BUFFERS HARDWARE-DEPENDENT BUFFER SPACE
TOP OF BANKED
MEMORY BANKED
O.S.
TPA
BANK SWITCHED
hhhhH hhhhH
PAGE 0
BANK 0 BANK 1 ..... BANK N
DIGITAL RESEARCH™
1-6
CP/M System Guide Banked and Nonbanked Systems
Bank 0, the system bank, is the bank that is enabled when CP/M 3
is cold started. Bank 1 is the transient program bank.
Figure 1-3 shows the CP/M 3 memory organization when the TPA
bank, Bank 1, is enabled in a bank-switched system.
TOP OF MEMORY
HARDWARE DEPENDENT BUFFER SPACE
TPA
TOP OF BANKED
MEMORY
TPA
LOW MEMORY
(0000H)
BANK 1
DIGITAL RESEARCH™
1-7
Memory Requirements CP/M System Guide
TOP OF MEMORY
O.S.
TPA
LOW MEMORY
(0000H)
DIGITAL RESEARCH™
1-8
CP/M System Guide Memory Requirements
The RSX modules shown in Figure 1-5 are Resident System Exten-
sions (RSX) that are loaded directly below the operating system when
included in an application or utility program. The Program Loader
places the RSX in memory and chains BDOS calls through the RSX
entry point in the RSX.
DIGITAL RESEARCH™
1-9
Memory Requirements CP/M System Guide
HASHED DIRECTORY
TABLES
(ONE PER DRIVE) OPTIONAL OVERLAYS
TRANSIENT PROGRAM
PAGE ZERO
The banked system supports a TPA of 60K or more. The banked por-
tion of the operating system in Bank 0 requires at least 16K of memory.
In the banked system, the BDOS and the BIOS are separated into
two parts: a resident portion, and a banked portion. The resident BDOS
and BIOS are located in common memory. The banked BDOS and
BIOS are located in the operating system bank, referred to as Bank 0
in this manual.
The TPA extends from 100H in Bank 1 up to the bottom of the resi-
dent BDOS in common memory. The banked BIOS and BDOS reside
DIGITAL RESEARCH™
1-10
CP/M System Guide Memory Requirements
in Bank 0 with the directory buffers. Typically, all data buffers reside
in common. Data buffers can reside in an alternate bank if the system
has a DMA controller capable of transferring arbitrary blocks of data
from one bank to another. Hashed directory tables (one per drive) can
be placed in any bank except Bank 1 (TPA). Hashed directory tables
require 4 bytes per directory entry.
BIOS
BDOS
PROGRAM LOADER
OPTIONAL OVERLAYS
TRANSIENT PROGRAM
DIGITAL RESEARCH™
1-11
Disk Organization CP/M System Guide
TRACK M
CP/M 3 DATA REGION
DATA TRACKS
CP/M 3 DIRECTORY REGION
TRACK N
CCP (OPTIONAL)
In Figure 1-7, the first N tracks are the system tracks; the remaining
tracks, the data tracks, are used by CP/M 3 for file storage. Note that
the system tracks are used by CP/M 3 only during system cold start and
warm start. All other CP/M 3 disk access is directed to the data tracks
of the disk. To maintain compatibility with Digital Research products,
you should use an eight-inch, single-density, IBM® 3740 formatted disk
with two system tracks.
DIGITAL RESEARCH™
1-12
CP/M System Guide Customizing CP/M 3
DIGITAL RESEARCH™
1-13
Customizing CP/M 3 CP/M System Guide
you can link with your customized loader BIOS and use to load the
CPM3.SYS file into memory. CPMLDR is a small, self-contained version
of CP/M 3 that supports only console output and sequential file input.
Consistent with CP/M 3 organization, it contains two modules: an
invariant CPMLDR_BDOS, and a variant CPMLDR_BIOS, which
is adapted to match the host microcomputer hardware environment.
The CPMLDR_BIOS module can perform cold start initialization of
I/O ports and similar functions. CPMLDR can display a memory map
of the CP/M 3 system at start-up. This is a GENCPM option.
The following steps tell you how to create a new version of CP/M 3
tailored to your specific hardware.
DIGITAL RESEARCH™
1-14
CP/M System Guide Initial Load (Cold Boot) of CP/M 3
In the second stage, the Cold Boot Loader loads the memory image
of the CP/M 3 system loader program, CPMLDR, from the system
tracks of a disk into memory and passes control to it. For a banked
system, the Cold Boot Loader loads CPMLDR into Bank 0. A PROM
loader can perform stages one and two.
In the third stage, CPMLDR reads the CPM3.SYS file, which con-
tains the BDOS and customized BIOS, from the the data area of the
disk into the memory addresses assigned by GENCPM. In a banked
system, CPMLDR reads the common part of the BDOS and BIOS
into the common part of memory, and reads the banked part of the
BDOS and BIOS into the area of memory below common base in
Bank 0. CPMLDR then transfers control to the Cold BOOT system
initialization routine in the BIOS.
For the final stage, the BIOS Cold BOOT routine, BIOS Function
0, performs any remaining necessary hardware initialization, displays
the sign-on message, and reads the CCP from the system tracks or from
a CCP.COM file on disk into location 100H of the TPA. The Cold
DIGITAL RESEARCH™
1-15
Initial Load (Cold Boot) of CP/M 3 CP/M System Guide
BOOT routine transfers control to the CCP, which then displays the
system prompt.
End of Section 1
DIGITAL RESEARCH™
1-16
CP/M System Guide Organization of the BIOS
Section 2
CP/M 3 BIOS Overview
Table 2-1 describes the entry points into the BIOS from the Cold
DIGITAL RESEARCH™
2-1
Organization of the BIOS CP/M System Guide
Start Loader and the BDOS. Entry to the BIOS is through a jump vec-
tor. The jump vector is a set of 33 jump instructions that pass program
control to the individual BIOS subroutines.
You must include all of the entry points in the BIOS jump vector
in your BIOS. However, if your system does not support some of the
functions provided for in the BIOS, you can use empty subroutines
for those functions. For example, if your system does not support a
printer, JMP LIST can reference a subroutine consisting of only a RET
instruction. Table 2-1 shows the elements of the jump vector.
DIGITAL RESEARCH™
2-2
CP/M System Guide Organization of the BIOS
DIGITAL RESEARCH™
2-3
System Control Block CP/M System Guide
DIGITAL RESEARCH™
2-4
CP/M System Guide System Initialization
The BOOT and WBOOT routine must load the CCP into the TPA
in Bank 1 at location 0100H. The CCP can be loaded in two ways. If
there is sufficient space on the system tracks, the CCP can be stored on
the system tracks and loaded from there. If you prefer, or if there is not
sufficient space on the system tracks, the BIOS Cold BOOT routine
can read the CCP into memory from the file CCP.COM on disk.
If the CCP is in a COM file, use the BOOT and WBOOT routines
DIGITAL RESEARCH™
2-5
System Initialization CP/M System Guide
COLD CCP
STADR LDR CPMLDR (OPTIONAL)
DIGITAL RESEARCH™
2-6
CP/M System Guide Character I/O
user to configure a new system with GENCPM and then run it without
having to update the system tracks of the system disk.
Note that you can define a single peripheral as the LIST, AUXOUT,
and AUXIN device simultaneously. If you assign no peripheral device
as the LIST, AUXOUT, or AUXIN device, the AUXOUT and LIST
DIGITAL RESEARCH™
2-7
Disk I/O CP/M System Guide
routines can just return, and the AUXIN routine can return with a 1AH
(CTRL-Z) in register A to indicate an immediate end-of-file.
Note that the BDOS can make a single call to SELDSK to select a
disk drive, follow it with a number of read or write operations to the
selected disk, and then select another drive for subsequent operations.
Table 2-5 shows the sequence of BIOS calls that the BDOS makes to
read or write a physical disk sector in a nonbanked and a banked system.
Table 2-6 shows the sequence of calls the BDOS makes to the BIOS
DIGITAL RESEARCH™
2-8
CP/M System Guide Disk I/O
DIGITAL RESEARCH™
2-9
Disk I/O CP/M System Guide
DIGITAL RESEARCH™
2-10
CP/M System Guide Disk I/O
Table 2-7 shows the sequence of BDOS calls to read two contiguous
physical sectors in a banked system.
DIGITAL RESEARCH™
2-11
Disk I/O CP/M System Guide
The BIOS contains the data structures to control the data and direc-
tory buffers and the hash tables. You can either assign these buffers and
tables yourself in the BIOS, or allow the GENCPM utility to generate
them automatically.
Hash tables greatly speed directory searching. The BDOS can use
hash tables to determine the location of directory entries and therefore
reduce the number of disk accesses required to read a directory entry.
The hash table allows the BDOS to directly access the sector of the
directory containing the desired directory entry without having to
read the directory sequentially. By eliminating a sequential read of the
directory records, hashing also increases the percentage of time that
the desired directory record is in a buffer, eliminating the need for any
physical disk accesses in these cases. Hash tables and directory caches
eliminate many of the directory accesses required when accessing large
files. However, in a nonbanked system, hash tables increase the size of
the operating system.
When the BIOS finds an error condition, the READ and WRITE
routines should perform several retries before reporting the error con-
dition to the BDOS. Ten retries are typical. If the BIOS returns an
error condition to the BDOS, the BDOS reports the error to the user
in the following form:
DIGITAL RESEARCH™
2-12
CP/M System Guide Memory Selects and Moves
The BDOS calls the SETBNK routine prior to calling disk READ or
disk WRITE functions. The SETBNK routine must save its specified
bank as the DMA bank. When the BDOS invokes a disk I/O routine,
the I/O routine should save the current bank number and select the
DMA bank prior to the disk READ or WRITE. After completion of
the disk READ or WRITE, the disk I/O routine must reselect the
current bank. Note that when the BDOS calls the disk I/O routines,
Bank 0 is in context (selected).
DIGITAL RESEARCH™
2-13
Clock Support CP/M System Guide
End of Section 2
DIGITAL RESEARCH™
2-14
CP/M System Guide The System Control Block
Section 3
CP/M 3 BIOS Functional
Specifications
In the SCB.ASM file, the high-order byte of the various SCB ad-
dresses is defined as 0FEH. The linker marks absolute external equates
as page relocatable when generating a System Page Relocatable (SPR)
DIGITAL RESEARCH™
3-1
The System Control Block CP/M System Guide
Listing 3-1 shows the SCB.ASM file. The listing shows the field
names of the System Control Block. A @ before a name indicates that
it is a data item. A ? preceding a name indicates that it is the label of
an instruction. In the listing, r/w means Read-Write, and r/o means
Read-Only. The BIOS can modify a Read-Write variable, but must
not modify a Read-Only variable. Table 3-1 describes each item in the
System Control Block in detail.
DIGITAL RESEARCH™
3-2
CP/M System Guide The System Control Block
The following table describes in detail each of the fields of the System
Control Block.
DIGITAL RESEARCH™
3-3
The System Control Block CP/M System Guide
DIGITAL RESEARCH™
3-4
CP/M System Guide The System Control Block
Field Meaning
@MLTIO (Read-Write Variable)
@MLTIO contains the current multisector count.
The BIOS can change the multisector count directly,
or through BDOS Function 44. The value of the
multisector count can range from 1 to 128.
@ERMDE (Read-Only Variable)
@ERMDE contains the current BDOS error mode.
0FFH indicates the BDOS is returning error codes to
the application program without displaying any error
messages. 0FEH indicates the BDOS is both display-
ing and returning errors. Any other value indicates
the BDOS is displaying errors without notifying the
application program.
@MEDIA (Read-Write Variable)
@MEDIA is global system flag indicating that a drive
door has been opened. The BIOS routine that de-
tects the open drive door sets this flag to 0FFH. The
BIOS routine also sets the MEDIA byte in the Disk
Parameter Header associated with the open-door
drive to 0FFH.
@BFLGS (Read-Only Variable)
The BDOS in CP/M 3 produces two kinds of error
messages: short error messages and extended error
messages. Short error messages display one or two
lines of text. Long error messages display a third line
of text containing the filename, filetype, and BDOS
Function Number involved in the error.
DIGITAL RESEARCH™
3-5
The System Control Block CP/M System Guide
Field Meaning
@BFLGS (continued)
In banked systems, GENCPM sets this flag in the
System Control Block to indicate whether the BIOS
displays short or extended error messages. Your error
message handler should check this byte in the System
Control Block. If the high-order bit, bit 7, is set to 0,
the BDOS displays short error messages. if the high-
order bit is set to 1, the BDOS displays the extended
three-line error messages.
DIGITAL RESEARCH™
3-6
CP/M System Guide The System Control Block
Field Meaning
?ERJMP (Read-Write Code Label)
The BDOS calls the error message subroutine through
this jump instruction. Register C contains an error
code as follows:
1 Permanent Error
2 Read Only Disk
3 Read Only File
4 Select Error
7 Password Error
8 File Exists
9 ? in Filename
DIGITAL RESEARCH™
3-7
Character I/O Data Structures CP/M System Guide
Field Meaning
@MXTPA (Read-Only Variable)
@MXTPA contains the address of the current BDOS
entry point. This is also the address of the top of the
TPA. The BOOT and WBOOT routines of the BIOS
must use this address to initialize the BDOS entry
JMP instruction at location 005H, during system
initialization. Each time a RSX is loaded, @MXTPA
is adjusted by the system to reflect the change in the
available User Memory (TPA).
Listing 3-2 shows a sample character device table that the DEVICE
utility uses to set and display I/O direction.
DIGITAL RESEARCH™
3-8
CP/M System Guide Character I/O Data Structures
Listing 3-3 shows the equates for the fields contained in the sample
character device table. Many systems do not support all of these baud
rates.
DIGITAL RESEARCH™
3-9
BIOS Disk Data Structures CP/M System Guide
In the banked system, only the Disk Parameter Block must reside
in common memory. The DPHs, checksum vectors, allocation vectors,
Buffer Control Blocks, and Directory Buffers can reside in common
memory or Bank 0. The hash tables can reside in common memory or
DIGITAL RESEARCH™
3-10
CP/M System Guide BIOS Disk Data Structures
any bank except Bank 1. The data buffers can reside in banked memory
if you implement the XMOVE function.
Figure 3-1 shows the relationships between the drive table, the Disk
Parameter Header, and the Data and Directory Buffer Control Block
fields and their respective data structures and buffers.
Drive Table (addresses of DPHs)
.........
0 1 2 3 4 15 Checksum Vector
Allocation Vector
Hash Table
DIGITAL RESEARCH™
3-11
BIOS Disk Data Structures CP/M System Guide
drivetable dw dph0
dw dph1
dw dph2
.
.
.
dw dphF
The GENCPM utility accesses the drive table to locate the various
disk parameter data structures, so that it can determine which system
configuration to use, and optionally allocate the various buffers itself.
You must supply a drive table if you want GENCPM to do this alloca-
tion. If certain addresses in the Disk Parameter Headers referenced by
this drive table are set to 0FFFEH, GENCPM allocates the appropriate
data structures and updates the DPH. You can supply the drive table
even if you have performed your own memory allocation. See the BIOS
DRVTBL function described in Section 3.4.1.
In Figure 3-2, which shows the format of the Disk Parameter Header,
b refers to bits.
DIGITAL RESEARCH™
3-12
CP/M System Guide BIOS Disk Data Structures
DIGITAL RESEARCH™
3-13
BIOS Disk Data Structures CP/M System Guide
Field Comments
MF MF is the Media Flag. The BDOS resets MF to zero
when the drive is logged in. The BIOS can set this flag
and @MEDIA in the SCB to 0FFH if it detects that a
drive door has been opened. If the flag is set to 0FFH, the
BDOS checks for a media change prior to performing the
next BDOS file operation on that drive. If the BDOS de-
termines that the drive contains a new volume, the BDOS
performs a login on that drive, and resets the MF flag to
00H. Note that the BDOS checks this flag only when a
system call is made, and not during an operation. Usually,
this flag is used only by systems that support door-open
interrupts.
DPB Set the DPB field to the address of a Disk Parameter
Block that describes the characteristics of the disk drive.
Several Disk Parameter Headers can address the same Disk
Parameter Block if their drive characteristics are identical.
(The Disk Parameter Block is described in Section 3.3.3.)
CSV CSV is the address of a scratchpad area used to detect
changed disks. This address must be different for each re-
movable media Disk Parameter Header. There must be one
byte for every 4 directory entries (or 128 bytes of directory).
In other words, length(CSV) = (DRM ∕ 4) + 1. (See Table
3-3 for an explanation of the DRM field.) If the drive is
permanently mounted, set the CKS variable in the DPB
to 8000H and set CSV to 0000H. This way, no storage is
reserved for a checksum vector. The checksum vector may
be located in common memory or in Bank 0. Set CSV to
0FFFEH for GENCPM to set up the checksum vector.
DIGITAL RESEARCH™
3-14
CP/M System Guide BIOS Disk Data Structures
Field Comments
ALV ALV is the address of the scratchpad area called the allo-
cation vector, which the BDOS uses to keep disk storage
allocation information. This area must be unique for each
drive.
DIGITAL RESEARCH™
3-15
BIOS Disk Data Structures CP/M System Guide
Field Comments
ALV Thus, with single-bit allocation vectors, if you do not reset
the disk system, DIR and SHOW can report an inaccurate
amount of free space. With single-bit allocation vectors,
the user must type a CTRL-C at the system prompt to reset
the disk system to ensure accurate reporting of free space.
Set ALV to 0FFFEH for GENCPM to automatically assign
space for the allocation vector, single- or double-bit, during
system generation. In the nonbanked system, GENCPM
prompts for the type of allocation vector. In the banked
system, the allocation vector is always double-bit and can
reside in common memory or Bank 0. When GENCPM
automatically assigns space for the allocation vector (ALV
= 0FFFEH), it places the allocation vector in Bank 0.
DIRBCB Set DIRBCB to the address of a single directory Buf-
fer Control Block (BCB) in an unbanked system. Set
DIRBCB to the address of a BCB list head in a banked
system.
DIGITAL RESEARCH™
3-16
CP/M System Guide BIOS Disk Data Structures
Field Comments
DTABCB Set DTABCB to the address of a data BCB list head in
a banked system.
DIGITAL RESEARCH™
3-17
BIOS Disk Data Structures CP/M System Guide
Figure 3-3 shows the format of the Disk Parameter Block, where b
refers to bits.
SPT BSH BLM EXM DSM DRM AL0 AL1 CKS OFF PSH PHM
DIGITAL RESEARCH™
3-18
CP/M System Guide BIOS Disk Data Structures
Field Comments
CKS The size of the directory check vector, (DRM ∕ 4) + 1. Set bit
15 of CKS to 1 if the drive is permanently mounted. Set CKS
to 8000H to indicate that the drive is permanently mounted
and directory checksumming is not required.
CP/M allocates disk space in a unit called a block. Blocks are also
called allocation units, or clusters. BLS is the number of bytes in a block.
The block size can be 1024, 2048, 4096, 8192, or 16384 (decimal) bytes.
A large block size decreases the size of the allocation vectors but can
result in wasted disk space. A smaller block size increases the size of the
allocation vectors because there are more blocks on the same size disk.
There is a restriction on the block size. If the block size is 1024, there
cannot be more than 255 blocks present on a logical drive. In other
words, if the disk is larger than 256K, it is necessary to use at least 2048
byte blocks.
The value of BLS is not a field in the Disk Parameter Block rather,
it is derived from the values of BSH and BLM as given in Table 3-4.
DIGITAL RESEARCH™
3-19
BIOS Disk Data Structures CP/M System Guide
The block mask, BLM, equals one less than the number of 128-byte
records in an allocation unit, (BLS ∕ 128 − 1), or (2BSH) − 1.
The value of the Block Shift Factor, BSH, is determined by the data
block allocation size. The Block Shift Factor (BSH) equals the logarithm
base two of the block size in 128-byte records, or log 2(BLS ∕ 128), where
log 2 represents the binary logarithm function.
The value of EXM depends upon both the BLS and whether the
DSM value is less than 256 or greater than 255, as shown in Table 3-5.
The value of EXM is one less than the maximum number of 16K
extents per FCB.
DIGITAL RESEARCH™
3-20
CP/M System Guide BIOS Disk Data Structures
DSM is one less than the total number of blocks on the drive. DSM
must be less than or equal to 7FFFH. If the disk uses 1024 byte blocks
(BSH=3, BLM=7), DSM must be less than or equal to 00FFH. The
product BLS × (DSM + l) is the total number of bytes the drive holds
and must be within the capacity of the physical disk. It does not include
the reserved operating system tracks.
The DRM entry is one less than the total number of 32-byte direc-
tory entries, and is a 16-bit value. DRM must be less than or equal to
(BLS ∕ 32 × 16) − 1. DRM determines the values of AL0 and AL1. The
two fields AL0 and AL1 can together be considered a string of 16 bits,
as shown in Figure 3-4.
AL0 AL1
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
DIGITAL RESEARCH™
3-21
BIOS Disk Data Structures CP/M System Guide
If DRM = 127 (128 directory entries), and BLS = 1024, there are
32 directory entries per block, requiring 4 reserved blocks. In this case,
the 4 high-order bits of AL0 are set, resulting in the values AL0 = 0F0H
and AL1 = 00H. The maximum directory allocation is 16 blocks where
the block size is determined by BSH and BLM.
The OFF field determines the number of tracks that are skipped
at the beginning of the physical disk. It can be used as a mechanism
for skipping reserved operating system tracks, which on system disks
contain the Cold Boot Loader, CPMLDR, and possibly the CCP. It
is also used to partition a large disk into smaller segmented sections.
PSH and PHM determine the physical sector size of the disk. All disk
I/O is in terms of the physical sector size. Set PSH and PSM to zero if
the BIOS is blocking and deblocking instead of the BDOS.
DIGITAL RESEARCH™
3-22
CP/M System Guide BIOS Disk Data Structures
Note that the BANK and LINK fields of the Buffer Control Block
are present only in the banked system. Therefore, the Buffer Control
Block is twelve bytes long in the nonbanked system, and fifteen bytes
long in the banked system. Note also that only the DRV, BUFFAD,
BANK, and LINK fields need to contain initial values. In Figure 3-5,
which shows the form of the Buffer Control Block, b refers to bits.
DIGITAL RESEARCH™
3-23
BIOS Disk Data Structures CP/M System Guide
DIGITAL RESEARCH™
3-24
CP/M System Guide BIOS Disk Data Structures
address of the first BCB in a linked list. If several DPHs reference the
same BCB list, they must reference the same BCB list head. Each BCB
has a LINK field that contains the address of the next BCB in the list,
or zero if it is the last BCB.
DIGITAL RESEARCH™
3-25
BIOS Disk Data Structures CP/M System Guide
buffers, and sets these fields to the address of the BCBs. This allows you
to write device drivers without regard to buffer requirements.
MACLIB CPM3
DTBL Macro
Use the DTBL macro to generate the drive table, DRVTBL. It has
one parameter, a list of the DPHs in your system. The list is enclosed
in angle brackets.
where DPHA is the address of the DPH for drive A, DPHB is the
address of the DPH for drive B, up to drive P. For example,
This example generates the drive table for a three-drive system. The
DTBL macro always generates a sixteen-word table, even if you supply
fewer DPH names. The unused entries are set to zero to indicate the
corresponding drives do not exist.
DIGITAL RESEARCH™
3-26
CP/M System Guide BIOS Disk Data Structures
DPH Macro
where:
SKEW Macro
The SKEW macro generates a skew table and requires the following
parameters: the number of physical sectors per track, the skew factor,
and the first sector number on each track (usually 0 or 1).
DIGITAL RESEARCH™
3-27
BIOS Disk Data Structures CP/M System Guide
where:
The following macro invocation generates the skew table for a stan-
dard single-density disk drive.
DPB Macro
where:
DIGITAL RESEARCH™
3-28
CP/M System Guide BIOS Subroutine Entry Points
The DPB macro can be used only when the disk drive is under eight
megabytes. DPBs for larger disk drives must be constructed by hand.
DIGITAL RESEARCH™
3-29
BIOS Subroutine Entry Points CP/M System Guide
Operation Function
Disk I/O
HOME, SELDSK, SETTRK, SETSEC,
SETDMA, READ, WRITE, SECTRN,
MULTIO, FLUSH
Memory Selects and Moves
MOVE, XMOVE, SELMEM, SETBNK
Clock Support
TIME
DIGITAL RESEARCH™
3-30
CP/M System Guide BIOS Subroutine Entry Points
DIGITAL RESEARCH™
3-31
BIOS Subroutine Entry Points CP/M System Guide
The BOOT entry point gets control from the Cold Start Loader in
Bank 0 and is responsible for basic system initialization. Any remaining
hardware initialization that is not done by the boot ROMs, the Cold
Boot Loader, or the LDRBIOS should be performed by the BOOT
routine.
DIGITAL RESEARCH™
3-32
CP/M System Guide BIOS Subroutine Entry Points
To initialize Page Zero, the BOOT routine must place a jump at lo-
cation 0000H to BIOS base + 3, the BIOS warm start entry point. The
BOOT routine must also place a jump instruction at location 0005H to
the address contained in the System Control Block variable, @MXTPA.
The BOOT routine must establish its own stack area if it calls any
BDOS or BIOS routines. In a banked system, the stack is in Bank 0
when the Cold BOOT routine is entered. The stack must be placed in
common memory.
Note that the CCP does not reset the disk system at warm start. The
DIGITAL RESEARCH™
3-33
BIOS Subroutine Entry Points CP/M System Guide
CCP resets the disk system when a CTRL-C is pressed following the
system prompt.
Note also that the BIOS stack must be in common memory to make
BDOS function calls. Only the BOOT and WBOOT routines can
perform BDOS function calls.
If the WBOOT routine is reading the CCP from a file, it must set
the multisector I/O count, @MLTIO in the System Control Block,
to the number of 128-byte records to be read in one operation before
reading CCP.COM. You can directly set @MLTIO in the SCB, or you
can call BDOS Function 44 to set the multisector count in the SCS.
The DEVTBL and DEVINI entry points allow you to support device
assignment with a flexible, yet completely optional system. It replaces
the IOBYTE facility of CP/M 2.2. Note that the CHRTBL must be
in common in banked systems.
DIGITAL RESEARCH™
3-34
CP/M System Guide BIOS Subroutine Entry Points
DIGITAL RESEARCH™
3-35
BIOS Subroutine Entry Points CP/M System Guide
lxi h,0FFFEh
You must also set the PSH and PSM fields of the associated Disk Pa-
rameter Block to zero.
In CP/M 3, you can direct each of the five logical character devices
to any combination of up to twelve physical devices. Each of the five
logical devices has a 16-bit vector in the System Control Block (SCB).
Each bit of the vector represents a physical device where bit 15 corre-
sponds to device zero, and bit 4 is device eleven. Bits 0 through 3 are
reserved for future system use.
You can use the public names defined in the supplied SCB.ASM file
to reference the I/O redirection bit vectors. The names are shown in
Table 3-11.
DIGITAL RESEARCH™
3-36
CP/M System Guide BIOS Subroutine Entry Points
Read the status of the currently assigned console device and return
0FFH in register A if a character is ready to read, and 00H in register
A if no console characters are ready.
DIGITAL RESEARCH™
3-37
BIOS Subroutine Entry Points CP/M System Guide
Send the character from register C to the listing device. The character
is in ASCII with no parity.
DIGITAL RESEARCH™
3-38
CP/M System Guide BIOS Subroutine Entry Points
Read the next character from the currently assigned AUXIN device
into register A with no parity. A returned ASCII CTRL-Z (1AH)
reports an end-of-file.
DIGITAL RESEARCH™
3-39
BIOS Subroutine Entry Points CP/M System Guide
The BIOS LISTST function returns the ready status of the list device.
The AUXIST routine checks the input status of the auxiliary port.
DIGITAL RESEARCH™
3-40
CP/M System Guide BIOS Subroutine Entry Points
The AUXOST routine checks the output status of the auxiliary port.
This routine allows full polled handshaking for communications support
using an auxiliary port.
This section defines the CP/M 3 BIOS disk I/O routines HOME,
SELDSK, SETTRK, SETSEC, SETDMA, READ, WRITE, SECTRN,
MULTIO, and FLUSH.
Return the disk head of the currently selected disk to the track 00
position. Usually, you can translate the HOME call into a call on
SETTRK with a parameter of 0.
DIGITAL RESEARCH™
3-41
BIOS Subroutine Entry Points CP/M System Guide
DIGITAL RESEARCH™
3-42
CP/M System Guide BIOS Subroutine Entry Points
DIGITAL RESEARCH™
3-43
BIOS Subroutine Entry Points CP/M System Guide
and C=80H when the BDOS calls SETDMA, then the subsequent
read operation reads its data starting at 80H, or the subsequent write
operation gets its data from 80H, until the next call to SETDMA occurs.
Assume the BDOS has selected the drive, set the track, set the sector,
and specified the DMA address. The READ subroutine attempts to
read one sector based upon these parameters, then returns one of the
error codes in register A as described above.
DIGITAL RESEARCH™
3-44
CP/M System Guide BIOS Subroutine Entry Points
Write the data from the currently selected DMA address to the cur-
rently selected drive, track, and sector. Upon each call to WRITE, the
BDOS provides the following information in register C:
0 = deferred write
1 = nondeferred write
2 = deferred write to the first sector of a new data block
DIGITAL RESEARCH™
3-45
BIOS Subroutine Entry Points CP/M System Guide
Typically, most disk systems perform well with a skew of every other
physical sector. You should maintain support of single-density, IBM
3740 compatible disks using a skew factor of 6 in your CP/M 3 system
to allow information transfer to and from other CP/M users.
Certain drive types either do not need skewing or perform the skewing
externally from the system software. In this case, the skew table address
DIGITAL RESEARCH™
3-46
CP/M System Guide BIOS Subroutine Entry Points
in the DPH can be set to zero, and the SECTRN routine can check for
the zero in DE and return with the physical sector set to the logical sector.
The BIOS can directly transfer all of the specified sectors to or from
the DMA buffer in one operation and then count down the remaining
calls to READ or WRITE.
DIGITAL RESEARCH™
3-47
BIOS Subroutine Entry Points CP/M System Guide
reset the multiple sector counters in the BIOS and return the error
immediately, or you can save the error status and return it to the BDOS
on the last READ or WRITE call of the MULTIO operation.
The flush buffers entry point allows the system to force physical
sector buffer flushing when your BIOS is performing its own record
blocking and deblocking.
The BDOS calls the FLUSH routine to ensure that no dirty buffers
remain in memory. The BIOS should immediately write any buffers
that contain unwritten data.
Note: if you do not implement FLUSH, the routine must return a zero
in register A. You can accomplish this with the following instructions:
xra a
ret
DIGITAL RESEARCH™
3-48
CP/M System Guide BIOS Subroutine Entry Points
Usually, the BDOS expects MOVE to transfer data within the cur-
rently selected bank or common memory. However, if the BDOS calls
the XMOVE entry point before calling MOVE, the MOVE routine
must perform an interbank transfer.
DIGITAL RESEARCH™
3-49
BIOS Subroutine Entry Points CP/M System Guide
DIGITAL RESEARCH™
3-50
CP/M System Guide BIOS Subroutine Entry Points
The BDOS calls the TIME function to indicate to the BIOS whether
it has just set the Time and Date fields in the SCB, or whether the BDOS
is about to get the Time and Date from the SCB. On entry to the TIME
function, a zero in register C indicates that the BIOS should update the
DIGITAL RESEARCH™
3-51
Banking Considerations CP/M System Guide
Time and Date fields in the SCB. A 0FFH in register C indicates that
the BDOS has just set the Time and Date in the SCB and the BIOS
should update its clock. Upon exit, you must restore register pairs HL
and DE to their entry values.
This entry point is for systems that must interrogate the clock to
determine the time. Systems in which the clock is capable of generating
an interrupt should use an interrupt service routine to set the Time and
Date fields on a regular basis.
You can place portions of the disk I/O routines in the system bank,
Bank 0. In a banked environment, if the disk I/O hardware supports
DMA transfers to and from banks other than the currently selected
bank, the disk I/O drivers can reside in Bank 0. If the system has a DMA
controller that supports block moves from memory to memory between
banks, CP/M 3 also allows you to place the blocking and deblocking
buffers in any bank other than Bank 1, instead of common memory.
If your disk controller supports data transfers only into the currently
DIGITAL RESEARCH™
3-52
CP/M System Guide Banking Considerations
selected bank, then the code that initiates and performs a data transfer
must reside in common memory. In this case, the disk I/O transfer rou-
tines must select the DMA bank, perform the transfer, then reselect Bank
0. The routine in common memory performs the following procedure:
Note that Bank 0 is in context (selected) when the BDOS calls the
system initialization functions BOOT and DRVTBL the disk I/O
routines HOME, SELDSK, SETTRK, SETSEC, SETDMA, READ,
WRITE, SECTRN, MULTIO, and FLUSH and the memory man-
agement routines XMOVE and SETBNK.
DIGITAL RESEARCH™
3-53
Assembling and Linking Your BIOS CP/M System Guide
After assembling the BIOS with RMAC, link your BNKBIOS using
LINK-80 with the [B] option. The [B] option aligns the DSEG on a page
boundary, and places the length of the CSEG into the BNKBIOS3.SPR
header page.
DIGITAL RESEARCH™
3-54
CP/M System Guide Assembling and Linking Your BIOS
A›RMAC BIOS3
A›RMAC BNKBIOS3
A›LINK BIOS3[OS]=BIOS3,SCB
A›LINK BNKBIOS3[B]=BNKBIOS3,SCB
End of Section 3
DIGITAL RESEARCH™
3-55
CP/M System Guide
DIGITAL RESEARCH™
3-56
CP/M System Guide Functional Sumary of BIOS Modules
Section 4
CP/M 3 Sample BIOS Modules
DIGITAL RESEARCH™
4-1
Functional Sumary of BIOS Modules CP/M System Guide
for reference only, and you should not modify it except for the equate
statement described in the following paragraph.
You must be sure the equate statement (banked equ true) at the
start of the BIOSKRNL.ASM source file is correct for your system
configuration. Digital Research distributes the BIOSKRNL.ASM file
for a banked system. If you are creating a BIOS for a nonbanked system,
change the equate statement to the following:
and reassemble with RMAC. This is the only change you should make
to the BIOSKRNL.ASM file.
DIGITAL RESEARCH™
4-2
CP/M System Guide Conventions Used in BIOS Modules
Module Function
CHARIO.ASM module
Performs all character device initialization, input,
output, and status polling. CHARIO contains the
character device characteristics table.
DRVTBL.ASM module
Points to the data structures for each configured disk
drive. The drive table determines which physical disk
unit is associated with which logical drive. The data
structure for each disk drive is called an Extended Disk
Parameter Header (XDPH).
Disk I/O modules
Initialize disk controllers and execute READ and
WRITE code for disk controllers. You must provide
an XDPH for each supported unit, and a separate disk
I/O module for each controller in the system. To add
another disk controller for which a prewritten module
exists, add its XDPH names to the DRVTBL and link
in the new module.
MOVE.ASM module
Performs memory-to-memory moves and bank selects.
DIGITAL RESEARCH™
4-3
Interactions of Modules CP/M System Guide
External names can refer to either code or data. All predefined ex-
ternal names in the modular BIOS prefixed with a @ character refer
to data items. All external names prefixed with a ? character refer to a
code label. To prevent conflicts with future extensions, user-defined
external names should not contain these characters.
DIGITAL RESEARCH™
4-4
CP/M System Guide Interactions of Modules
You can use the DEVICE utility to assign several physical devices
to a logical device. The BIOSKRNL root module polls the assigned
physical devices, and either reads a character from the first ready input
device that is selected, or sends the character to all of the selected output
devices as they become ready.
The BIOSKRNL module handles all BIOS calls associated with disk
DIGITAL RESEARCH™
4-5
Predefined Variables and Subroutines CP/M System Guide
I/O. It initializes global variables with the parameters for each operation,
then invokes the READ or WRITE routine for a particular controller.
The SELDSK routine in the BIOSKRNL calls the LOGIN routine for
a controller when the BDOS initiates a drive login. This allows disk
density or media type to be automatically determined.
Table 4-2 contains a summary of each public symbol and the module
that defines it.
DIGITAL RESEARCH™
4-6
CP/M System Guide Predefined Variables and Subroutines
The System Control Block defines public variables that other mod-
ules can reference. The System Control Block variables @CIVEC,
@COVEC, @AIVEC, @AOVEC, and @LOVEC are referenced by
BIOSKRNL.ASM. The variable @BNKBF can be used by ?LDCCP
and ?RLCCP to implement interbank block moves. The public variable
names @ERMDE, @FX, @RESEL, @VINFO, @CRDSK, @USRCD,
and @CRDMA are used for error routines which intercept BDOS
DIGITAL RESEARCH™
4-7
Predefined Variables and Subroutines CP/M System Guide
DIGITAL RESEARCH™
4-8
CP/M System Guide Predefined Variables and Subroutines
All BIOS entry points in the jump vector are declared as public for
general reference by other BIOS modules, as shown in Table 4-5.
DIGITAL RESEARCH™
4-9
BOOT Module CP/M System Guide
DIGITAL RESEARCH™
4-10
CP/M System Guide Character I/O
Module Meaning
?LDCCP BIOSKRNL calls ?LDCCP during cold start to load
the CCP into the TPA. The CCP can be loaded either
from the system tracks of the boot device or from a file,
at the discretion of the system implementor. In a banked
system, you can place a copy of the CCP in a reserved
area of another bank to increase the performance of the
?RLCCP routine.
?RLCCP BIOSKRNL calls ?RLCCP during warm start to reload
the CCP into the TPA. In a banked system, the CCP
can be copied from an alternate bank to eliminate any
disk access. Otherwise, the CCP should be loaded from
either the system tracks of the boot device or from a file.
DIGITAL RESEARCH™
4-11
Character I/O CP/M System Guide
The first field of the character device table, @CTBL, is the 6-byte
device name. This device name should be all upper-case, left-justified,
and padded with ASCII spaces (20H).
The third field of @CTBL is 1 byte and contains the current baud
rate for serial devices. The high-order nibble of this field is reserved for
future use and should be set to zero. The low-order four bits contain the
current baud rate as shown in Table 4-8. Many systems do not support
all of these baud rates.
DIGITAL RESEARCH™
4-12
CP/M System Guide Character I/O
Table 4-9 shows the entry points to the routines in the CHARIO
module. The BIOSKRNL module calls these routines to perform ma-
chine-dependent character I/O.
DIGITAL RESEARCH™
4-13
Disk I/O CP/M System Guide
Label Meaning
?CIST Character Device Input Status
DIGITAL RESEARCH™
4-14
CP/M System Guide Disk I/O
The XDPHs are the only public entry points in the disk I/O modules.
The root module references the XDPHs to locate the actual I/O driver
code to perform sector READS and WRITES. When the READ and
WRITE routines are called, the parameters controlling the READ or
WRITE operation are contained in a series of global variables that are
declared public in the root module.
The drive table module, DRVTBL, defines the CP/M absolute drive
codes associated with the physical disks.
DIGITAL RESEARCH™
4-15
Disk I/O CP/M System Guide
The XDPHs for each unit of a controller are the only entry points
in a particular disk drive module. They contain both the DPH for the
drive and the addresses of the various action routines for that drive,
including READ, WRITE, and initialization. Figure 4-1 shows the
format of the Extended Disk Parameter Header.
DIGITAL RESEARCH™
4-16
CP/M System Guide Disk I/O
DIGITAL RESEARCH™
4-17
Disk I/O CP/M System Guide
Field Meaning
LOGIN The LOGIN word contains the address of the LOGIN
routine for the drive.
INIT The INIT word contains the address of the first-time
initialization code for the drive.
UNIT The UNIT byte contains the drive code relative to
the disk controller.
TYPE The TYPE byte is unused by the BIOS root, and is
reserved for the driver to keep the current density or
media type to support multiple-format disk subsystems.
regular DPH The remaining fields of the XDPH comprise a standard
DPH, as discussed in Section 3 of this manual.
The pointers contained in the XDPH reference the actual code entry
points to a disk driver module. These routines are not declared public.
Only the XDPH itself is public. The BIOS root references the XDPHs
only through the @DTBL. Table 4-11 shows the BIOS subroutine
entry points.
DIGITAL RESEARCH™
4-18
CP/M System Guide Disk I/O
DIGITAL RESEARCH™
4-19
Disk I/O CP/M System Guide
The D: is the selected drive, and T-nn and S-nn display the track and
sector number for the operation. The READ and WRITE routines
should print the exact cause of the error after this message, such as
Not Ready, or Write Protect. The driver can then ask the operator if
additional retries are desired, and return an error code to the BDOS
if they are not.
DIGITAL RESEARCH™
4-20
CP/M System Guide MOVE Module
DIGITAL RESEARCH™
4-21
Linking Modules into the BIOS CP/M System Guide
LINK BIOS3[os]=BIOS,SCB,BOOT,CHARIO,MOVE,DRVTBL,‹disk-modules›
End of Section 4
DIGITAL RESEARCH™
4-22
CP/M System Guide
Section 5
System Generation
DIGITAL RESEARCH™
5-1
GENCPM Utility CP/M System Guide
Purpose:
Input Files:
BNKBIOS3.SPR BIOS3.SPR
RESBDOS3.SPR BDOS3.SPR
BNKBDOS3.SPR
optionally GENCPM.DAT
DIGITAL RESEARCH™
5-2
CP/M System Guide GENCPM Utility
Output File:
CPM3.SYS
optionally GENCPM.DAT
GENCPM can get its input from a file GENCPM.DAT. The values
in the file replace the default values of GENCPM. If you enter the
AUTO parameter in the command line GENCPM gets its input from
the file GENCPM.DAT and generates a new system displaying only its
sign-on and sign-off messages on the console. If AUTO is specified and
a GENCPM.DAT file does not exist on the current drive, GENCPM
reverts to manual generation.
DIGITAL RESEARCH™
5-3
GENCPM Utility CP/M System Guide
Program Questions:
DIGITAL RESEARCH™
5-4
CP/M System Guide GENCPM Utility
A character in the last column must not force a new line for
console editing in CP/M 3. If your terminal forces a new line
automatically, decrement the column count by one.
Enter the number of the lines per screen for your console.
DIGITAL RESEARCH™
5-5
GENCPM Utility CP/M System Guide
DIGITAL RESEARCH™
5-6
CP/M System Guide GENCPM Utility
DIGITAL RESEARCH™
5-7
GENCPM Utility CP/M System Guide
DIGITAL RESEARCH™
5-8
CP/M System Guide GENCPM Utility
Enter the base page, the length, and the bank of the memory
segment.
DIGITAL RESEARCH™
5-9
GENCPM Utility CP/M System Guide
DIGITAL RESEARCH™
5-10
CP/M System Guide GENCPM Utility
Enter the drive letter (A–P) of the drive with which you
want this drive to share a buffer.
DIGITAL RESEARCH™
5-11
GENCPM Utility CP/M System Guide
Examples:
combas = c0 ‹CR›
lerror = ? ‹CR›
numsegs = 3 ‹CR›
DIGITAL RESEARCH™
5-12
CP/M System Guide GENCPM Utility
A›GENCPM
DIGITAL RESEARCH™
5-13
GENCPM Utility CP/M System Guide
DIGITAL RESEARCH™
5-14
CP/M System Guide GENCPM Utility
DIGITAL RESEARCH™
5-15
GENCPM Utility CP/M System Guide
A›GENCPM
DIGITAL RESEARCH™
5-16
CP/M System Guide GENCPM Utility
DIGITAL RESEARCH™
5-17
GENCPM Utility CP/M System Guide
DIGITAL RESEARCH™
5-18
CP/M System Guide Customizing the CPMLDR
The system tracks for CP/M 3 contain the customized Cold Start
Loader, CPMLDR with the customized LDRBIOS, and possibly the
CCP.
The COPYSYS utility places the Cold Start Loader, the CPMLDR,
and optionally the CCP on the system tracks, as shown in Table 5-1.
00 02 00 0100H CPMLDR
.
. and
.
00 21 09 0A80H LDRBDOS
00 22 10 0B00H LDRBIOS
.
.
00 26 12 0D00H and
01 01 12 0D80H
.
DIGITAL RESEARCH™
5-19
Customizing the CPMLDR CP/M System Guide
Typically the Cold Start Loader is loaded into memory from Track
0, Sector 1 of the system tracks when the reset button is depressed. The
Cold Start Loader then loads CPMLDR from the system tracks into
memory.
A›LINK CPMLDR[L100]=CPMLDR,LDRBIOS
Replace the address 100 with the load address to which your
boot loader loads CPMLDR.COM. You must include a bias
of 100H bytes for buffer space when you determine the load
address.
DIGITAL RESEARCH™
5-20
CP/M System Guide Customizing the CPMLDR
BIOS. The LDRBIOS has the same JMP vector as the regular CP/M 3
BIOS. The LDRBIOS is called only to perform disk reads (READ)
from one drive, console output (CONOUT) for sign-on messages,
and minimal system initialization.
The CPMLDR calls the BOOT entry point at the beginning of the
LDRBIOS to allow it to perform any necessary hardware initialization.
The BOOT entry point should return to CPMLDR instead of loading
and branching to the CCP, as a BIOS normally does. Note that inter-
rupts are not disabled when the LDRBIOS BOOT routine is called.
DIGITAL RESEARCH™
5-21
CPMLDR Utility CP/M System Guide
CPMLDR
Purpose:
Input File:
CPM3.SYS
Examples:
A›CPMLDR
CP/M V3.0 Loader
Copyright (C) 1982, Digital Research
DIGITAL RESEARCH™
5-22
CP/M System Guide Booting CP/M 3
60K TPA
A›
DIGITAL RESEARCH™
5-23
Booting CP/M 3 CP/M System Guide
End of Section 5
DIGITAL RESEARCH™
5-24
CP/M System Guide
Section 6
Debugging the BIOS
A›SID
CP/M 3 SID - Version 3.0
#L5
0005 JMP C500
.
.
.
DIGITAL RESEARCH™
6-1
CP/M System Guide
A›GENCPM
.
.
Top page of memory (FF)? C3
.
.
.
A›SID CPMLDR.COM
CP/M 3 SID - Version 3.0
NEXT MSZE PC END
0E80 0EB0 0100 D4FF
#
#I$B
#G
DIGITAL RESEARCH™
6-2
CP/M System Guide
appears:
34K TPA
* 01A9
#
6. With the CP/M 3 system in the proper location, you can set
passpoints in your BIOS. Use the L command with the address
specified as the beginning of the BIOS by the CPMLDR load
table as shown in step 5 above. This L command causes SID
to display the BIOS jump vector which begins at that address.
The jump vector indicates the beginning address of each sub-
routine in the table. For example, the first jump instruction in
the example below is to the Cold Boot subroutine.
#LAA00
JMP AA68
JMP AA8E
JMP ABA4
JMP ABAF
JMP ABCA
.
.
.
DIGITAL RESEARCH™
6-3
CP/M System Guide
#PAA68
#GAA00
End of Section 6
DIGITAL RESEARCH™
6-4
CP/M System Guide
Appendix A
Removable Media Considerations
DIGITAL RESEARCH™
A-1
CP/M System Guide
The BIOS media flag facility gives you another option for supporting
drives with removable media. However, to use this option, the disk con-
troller must be capable of generating an interrupt when the drive door
is opened. If your hardware provides this support, you can improve the
handling of removable media by implementing the following procedure:
1. Mark the drive as a permanent drive and set the DPB CKS
parameter to the total number of directory entries, divided by
four. For example, set the CKS field for a disk with 96 directory
entries to 8018H.
By using the media flag facility, you gain the performance advantage
associated with permanent drives on drives that support removable
media. The BDOS checks the System Control Block @MEDIA flag
on entry for all disk-related function calls. If the flag has not been set,
it implies that no disks on the system have been changed. If the flag is
set, the BDOS checks the DPH MEDIA flag of each currently logged-
in disk. If the DPH MEDIA flag of a drive is set, the BDOS reads the
entire directory on the drive to determine whether the drive has had a
media change before performing any other operations on the drive. In
addition, it temporarily classifies any permanent disk with the DPH
MEDIA flag set as a removable drive. Thus, the BDOS discards all
directory physical record buffers when a drive door is opened to force
all directory READ operations to access the disk.
DIGITAL RESEARCH™
A-2
CP/M System Guide
End of Appendix A
DIGITAL RESEARCH™
A-3
CP/M System Guide
DIGITAL RESEARCH™
A-4
CP/M System Guide
Appendix B
Auto-density Support
To support multiple disk formats, the drivers BIOS driver must include
a Disk Parameter Block (DPB) for each type of disk or include code
to generate the proper DPB parameters dynamically. In addition, the
BIOS driver must determine the proper format of the disk when the
SELDSK entry point is called with register E bit 0 equal to 0 (initial
SELDSK calls). If the BIOS driver cannot determine the format, it can
return 0000H in register pair HL to indicate the select was not success-
ful. Otherwise, it must update the Disk Parameter Header (DPH) to
address a DPB that describes the current media, and return the address
of the DPH to the BDOS.
Note: all subsequent SELDSK calls with register E bit 0 equal to 1, the
BIOS driver must continue to return the address of the DPH returned
in the initial SELDSK call. The value 0000H is only a legal return value
for initial SELDSK calls.
DIGITAL RESEARCH™
B-1
CP/M System Guide
it must return the value 0FFH in register A and set the media flag in
the System Control Block. This signals the BDOS that the media has
changed and the next BIOS call to the drive will be an initial SELDSK
call. Do not modify the drivers DPH or DPB until the initial SELDSK
call is made. Note that the BDOS can detect a change in media and
will make an initial SELDSK call, even though the BIOS READ and
WRITE routines have not detected a disk format change. However,
the SELDSK routine must always determine the format on initial calls.
End of Appendix B
DIGITAL RESEARCH™
B-2
CP/M System Guide
Appendix C
Modifying a CP/M 2 BIOS
If you are modifying an existing CP/M 2.2 BIOS, you must note
the following changes.
DIGITAL RESEARCH™
C-1
CP/M System Guide
Function Meaning
BIOS Function 02: CONST
Can be implemented unchanged.
BIOS Function 03: CONIN
Can be implemented unchanged. Do not mask
the high-order bit.
BIOS Function 04: CONOUT
Can be implemented unchanged.
BIOS Function 05: LIST
Can be implemented unchanged.
BIOS Function 06: AUXOUT
Called PUNCH in CP/M 2. Can be implemented
unchanged.
BIOS Function 07: AUXIN
Called READER in CP/M 2. Can be implemented
unchanged. Do not mask the high-order bit.
BIOS Function 08: HOME
No change.
BIOS Function 09: SELDSK
Can not return a select error when SELDSK is
called with bit 0 in register E equal to 1.
BIOS Function 10: SETTRK
No change.
BIOS Function 11: SETSEC
Sectors are physical sectors, not logical 128-byte
sectors.
BIOS Function 12: SETDMA
Now called for every READ or WRITE operation.
The DMA buffer can now be greater than 128 bytes.
DIGITAL RESEARCH™
C-2
CP/M System Guide
Function Meaning
BIOS Function 13: READ
READ operations are in terms of physical sectors.
READ can return a 0FFH error code if it detects
that the disk format has changed.
BIOS Function 14: WRITE
WRITE operations are in terms of physical sectors.
If write detects that the disk is Read-Only, it can
return error code 2. WRITE can return a 0FFH
error code if it detects that the disk format has
changed.
BIOS Function 15: LISTST
Can be implemented unchanged.
BIOS Function 16: SECTRN
Sectors are physical sectors, not logical 128-byte
sectors.
DIGITAL RESEARCH™
C-3
CP/M System Guide
End of Appendix C
DIGITAL RESEARCH™
C-4
CP/M System Guide
Appendix D
CPM3.SYS File Format
DIGITAL RESEARCH™
D-1
CP/M System Guide
End of Appendix D
DIGITAL RESEARCH™
D-2
Root Module of the Relocatable BIOS for CP/M 3
Appendix E
Root Module of Relocatable
BIOS for CP/M 3
All the listings in Appendixes E through I are assembled with, the CP/M Re-
locating Macro Assembler, and cross-referenced XREF™, an assembly language
cross-reference program used with RMAC. These listings are output from the
XREF program. The assembly sources are on your distribution disk as .ASM files.
DIGITAL RESEARCH™
E-1
Root Module of the Relocatable BIOS for CP/M 3
34
35
36 ; variables in system data page
37
38 extrn @covec,@civec,@aovec,@aivec,@lovec ; I/O redirection vectors
39 extrn @mxtpa ; addr of system entry point
40 extrn @bnkbf ; 128 byte scratch buffer
41
42 ; initialization
43
44 extrn ?init ; general initialization and signon
45 extrn ?ldccp,?rlccp ; load & reload CCP for BOOT & WBOOT
46
47 ; user defined character I/O routines
48
49 extrn ?ci,?co,?cist,?cost ; each take device in <B>
50 extrn ?cinit ; (re)initialize device in <C>
51 extrn @ctbl ; physical character device table
52
53 ; disk communication data items
54
55 extrn @dtbl ; table of pointers to XDPHs
56 public @adrv,@rdrv,@trk,@sect ; parameters for disk I/O
57 public @dma,@dbnk,@cnt ; '' '' '' ''
58
59 ; memory control
60
61 public @cbnk ; current bank
62 extrn ?xmove,?move ; select move bank, and block move
63 extrn ?bank ; select CPU bank
64
65 ; clock support
66
67 extrn ?time ; signal time operation
68
69 ; general utility routines
70
71 public ?pmsg,?pdec ; print message, print number from 0 to 65535
72 public ?pderr ; print BIOS disk error message header
73
74 maclib modebaud ; define mode bits
75
76
77 ; External names for BIOS entry points
78
79 public ?boot,?wboot,?const,?conin,?cono,?list,?auxo,?auxi
80 public ?home,?sldsk,?sttrk,?stsec,?stdma,?read,?write
81 public ?lists,?sctrn
82 public ?conos,?auxis,?auxos,?dvtbl,?devin,?drtbl
83 public ?mltio,?flush,?mov,?tim,?bnksl,?stbnk,?xmov
84
85
86 ; BIOS Jump vector.
87
88 ; All BIOS routines are invoked by calling these
89 ; entry points.
DIGITAL RESEARCH™
E-2
Root Module of the Relocatable BIOS for CP/M 3
90
91 0000 C30000 ?boot: jmp boot ; initial entry on cold start
92 0003 C36C00 ?wboot: jmp wboot ; reentry on program exit, warm start
93
94 0006 C37701 ?const: jmp const ; return console input status
95 0009 C39201 ?conin: jmp conin ; return console input character
96 000C C3DA00 ?cono: jmp conout ; send console output character
97 000F C3E600 ?list: jmp list ; send list output character
98 0012 C3E000 ?auxo: jmp auxout ; send auxilliary output character
99 0015 C39801 ?auxi: jmp auxin ; return auxilliary input character
100
101 0018 C36E00 ?home: jmp home ; set disks to logical home
102 001B C33F00 ?sldsk: jmp seldsk ; select disk drive, return disk parameter info
103 001E C37100 ?sttrk: jmp settrk ; set disk track
104 0021 C37700 ?stsec: jmp setsec ; set disk sector
105 0024 C37D00 ?stdma: jmp setdma ; set disk I/O memory address
106 0027 C39400 ?read: jmp read ; read physical block(s)
107 002A C3AA00 ?write: jmp write ; write physical block(s)
108
109 002D C31201 ?lists: jmp listst ; return list device status
110 0030 C38900 ?sctrn: jmp sectrn ; translate logical to physical sector
111
112 0033 C30601 ?conos: jmp conost ; return console output status
113 0036 C37D01 ?auxis: jmp auxist ; return aux input status
114 0039 C30C01 ?auxos: jmp auxost ; return aux output status
115 003C C3D200 ?dvtbl: jmp devtbl ; return address of device def table
116 003F C30000 ?devin: jmp ?cinit ; change baud rate of device
117
118 0042 C3D600 ?drtbl: jmp getdrv ; return address of disk drive table
119 0045 C3CB00 ?mltio: jmp multio ; set multiple record count for disk I/O
120 0048 C3CF00 ?flush: jmp flush ; flush BIOS maintained disk caching
121
122 004B C30000 ?mov: jmp ?move ; block move memory to memory
123 004E C30000 ?tim: jmp ?time ; Signal Time and Date operation
124 0051 C32502 ?bnksl: jmp bnksel ; select bank for code execution and default DMA
125 0054 C38500 ?stbnk: jmp setbnk ; select different bank for disk I/O DMA operations.
126 0057 C30000 ?xmov: jmp ?xmove ; set source and destination banks for one operation
127
128 005A C30000 jmp 0 ; Reserved for system implementor
129 005D C30000 jmp 0 ; reserved for future expansion
130 0060 C30000 jmp 0 ; reserved for future expansion
131
132
133 ; BOOT
134 ; Initial entry point for system startup.
135
136 dseg ; this part can be banked
137
138 boot:
139 0000 31D200 lxi sp,boot$stack
140 0003 0E0F mvi c,15 ; initialize all 16 character devices
141 c$init$loop:
142 0005 C5CD0000C1 push b ! call ?cinit ! pop b
143 000A 0DF20500 dcr c ! jp c$init$loop
144
145 000E CD0000 call ?init ; perform any additional system initialization
DIGITAL RESEARCH™
E-3
Root Module of the Relocatable BIOS for CP/M 3
DIGITAL RESEARCH™
E-4
Root Module of the Relocatable BIOS for CP/M 3
DIGITAL RESEARCH™
E-5
Root Module of the Relocatable BIOS for CP/M 3
DIGITAL RESEARCH™
E-6
Root Module of the Relocatable BIOS for CP/M 3
DIGITAL RESEARCH™
E-7
Root Module of the Relocatable BIOS for CP/M 3
370 ist$scan:
371 0180 0600 mvi b,0 ; start with device 0
372 cis$next:
373 0182 29 dad h ; check next bit
374 0183 3E00 mvi a,0 ; assume device not ready
375 0185 DC5D01 cc cist1 ; check status for this device
376 0188 B7C0 ora a ! rnz ; if any ready, return true
377 018A 04 inr b ; drop device number
378 018B 7CB5 mov a,h ! ora l ; see if any more selected devices
379 018D C28201 jnz cis$next
380 0190 AF xra a ; all selected were not ready, return false
381 0191 C9 ret
382
383
384 ; CONIN
385 ; Console Input. Return character from first
386 ; ready console input device.
387
388 conin:
389 0192 2A0000 lhld @civec
390 0195 C39B01 jmp in$scan
391
392
393 ; AUXIN
394 ; Auxiliary Input. Return character from first
395 ; ready auxiliary input device.
396
397 auxin:
398 0198 2A0000 lhld @aivec
399
400 in$scan:
401 019B E5 push h ; save bit vector
402 019C 0600 mvi b,0
403 ci$next:
404 019E 29 dad h ; shift out next bit
405 019F 3E00 mvi a,0 ; insure zero a (nonexistant device not ready).
406 01A1 DC5D01 cc cist1 ; see if the device has a character
407 01A4 B7 ora a
408 01A5 C2B201 jnz ci$rdy ; this device has a character
409 01A8 04 inr b ; else, next device
410 01A9 7CB5 mov a,h ! ora l ; see if any more devices
411 01AB C29E01 jnz ci$next ; go look at them
412 01AE E1 pop h ; recover bit vector
413 01AF C39B01 jmp in$scan ; loop til we find a character
414
415 ci$rdy:
416 01B2 E1 pop h ; discard extra stack
417 01B3 C30000 jmp ?ci
418
419
420 ; Utility Subroutines
421
422
423 ipchl: ; vectored CALL point
424 01B6 E9 pchl
425
DIGITAL RESEARCH™
E-8
Root Module of the Relocatable BIOS for CP/M 3
426
427 ?pmsg: ; print message @<HL> up to a null
428 ; saves <BC> & <DE>
429 01B7 C5 push b
430 01B8 D5 push d
431 pmsg$loop:
432 01B9 7EB7CAC801 mov a,m ! ora a ! jz pmsg$exit
433 01BE 4FE5 mov c,a ! push h
434 01C0 CD0C00E1 call ?cono ! pop h
435 01C4 23C3B901 inx h ! jmp pmsg$loop
436 pmsg$exit:
437 01C8 D1 pop d
438 01C9 C1 pop b
439 01CA C9 ret
440
441 ?pdec: ; print binary number 0-65535 from <HL>
442 01CB 01F30111F0 lxi b,table10! lxi d,-10000
443 next:
444 01D1 3E2F mvi a,'0'-1
445 pdecl:
446 01D3 E53C19D2DE push h! inr a! dad d! jnc stoploop
447 01D9 3333C3D301 inx sp! inx sp! jmp pdecl
448 stoploop:
449 01DE D5C5 push d! push b
450 01E0 4FCD0C00 mov c,a! call ?cono
451 01E4 C1D1 pop b! pop d
452 nextdigit:
453 01E6 E1 pop h
454 01E7 0A5F03 ldax b! mov e,a! inx b
455 01EA 0A5703 ldax b! mov d,a! inx b
456 01ED 7BB2C2D101 mov a,e! ora d! jnz next
457 01F2 C9 ret
458
459 table10:
460 01F3 18FC9CFFF6 dw -1000,-100,-10,-1,0
461
462 ?pderr:
463 01FD 21D100CDB7 lxi h,drive$msg ! call ?pmsg ; error header
464 0203 3AED00C641 lda @adrv ! adi 'A' ! mov c,a ! call ?cono ; drive code
465 020C 21E300CDB7 lxi h,track$msg ! call ?pmsg ; track header
466 0212 2AEF00CDCB lhld @trk ! call ?pdec ; track number
467 0218 21E800CDB7 lxi h,sector$msg ! call ?pmsg ; sector header
468 021E 2AF100CDCB lhld @sect ! call ?pdec ; sector number
469 0224 C9 ret
470
471
472 ; BNKSEL
473 ; Bank Select. Select CPU bank for further execution.
474
475 bnksel:
476 0225 323B02 sta @cbnk ; remember current bank
477 0228 C30000 jmp ?bank ; and go exit through users
478 ; physical bank select routine
479
480
481 022B FFFFFFFFFFxofflist db -1,-1,-1,-1,-1,-1,-1,-1 ; ctl-s clears to zero
DIGITAL RESEARCH™
E-9
Root Module of the Relocatable BIOS for CP/M 3
DIGITAL RESEARCH™
E-10
Root Module of the Relocatable BIOS for CP/M 3
538 setsec:
539 0077 6960 mov l,c ! mov h,b
540 0079 22F100 shld @sect
541 007C C9 ret
542
543
544 ; SETDMA
545 ; Set Disk Memory Address. Saves DMA address
546 ; from <BC> in @DMA and sets @DBNK to @CBNK
547 ; so that further disk operations take place
548 ; in current bank.
549
550 setdma:
551 007D 6960 mov l,c ! mov h,b
552 007F 22F300 shld @dma
553
554 0082 3A3B02 lda @cbnk ; default DMA bank is current bank
555 ; fall through to set DMA bank
556
557 ; SETBNK
558 ; Set Disk Memory Bank. Saves bank number
559 ; in @DBNK for future disk data
560 ; transfers.
561
562 setbnk:
563 0085 32F600 sta @dbnk
564 0088 C9 ret
565
566
567 ; SECTRN
568 ; Sector Translate. Indexes skew table in <DE>
569 ; with sector in <BC>. Returns physical sector
570 ; in <HL>. If no skew table (<DE>=0) then
571 ; returns physical=logical.
572
573 sectrn:
574 0089 6960 mov l,c ! mov h,b
575 008B 7AB3C8 mov a,d ! ora e ! rz
576 008E EB096E2600 xchg ! dad b ! mov l,m ! mvi h,0
577 0093 C9 ret
578
579
580 ; READ
581 ; Read physical record from currently selected drive.
582 ; Finds address of proper read routine from
583 ; extended disk parameter header (XDPH).
584
585 read:
586 0094 2AED002600 lhld @adrv ! mvi h,0 ! dad h ; get drive code and double it
587 009A 11000019 lxi d,@dtbl ! dad d ; make address of table entry
588 009E 7E23666F mov a,m ! inx h ! mov h,m ! mov l,a ; fetch table entry
589 00A2 E5 push h ; save address of table
590 00A3 11F8FF19 lxi d,-8 ! dad d ; point to read routine address
591 00A7 C3BD00 jmp rw$common ; use common code
592
593
DIGITAL RESEARCH™
E-11
Root Module of the Relocatable BIOS for CP/M 3
594 ; WRITE
595 ; Write physical sector from currently selected drive.
596 ; Finds address of proper write routine from
597 ; extended disk parameter header (XDPH).
598
599 write:
600 00AA 2AED002600 lhld @adrv ! mvi h,0 ! dad h ; get drive code and double it
601 00B0 11000019 lxi d,@dtbl ! dad d ; make address of table entry
602 00B4 7E23666F mov a,m ! inx h ! mov h,m ! mov l,a ; fetch table entry
603 00B8 E5 push h ; save address of table
604 00B9 11F6FF19 lxi d,-10 ! dad d ; point to write routine address
605
606 rw$common:
607 00BD 7E23666F mov a,m ! inx h ! mov h,m ! mov l,a ; get address of routine
608 00C1 D1 pop d ; recover address of table
609 00C2 1B1B dcx d ! dcx d ; point to relative drive
610 00C4 1A32EE00 ldax d ! sta @rdrv ; get relative drive code and post it
611 00C8 1313 inx d ! inx d ; point to DPH again
612 00CA E9 pchl ; leap to driver
613
614
615 ; MULTIO
616 ; Set multiple sector count. Saves passed count in
617 ; @CNT
618
619 multio:
620 00CB 32F500C9 sta @cnt ! ret
621
622
623 ; FLUSH
624 ; BIOS deblocking buffer flush. Not implemented.
625
626 flush:
627 00CF AFC9 xra a ! ret ; return with no error
628
629
630
631 ; error message components
632 00D1 0D0A074249drive$msg db cr,lf,bell,'BIOS Error on ',0
633 00E3 3A20542D00track$msg db ': T-',0
634 00E8 2C20532D00sector$msg db ', S-',0
635
636
637 ; disk communication data items
638
639 00ED @adrv ds 1 ; currently selected disk drive
640 00EE @rdrv ds 1 ; controller relative disk drive
641 00EF @trk ds 2 ; current track number
642 00F1 @sect ds 2 ; current sector number
643 00F3 @dma ds 2 ; current DMA address
644 00F5 00 @cnt db 0 ; record count for multisector transfer
645 00F6 00 @dbnk db 0 ; bank for DMA operations
646
647
648 cseg ; common memory
649
DIGITAL RESEARCH™
E-12
Root Module of the Relocatable BIOS for CP/M 3
DIGITAL RESEARCH™
E-13
Root Module of the Relocatable BIOS for CP/M 3
DIGITAL RESEARCH™
E-14
Root Module of the Relocatable BIOS for CP/M 3
End of Appendix E
DIGITAL RESEARCH™
E-15
Root Module of the Relocatable BIOS for CP/M 3
DIGITAL RESEARCH™
E-16
CP/M System Guide
Appendix F
System Control Block Definition
for CP/M 3 BIOS
DIGITAL RESEARCH™
F-1
CP/M System Guide
End of Appendix F
DIGITAL RESEARCH™
F-2
CP/M System Guide
Appendix G
Equates for Mode Byte Bit Fields
End of Appendix G
DIGITAL RESEARCH™
G-1
CP/M System Guide
DIGITAL RESEARCH™
G-2
CP/M System Guide
Appendix H
Macro Definitions for CP/M 3
BIOS Data Structures
DIGITAL RESEARCH™
H-1
CP/M System Guide
endm
if ?n > 16
.' Too many drives. Max 16 allowed'
exitm
endif
if ?n < 16
rept (16-?n)
dw 0
endm
endif
endm
endm
DIGITAL RESEARCH™
H-2
CP/M System Guide
?bsh set 3
?n set ?bls/1024
rept 8
?n set ?n/2
if ?n = 0
exitm
endif
?bsh set ?bsh + 1
endm
?blm set ?bls/128-1
?size set (?trks-?off)*?spt
?dsm set ?size/(?bls/128)-1
DIGITAL RESEARCH™
H-3
CP/M System Guide
;
gcd macro ?m,?n
;; greatest common divisor of m,n
;; produces value gcdn as result
;; (used in sector translate table generation)
?gcdm set ?m ;;variable for m
?gcdn set ?n ;;variable for n
?gcdr set 0 ;;variable for r
rept 65535
?gcdx set ?gcdm/?gcdn
?gcdr set ?gcdm - ?gcdx*?gcdn
if ?gcdr = 0
exitm
endif
?gcdm set ?gcdn
?gcdn set ?gcdr
endm
endm
DIGITAL RESEARCH™
H-4
CP/M System Guide
gcd %?secs,?skf
;; ?gcdn = gcd(?secs,skew)
?neltst set ?secs/?gcdn
;; neltst is number of elements to generate
;; before we overlap previous elements
?nelts set ?neltst ;;counter
rept ?secs ;;once for each sector
db ?nxtsec+?fsc
?nxtsec set ?nxtsec+?skf
if ?nxtsec >= ?secs
?nxtsec set ?nxtsec-?secs
endif
?nelts set ?nelts-1
if ?nelts = 0
?nxtbas set ?nxtbas+1
?nxtsec set ?nxtbas
?nelts set ?neltst
endif
endm
endm
End of Appendix H
DIGITAL RESEARCH™
H-5
CP/M System Guide
DIGITAL RESEARCH™
H-6
ACS 8000-15 BIOS Modules
Appendix I
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-1
ACS 8000-15 BIOS Modules
33
34 out$blocks:
35 0025 7EB7C847 mov a,m ! ora a ! rz ! mov b,a
36 0029 234E23 inx h ! mov c,m ! inx h
37 outir
38 002C+EDB3 DB 0EDH,0B3H
39 002E EDB3 DB 0EDH,0B3H
40 0030 C32500 jmp out$blocks
41
42
43 cseg ; boot loading must be done from resident memory
44
45 ; This version of the boot loader loads the CCP from a file
46 ; called CCP.com on the system drive (A:).
47
48
49 ?ldccp:
50 ; First time, oad the A:CCP.COM file into TPA
51 0000 AF32DB00 xra a ! sta ccp$fcb+15 ; zero extent
52 0004 21000022EC lxi h,0 ! shld fcb$nr ; start at beginning of file
53 000A 11CC00CD73 lxi d,ccp$fcb ! call open ; open file containing CCP
54 0010 3CCA4A00 inr a ! jz no$CCP ; error if no file...
55 0014 110001CD78 lxi d,0100h ! call setdma ; start of TPA
56 001A 118000CD7D lxi d,128 ! call setmulti ; allow up to 16k bytes
57 0020 11CC00CD82 lxi d,ccp$fcb ! call read ; loat the thing
58 ; now,
59 ; copy CCP to bank 0 for reloading
60 0026 2100010100 lxi h,0100h ! lxi b,0C00h ; clone 3K, just in case
61 002C 3A0000F5 lda @cbnk ! push psw ; save current bank
62 ld$1:
63 0030 3E01CD0000 mvi a,tpa$bank ! call ?bnksl ; select TPA
64 0035 7EF5 mov a,m ! push psw ; get a byte
65 0037 3E02CD0000 mvi a,2 ! call ?bnksl ; select extra bank
66 003C F177 pop psw ! mov m,a ; save the byte
67 003E 230B inx h ! dcx b ; bump pointer, drop count
68 0040 78B1 mov a,b ! ora c ; test for done
69 0042 C23000 jnz ld$1
70 0045 F1CD0000 pop psw ! call ?bnksl ; restore original bank
71 0049 C9 ret
72
73 no$CCP: ; here if we couldn't find the file
74 004A 21AB00CD00 lxi h,ccp$msg ! call ?pmsg ; report this...
75 0050 CD0000 call ?conin ; get a response
76 0053 C30000 jmp ?ldccp ; and try again
77
78
79 ?rlccp:
80 0056 2100010100 lxi h,0100h ! lxi b,0C00h ; clone 3K
81 rl$1:
82 005C 3E02CD0000 mvi a,2 ! call ?bnksl ; select extra bank
83 0061 7EF5 mov a,m ! push psw ; get a byte
84 0063 3E01CD0000 mvi a,tpa$bank ! call ?bnksl ; select TPA
85 0068 F177 pop psw ! mov m,a ; save the byte
86 006A 230B inx h ! dcx b ; bump pointer, drop count
87 006C 78B1 mov a,b ! ora c ; test for done
88 006E C25C00 jnz rl$1
DIGITAL RESEARCH™
I-2
ACS 8000-15 BIOS Modules
89 0071 C9 ret
90
91 ; No external clock.
92 ?time:
93 0072 C9 ret
94
95 ; CP/M BDOS Function Interfaces
96
97 open:
98 0073 0E0FC30500 mvi c,15 ! jmp bdos ; open file control block
99
100 setdma:
101 0078 0E1AC30500 mvi c,26 ! jmp bdos ; set data transfer address
102
103 setmulti:
104 007D 0E2CC30500 mvi c,44 ! jmp bdos ; set record count
105
106 read:
107 0082 0E14C30500 mvi c,20 ! jmp bdos ; read records
108
109
110 0087 0D0A0D0A43signon$msg db 13,10,13,10,'CP/M Version 3.0, sample BIOS',13,10,0
111
112 00AB 0D0A42494Fccp$msg db 13,10,'BIOS Err on A: No CCP.COM file',0
113
114
115 00CC 0143435020ccp$fcb db 1,'CCP ','COM',0,0,0,0
116 00DC ds 16
117 00EC 000000 fcb$nr db 0,0,0
118
119 00EF 0326CFFF07init$table db 3,p$zpio$3a,0CFh,0FFh,07h ; set up config port
120 00F4 0327CF0007 db 3,p$zpio$3b,0CFh,000h,07h ; set up bank port
121 00F9 012500 db 1,p$bank$select,0 ; select bank 0
122 00FC 00 db 0
123
BANKED FFFF 6# 18
BC 0000
BDOS 0005 16# 98 101 104 107
CCPFCB 00CC 51 53 57 115#
CCPMSG 00AB 74 112#
DE 0002
FALSE 0000 4#
FCBNR 00EC 52 117#
HL 0004
INITTABLE 00EF 30 119#
IX 0004
IY 0004
LD1 0030 62# 69
NOCCP 004A 54 73#
OPEN 0073 53 97#
OUTBLOCKS 0025 30 34# 40
PBANKSELECT 0025 121
PBAUDCON1 000C
PBAUDCON2 0030
PBAUDCON34 0031
PBAUDLPT1 000E
DIGITAL RESEARCH™
I-3
ACS 8000-15 BIOS Modules
PBAUDLPT2 0032
PBOOT 0014
PCENTDATA 0011
PCENTSTAT 0010
PCON2DATA 002C
PCON2STAT 002D
PCON3DATA 002E
PCON3STAT 002F
PCON4DATA 002A
PCON4STAT 002B
PCONFIGURATION 0024
PCRTDATA 001C
PCRTSTAT 001D
PFDCMND 0004
PFDDATA 0007
PFDINT 0008
PFDMISC 0009
PFDSECTOR 0006
PFDSTAT 0004
PFDTRACK 0005
PINDEX 000F
PLPT2DATA 0028
PLPT2STAT 0029
PLPTDATA 001E
PLPTSTAT 001F
PRTC 0033
PSELECT 0008
PWD1797 0004
PZCTC1 000C
PZCTC2 0030
PZDART 001C
PZDMA 0000
PZPIO1 0008
PZPIO1A 000A
PZPIO1B 000B
PZPIO2 0010
PZPIO2A 0012
PZPIO2B 0013
PZPIO3 0024
PZPIO3A 0026 119
PZPIO3B 0027 120
PZSIO1 0028
PZSIO2 002C
READ 0082 57 106#
RL1 005C 81# 88
SETDMA 0078 55 100#
SETMULTI 007D 56 103#
SIGNONMSG 0087 31 110#
TPABANK 0001 19# 21# 63 84
TRUE FFFF 3# 4 6
?BNKSL 0000 11 63 65 70 82 84
?CONIN 0000 9 75
?INIT 0000 8 26#
?LDCCP 0000 8 49# 76
?PMSG 0000 9 31 74
?RLCCP 0056 8 79#
DIGITAL RESEARCH™
I-4
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-5
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-6
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-7
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-8
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-9
ACS 8000-15 BIOS Modules
PZDART 001C
PZDMA 0000
PZPIO1 0008
PZPIO1A 000A
PZPIO1B 000B
PZPIO2 0010
PZPIO2A 0012 182
PZPIO2B 0013 181
PZPIO3 0024
PZPIO3A 0026
PZPIO3B 0027
PZSIO1 0028
PZSIO2 002C
SERIALINITTBL 0135 46 169#
SIOPORT 013A 43 175#
SIOREG4 013F 38 177#
SPEED 0138 40 173#
SPEEDTABLE 0125 39 167#
STREAMOUT 0045 47 52# 58
?CI 0053 16 61#
?CINIT 0000 16 27#
?CIST 006A 16 65 76#
?CO 0085 16 93#
?COST 00BB 16 99 116#
@CTBL 00EC 17 33 143#
DIGITAL RESEARCH™
I-10
ACS 8000-15 BIOS Modules
FDSD1 0000 2 6
@DTBL 0000 1 6#
DIGITAL RESEARCH™
I-11
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-12
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-13
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-14
ACS 8000-15 BIOS Modules
208 0107 7E321202 mov a,m ! sta select$mask ; get select mask and save it
209 010B D308 out p$select ; select drive
210 more$retries:
211 010D 0E0A mvi c,10 ; allow 10 retries
212 retry$operation:
213 010F C5 push b ; save retry counter
214
215 0110 3A12022113 lda select$mask ! lxi h,old$select ! cmp m
216 0117 77 mov m,a
217 0118 C22D01 jnz new$track ; if not same drive as last, seek
218
219 011B 3A00002114 lda @trk ! lxi h,old$track ! cmp m
220 0122 77 mov m,a
221 0123 C22D01 jnz new$track ; if not same track, then seek
222
223 0126 DB09E602C2 in p$fdmisc ! ani 2 ! jnz same$track ; head still loaded, we are OK
224
225 new$track: ; or drive or unloaded head means we should . . .
226 012D CDA901 call check$seek ; . . read address and seek if wrong track
227
228 0130 011B41 lxi b,16667 ; 100 ms / (24 t states*250 ns)
229 spin$loop: ; wait for head/seek settling
230 0133 0B dcx b
231 0134 78B1 mov a,b ! ora c
232 0136 C23301 jnz spin$loop
233
234 same$track:
235 0139 3A0000D305 lda @trk ! out p$fdtrack ; give 1797 track
236 013E 3A0000D306 lda @sect ! out p$fdsector ; and sector
237
238 0143 219A02 lxi h,dma$block ; point to dma command block
239 0146 010011 lxi b,dmab$length*256 + p$zdma ; command block length and port address
240 outir ; send commands to Z80 DMA
241 0149+EDB3 DB 0EDH,0B3H
242
243 014B DB25 in p$bankselect ; get old value of bank select port
244 014D E63F47 ani 3Fh ! mov b,a ; mask off DMA bank and save
245 0150 3A00000F0F lda @dbnk ! rrc ! rrc ; get DMA bank to 2 hi-order bits
246 0155 E6C0B0 ani 0C0h ! ora b ; merge with other bank stuff
247 0158 D325 out p$bankselect ; and select the correct DMA bank
248
249 015A 3A1102 lda disk$command ; get 1797 command
250 015D CDD501 call exec$command ; start it then wait for IREQ and read status
251 0160 321502 sta disk$status ; save status for error messages
252
253 0163 C1 pop b ; recover retry counter
254 0164 B7C8 ora a ! rz ; check status and return to BDOS if no error
255
256 0166 E610 ani 0001$0000b ; see if record not found error
257 0168 C4A901 cnz check$seek ; if a record not found, we might need to seek
258
259 016B 0DC20F01 dcr c ! jnz retry$operation
260
261 ; suppress error message if BDOS is returning errors to application...
262
263 016F 3A0000FEFF lda @ermde ! cpi 0FFh ! jz hard$error
DIGITAL RESEARCH™
I-15
ACS 8000-15 BIOS Modules
264
265 ; Had permanent error, print message like:
266
267 ; BIOS Err on d: T-nn, S-mm, <operation> <type>, Retry ?
268
269 0177 CD0000 call ?pderr ; print message header
270
271 017A 2A2702CD00 lhld operation$name ! call ?pmsg ; last function
272
273 ; then, messages for all indicated error bits
274
275 0180 3A1502 lda disk$status ; get status byte from last error
276 0183 212902 lxi h,error$table ; point at table of message addresses
277 errm1:
278 0186 5E235623 mov e,m ! inx h ! mov d,m ! inx h ; get next message address
279 018A 87F5 add a ! push psw ; shift left and push residual bits with status
280 018C EBDC0000EB xchg ! cc ?pmsg ! xchg ; print message, saving table pointer
281 0191 F1C28601 pop psw ! jnz errm1 ; if any more bits left, continue
282
283 0195 218A02CD00 lxi h,error$msg ! call ?pmsg ; print "<BEL>, Retry (Y/N) ? "
284 019B CDF501 call u$conin$echo ; get operator response
285 019E FE59CA0D01 cpi 'Y' ! jz more$retries ; Yes, then retry 10 more times
286 hard$error: ; otherwise,
287 01A3 3E01C9 mvi a,1 ! ret ; return hard error to BDOS
288
289 cancel: ; here to abort job
290 01A6 C30000 jmp ?wboot ; leap directly to warmstart vector
291
292
293 ; subroutine to seek if on wrong track
294 ; called both to set up new track or drive
295
296 check$seek:
297 01A9 C5 push b ; save error counter
298 01AA CDE101 call read$id ; try to read ID, put track in <B>
299 01AD CABE01 jz id$ok ; if OK, we're OK
300 01B0 CDCE01 call step$out ; else step towards Trk 0
301 01B3 CDE101 call read$id ; and try again
302 01B6 CABE01 jz id$ok ; if OK, we're OK
303 01B9 CDD301 call restore ; else, restore the drive
304 01BC 0600 mvi b,0 ; and make like we are at track 0
305 id$ok:
306 01BE 78D305 mov a,b ! out p$fdtrack ; send current track to track port
307 01C1 3A0000B8C1 lda @trk ! cmp b ! pop b ! rz ; if its desired track, we are done
308 01C7 D307 out p$fddata ; else, desired track to data port
309 01C9 3E1A mvi a,00011010b ; seek w/ 10 ms. steps
310 01CB C3D501 jmp exec$command
311
312
313
314 step$out:
315 01CE 3E6A mvi a,01101010b ; step out once at 10 ms.
316 01D0 C3D501 jmp exec$command
317
318 restore:
319 01D3 3E0B mvi a,00001011b ; restore at 15 ms
DIGITAL RESEARCH™
I-16
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-17
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-18
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-19
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-20
ACS 8000-15 BIOS Modules
Listing I-5. Bank and Move Module for CP/M 3 Linked BIOS
1 title 'bank & move module for CP/M3 linked BIOS'
2
3 cseg
4
5 public ?move,?xmove,?bank
6 extrn @cbnk
7
8 maclib z80
9 maclib ports
10
11 ?xmove: ; ALTOS can't perform interbank moves
12 0000 C9 ret
13
14 ?move:
15 0001 EB xchg ; we are passed source in DE and dest in HL
16 ldir ; use Z80 block move instruction
17 0002+EDB0 DB 0EDH,0B0H
18 0004 EB xchg ; need next addresses in same regs
19 0005 C9 ret
DIGITAL RESEARCH™
I-21
ACS 8000-15 BIOS Modules
20
21 ; by exiting through bank select
22 ?bank:
23 0006 C5 push b ; save register b for temp
24 0007 171717E618 ral ! ral ! ral ! ani 18h ; isolate bank in proper bit position
25 000C 47 mov b,a ; save in reg B
26 000D DB25 in p$bankselect ; get old memory control byte
27 000F E6E7B0 ani 0E7h ! ora b ; mask out old and merge in new
28 0012 D325 out p$bankselect ; put new memory control byte
29 0014 C1 pop b ; restore register b
30 0015 C9 ret
31
32 ; 128 bytes at a time
33
34 0016 end
BC 0000
DE 0002
HL 0004
IX 0004
IY 0004
PBANKSELECT 0025 26 28
PBAUDCON1 000C
PBAUDCON2 0030
PBAUDCON34 0031
PBAUDLPT1 000E
PBAUDLPT2 0032
PBOOT 0014
PCENTDATA 0011
PCENTSTAT 0010
PCON2DATA 002C
PCON2STAT 002D
PCON3DATA 002E
PCON3STAT 002F
PCON4DATA 002A
PCON4STAT 002B
PCONFIGURATION 0024
PCRTDATA 001C
PCRTSTAT 001D
PFDCMND 0004
PFDDATA 0007
PFDINT 0008
PFDMISC 0009
PFDSECTOR 0006
PFDSTAT 0004
PFDTRACK 0005
PINDEX 000F
PLPT2DATA 0028
PLPT2STAT 0029
PLPTDATA 001E
PLPTSTAT 001F
PRTC 0033
PSELECT 0008
PWD1797 0004
PZCTC1 000C
PZCTC2 0030
PZDART 001C
DIGITAL RESEARCH™
I-22
ACS 8000-15 BIOS Modules
PZDMA 0000
PZPIO1 0008
PZPIO1A 000A
PZPIO1B 000B
PZPIO2 0010
PZPIO2A 0012
PZPIO2B 0013
PZPIO3 0024
PZPIO3A 0026
PZPIO3B 0027
PZSIO1 0028
PZSIO2 002C
?BANK 0006 5 22#
?MOVE 0001 5 14#
?XMOVE 0000 5 11#
@CBNK 0000 6
; chip bases
p$zdma equ 0
p$wd1797 equ 4
p$zpio1 equ 8
p$zctc1 equ 12
p$zpio2 equ 16
p$boot equ 20 ; OUT disables boot EPROM
p$zdart equ 28 ; console 1 and printer 1
p$zpio3 equ 36
p$zsio1 equ 40
p$zsio2 equ 44
p$zctc2 equ 48
DIGITAL RESEARCH™
I-23
ACS 8000-15 BIOS Modules
; parallel I/O 1
DIGITAL RESEARCH™
I-24
ACS 8000-15 BIOS Modules
DIGITAL RESEARCH™
I-25
ACS 8000-15 BIOS Modules
; Submit file to build sample BIOS for ACS 8000-15 single-density system
;
rmac bioskrnl
rmac boot
rmac move
rmac chario
rmac drvtbl
rmac fd1797sd
rmac scb
link bnkbios3[b,q]=bioskrnl,boot,move,chario,drvtbl,fd17975d,scb
gencpm
End of Appendix I
DIGITAL RESEARCH™
I-26
Public Entry Points for CP/M 3 Sample BIOS Modules
Appendix J
Public Entry Points for
CP/M 3 Sample BIOS Modules
Table J-1. Public Entry Points for CP/M 3 Sample BIOS Modules
Module Public Function Input Parameter Return Value
Name Entry Point
BIOSKRNL
?PMSG Print Message HL points to msg none
?PDEC Print Decimal HL=number none
?PDERR Print BIOS Disk Err none none
Msg Header
CHARIO
?CINIT Char Dev Init C=Phys Dev # none
Dev Parms in
@CTBL
?CIST Char Inp Dev St B=Phys Dev # A=00 if no input
A=0FFH if input
char available
?COST Char Out Dev St B=Phys Dev # A=00 if output busy
A=0FFH if output
ready
?CI Char Dev Input B=Phys Dev # A=next available
input char
?CO Char Dev Output B=Phys Dev #
C=Input Char
MOVE
?MOVE Memory to Memory BC=byte count DE, HL point to
Move DE=start source adr next bytes after move
HL=star dest adr
DIGITAL RESEARCH™
J-1
Public Entry Points for CP/M 3 Sample BIOS Modules
BOOT
?INIT System Init none none
?LDCCP Load CCP none none
?RLCCP Reload CCP none none
?TIME Get/Set Time C=000H if get none
C=0FFH if set
End of Appendix J
DIGITAL RESEARCH™
J-2
CP/M System Guide
Appendix K
Public Data Items in CP/M 3
Sample BIOS Modules
CHARIO
@CTBL Character Device Table
DRVTBL
@DTBL Drive Table
End of Appendix K
DIGITAL RESEARCH™
K-1
CP/M System Guide
DIGITAL RESEARCH™
K-2
CP/M System Guide
Appendix L
CP/M 3 BIOS Function
Summary
DIGITAL RESEARCH™
L-1
CP/M System Guide
DIGITAL RESEARCH™
L-2
CP/M System Guide
End of Appendix L
DIGITAL RESEARCH™
L-3
CP/M System Guide
DIGITAL RESEARCH™
L-4
Index
Symbols @DATE. . . . . . . . . . . . . . . . . . . . 3-3, 3-6
@DBNK . . . . . . . . . . . . . . . . . . . 4-6, 4-8
? . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2, 5-4 ?DEVIN. . . . . . . . . . . . . . . . . . . . . . . 4-10
restrictions on use. . . . . . . . . . . . . 4-4 @DMA. . . . . . . . . . . . . . . . . . . . . 4-6, 4-8
@ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 ?DRTBL. . . . . . . . . . . . . . . . . . . . . . . 4-10
restriction on use. . . . . . . . . . . . . . 4-4 @DTBL. . . . . . . . . . . . . . . . . . . . . . . . 4-7
$ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-2 ?DVTBL . . . . . . . . . . . . . . . . . . . . . . 4-10
$B. . . . . . . . . . . . . . . . . . . . . . . . . 5-22, 6-2 @ERDSK. . . . . . . . . . . . . . . . . . . 3-3, 3-4
@ADRV. . . . . . . . . . . . . . . . . . . . 4-6, 4-8 ?ERJMP. . . . . . . . . . . . . . . . . . . . 3-3, 3-7
@AIVEC. . . . . . . . . . . . . . . . . . . 3-2, 3-4 @ERMDE. . . . . . . . . . . . . . . . . . 3-3, 3-5
@AOVEC. . . . . . . . . . . . . . . . . . 3-2, 3-4 ?FLUSH. . . . . . . . . . . . . . . . . . . . . . . 4-10
?AUXI. . . . . . . . . . . . . . . . . . . . . . . . . . 4-9 @FX . . . . . . . . . . . . . . . . . . . . . . . 3-3, 3-4
?AUXIS . . . . . . . . . . . . . . . . . . . . . . . 4-10 ?HOME. . . . . . . . . . . . . . . . . . . . . . . . 4-9
?AUXO. . . . . . . . . . . . . . . . . . . . . . . . . 4-9 @HOUR. . . . . . . . . . . . . . . . . . . 3-3, 3-6
?AUXOS . . . . . . . . . . . . . . . . . . . . . . 4-10 ?INIT . . . . . . . . . . . . . . . . . . . . . 4-7, 4-10
?BANK. . . . . . . . . . . . . . . . . . . . . . . . . 4-7 ?LDCCP . . . . . . . . . . . . . . . . . . 4-7, 4-11
@BFLGS. . . . . . . . . . . . . . . . . . . 3-3, 3-5 ?LIST. . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
@BNKBF . . . . . . . . . . . . . . . . . . 3-3, 3-4 ?LISTS . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
?BNKSL. . . . . . . . . . . . . . . . . . . . . . . 4-10 @LOVEC. . . . . . . . . . . . . . . . . . 3-2, 3-4
?BOOT. . . . . . . . . . . . . . . . . . . . . . . . . 4-9 @MEDIA . . . . . . . . . . . . . . . . . . 3-3, 3-5
@CBNK . . . . . . . . . . . . . . . . . . . 4-6, 4-8 @MIN . . . . . . . . . . . . . . . . . . . . . 3-3, 3-6
?CI. . . . . . . . . . . . . . . . . . . . . . . . 4-7, 4-13 ?MLTIO. . . . . . . . . . . . . . . . . . . . . . . 4-10
?CINIT. . . . . . . . . . . . . . . . . . . . 4-7, 4-14 @MLTIO . . . . . . . . . . . . . . . . . . 3-3, 3-5
?CIST. . . . . . . . . . . . . . . . . . . . . 4-7, 4-14 ?MOV. . . . . . . . . . . . . . . . . . . . . . . . . 4-10
@CIVEC. . . . . . . . . . . . . . . . . . . 3-2, 3-4 ?MOVE . . . . . . . . . . . . . . . . . . . . . . . . 4-7
@CNT. . . . . . . . . . . . . . . . . . . . . 4-6, 4-8 @MXTPA. . . . . . . . . . . . . . . . . . 3-3, 3-8
?CO. . . . . . . . . . . . . . . . . . . . . . . 4-7, 4-13 ?PDEC. . . . . . . . . . . . . . . . . . . . . 4-7, 4-9
?CONIN. . . . . . . . . . . . . . . . . . . . . . . 4-9 ?PDERR. . . . . . . . . . . . . . . . . . . . 4-7, 4-9
?CONO. . . . . . . . . . . . . . . . . . . . . . . . 4-9 ?PMSG. . . . . . . . . . . . . . . . . . . . . 4-7, 4-9
?CONOS. . . . . . . . . . . . . . . . . . . . . . 4-10 @RDRV. . . . . . . . . . . . . . . . . . . . 4-7, 4-8
?CONST. . . . . . . . . . . . . . . . . . . . . . . 4-9 ?READ. . . . . . . . . . . . . . . . . . . . . . . . . 4-9
?COST. . . . . . . . . . . . . . . . . . . . 4-7, 4-14 @RESEL . . . . . . . . . . . . . . . . . . . 3-3, 3-4
@COVEC. . . . . . . . . . . . . . . . . . 3-2, 3-4 ?RLCCP. . . . . . . . . . . . . . . . . . . 4-7, 4-11
@CRDMA. . . . . . . . . . . . . . . . . 3-3, 3-4 ?SCTRN . . . . . . . . . . . . . . . . . . . . . . . 4-9
@CRDSK. . . . . . . . . . . . . . . . . . 3-3, 3-4 @SEC. . . . . . . . . . . . . . . . . . . . . . 3-3, 3-6
@CTBL. . . . . . . . . . . . . . . . . . . . . . . . 4-6 @SECT . . . . . . . . . . . . . . . . . . . . 4-7, 4-8
DIGITAL RESEARCH™
Index-1
?SLDSK. . . . . . . . . . . . . . . . . . . . . . . . 4-9 B
?STBNK. . . . . . . . . . . . . . . . . . . . . . . 4-10
?STDMA. . . . . . . . . . . . . . . . . . . . . . . 4-9 backspace. . . . . . . . . . . . . . . . . . . . . . . 5-6
?STSEC . . . . . . . . . . . . . . . . . . . . . . . . 4-9 bank
?STTRK. . . . . . . . . . . . . . . . . . . . . . . . 4-9 0 . . . . . . . . . . . . . . . . . . . . . . . . 1-5, 1-7
?TIM. . . . . . . . . . . . . . . . . . . . . . . . . . 4-10 1 . . . . . . . . . . . . . . . . . . . . . . . . 1-5, 1-7
?TIME . . . . . . . . . . . . . . . . . . . . . . . . . 4-7 banked BIOS
@TRK . . . . . . . . . . . . . . . . . . . . . 4-7, 4-8 assembling. . . . . . . . . . . . . . . . . . . 3-54
@USRCD. . . . . . . . . . . . . . . . . . 3-3, 3-4 linking . . . . . . . . . . . . . . . . . . . . . . 3-55
@VINFO. . . . . . . . . . . . . . . . . . . 3-3, 3-4 preparing. . . . . . . . . . . . . . . . . . . . 3-54
?WBOOT. . . . . . . . . . . . . . . . . . . . . . 4-9 banked memory
?WRITE. . . . . . . . . . . . . . . . . . . . . . . . 4-9 buffer control block . . . . . . . . . . 3-23
?XMOV. . . . . . . . . . . . . . . . . . . . . . . 4-10 banked system
?XMOVE. . . . . . . . . . . . . . . . . . . . . . . 4-7 allocation vector. . . . . . . . . . . . . . 3-16
BANK field. . . . . . . . . . . . . . . . . . 3-25
A BCD data structures. . . . . . . . . . 3-25
BDOS and BIOS, in Bank 0. . . 1-10
AL0 and AL1 . . . . . . . . . . . . . . . . . . 3-21 BDOS and BIOS, in common me-
allocation units. . . . . . . . . . . . . . . . . 3-19 mory. . . . . . . . . . . . . . . . . . . . . . 1-10
allocation vector. . . . . . . . . . . . 3-10, 5-3 common memory . . . . . . . . 1-5, 3-10
See also ALV with Bank 1 enabled. . . . . . . . . . . 1-7
ALV BANK field. . . . . . . . . . . . . . . 3-23, 3-25
banked system . . . . . . . . . . . . . . . 3-16 bank number
double. . . . . . . . . . . . . . . . . . . . . . . . 5-7 current. . . . . . . . . . . . . . . . . . . . . . 2-13
double-bit . . . . . . . . . . . . . . . . . . . 3-16 bank-switched memory. . . . . . . . . . . 1-7
single-bit . . . . . . . . . . . . . . . . . . . . 3-16 block moves and memory selects. . . . .
assembler source file. . . . . . . . . . . . . . 4-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
assembly language organization. . . . . . . . . . . . . . . . . 1-10
cross-reference program. . . . . . . . E-1 requirements. . . . . . . . . . . . . . 1-2, 1-9
sources . . . . . . . . . . . . . . . . . . . . . . . E-1 Basic Disk Operating System
assembly-time arithmetic. . . . . . . . . 3-2 See BDOS
assignment vector. . . . . . . . . . . . . . . . 4-5 Basic Input Output System
auto-density support. . . . . . . . . . . . . B-1 See BIOS
AUTO DISPLAY parameter . . . . . 5-3 baud rate
automatic login feature. . . . . . . . . . 3-19 current. . . . . . . . . . . . . . . . . . . . . . . 3-8
AUTO parameter. . . . . . . . . . . . . . . . 5-3 serial device. . . . . . . . . . . . . . . . . . 4-12
AUXIN. . . . . . . 2-2, 2-4, 2-7, 3-30, 3-39 BDOS. . . . . . . . . . . . . . . . . . . . . . 1-2, 2-1
AUXIST. . . . . . . . . . 2-3, 2-4, 3-31, 3-40 disk I/O. . . . . . . . . . . . . . . . . . . . . . 2-8
AUXOST. . . . . . . . . 2-3, 2-4, 3-31, 3-41 flags. . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
AUXOUT. . . . 2-2, 2-4, 2-7, 3-30, 3-39 Function 44. . . . . . . . . . . . . . . . . . 3-34
DIGITAL RESEARCH™
Index-2
Function 49. . . . . . . . . . . . . . . . . . . 1-4 17 . . . . . . . . . . . . . 3-31, 3-40, C-3, L-2
Function 50. . . . . . . . . . . . . . . . . . . 2-3 18 . . . . . . . . . . . . . 3-31, 3-40, C-3, L-2
JMP. . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 19 . . . . . . . . . . . . . 3-31, 3-41, C-3, L-2
Binary Coded Decimal (BCD) 20 . . . . . . . . . . . . . 3-31, 3-34, C-3, L-2
fields. . . . . . . . . . . . . . . . . . . . . . . . . 3-6 21 . . . . . . . . . . . . . 3-31, 3-35, C-3, L-2
format. . . . . . . . . . . . . . . . . . . . . . . 2-14 22 . . . . . . . . . . . . . 3-31, 3-35, C-3, L-2
BIOS. . . . . . . . . . . . . . . . . . . 1-1, 1-2, 2-1 23 . . . . . . . . . . . . . 3-31, 3-47, C-3, L-2
assembling. . . . . . . . . . . . . . . . . . . 3-54 24 . . . . . . . . . . . . . 3-31, 3-48, C-4, L-2
calls. . . . . . . . . . . . . . . . . . . . . . . . . . 2-8 25 . . . . . . . . . . . . . 3-32, 3-49, C-4, L-2
cold start . . . . . . . . . . . . . . . . . . . . 5-23 26 . . . . . . . . . . . . . 3-32, 3-51, C-4, L-2
customizing. . . . . . . . . . . . . . 1-5, 1-12 27 . . . . . . . . . . . . . 3-32, 3-50, C-4, L-2
debugging . . . . . . . . . . . . . . . 5-22, 6-1 28 . . . . . . . . . . . . . 3-32, 3-50, C-4, L-2
disk data structures. . . . . . . . . . . 3-10 29 . . . . . . . . . . . . . 3-32, 3-51, C-4, L-3
entry points. . . . . . . . . 2-2, 3-29, 4-10 BIOS functions
error message header. . . . . . . . . . 4-20 list. . . . . . . . . . . . . . . . . . . . . . 3-30, C-1
flush buffers. . . . . . . . . . . . . . . . . . 3-48 summary . . . . . . . . . . . . . . . . . . . . . L-1
media flag . . . . . . . . . . . . . . . . . . . . A-2 BIOS jump vector . . . . . . . . . . 2-2, 3-29
new functions. . . . . . . . . . . . . . . . . C-3 public names. . . . . . . . . . . . . . . . . . 4-9
organization. . . . . . . . . . . . . . . . . . 2-1 BIOSKRNL.ASM. . . . . . . 4-1, 4-2, 4-4
routines . . . . . . . . . . . . . . . . . . . . . . 1-3 equate statement . . . . . . . . . . . . . . 4-2
subroutine entry points. . 3-29, 4-19 global variables. . . . . . . . . . . . . . . . 4-8
subroutines. . . . . . . . . . . . . . . . . . . 2-4 modification restriction. . . . . . . . 4-2
BIOS function calls nonbanked system. . . . . . . . . . . . . 4-2
0 . . . . . . . . . . . . . 3-30, 3-32, C-1, L-1 public utility subroutines. . . . . . . 4-9
1 . . . . . . . . . . . . . 3-30, 3-33, C-1, L-1 BIOS modules. . . . . . . . . . . . . . . 4-1, 4-3
2 . . . . . . . . . . . . . 3-30, 3-37, C-2, L-1 conventions. . . . . . . . . . . . . . . . . . . 4-3
3 . . . . . . . . . . . . . 3-30, 3-38, C-2, L-1 external names. . . . . . . . . . . . . . . . 4-3
4 . . . . . . . . . . . . . 3-30, 3-38, C-2, L-1 external reference. . . . . . . . . . . . . . 4-3
5 . . . . . . . . . . . . . 3-30, 3-38, C-2, L-1 functional summary . . . . . . . . . . . 4-2
6 . . . . . . . . . . . . . 3-30, 3-39, C-2, L-1 BLM . . . . . . . . . . . . . . . . . . . . . 3-18, 3-20
7 . . . . . . . . . . . . . 3-30, 3-39, C-2, L-1 block
8 . . . . . . . . . . . . . 3-30, 3-41, C-2, L-1 mask. . . . . . . . . . . . . . . . . . . 3-18, 3-20
9 . . . . . . . . . . . . . 3-30, 3-42, C-2, L-1 shift factor. . . . . . . . . . . . . . 3-18, 3-20
10 . . . . . . . . . . . . . 3-31, 3-43, C-2, L-1 size restriction. . . . . . . . . . . . . . . . 3-19
11 . . . . . . . . . . . . . 3-31, 3-43, C-2, L-1 transfers (memory-to-memory). 2-13
12 . . . . . . . . . . . . . 3-31, 3-43, C-2, L-1 blocking/deblocking. . . . . . . . . . . . 3-36
13 . . . . . . . . . . . . . 3-31, 3-44, C-3, L-1 in BIOS. . . . . . . . . . . 3-34, 3-45, 3-48
14 . . . . . . . . . . . . . 3-31, 3-45, C-3, L-2 blocking logical
15 . . . . . . . . . . . . . 3-31, 3-40, C-3, L-2 128-byte records . . . . . . . . . . . . . 2-11
16 . . . . . . . . . . . . . 3-31, 3-46, C-3, L-2 BOOT . . . . . . . . . . . . . . . 2-4, 3-30, 3-32
DIGITAL RESEARCH™
Index-3
entry point. . . . . . . . . . . . . . . . . . . 5-21 data structures . . . . . . . . . . . . . . . . 3-8
JMP. . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 interface routines. . . . . . . . . . . . . . 4-5
BOOT.ASM. . . . . . . . . . . . . . . . . . . . 4-1 machine-dependent . . . . . . . . . . 4-12
module. . . . . . . . . . . . . . . . . . . . 4-2, I-1 operation. . . . . . . . . . . . . . . . . . . . . 4-5
booting CP/M 3. . . . . . . . . . . . . . . . 5-23 redirection. . . . . . . . . . . . . . . . . . . 4-11
boot loader. . . . . . . . . . . . . . . . . . . . . 5-23 CHARIO.ASM. . . . . . . . . . . . . . . . . 4-1
module. . . . . . . . . . . . . . . . . . . . . . . . I-1 module. . . . . . . . . . . . . . . . . . . . . . . 4-3
boot ROMs. . . . . . . . . . . . . . . . . . . . 3-32 CHARIO module. . . . . . . . . . 4-5, 4-11
BOOT routine. . . . . . . . . . . . . . . . . . 2-5 checksumming
BSH. . . . . . . . . . . . . . . . . . . . . . 3-18, 3-20 full directory. . . . . . . . . . . . . . . . . 3-19
Buffer Control Block. . . . . . . 3-10, 3-16 checksum vectors. . . . . . 3-10, 3-14, 5-3
fields. . . . . . . . . . . . . . . . . . . . . . . . 3-24 clusters
format. . . . . . . . . . . . . . . . . . . . . . . 3-23 See block
buffer definitions . . . . . . . . . . . . . . . 5-12 Cold Boot
buffering scheme. . . . . . . . . . . . 1-9, 2-11 Loader . . . . . . . . . . . . 1-12, 1-15, 3-32
buffers. . . . . . . . . . . . . . . . . . . . . . . . . 3-25 passpoint. . . . . . . . . . . . . . . . . . . . . 6-4
Blocking/Deblocking. . . . . . . . . 5-10 process . . . . . . . . . . . . . . . . . . . . . . 1-15
dirty . . . . . . . . . . . . . . . . . . . . . . . . 3-48 cold start. . . . . . . . . . . . . . 1-12, 5-23, I-1
pending . . . . . . . . . . . . . . . . . . . . . 3-34 initialization. . . . . . . . . . . . . . . . . 1-15
buffer space. . . . . . . . . . . . . . . . . 1-9, 2-11 loader. . . . . . . . . . . . . . . 2-1, 2-6, 5-23
allocation. . . . . . . . . . . . . . . . 2-1, 5-10 common memory. 1-5, 1-12, 3-10, 3-53
hardware-dependent. . . . . . . . . . . 1-6 banked system . . . . . . . . . . . . . . . 3-10
base page . . . . . . . . . . . . . . . . . . . . . 5-7
C BIOS data structures . . . . . . . . . 3-52
CCP. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 CONIN. . . . . . 2-2, 2-4, 2-7, 3-30, 3-38
flags. . . . . . . . . . . . . . . . . . . . . . . . . . 1-4 CONOST. . . . . . . . 2-3, 2-4, 3-31, 3-40
loading into TPA. . . . . . . . . . . . . 4-11 CONOUT . . . 2-2, 2-4, 2-7, 3-30, 3-38
CCP.COM . . . . . . . . . . . . . . . . 1-15, 2-5 Console Command Processor
character device. . . . . . . . . . . . . . . . . . 4-5 See CCP
characteristics table. . . . . . . . . . . . . I-5 console output. . . . . . . . . . . . . . . . . . 1-14
initialization. . . . . . . . . . . . . . . . . 4-14 call. . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
input. . . . . . . . . . . . . . . . . . . . . . . . 4-13 function. . . . . . . . . . . . . . . . . . . . . . 1-3
interfacing. . . . . . . . . . . . . . . . . . . 4-11 CONST. . . . . . . . . . 2-2, 2-4, 3-30, 3-37
labels. . . . . . . . . . . . . . . . . . . . . . . . 4-13 COPYSYS utility. . . . . . . . . . 5-19, 5-24
output. . . . . . . . . . . . . . . . . . . . . . . 4-13 CP/M 2 BIOS modification. . . . . . C-1
table (@CTBL). . . . . . . . . . . . . . . 4-5 CP/M 3
character devices See also BIOS
logical to physical redirection. . . 4-5 customizing hardware. . . . . . . . . 1-13
character I/O. . . . . . . . . . . . . . . . . . . . 2-7 Linked BIOS Bank/Move Module. . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . I-21
DIGITAL RESEARCH™
Index-4
loading into memory . . . . . . . . . 1-15 DEVINI. . . . . . . . . . 2-3, 2-4, 3-31, 3-35
CPM3.SYS. . . . . . . . . . . . . . . . . . . . . . 1-2 DEVTBL. . . . . . . . . 2-3, 2-4, 3-31, 3-34
file. . . . . . . . . . . . . . . . . 1-13, 1-15, 2-6 Direct Memory Access
file format . . . . . . . . . . . . . . . . . . . . D-1 See DMA
loading into memory . . . . . . . . . 5-19 directory
CPMLDR . . . . . . . . 1-6, 2-6, 5-19, 5-22 buffers. . . . . . . 2-11, 3-10, 3-24, 5-10
sign-on message. . . . . . . . . . . . . . 5-23 caches. . . . . . . . . . . . . . . . . . . . . . . 2-12
utility . . . . . . . . . . . . . . . . . . . . . . . 5-22 checksumming. . . . . . . . . . . . . . . 3-19
CPMLDR_BDOS. . . . . . . . . . . . . . 1-14 entries. . . . . . . . . . . . . . . . . . . 1-1, 3-22
CPMLDR_BIOS. . . . . . . . . . . . . . . 1-14 hashing. . . . . . . . . . . . . . . . . . . . . . 3-17
CPMLDR.COM. . . . . . . . . . . . . . . 5-20 hash tables. . . . . . . . . . . 1-6, 1-11, 5-9
CTRL-C . . . . . . . . . . . . . . . . . . . . . . 3-16 records. . . . . . . . . . . . . . . . . . . . . . 2-11
CTRL-Z. . . . . . . . . . . . . . . . . . . 2-8, 3-36 region. . . . . . . . . . . . . . . . . . . . . . . 1-12
Customizing CP/M 3. . . . . . . . . . . 1-13 search. . . . . . . . . . . . . . . . . . . . . . . 2-12
disk
D accesses. . . . . . . . . . . . . . . . . . 2-6, 2-12
data compatibility . . . . . . . . . . . . . . . . 1-12
block allocation size . . . . . . . . . . 3-18 controller. . . . . . . . . . . . . . . . . . . . 4-18
buffers. . . . . . . . 1-6, 2-12, 3-24, 5-10 density automatically determined. . . .
record buffers. . . . . . . . . . . . . . . . 2-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
record caching . . . . . . . . . . . . . . . 2-11 drives. . . . . . . . . . . . . . . 1-13, A-1, B-1
region. . . . . . . . . . . . . . . . . . . . . . . 1-12 I/O . . . . . . . . . . . . . . . . . . 2-1, 4-1, 4-2
data structures. . . . . . . . . . . . . 3-25, I-10 organization. . . . . . . . . . . . . . . . . 1-12
in common memory. . . . . . . . . . 3-52 subsystem. . . . . . . . . . . . . . . 3-10, 3-46
DDT. . . . . . . . . . . . . . . . . . . . . . . . . . 5-22 disk formats
deblocking buffers . . . . . . . . . . 1-9, 2-11 multiple. . . . . . . . . . . . . . . . . . . . . . B-1
deblocking logical 128-byte records. . . . . Disk Parameter Block. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11 . . . . . . . . . . 2-11, 3-10, 3-14, B-1, I-11
debugger. . . . . . . . . . . . . . . . . . . . . . . . 6-1 banked system . . . . . . . . . . . . . . . 3-10
debugging DPB macro. . . . . . . . . . . . . . . . . . 3-28
BIOS. . . . . . . . . . . . . . . . . . . . 5-22, 6-1 fields. . . . . . . . . . . . . . . . . . . . . . . . 3-18
with SID . . . . . . . . . . . . . . . . 5-22, 6-1 format. . . . . . . . . . . . . . . . . . . . . . . 3-18
default value with question mark. . 5-4 Disk Parameter Header. . . . . . . . . . . . . . . .
density selection . . . . 2-11, 3-10, 3-12, 3-42, B-1, I-11
automatic. . . . . . . . . . . . . . . . . . . . 3-45 DPH macro . . . . . . . . . . . . . . . . . 3-27
density-sensing . . . . . . . . . . . . . . . . . 3-42 fields. . . . . . . . . . . . . . . . . . . . . . . . 3-13
device name format. . . . . . . . . . . . . . . . . . . . . . . 3-13
format. . . . . . . . . . . . . . . . . . . . . . . 4-12 regular . . . . . . . . . . . . . . . . . . . . . . 4-18
DEVICE utility . . . . . . . . . . . . . 2-8, 4-5 disks
distribution. . . . . . . . . . . . . . . . . . . 1-2
DIGITAL RESEARCH™
Index-5
double-density. . . . . . . . . . . . . . . 3-21 for Mode Byte Bit Fields. . . . . . . G-1
number supported. . . . . . . . . . . . . 1-1 erased character. . . . . . . . . . . . . . . . . . 5-6
physical sector size. . . . . . . . . . . . 3-22 error
reformatting. . . . . . . . . . . . . . . . . 3-21 code. . . . . . . . . . . . . . . . . . . . . 2-12, 3-7
DMA. . . . . . . . . . . . . . . . . . . . . . . . . . . I-11 handling. . . . . . . . . . . . . . . . . . . . . 4-20
address. . . . . . . . . . . . . . . . . . . . . . . 2-8 in multisector transfer . . . . . . . . 3-47
buffer . . . . . . . . . . . . . . . . . . . . . . . 2-11 nonrecoverable. . . . . . . . . . . . . . . 4-20
controller. . . . . . . . . . . . . . . . . . . . 1-11 error message
dollar sign ($) . . . . . . . . . . . . . . . . . . . D-2 extended. . . . . . . . . . . . . . . . . . . . . . 1-1
DPH error messages
See Disk Parameter Header extended. . . . . . . . . . . . . . . . . . . . . . 3-5
drive in foreign language. . . . . . . . . . . . 3-7
characteristics. . . . . . . . . . . . . . . . 1-14 long. . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
default. . . . . . . . . . . . . . . . . . . . . . . . 5-6 short. . . . . . . . . . . . . . . . . . . . . . . . . 3-5
table. . . . . . . . . . . . . . . . . . . . . 3-12, 4-6 Extended Disk Parameter Header
drive code (XDPH) . . . . . . . . . . . . 4-3, 4-6, 4-15
absolute . . . . . . . . . . . . . . . . . . . . . . 4-8 fields. . . . . . . . . . . . . . . . . . . . . . . . 4-17
DRVTBL. . . . . . . . . 2-3, 2-4, 3-31, 3-35 format. . . . . . . . . . . . . . . . . . . . . . . 4-17
module. . . . . . . . . . . . . . . . . . 4-6, 4-15 Extent mask. . . . . . . . . . . . . . . . . . . . 3-18
DRVTBL.ASM. . . . . . . . . . . . . . . . . 4-1
module. . . . . . . . . . . . . . . . . . . . . . . 4-3 F
dynamic file
allocation of space. . . . . . . . . . . . . 1-1 CPM3.SYS format . . . . . . . . . . . . D-1
disk definition table . . . . . . . . . . 3-42 random access. . . . . . . . . . . . . . . . . 1-1
E storage . . . . . . . . . . . . . . . . . . . . . . 1-12
structure. . . . . . . . . . . . . . . . . . . . . . 1-1
end-of-file. . . . . . . . . . . . . . . . . . . . . . . 2-8 first-time initialization code. . . . . . 4-18
condition. . . . . . . . . . . . . . . . 2-7, 3-36 flag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
entries . . . . . . . . . . . . . . . . . . . . . . . . . 3-18 global system. . . . . . . . . . . . . . . . . . 3-5
entry points media . . . . . . . . . . . . . . . . . . . . . . . 3-14
BIOS subroutine. . . . . . . . . . . . . 4-19 FLUSH. . . . . . . . . . . 2-3, 2-4, 3-31, 3-48
BOOT. . . . . . . . . . . . . . . . . . . . . . 3-32
BOOT module . . . . . . . . . . . . . . 4-10 G
flush buffers. . . . . . . . . . . . . . . . . . 3-48 G command. . . . . . . . . . . . . . . . . . . . . 6-4
MOVE module. . . . . . . . . . . . . . 4-21 GENCPM. . . . . . . . . . . . 1-6, 1-13, 1-14
WBOOT. . . . . . . . . . . . . . . . . . . . 3-33 command input. . . . . . . . . . . . . . . 5-1
entry values. . . . . . . . . . . . . . . . . . . . . . 3-1 directory hashing. . . . . . . . . . . . . 3-17
equates in banked system. . . . . . . . . . . . . . 5-1
absolute external . . . . . . . . . . . . . . 3-1 in nonbanked system . . . . . . . . . . 5-1
DIGITAL RESEARCH™
Index-6
questions. . . . . . . . . . . . . . . . . . . . . 5-4 I/O. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
utility . . . . . . . . 2-12, 3-12, 3-25, 5-1 character . . . . . . . . . . . . 2-7, 4-5, 4-11
devices . . . . . . . . . . . . . . . . . . . . . . 1-13
H disk. . . . . . . . . . . . . . . . . . . . . . 2-8, 4-5
handshaking drivers. . . . . . . . . . . . . . . . . . . . . . . . 4-1
polled. . . . . . . . . . . . . . . . . . 3-40, 3-41 multiple sector. . . . . . . . . . . . . . . 4-21
hardware Port Addresses. . . . . . . . . . . . . . . . I-23
initialization. . . . . . . . . . . . 1-15, 4-10 ports. . . . . . . . . . . . . . . . . . . . . . . . 4-10
requirements. . . . . . . . . . . . . . . . . . 1-1 redirection. . . . . . . . . . . . . . . . . . . . 2-8
special DMA. . . . . . . . . . . . . . . . . 3-49 simple device. . . . . . . . . . . . . . . . . . 1-3
supported. . . . . . . . . . . . . . 1-12, 1-13 IOBYTE facility. . . . . . . . . . . . . . . . 3-34
hardware environment . . 1-3, 1-12, 2-1 I/O redirection bit. . . . . . . . . . . . . . 3-36
banked system . . . . . . . . . . . . . . . 1-12 J
nonbanked system. . . . . . . . . . . . 1-13
hash table. . . . . . . . . . . . . . . . . . . . . . 3-17 JMP. . . . . . . . . . . . . . . . . . . . . . . . 2-2, 2-5
directory . . . . . . . . . . . . . . . . 1-11, 5-9 jump
searches . . . . . . . . . . . . . . . . . . . . . . A-1 address. . . . . . . . . . . . . . . . . . . . . . . 2-3
head number. . . . . . . . . . . . . . . . . . . 3-13 instructions. . . . . . . . . . 2-2, 3-1, 3-30
hexadecimal address. . . . . . . . . . . . . . 1-5 table. . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
high-order vector. . . . . . . . . . . . . . . . 2-2, 2-4, 4-9
bit . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21
byte. . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 L
nibble. . . . . . . . . . . . . . . . . . . . . . . 4-12 LDRBIOS. . . . . . . . . . . 1-14, 3-32, 5-20
HOME. . . . . . . . . . . 2-2, 2-4, 3-30, 3-41 length restriction. . . . . . . . . . . . . 5-21
I linking . . . . . . . . . . . . . . . . . . . . . . 5-21
LDRBIOS.ASM
IBM 3740 disk . . . . . . . . . . . . . . . . . 1-12 assembling. . . . . . . . . . . . . . . . . . . 5-21
INIT. . . . . . . . . . . . . . . . . . . . . 4-18, 4-20 Least Recently Used (LRU) buffering. . .
initialization . . . . . . . . . . . . . . . . . . . . . . . . 1-10, 2-11
basic system. . . . . . . . . . . . . . . . . . 3-32 LINK
cold start . . . . . . . . . . . . . . . . . . . . 1-14 field. . . . . . . . . . . . . . . . . . . . . . . . . 3-23
hardware . . . . . . . . . . . . . . . 3-32, 4-10 L option. . . . . . . . . . . . . . . . . . . . . 5-21
Page Zero. . . . . . . . . . . . . . . . 2-5, 3-33 LINK-80. . . . . . . . . . . . . . . . . . . 3-54, 4-3
system tracks. . . . . . . . . . . . . . . . . 5-24 linker. . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
input . . . . . . . . . . . . . . . . . . . . . . . . . . . . I-5 LIST . . . . . . . . . 2-2, 2-4, 2-7, 3-30, 3-38
input/output LISTST. . . . . . . . . . . 2-2, 2-4, 3-31, 3-40
See I/O location zero . . . . . . . . . . . . . . . . . . . . 1-7
interbank moves. . . . . . . . . . . . . . . . 4-22
intrabank moves. . . . . . . . . . . . . . . . 4-21
DIGITAL RESEARCH™
Index-7
logical nonbanked . . . . . . . . . . . . . . . . . . . 1-9
character device combinations. . . . . . . segment table . . . . . . . . . . . . . . . . . 5-9
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-36 memory-to-memory move. . . . . . . 4-21
device characteristics. . . . . . . . . . . 2-7 mode
device reassigning . . . . . . . . . . . . . 2-8 bits. . . . . . . . . . . . . . . . . . . . . . . . . . 4-12
drive . . . . . . . . . . . . . . . . . . . . . . . . . I-10 byte. . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
read operation. . . . . . . . . . . . . . . . 3-46 modules
record blocking/deblocking. . . 2-11 communication between. . . . . . . 1-3
records. . . . . . . . . . . . . . . . . . . . . . . 1-4 interactions. . . . . . . . . . . . . . . . . . . 4-4
sequential sector address. . . . . . 3-46 MOVE . . . . . 2-3, 2-4, 2-13, 3-32, 3-49
LOGIN. . . . . . . . . . . . . . . . . . . 4-18, 4-19 MOVE.ASM. . . . . . . . . . . . . . . . . . . . 4-1
L option . . . . . . . . . . . . . . . . . . . . . . . 5-21 module. . . . . . . . . . . . . . . . . . . . . . . 4-3
low-order MOVE Module . . . . . . . . . . . . . . . . 4-21
bit . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21 entry points. . . . . . . . . . . . . . . . . . 4-21
byte. . . . . . . . . . . . . . . . . . . . . . . . . . 1-5 MOVES
LRU buffering scheme . . . . . 1-10, 2-11 interbank. . . . . . . . . . . . . . . . . . . . 4-21
intrabank. . . . . . . . . . . . . . . . . . . . 4-21
M MULTIO. . . . . . . . . . . . . . . . . . . . . . . . . . . .
macro definitions. . . . . . . . . . 3-26, H-1 . . . . . . . 2-3, 2-4, 2-8, 2-11, 3-31, 3-47
media multiple sector read or write operations.
automatic type determination . . 4-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
changes. . . . . . . . . . . . . . . . . . . . . . . A-1 multisector transfer. . . . . . . . . . . . . 3-47
flag. . . . . . . . . . . . . . . . . . . . . . 3-14, A-2 N
removable . . . . . . . . . . . . . . . . . . . . A-1
memory names
addresses . . . . . . . . . . . . . . . . . . . . 1-14 external. . . . . . . . . . . . . . . . . . . . . . . 4-3
configurations. . . . . . . . . . . . . . . . . 1-1 public. . . . . . . . . . . . . . . . . . . . . . . . 4-3
contiguous. . . . . . . . . . 1-7, 1-12, 1-13 user-defined. . . . . . . . . . . . . . . . . . . 4-4
image. . . . . . . . . . . . . . . . . . . . . . . . 1-15 nonbanked BIOS
organization. . . . . . . . . . . . . . . . . . 1-7 assembling. . . . . . . . . . . . . . . . . . . 3-55
selects. . . . . . . . . . . . . . . . . . . . . . . . 2-1 debugging . . . . . . . . . . . . . . . . . . . . 6-1
top of banked. . . . . . . . . . . . . . . . . 1-7 linking . . . . . . . . . . . . . . . . . . . . . . 3-55
memory-mapped video display. . . . 2-7 nonbanked memory. . . . . . . . . . . . . . 1-5
memory organization nonbanked system
banked. . . . . . . . . . . . . . 1-6, 1-7, 1-10 allocation vector. . . . . . . . . . . . . . 3-16
general . . . . . . . . . . . . . . . . . . . . . . . 1-5 buffer control block . . . . . . . . . . 3-23
nonbanked . . . . . . . . . . . . . . 1-8, 1-11 configuration . . . . . . . . . . . . . . . . 1-11
memory requirements. . . . . . . . . . . . 1-9 nonbank-switched memory. . . . . . . 1-1
banked. . . . . . . . . . . . . . . . . . . . . . . 1-9 requirements. . . . . . . . . . . . . . 1-1, 1-9
DIGITAL RESEARCH™
Index-8
number of lines per console page. . 5-5 transfer. . . . . . . . . . . . . . . . . . . . . . 2-11
translation. . . . . . . . . . . . . . . . . . . 3-46
O PORTS.LIB. . . . . . . . . . . . . . . . . . . . . I-23
OFF field . . . . . . . . . . . . . . . . . . . . . . 3-22 printers. . . . . . . . . . . . . . . . . . . . . . . . 1-13
OPEN. . . . . . . . . . . . . . . . . . . . . . . . . . 2-6 Print Record . . . . . . . . . . . . . . . . . . . . D-1
operating system bank. . . . . . . . . . . 1-10 public
operating system modules data items. . . . . . . . . . . . . . . . . . . . . K-1
banked. . . . . . . . . . . . . . . . . . . . . . . 1-6 definitions. . . . . . . . . . . . . . . . . . . . F-1
resident. . . . . . . . . . . . . . . . . . . . . . . 1-6 entry points. . . . . . . . . . . . . . . . . . . . J-1
output. . . . . . . . . . . . . . . . . . . . . . . . . . . I-5 names. . . . . . . . . . . . . . . . . . . . . . . . 4-9
overlay symbols defined in modules. . . . 4-6
data buffer. . . . . . . . . . . . . . . . . . . 5-12 public variables. . . . . . . . . . . . . . . . . . F-1
directory buffer . . . . . . . . . . . . . . 5-11 names. . . . . . . . . . . . . . . . . . . . . . . . 2-5
predefined. . . . . . . . . . . . . . . . . . . . 4-6
P
Q
Page Zero. . . . . . . . . . . 1-4, 1-5, 2-5, 4-5
initialization. . . . . . . . . . . . . . . . . . 2-5 question
passpoint. . . . . . . . . . . . . . . . . . . . . . . . 6-4 GENCPM. . . . . . . . . . . . . . . . . . . . 5-4
Cold BOOT routine . . . . . . . . . . 6-4 question mark. . . . . . . . . . . . . . . . . . . 5-4
in BIOS. . . . . . . . . . . . . . . . . . . . . . 6-3 question variable. . . . . . . . . . . . . . . . . 5-4
password protection. . . . . . . . . . . . . . 1-1 R
P command . . . . . . . . . . . . . . . . . . . . . 6-4
peripheral READ. . . 2-2, 2-4, 2-8, 2-9, 3-31, 3-44,
single. . . . . . . . . . . . . . . . . . . . . . . . . 2-7 . . . . . . . . . . . . . . . . . . . . . . . . . 4-17, 4-19
types. . . . . . . . . . . . . . . . . . . . . . . . 1-14 Read-Write routines. . . . . . . . 2-11, 2-12
peripheral device register A . . . . . . . . . . . . . . . . . . . 2-4, 2-8
I/O . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 removable disks
reassigning. . . . . . . . . . . . . . . . . . . . 2-7 BIOS media flag. . . . . . . . . . . . . . . A-3
physical removable drives
devices . . . . . . . . . . . . . . . . . . . . . . . 2-8 BIOS media flag. . . . . . . . . . . . . . . A-2
disk unit. . . . . . . . . . . . . . . . . . . . . . I-10 directory hashing. . . . . . . . . . . . . . A-1
I/O . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 performance penalty. . . . . . . . . . . A-1
physical record RESERV1. . . . . . . . . . . . . . . . . . 2-3, 3-32
buffers. . . . . . . . . . . . . . . . . . . . . . . . A-1 RESERV2. . . . . . . . . . . . . . . . . . 2-3, 3-32
mask. . . . . . . . . . . . . . . . . . . 3-19, 3-22 Resident System Extension (RSX)
shift factor. . . . . . . . . . . . . . 3-19, 3-22 Modules. . . . . . . . . . . . . . . . . . . . . . 1-9
physical sector. . . . . . . . . . . . . . . . . . . 2-8 residual multisector count. . . . . . . 3-47
buffers. . . . . . . . . . . . . . . . . . . . . . . 2-11 retry routine. . . . . . . . . . . . . . . . . . . . 4-20
count. . . . . . . . . . . . . . . . . . . . . . . . . 4-8 returned values . . . . . . . . . . . . . . . . . . 3-1
DIGITAL RESEARCH™
Index-9
RMAC. . . . . . . . . . 3-54, 4-3, 5-20, E-1 L command. . . . . . . . . . . . . . . . . . . 6-3
r/o . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 sign-on message. . . . . . . . . . . . 1-15, 5-23
root module. . . . . . . . . . . . . . . 4-15, 4-21 single-density
rotational latency. . . . . . . . . . . . . . . 3-47 disk handler Z80 DMA. . . . . . . . I-11
RSX entry point. . . . . . . . . . . . . . . . . 1-9 floppy disk drive. . . . . . . . . . . . . . 1-13
Rubout . . . . . . . . . . . . . . . . . . . . . . . . . 5-6 skew factor. . . . . . . . . . . . . . . . . . . . . 3-46
r/w. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 skew table
address. . . . . . . . . . . . . . . . . . . . . . 3-46
S SKEW macro. . . . . . . . . . . . . . . . 3-27
SCB space allocation. . . . . . . . . . . . . . . . . . 1-6
See System Control Block starting
SCB.ASM . . . . . . . . . . . . . . . . . . . . . . 4-1 disk transfer address. . . . . . . . . . . 4-8
file. . . . . . . . . . . . . . . . . . . 2-5, 3-1, 3-2 sector . . . . . . . . . . . . . . . . . . . . . . . . 4-8
module. . . . . . . . . . . . . . . . . . . 4-2, F-1 track . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
scratchpad area . . . . . . . . . . . . 3-10, 3-15 status polling. . . . . . . . . . . . . . . . . . . . . I-5
sector subroutine
address. . . . . . . . . . . . . . . . . . . . . . 3-13 names. . . . . . . . . . . . . . . . . . . . . . . . 2-5
skew factors. . . . . . . . . . . . . . . . . . 3-13 subroutines
SECTRN. . . . . . . . . 2-2, 2-4, 3-31, 3-46 empty. . . . . . . . . . . . . . . . . . . . . . . . 2-2
SELDSK. . . . 2-4, 2-9, 2-11, 3-30, 3-42, symbols
B-1 public. . . . . . . . . . . . . . . . . . . . . . . . 4-6
JMP. . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 system
routine. . . . . . . . . . . . . . . . . . . 4-6, B-1 bank . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
SELMEM. . . . . . . . . 2-3, 2-4, 3-32, 3-50 components. . . . . . . . . . . . . . . . . . . 1-2
separate buffer pools . . . . . . . . 1-9, 2-11 generation (GENCPM) . . 1-8, 3-16
sequential initialization. . . . . . . . . 2-1, 2-5, 4-10
file input. . . . . . . . . . . . . . . . . . . . . 1-14 labels. . . . . . . . . . . . . . . . . . . . . . . . . 3-2
read. . . . . . . . . . . . . . . . . . . . . . . . . 2-12 loader program (CPMLDR) . . 1-15
serial devices. . . . . . . . . . . . . . . . . . . . . 4-5 printer. . . . . . . . . . . . . . . . . . . . . . . . 2-7
baud rates. . . . . . . . . . . . . . . . . . . . 4-12 start-up. . . . . . . . . . . . . . . . . . 1-4, 1-13
SETBNK. . . . . 2-3, 2-4, 2-9, 3-32, 3-50 time and date . . . . . . . . . . . . . . . . . 2-1
SETDMA . . . . 2-2, 2-4, 2-8, 2-9, 2-11, System Control Block (SCB)
. . . . . . . . . . . . . . . . . . . . . . . . 3-31, 3-43 error mode variable. . . . . . . . . . . 2-12
SETSEC. 2-2, 2-4, 2-9, 2-11, 3-31, 3-43 external labels. . . . . . . . . . . . . . . . . 3-2
SETTRK . . . . 2-2, 2-4, 2-9, 2-11, 3-31, fields. . . . . . . . . . . . . . . . . . . . . . . . . 1-4
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-43 system tracks. . . . . . . . . . . 1-12, 2-5, 2-6
SID. . . . . . . . . . . . . . . . . . . . 5-22, 6-1, 6-4 initialization. . . . . . . . . . . . . . . . . 5-24
G command . . . . . . . . . . . . . . . . . . 6-2 organization. . . . . . . . . . . . . . . . . 5-19
I command . . . . . . . . . . . . . . . . . . . 6-2 Sytem Ctonrol Block (SCB)
definition. . . . . . . . . . . . . . . . . . . . . 2-5
DIGITAL RESEARCH™
Index-10
T X
target system . . . . . . . . . . . . . . . . . . . 1-14 XDPH. . . . . . . . . . . . . . . . . 4-3, 4-6, 4-15
TIME . . . . . . . . . . . . 2-3, 2-4, 3-32, 3-51 fields. . . . . . . . . . . . . . . . . . . . . . . . 4-17
time of day format. . . . . . . . . . . . . . . . . . . . . . . 4-17
clocks . . . . . . . . . . . . . . . . . . . . . . . 4-10 XMOVE. . . . 2-3, 2-4, 2-13, 3-32, 3-51
function. . . . . . . . . . . . . . . . . . . . . 2-13 XON/XOFF protocol. . . . . . . . . . . 3-8
top of memory. . . . . . . . . . . 1-6, 1-7, 5-6 XREF . . . . . . . . . . . . . . . . . . . . . . . . . . E-1
tracing routines. . . . . . . . . . . . . . . . . . 6-4
track address . . . . . . . . . . . . . . . . . . . 3-13 Z
Transient Program Area (TPA) . . . 1-2, Z80 LDIR instruction. . . . . . . . . . . 3-49
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
transient programs. . . . . . . . . . . 1-6, 2-5
TYPE . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
U
UNIT. . . . . . . . . . . . . . . . . . . . . . . . . 4-18
USERF. . . . . . . . . . . . . . . . . . . . 2-3, 3-32
user interface. . . . . . . . . . . . . . . . . . . . 1-2
V
variables
global . . . . . . . . . . . . . . . . . . . . . . . . 4-8
public. . . . . . . . . . . . . . . . 2-5, 4-6, F-1
vectors
allocation. . . . . . . . . . . . . . . . . . . . 3-15
checksum. . . . . . . . . . . . . . . . . . . . 3-14
redirection. . . . . . . . . . . . . . . . . . . . 3-4
W
Warm BOOT routine. . . . . . . . . . . . 1-4
warm start. . . . . . . . . . . . . . . . . . . 1-12, I-1
WBOOT. . . . . . . . . . . . . 2-4, 3-30, 3-33
entry point. . . . . . . . . . . . . . . . . . . 3-33
JMP. . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
routine. . . . . . . . . . . . . . . . . . . . . . . 2-5
WBOOT routine. . . . . . . . . . . . . . . . 2-5
WRITE. . 2-2, 2-4, 2-8, 2-9, 2-11, 3-31,
. . . . . . . . . . . . . . . . . . . . 3-45, 4-17, 4-19
DIGITAL RESEARCH™
Index-11