Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -0,0 +1,132 @@
ar8k(1) archive/librarian ar8k(1)
NAME
ar8k - archive and library maintainer
SYNOPSIS
ar8k key afile [name ...]
DESCRIPTION
The primary purpose of ar8k is to prepare and maintain files for
the linker, ld8k. However, it may be used to prepare and main-
tain collections of files for any other purpose.
The format of the files is the same as that used by UNIX 7th Ed-
ition.
Key is one character from the set d-r-q-t-x, plus optionally v.
Afile is the archive file.
The [names ...] are files in the archive file, or files to be
included in the archive file.
Meaning of the key letters is as follows:
d Delete the named files from the archive file
r Replace the named files in the archive file. If the named
files are not currently in the archive file, they are placed
at the end.
q Quickly append the named files to the end of the archive
file. No checking is done to see whether the files are al-
ready in the archive.
t Print a table of contents. If no names are given, the entire
archive is listed, otherwise only the indicated files are
listed.
x Extract the named files. If there is no name list, the en-
tire archive is extracted. The archive file is not modified.
v Verbose. With t, a long listing about each component is pro-
duced. With any other letter, a blow-by-blow description of
all activity is produced.
- 1 -
ar8k(1) archive/librarian ar8k(1)
FILES
ar8kxxxx.tmp temporary file
- 2 -

View File

@@ -0,0 +1,56 @@
.th ar8k 1 archive/librarian
.sh NAME
ar8k - archive and library maintainer
.sh SYNOPSIS
ar8k key afile [name ...]
.sh DESCRIPTION
The primary purpose of ar8k is to prepare and maintain files for
the linker, ld8k. However, it may be used to prepare and maintain
collections of files for any other purpose.
The format of the files is the same as that used by UNIX 7th Edition.
Key is one character from the set d-r-q-t-x, plus optionally v.
Afile is the archive file.
The [names ...] are files in the archive file, or files to be included in
the archive file.
Meaning of the key letters is as follows:
.in+3
.ti-3
d\ \ Delete the named files from the archive file
.ti-3
r\ \ Replace the named files in the archive file. If the named files
are not currently in the archive file, they are placed at the end.
.ti-3
q\ \ Quickly append the named files to the end of the archive file.
No checking is done to see whether the files are already in the archive.
.ti-3
t\ \ Print a table of contents. If no names are given, the entire archive
is listed, otherwise only the indicated files are listed.
.ti-3
x\ \ Extract the named files. If there is no name list, the entire
archive is extracted. The archive file is not modified.
.ti-3
v\ \ Verbose. With t, a long listing about each component is produced.
With any other letter, a blow-by-blow description of all activity is
produced.
.in-3
.sh FILES
ar8kxxxx.tmp temporary file

View File

@@ -0,0 +1,78 @@
.TH ASZ8K 1 local
.SH NAME
asz8k \- Z8000 assembler
.SH SYNOPSIS
.B asz8k
[
.B \-lux
]
.RB name .z8k
.br
.B asz8s
[
.B \-lux
]
.RB name .z8s
.SH DESCRIPTION
.I Asz8k
is an assembler for the Z8002 and Z8001, respectively.
They are actually two links to the same program; the name determines
the kind of code which is generated.
The source file
.IB name .z8k
or
.IB name .z8s
is assembled and the object output is left on the file
.IB name .obj\fR,
in the Unidot object file format.
.PP
The following options are supported:
.IP \fB\-l
Generate an assembly listing on the file
.IB name .lst\fR.
The
.B \-x
option implies this.
.IP \fB\-u
Treat all undefined symbols in the assembly as global.
.IP \fB\-x
Generate assembly and cross reference listings on the file
.IB name .lst\fR.
This option implies the
.B \-l
option.
.SH FILES
.IP "/usr/bin/asz8k, /usr/bin/asz8s"
Assembler program (two links to one file).
.IP "/usr/lib/asz8k.pd, /usr/lib/asz8s.pd"
Symbol and opcode definitions (two links to one file).
.SH SEE ALSO
xcon(1)
.br
.I Unidot Cross Assembler Family Programmer's Reference
.br
.I Unidot Universal Link Editor Programmer's Reference
.SH DIAGNOSTICS
Assembly errors are flagged by single-character diagnostics at the left
side of the listing.
Lines containing errors are printed on the standard output regardless
of whether a listing is enabled.
The possible errors are:
.sp
A Macro argument error
.br
C Conditional assembly error
.br
E Expression error
.br
L Label error
.br
M Multiply defined symbol
.br
O Opcode error
.br
P Phase error
.br
S Syntax error
.br
U Undefined symbol

View File

@@ -0,0 +1,66 @@
ASZ8K(1) UNIX 3.0 (local) ASZ8K(1)
NAME
asz8k, asz8s - Z8000 assemblers
SYNOPSIS
asz8k [ -lux ] name.z8k
asz8s [ -lux ] name.z8s
DESCRIPTION
_A_s_z_8_k and _A_s_z_8_s are assemblers for the Z8002 and Z8001,
respectively. They are actually two links to the same
program; the name determines the kind of code which is
generated. The source file _n_a_m_e.z8k or _n_a_m_e.z8s is
assembled and the object output is left on the file
_n_a_m_e.obj, in the Unidot object file format.
The following options are supported:
-l Generate an assembly listing on the file _n_a_m_e.lst. The
-x option implies this.
-u Treat all undefined symbols in the assembly as global.
-x Generate assembly and cross reference listings on the
file _n_a_m_e.lst. This option implies the -l option.
FILES
/usr/bin/asz8k, /usr/bin/asz8s
Assembler program (two links to one file).
/usr/lib/asz8k.pd, /usr/lib/asz8s.pd
Symbol and opcode definitions (two links to one file).
SEE ALSO
xcon(1)
_U_n_i_d_o_t _C_r_o_s_s _A_s_s_e_m_b_l_e_r _F_a_m_i_l_y _P_r_o_g_r_a_m_m_e_r'_s _R_e_f_e_r_e_n_c_e
_U_n_i_d_o_t _U_n_i_v_e_r_s_a_l _L_i_n_k _E_d_i_t_o_r _P_r_o_g_r_a_m_m_e_r'_s _R_e_f_e_r_e_n_c_e
DIAGNOSTICS
Assembly errors are flagged by single-character diagnostics
at the left side of the listing. Lines containing errors
are printed on the standard output regardless of whether a
listing is enabled. The possible errors are:
A Macro argument error
C Conditional assembly error
E Expression error
L Label error
M Multiply defined symbol
O Opcode error
P Phase error
S Syntax error
U Undefined symbol
Page 1 (printed 4/5/83)

View File

@@ -0,0 +1,132 @@
CC COMMAND UNDER CP/M
9/9/82 FZ
The cc command under UNIX makes heavy use of the fork() and
exec() system calls. In particular, a typical structure of
a cc execution is:
For each ".c" file do
fork/exec preprocessor
fork/exec 1st pass
fork/exec second pass
if -O flag fork/exec optimizer (always for Unidot)
fork/exec assembler (not in Unidot)
od
Thus each of the passes is loaded and executed repeatedly,
while the parent task (cc) waits.
This scheme will not work in a single-tasking environment.
The alternative appears to be use of the CHAIN or PROGRAM
LOAD functions (BDOS calls 47 and 59 respectively.) The
difficulty is that the sequence of chains or loads will have
to form a loop: cc chains/loads cpp chains/loads pass1
chains/loads pass2 chains/loads pass3 chains/loads cc (for
next program file) chains/loads cpp...
Eventually cc will have to detect that all the files have
been compiled and end the loop. The communication between
chaining and chained programs can be done via the "DMA
buffer", which is large enough to contain a command line of
128 bytes. Communication between loading and loaded pro-
grams may be somewhat more flexible, since the LOAD call
appears to give the caller freedom in where the program is
loaded (e.g., not necessarily at the beginning of the TPA),
and thus holds out hope of shared memory. (I don't think
this will work, actually.) What must be communicated is
essentially the contents of the command line, together with
a pointer to where in the command line the current loop has
gotten to. Although passing the command line along sounds
attractive, it introduces the inefficiency of repeatedly
parsing the various compile time flags. I don't see how
this can be avoided at this point. Changing the flags from
the format in which they are entered to a different format
which is trivial to parse (e.g a letter for each flag,
present or not) could perhaps alleviate this inefficiency.
Format of the external command line passed by a user to cc:
cc [-c] [-P] [-E] [-o name] [-Dname[=def]] [-Uname] [-K] files.[cso]...
Format of the DMA buffer, used by a chaining pass of cc to
send information about the current status of the compile to
the next pass:
|-------------------------------------------------------------------------|
| N | -[c][P][E][K] [-Dname[=def]] [-Uname] file.x file.c file.o ... | 0 |
|-------------------------------------------------------------------------|
1 N bytes 1
byte byte
where the the extension on a file is changed to ".x" to
indicate that it has already been processed. Note that the
following more or less standard flags will not be supported:
-O Optimization is always done with the Unidot compiler.
-S Assembler code is not generated.
-I Directories are not implemented.
-B Only one version of compiler.
-t Ditto.

View File

@@ -0,0 +1,198 @@
ld8k(1) Loader/linker ld8k(1)
DESCRIPTION
ld8k - loader/linker
SYNOPSIS
ld8k [option] file ...
DESCRIPTION
Ld8k combines several object programs into one. It is capable
of linking both segmented and non-segmented Z8000 object
modules. However, all of the modules linked must be of the same
type. Ld8k also has facilities for searching libraries in the
format prepared by ar8k. Normally, the output (default = x.out)
is prepared for execution, however the -r option may be used to
preserve relocation information so that the output can be used
as further input to ld8k.
If no errors occur during the execution of ld8k, the output
module is marked with a magic word that indicates that it is ex-
ecutable.
Arguments to ld8k are processed in the order that they appear in
the command line. Libraries are searched exactly once at the
point at which they appear in the command. Only routines that
resolve at least one external reference are loaded. Therefore
ordering of libraries is important.
Whether segmented or non-segmented linking is done depends on
the type of the first object module encountered, since no mixing
of types is permissible. In searching archives, only entry
points in modules having the correct type are considered. Hence
archives can have modules with duplicated entry point names so
long as they are in different object module types.
There are several options. Except for library specification (-
lxx), all should appear before any file names.
-i Prepare the object file for "split I and D" space. That
is, start the data addresses at zero, and in the case of
segmented loads, segment numbers can also be reused.
-lxx Search the library name "libxx.a". This may appear any-
where in the command line.
-n Mark the text read only so that it may be shared. This is
meaningful only for non-segmented loads. The data boundary
is moved up to the next 8K byte boundary.
-o The next argument is taken as the name of the object file
instead of "x.out".
- 1 -
ld8k(1) Loader/linker ld8k(1)
-r Preserve relocation information in the output even if all
references are resolved.
-s "Strip" the output by removing the symbol table and reloca-
tion information to save space in the object file.
-t The next argument is a decimal number that sets the size of
the stack segment.
-u Enter the next argument as an undefined reference so that
loading can be accomplished solely from an archive file.
-d The next argument is taken to be a file name containing
segment numbers and name correspondences. In this way
specific segment numbers can be assigned to named segments,
or the loader can be forced to ignore specific segment
numbers. The are two formats for the descriptor file. The
first format is a sequence of ASCII lines as follows:
<number>[,<typechar>]*=<name>[,<name>]*
or
<number>
The first form requires the named segments to be assigned
the given number. The <typechar> should be one of the
letters "t", "b", "d", or "c" to indicate segment types
text, data, bss, or constant respectively. If the type is
not indicated, the type of the named segment will be used.
If all of the named segments with the same name will not
fit into 64KB, an error message will be issued. The order
in which the named segments are assigned to the numbered
segment is the order in which the names appear in the con-
trol line. The second form effectively reserves the seg-
ment number and does not permit the loader to use it.
The second form of the descriptor file is as follows:
<type>=<number>[-<number][,<number[-<number]]*
In this form the type is one of the names: "text", "bss",
"data", or "cons", and the numbers are the valid numbers
for this type of segment.
In both forms, the output file will have the segments ap-
pearing in the same order in which they are first encoun-
tered in the descriptor file. In this way, the object ord-
er can be forced. For example:
text=11,9,7
cons=10,12,8
data=15-18
bss=3-1
- 2 -
ld8k(1) Loader/linker ld8k(1)
will cause text to be put first in segment 11, then 9, then
7 (as each of the segments is filled in turn), constants
into 10, 12, and 8, data into 15, 16, 17, and 18, and bss
to be filled into 3, 2, and 1. The specific ordering will
be preserved in each case. If this proves to be an insuf-
ficient number of preallocated segments, segments 0, 4, 5,
6, 13, 14, 19+ will be selected in turn. (Remember that
segments can be avoided using the first form above.)
If segment types are mixed (text=5/data=5 for example),
both types of segments will be allocated first in segment
5, then subsequent allocation will be separated. However,
if the file reads text=4,6/data=5,6, both data and text
will be allowed to spill into segment 6.
-d"descriptor line" this is a shorthand form of the preceding
control in which one line will suffice. -d commands may be
repeated, in which case they are processed in the order
they are encountered.
FILES
lib*.a libraries x.out object file
- 3 -

View File

@@ -0,0 +1,140 @@
.th ld8k 1 Loader/linker
.sh DESCRIPTION
ld8k - loader/linker
.sh SYNOPSIS
ld8k [option] file ...
.sh DESCRIPTION
Ld8k combines several object programs into one. It is capable of linking
both segmented and non-segmented Z8000 object modules. However, all of
the modules linked must be of the same type. Ld8k also has facilities for
searching libraries in the format prepared by ar8k.
Normally, the output (default = x.out) is prepared for execution, however
the -r option may be used to preserve relocation information so that the
output can be used as further input to ld8k.
If no errors occur during the execution of ld8k, the output module is
marked with a magic word that indicates that it is executable.
Arguments to ld8k are processed in the order that they appear in the
command line. Libraries are searched exactly once at the point at which
they appear in the command. Only routines that resolve at least one
external reference are loaded. Therefore ordering of libraries is
important.
Whether segmented or non-segmented linking is done depends on the
type of the first object module encountered, since no mixing of types
is permissible. In searching archives, only entry points in modules
having the correct type are considered. Hence archives can have modules
with duplicated entry point names so long as they are in different object
module types.
There are several options. Except for library specification (-lxx),
all should appear before any file names.
.in+5
.ti-5
-i\ \ \ Prepare the object file for "split I and D" space. That is,
start the data addresses at zero, and in the case of segmented loads,
segment numbers can also be reused.
.ti-5
-lxx\ Search the library name "libxx.a".
This may appear anywhere in the command line.
.ti-5
-n\ \ \ Mark the text read only so that it may be shared. This is
meaningful only for non-segmented loads. The data boundary is moved up
to the next 8K byte boundary.
.ti-5
-o\ \ \ The next argument is taken as the name of the object file
instead of "x.out".
.ti-5
-r\ \ \ Preserve relocation information in the output even if all references
are resolved.
.ti-5
-s\ \ \ "Strip" the output by removing the symbol table and relocation
information to save space in the object file.
.ti-5
-t\ \ \ The next argument is a decimal number that sets the size of the
stack segment.
.ti-5
-u\ \ \ Enter the next argument as an undefined reference so that loading
can be accomplished solely from an archive file.
.ti-5
-d\ \ \ The next argument is taken to be a file name containing segment
numbers and name correspondences. In this way specific segment numbers
can be assigned to named segments, or the loader can be forced to ignore
specific segment numbers. The are two formats for the descriptor file.
The first format is a sequence of ASCII lines as follows:
<number>[,<typechar>]*=<name>[,<name>]*
or
<number>
The first form requires the named segments to be assigned the given
number. The <typechar> should be one of the letters "t", "b", "d", or "c"
to indicate segment types text, data, bss, or constant respectively. If
the type is not indicated, the type of the named segment will be used.
If all of the named segments with the same name
will not fit into 64KB, an error
message will be issued. The order in which the named segments are assigned
to the numbered segment is the order in which the names appear in the
control line. The second form effectively reserves the segment number and
does not permit the loader to use it.
The second form of the descriptor file is as follows:
<type>=<number>[-<number][,<number[-<number]]*
In this form the type is one of the names: "text", "bss", "data", or "cons",
and the numbers are the valid numbers for this type of segment.
In both forms, the output file will have the segments appearing in the
same order in which they are first encountered in the descriptor file. In
this way, the object order can be forced. For example:
.nf
.in+10
text=11,9,7
cons=10,12,8
data=15-18
bss=3-1
.in-10
.fi
will cause text to be put first in segment 11, then 9, then 7 (as each of
the segments is filled in turn), constants into 10, 12, and 8, data into
15, 16, 17, and 18, and bss to be filled into 3, 2, and 1. The specific
ordering will be preserved in each case. If this proves to be an insufficient
number of preallocated segments, segments 0, 4, 5, 6, 13, 14, 19+ will be
selected in turn. (Remember that segments can be avoided using the first
form above.)
If segment types are mixed (text=5/data=5 for example), both types of
segments will be allocated first in segment 5, then subsequent allocation
will be separated. However, if the file reads text=4,6/data=5,6, both
data and text will be allowed to spill into segment 6.
.ti-5
-d"descriptor line" this is a shorthand form of the preceding control
in which one line will suffice. -d commands may be repeated, in which
case they are processed in the order they are encountered.
.in-5
.sh FILES
lib*.a libraries
x.out object file

View File

@@ -0,0 +1,682 @@
.Ig
4/20/82
.op
.sp 15
.ce 100
.SH
CP/M-8000
.sp
.sh
Operating System
.sh
.sp
Programmer's Guide
.cs 5
.sp 10
Copyright \ \ January 1983
.sp
Digital Research
P.O. Box 579
160 Central Avenue
Pacific Grove, CA 93950
(408) 649-3896
TWX 910 360 5001
.sp 4
All Rights Reserved
.ce 0
.bp
.po 17
.ll 50
.ce
COPYRIGHT
.sp
Copyright \ \ 1983 by Digital Research. 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, Post Office Box 579, Pacific
Grove, California, 93950.
.sp
This documentation is, however, tutorial in nature. Thus, the reader is
granted permission to include the example programs, either in whole
or in part, in his own programs.
.sp 3
.ce
DISCLAIMER
.sp
Digital Research makes no representations or warranties with
respect to the contents hereof and specifically disclaims
any implied warranties of merchantability or fitness for
any particular purpose. Further, Digital Research reserves the
right to revise this publication and to make changes from
time to time in the content hereof without obligation of
Digital Research to notify any person of such revision or
changes.
.sp 3
.ce
TRADEMARKS
.sp
CP/M and CP/M-86 are registered trademarks of Digital Research.
AS68, CP/M-8000, CP/M-80, CP/M-86, DDT-8000, LD8K, MP/M-80, and MP/M-86 are
trademarks of Digital Research. Zilog is a registered trademark of
Zilog Inc. Unix is a registered trademark of Bell Laboratories.
.sp 3
The\c
.ul
CP/M-8000 Operating System Programmer's Guide
.qu
\was prepared using the Digital Research TEX Text Formatter and printed
in the United States of America.
.sp 2
.ce 3
******************************
* First Edition: May 1983 *
******************************
.bp
.cs 5
.mt 5
.op
.mb 6
.pl 66
.ll 65
.po 10
.pp 5
.hm 2
.fm 2
.ft iii
.ce
.sh
FOREWORD
.sp
.pp
CP/M-8000 is a single-user operating system designed for the
ZILOG \ \ Z8000 or a compatible Z8000 microprocessor. CP/M-8000
requires a minimum of 128K bytes of random access memory (RAM) to
run its base-level system, which contains the CP/M \ \ commands and
the utilities listed below.
.sp
.nf
o CP/M Built-in Commands:
.sp
DIR
.br
DIRS
.br
ERA
.br
REN
.br
SUBMIT
.br
TYPE
.br
USER
.sp
o Standard CP/M Utilities:
.sp
DDT-8000
.br
ED
.br
PIP
.br
STAT
.sp
o Programming Utilities:
.sp
Archive (AR8K)
.br
DUMP
.br
XDUMP
.sp
o Programming Tools
.sp
Assembler (AS8K \ \ )
.br
Linker (LD8K \ \ )
.br
C Compiler*
.br
C Preprocessor*
.sp
* Described in the \c
.ul
C Programming Guide for CP/M-8000.
.qu
.fi
.sp
CP/M-8000 requires a minimum of 128K bytes of RAM
to run the programming tools distributed with CP/M-8000.
.pp
The CP/M-8000 file system is based on and is upwardly compatible
with the CP/M-80 \ \ Version 2.2 and CP/M-86 \ \ Version 1.1 file
systems. However, CP/M-8000 supports a much larger file size
with a maximum of 32 megabytes per file.
.bp
.fm 2
.ft iv
.sp
.pp
CP/M-8000 supports a maximum of 16 disk
drives, with 512 megabytes per drive. CP/M-8000 supports other
peripheral devices that the Basic I/O System
(BIOS) assigns to one of the four logical devices: LIST, CONSOLE,
AUXILIARY INPUT, or AUXILIARY OUTPUT.
.pp
This guide describes the programming interface to CP/M-8000. The first few
sections in this guide discuss the CP/M-8000 architecture, memory models,
executable programs, and file system access functions. Latter sections of
this guide describe programming tools and utilities distributed with your
CP/M-8000 system.
.pp
This guide assumes you are an experienced programmer familiar
with the basic programming concepts of assembly language.
If you are not familiar with the Zilog Z8000 assembly language,
refer to Zilog manuals listed below.
.sp
.in 5
.ti -2
o \c
.ul
======= fill in: Z8000 assembly-language manual =========
.in 0
.pp
Before you can use the facilities in this guide, your CP/M-8000
system must be configured for your hardware environment.
Normally, your system is configured for you by the manufacturer
of your computer or the software distributor. However, if you
have an unusual hardware environment, this may not be the case.
Refer to the \c
.ul
CP/M-8000 Operating System System Guide \c
.qu
for details on how to configure your system for a custom hardware
environment.
.sp 2
.sh
New Functions and Implementation Changes
.qs
.pp
CP/M-8000 has six new Basic Disk Operating System (BDOS) functions
and additional implementation changes in the BDOS functions and
data structures that differ from other CP/M systems.
The new BDOS functions and implementation changes are listed
in Appendix F.
.pp
Table F-4 in Appendix F contains functions and commands supported by other CP/M
systems, but that are not supported by CP/M-8000.
.bp
.ft v
.ce
.sh
Table of Contents
.qs
.sp 3
.nf
.sh
1 Introduction to CP/M-8000
.qs
.sp
1.1 CP/M-8000 System Architecture . . . . . . . . . . . . 1
.sp
1.2 Transient Programs . . . . . . . . . . . . . . . . . 2
.sp
1.3 File System Access . . . . . . . . . . . . . . . . . 2
.sp
1.4 Programming Tools and Commands . . . . . . . . . . . 2
.sp
1.5 CP/M-8000 File Specification . . . . . . . . . . . . . 5
.sp
1.6 Wildcards . . . . . . . . . . . . . . . . . . . . . . 6
.sp
1.7 CP/M-8000 Terminology . . . . . . . . . . . . . . . . 7
.sp 2
.sh
2 The CCP and Transient Programs
.sp
2.1 CCP Built-In and Transient Commands . . . . . . . . . 9
.sp
2.2 Loading A Program In Memory . . . . . . . . . . . . . 10
.sp
2.2.1 Base Page Initialization By The CCP . . . . . 10
2.2.2 Loading Multiple Programs . . . . . . . . . . 10
2.2.3 Base Page Initialization . . . . . . . . . . . 11
.sp
2.3 Exiting Transient Programs . . . . . . . . . . . . . 11
.sp
2.4 Transient Program Execution Model . . . . . . . . . . 12
.sp 2
.sh
3 Command File Format
.qs
========= THIS SECTION NEEDS REVISION FOR X.OUT ==========
.sp
3.1 The Header and Program Segments . . . . . . . . . . . 15
.sp
3.2 The Symbol Table . . . . . . . . . . . . . . . . . . 17
.sp
3.2.1 Printing The Symbol Table . . . . . . . . . . 19
.sp
3.3 Relocation Information . . . . . . . . . . . . . . . 19
.sp
3.3.1 The Format of A Relocation Word . . . . . . . 20
.sp 2
.sh
4 Basic Disk Operating System Functions
.qs
.sp
4.1 BDOS Functions and Parameters . . . . . . . . . . . . 24
.sp
4.1.1 Invoking BDOS Functions . . . . . . . . . . . . 24
4.1.2 Organization Of BDOS Functions . . . . . . . . 25
.bp
.ft vi
.ce 2
.sh
Table of Contents
.sp
.sh
(continued)
.qs
.sp 3
4.2 File Access Functions . . . . . . . . . . . . . . . . 25
.sp
4.2.1 A File Control Block (FCB) . . . . . . . . . . 26
4.2.2 File Processing Errors . . . . . . . . . . . . 28
4.2.3 Open File Function . . . . . . . . . . . . . . 31
4.2.4 Close File Function . . . . . . . . . . . . . 32
4.2.5 Search For First Function . . . . . . . . . . 33
4.2.6 Search For Next Function . . . . . . . . . . . 34
4.2.7 Delete File Function . . . . . . . . . . . . . 35
4.2.8 Read Sequential Function . . . . . . . . . . . 36
4.2.9 Write Sequential Function . . . . . . . . . . 37
4.2.10 Make File Function . . . . . . . . . . . . . . 39
4.2.11 Rename File Function . . . . . . . . . . . . . 40
4.2.12 Set Direct Memory Access (DMA) Address . . . . 41
4.2.13 Set File Attributes Function . . . . . . . . . 42
4.2.14 Read Random Function . . . . . . . . . . . . . 44
4.2.15 Write Random Function . . . . . . . . . . . . 46
4.2.16 Compute File Size Function . . . . . . . . . . 48
4.2.17 Set Random Record Function . . . . . . . . . . 49
4.2.18 Write Random With Zero Fill Function . . . . . 51
.sp
4.3 Drive Functions . . . . . . . . . . . . . . . . . . . 52
.sp
4.3.1 Reset Disk System Function . . . . . . . . . . 53
4.3.2 Select Disk Function . . . . . . . . . . . . . 54
4.3.3 Return Login Vector Function . . . . . . . . . 55
4.3.4 Return Current Disk Function . . . . . . . . . 56
4.3.5 Write Protect Disk Function . . . . . . . . . 57
4.3.6 Get Read-Only Vector Function . . . . . . . . 58
4.3.7 Get Disk Parameters Function . . . . . . . . . 59
4.3.8 Reset Drive Function . . . . . . . . . . . . . 61
4.3.9 Get Disk Free Space Function . . . . . . . . . 62
.sp
4.4 Character I/O Functions . . . . . . . . . . . . . . . 62
.sp
4.4.1 Console I/O Functions . . . . . . . . . . . . 64
Console Input Function . . . . . . . . . . . . 64
Console Output Function . . . . . . . . . . . 65
Direct Console I/O Function . . . . . . . . . 66
Print String Function . . . . . . . . . . . . 68
Read Console Buffer Function . . . . . . . . . 69
Get Console Status Function . . . . . . . . . 71
.sp
.mb 5
.fm 1
4.4.2 Additional Serial I/O Functions . . . . . . . 72
Auxiliary Input Function . . . . . . . . . . . 72
Auxiliary Output Function . . . . . . . . . . 73
List Output Function . . . . . . . . . . . . . 74
.bp
.ft vii
.mb 6
.fm 2
.ce 2
.sh
Table of Contents
.qs
.sp
.sh
(continued)
.qs
.sp 3
4.4.3 I/O Byte Functions . . . . . . . . . . . . . . 74
Get I/O Byte Function . . . . . . . . . . . . 76
Set I/O Byte Function . . . . . . . . . . . . 77
.sp
4.5 System/Program Control Functions . . . . . . . . . . 77
.sp
4.5.1 System Reset Function . . . . . . . . . . . . 78
4.5.2 Return Version Number Function . . . . . . . . 79
4.5.3 Set/Get User Code . . . . . . . . . . . . . . 81
4.5.4 Chain To Program Function . . . . . . . . . . 82
4.5.5 Flush Buffers Function . . . . . . . . . . . . 83
4.5.6 Direct BIOS Call Function . . . . . . . . . . 84
4.5.7 Program Load Function . . . . . . . . . . . . 85
.sp
4.6 Exception Functions . . . . . . . . . . . . . . . . . 87
.sp
4.6.1 Set Exception Vector Function . . . . . . . . 88
4.6.2 Set Supervisor State . . . . . . . . . . . . . 91
4.6.3 Get/Set TPA Limits . . . . . . . . . . . . . . 92
.sp 2
.sh
5 AS8K Assembler
.qs
============= BASE ON MCCLURE'S DOCUMENTATION ==============
.sp
5.1 Assembler Operation . . . . . . . . . . . . . . . . . 95
.sp
5.2 Initializing AS68 . . . . . . . . . . . . . . . . . . 95
.sp
5.3 Invoking the Assembler (AS68) . . . . . . . . . . . . 95
.sp
5.4 Assembly Language Directives . . . . . . . . . . . . 98
.sp
5.5 Sample Commands Invoking AS68 . . . . . . . . . . . . 104
.sp
5.6 Assembly Language Differences . . . . . . . . . . . . 104
.sp
5.7 Assembly Language Extensions . . . . . . . . . . . . 106
.sp
5.8 Error Messages . . . . . . . . . . . . . . . . . . . 107
.sp 2
.sh
6 LD8K Linker
.qs
============= BASE ON MCCLURE'S DOCUMENTATION ==============
.sp
6.1 Linker Operation . . . . . . . . . . . . . . . . . . 109
.sp
6.2 Invoking the Linker (L068) . . . . . . . . . . . . . 109
.sp
6.3 Sample Commands Invoking L068 . . . . . . . . . . . . 112
.sp
6.4 L068 Error Messages . . . . . . . . . . . . . . . . . 112
.bp
.ft viii
.ce 2
.sh
Table of Contents
.sp
.sh
(continued)
.qs
.sp 3
.sh
7 Programming Utilities
.qs
.sp
7.1 Archive Utility . . . . . . . . . . . . . . . . . . . 113
.sp
============= BASE ON MCCLURE'S DOCUMENTATION ==============
7.1.1 AR68 Syntax . . . . . . . . . . . . . . . . . 113
7.1.2 AR68 Operation . . . . . . . . . . . . . . . . 115
7.1.3 AR68 Commands and Options . . . . . . . . . . 115
7.1.4 Errors . . . . . . . . . . . . . . . . . . . . 120
.sp
7.2 DUMP Utility . . . . . . . . . . . . . . . . . . . . 120
.sp
7.2.1 Invoking DUMP . . . . . . . . . . . . . . . . 120
7.2.2 DUMP Output . . . . . . . . . . . . . . . . . 121
7.2.3 DUMP Examples . . . . . . . . . . . . . . . . 122
.sp
7.4 XDUMP Utility . . . . . . . . . . . . . . . . . . . 124
.sp
============== TO BE WRITTEN ==============================
7.4.1 Invoking XDUMP . . . . . . . . . . . . . . . 124
7.4.2 XDUMP Output . . . . . . . . . . . . . . . . 124
7.4.3 XDUMP Examples . . . . . . . . . . . . . . . 125
.sp
.sh
8 DDT-8000
.qs
.sp
8.1 DDT-8000 Operation . . . . . . . . . . . . . . . . . . 129
============== BASE ON THORN'S DOCUMENTATION ==============
.sp
8.1.1 Invoking DDT-8000 . . . . . . . . . . . . . . . 129
8.1.2 DDT-8000 Command Conventions . . . . . . . . . 129
8.1.3 Specifying Address . . . . . . . . . . . . . . 130
8.1.4 Terminating DDT-8000 . . . . . . . . . . . . . 130
8.1.5 DDT-8000 Operation with Interrupts . . . . . . 130
.bp
.ft ix
.ce 2
.sh
Table of Contents
.sp
.sh
(continued)
.qs
.sp 3
8.2 DDT-8000 Commands . . . . . . . . . . . . . . . . . . 131
.sp
8.2.1 The D (Display) Command . . . . . . . . . . . 131
8.2.2 The E (Load for Execution) Command . . . . . . 132
8.2.3 The F (Fill) Command . . . . . . . . . . . . . 132
8.2.4 The G (Go) Command . . . . . . . . . . . . . . 133
8.2.5 The H (Hexadecimal Math) Command . . . . . . . 133
8.2.6 The I (Input Command Tail) Command . . . . . . 133
8.2.7 The L (List) Command . . . . . . . . . . . . . 134
8.2.8 The M (Move) Command . . . . . . . . . . . . . 134
8.2.9 The R (Read) Command . . . . . . . . . . . . . 135
8.2.10 The S (Set) Command . . . . . . . . . . . . . 135
8.2.11 The T (Trace) Command . . . . . . . . . . . . 136
8.2.12 The U (Untrace) Command . . . . . . . . . . . 136
8.2.13 The V (Value) Command . . . . . . . . . . . . 137
8.2.14 The W (Write) Command . . . . . . . . . . . . 137
8.2.15 The X (Examine CPU State) Command . . . . . . 137
.sp
8.3 Assembly Language Syntax for A and L Commands . . . . 139
.bp
.ft x
.ce
.sh
Appendixes
.qs
.sp 3
.sh
A Summary of BIOS Functions \c
.qs
\ . . . . . . . . . . . . . . . . 141
.sp 2
.sh
B Transient Program Load Example\c
.qs
\ . . . . . . . . . . . . . . 143
.sp 2
.sh
C Base Page Format\c
.qs
\ . . . . . . . . . . . . . . . . . . . . . 151
.sp 2
.sh
D Instruction Set Summary \c
.qs
\ . . . . . . . . . . . . . . . . . 153
.sp 2
.sh
E Error Messages\c
.qs
\ . . . . . . . . . . . . . . . . . . . . . . 157
=============== DELETE OR REVISE ===========================
.sp
E.1 AR68 Error Messages . . . . . . . . . . . . . . . . . 157
.sp
E.1.1 Fatal Diagnostic Error Messages . . . . . . . 157
E.1.2 AR68 Internal Logic Error Messages . . . . . . 160
.sp
E.2 AS68 Error Messages . . . . . . . . . . . . . . . . . 161
.sp
E.2.1 AS68 Diagnostic Error Messages . . . . . . . . 161
E.2.2 User-recoverable Fatal Error Messages . . . . 167
E.2.3 AS68 Internal Logic Error Messages . . . . . . 171
.sp
E.3 BDOS Error Messages . . . . . . . . . . . . . . . . . 171
.sp
E.4 BIOS Error Messages . . . . . . . . . . . . . . . . . 175
.sp
E.5 CCP Error Messages . . . . . . . . . . . . . . . . . 176
.sp
E.5.1 Diagnostic Error Messages . . . . . . . . . . 176
E.5.2 CCP Internal Logic Error Messages . . . . . . 179
.sp
E.6 DDT-8000 Error Messages . . . . . . . . . . . . . . . 180
.sp
E.6.1 Diagnostic Error Messages . . . . . . . . . . 180
E.6.2 DDT-8000 Internal Logic Error Messages . . . . 186
.sp
E.7 DUMP Error Messages . . . . . . . . . . . . . . . . . 187
.sp
E.8 LD8K Error Messages . . . . . . . . . . . . . . . . . 187
.sp
E.8.1 Fatal Diagnostic Error Messages . . . . . . . 187
E.8.2 LO68 Internal Logic Error Messages . . . . . . 191
.sp
E.9 XDUMP Error Messages . . . . . . . . . . . . . . . . . 191
.bp
.ft xi
.ce 2
.sh
Appendixes
.sp
.sh
(continued)
.qs
.sh
F New Functions and Implementation Changes\c
.qs
\ . . . . . . . . . 199
.sp
F.1 BDOS Function and Data Structure Changes . . . . . . 199
.sp
F.2 BDOS Functions Not Supported By CP/M-8000 . . . . . . 200
.bp
.ft xii
.ce
.sh
Tables, Figures, and Listings
.qs
================= TO BE REVISED ==========================
.sp 3
.sh
Tables
.qs
.sp
.nf
1-1. Program Modules in the CPM.SYS File . . . . . . . 1
1-2. CP/M-8000 Programmer's Guide Conventions . . . . . 2
1-3. CP/M-8000 Commands (Programmer's Guide) . . . . . 3
1-4. CP/M-8000 Commands (Users Guide) . . . . . . . . . 4
1-5. CP/M-8000 Commands (C Manual) . . . . . . . . . . 5
1-6. Delimiter Characters . . . . . . . . . . . . . . 6
1-7. CP/M-8000 Terminology . . . . . . . . . . . . . . 7
3-1. Values for Symbol Types . . . . . . . . . . . . . 18
3-2. Relocation Word Values (bits 0 through 2) . . . . 20
4-1. CP/M-8000 BDOS Functions . . . . . . . . . . . . . 23
4-2. BDOS Parameter Summary . . . . . . . . . . . . . 24
4-3. File Access Functions . . . . . . . . . . . . . . 26
4-4. Read-Write Error Response Options . . . . . . . . 29
4-5. Disk File Error Response Options . . . . . . . . 30
4-6. Unsuccessful Write Operation Return Codes . . . . 38
4-7. File Attributes . . . . . . . . . . . . . . . . . 43
4-8. Read Random Function Return Codes . . . . . . . . 45
4-9. Write Random Function Return Codes . . . . . . . 47
4-10. Current Position Definitions . . . . . . . . . . 49
4-11. Drive Functions . . . . . . . . . . . . . . . . . 52
4-12. Fields in the DPB and CDPB . . . . . . . . . . . 60
4-13. Character I/O Functions . . . . . . . . . . . . . 62
4-14. Direct Console I/O Function Values . . . . . . . 66
4-15. Line Editing Controls . . . . . . . . . . . . . . 70
4-16. I/O Byte Field Definitions . . . . . . . . . . . 75
4-17. System and Program Control Functions . . . . . . 77
4-18. Version Numbers . . . . . . . . . . . . . . . . . 79
4-19. Program Load Function Return Codes . . . . . . . 85
4-20. Load Parameter Block Options . . . . . . . . . . 86
4-21. Valid Vectors and Exceptions . . . . . . . . . . 90
4-22. TPAB Parameter Field Values, Bits 0 and 1 . . . . 93
5-1. Assembler Option . . . . . . . . . . . . . . . . 96
5-2. Assembly Language Directives . . . . . . . . . . 98
8-1. DDT-68K Command Summary . . . . . . . . . . . . . 106
A-1. Summary of BIOS Functions . . . . . . . . . . . . 117
C-1. Base Page Format: Offsets and Contents . . . . . 127
D-1. Instruction Set Summary . . . . . . . . . . . . . 128
D-2. Variations of Instruction Types . . . . . . . . . 131
E-1. AR68 Fatal Diagnostic Error Messages . . . . . . 157
E-2. AS68 Diagnostic Error Messages . . . . . . . . . 161
E-3. User-recoverable Fatal Error Messages . . . . . . 167
.bp
.ft xiii
.ce 2
.sh
Tables, Figures, and Listings
.sp
.sh
(continued)
.sp 3
.sh
Tables
.qs
E-4. BDOS Error Messages . . . . . . . . . . . . . . . 172
E-5. BIOS Error Messages . . . . . . . . . . . . . . . 175
E-6. CCP Diagnostic Error Messages . . . . . . . . . . 176
E-7. DDT-8000 Diagnostic Error Messages . . . . . . . . 180
E-8. DUMP Error Messages . . . . . . . . . . . . . . . 187
E-9. LO68 Fatal Diagnostic Error Messages . . . . . . 188
E-10. NM68 Error Messages . . . . . . . . . . . . . . . 192
E-11. RELOC Error Messages . . . . . . . . . . . . . . 193
E-12. SENDC68 Diagnostic Error Messages . . . . . . . . 196
E-13. SIZE68 Error Messages . . . . . . . . . . . . . . 197
F-1. New BDOS Functions . . . . . . . . . . . . . . . 199
F-2. BDOS Function Implementation Changes . . . . . . 199
F-3. BDOS Data Structure Implementation Changes . . . 200
F-4. BDOS Functions Not Supported by CP/M-8000 . . . . 200
.sp 2
.sh
Figures
.qs
.sp
2-1. Format of the Command Tail in the DMA Buffer . . 11
2-2. CP/M-8000 Default Memory Model . . . . . . . . . . 13
2-3. CP/M-8000 Memory Model with Inaccessible Memory . 14
3-1. Header for Contiguous Program Segments . . . . . 16
3-2. Header for Noncontiguous Program Segments . . . . 17
3-3. Entry in Symbol Table . . . . . . . . . . . . . . 18
4-1. FCB Format for Rename Function . . . . . . . . . 40
4-2. DPB and CDBP . . . . . . . . . . . . . . . . . . 59
4-3. I/O Byte . . . . . . . . . . . . . . . . . . . . 74
4-4. Command Line Format in the DMA Buffer . . . . . . 82
4-5. BIOS Parameter Block (BPB) . . . . . . . . . . . 84
4-6. Format of the Load Parameter Block (LPB) . . . . 86
4-7. Exception Parameter Block (EPB) . . . . . . . . . 88
4-8. Transient Program Parameter Block . . . . . . . . 92
4-9. Parameter Field in TPAB . . . . . . . . . . . . . 93
.sh
Listings
.qs
.sp
B-1. Transient Program Load Example 1 . . . . . . . . 143
B-2. Transient Program Load Example 2 . . . . . . . . 146
.nx one

View File

@@ -0,0 +1,592 @@
.bp odd
.fi
.he
.in 0
.cs 5
.pn 1
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.ce 2
.tc 1 Introduction to CP/M-8000
.sh
Section 1
.sp
.sh
Introduction to CP/M-8000
.sp 2
.pp 5
CP/M-8000 contains most of the facilities of other CP/M systems with
additional features required to address up to sixteen megabytes of main
memory available on the Z8000 microprocessor. The CP/M-8000 file system is
upwardly compatible with CP/M-80 Version 2.2 and CP/M-86 Version 1.1.
The CP/M-8000 file structure supports a maximum of sixteen drives with up to
512 megabytes on each drive and a maximum file size of 32 megabytes.
.ix file structure
.ix CP/M-8000 architecture
.ix CP/M-8000 operating system
.ix CPM.SYS file
.tc 1.1 CP/M-8000 System Architecture
.he CP/M-8000 Programmer's Guide 1.1 CP/M-8000 Architecture
.sp 2
.sh
1.1 CP/M-8000 Architecture
.pp
The CP/M-8000 operating system resides in the file CPM.SYS on
the system disk. A cold start loader resides on the first
two tracks of the system disk and loads the CPM.SYS file into memory
during a cold start. The CPM.SYS file contains the three program modules
described in Table 1-1.
====================== BOOT DETAILS TO BE FILLED IN LATER ===============
.sp 2
.ce
.sh
Table 1-1. Program Modules in the CPM.SYS File
.sp
.nf
.in 5
Module Mnemonic Description
.sp
.qs
.fi
.ll 60
.in 43
.ti -38
Console Command Processor CCP User interface that parses the
user command line.
.sp
.ti -38
Basic Disk Operating System BDOS Provides functions that access the
file system.
.sp
.ti -38
Basic I/O System BIOS Provides functions that interface
peripheral device drivers for I/O processing.
.in 0
.ix cold start loader
.ix CPM.SYS
.ix Console Command Processor
.ix CCP
.ix Basic Disk Operating System
.ix BDOS
.ix Basic I/O System
.ix BIOS
.ix exception vectors
.sp
.pp
.ll 65
The sizes of the CCP and BDOS modules are fixed for a given
release of CP/M-8000. The BIOS custom module, normally supplied by
the computer manufacturer or software distributor
depends
on the system configuration, which varies with the
implementation. Therefore, the size of the BIOS also varies with
the implementation.
.pp
The CP/M-8000 operating system can be loaded to execute in any
memory segment in the Z8000's memory space.
All CP/M-8000 modules remain resident in memory. The CCP cannot be
used as a data area subsequent to transient program load.
.sp 2
.tc 1.2 Transient Programs
.he CP/M-8000 Programmer's Guide 1.2 Transient Programs
.sh
1.2 Transient Programs
.qs
.ix transient programs
.pp
After CP/M-8000 is loaded in memory, the remaining segments of
address space that are not occupied by the CP/M-8000 operating
system are called the Transient Program Area (TPA). CP/M-8000 loads
executable files, called command files, from disk to the TPA.
These command files are also called transient commands or
transient programs because they temporarily reside in memory,
rather than being permanently resident in memory and configured in CP/M-8000.
The format of a command file is described in Section 3.
.ix transient program
.ix command file
.pp
Non-segmented transient programs may be run either in a single
TPA segment, or in two segments: one for instructions and one for
data (called "split I and D" spaces). Segmented programs may use
any segments of the TPA.
.ix segmented programs
.ix non-segmented programs.
.tc 1.3 File System Access
.he CP/M-8000 Programmer's Guide 1.3 File System Access
.sp 2
.sh
1.3 File System Access
.qs
.ix file system access
.pp
Programs do not specify absolute locations or default variables
when accessing CP/M-8000. Instead, programs invoke BDOS and BIOS
functions. Section 4 describes the BDOS functions in detail.
Appendix A lists the BIOS calls. Refer to the \c
.ul
CP/M-8000 Operating System System Guide \c
.qu
for detailed descriptions of the BIOS
functions. In addition to these functions, CP/M-8000 decreases
dependence on absolute addresses by maintaining a base page in
the TPA for each transient program in memory. The base page
contains initial values for the File Control Block (FCB) and the
Direct Memory Access (DMA) buffer. For details on the base page
and loading transient programs, refer to Section 2.
.tc 1.4 Programming Tools and Commands
.he CP/M-8000 Programmer's Guide 1.4 Programming Tools and Commands
.sp 2
.sh
1.4 Programming Tools and Commands
.qs
.ix programming tools and commands
.pp
CP/M-8000 contains a full set of programming tools that include an assembler
(AS8K), linker/relocator, (LD8K), Archive Utility (AR8K),
hex/ascii DUMP Utility, and object-file dump utility (XDUMP).
Each of these tools is discussed in the
latter part of this guide. Table 1-3 lists the commands that invoke these
tools. Table 1-2 describes command conventions used in this manual.
Tables 1-4 and 1-5 list other commands supported by CP/M-8000 and the manual
in which they are documented.
.ix operating system, access
.ix base page
.ix access, operating system
.sp 2
.ce
.sh
Table 1-2. CP/M-8000 Programmer's Guide Conventions
.sp
.nf
Convention Meaning
.sp
.fi
.ll 60
.in 23
.ti -18
[] Square brackets in a command line enclose optional
parameters.
.sp
.ti -18
nH The capital letter H follows numeric values that are
represented in hexadecimal notation.
.sp
.ti -18
numeric values Unless otherwise stated, numeric values are represented in
decimal notation.
.sp
.ti -18
(n) BDOS function numbers are enclosed in parentheses when they
appear in text.
.bp
.in 0
.ll 65
.ce
.sh
Table 1-2. (continued)
.sp
.nf
Convention Meaning
.sp
.fi
.ll 60
.in 23
.ti -18
.
.ti -18
. or ...
.ti -18
. A vertical or horizontal elipsis indicates missing elements
in a series unless noted otherwise.
.sp
.ti -18
RETURN The word RETURN refers to the RETURN key on the keyboard of
your console. Unless otherwise noted, to invoke a command, you must press
RETURN after you enter a command line from your console.
.sp
.ti -18
CTRL-X The mnemonic CTRL-X instructs you to press the key labeled
CTRL while you press another key indicated by the variable X. For example,
CTRL-C instructs you to press the CTRL key while you simultaneously press the
key lettered C.
.fi
.in 0
.ll 65
.sp
.pp
Table 1-3 describes commands used in the \c
.ul
CP/M-8000 Operating System Programmer's Guide.
.qu
.sp 2
.sh
.ce
Table 1-3. CP/M-8000 Commands (Programmer's Guide)
.sp
.ix CP/M-8000 commands
.ll 60
.in 21
.ti -16
Command Description
.sp
.qs
.ti -15
AR8K Invokes the Archive Utility (AR8K). AR8K creates a
library and/or deletes, adds, or extracts object modules from an
existing library, such as the C Run-time Library.
.sp
.ix AR8K
.ix archive utility (AR8K)
.ti -15
AS8K Invokes the Assembler (AS8K).
.sp
.ix AS8K
.ix Assembler (AS8K)
.ti -15
DDT Invokes DDT-8000, the CP/M-8000 debugger.
.sp
.ix DDT
.ix DDT-8000
.ti -15
DUMP Invokes the DUMP Utility that prints the contents of a file
in hexadecimal and ASCII notation.
.sp
.ix DUMP
.ix DUMP utility
.ti -15
LD8K Invokes the Linker.
.sp
.ix LD8K
.ti -15
XDUMP Invokes the XDUMP Utility that prints the header,
contents, and symbol table of an object or command file.
.sp
.ix XDUMP
.ix XDUMP utility
.bp
.in 0
.ll 65
.sh
.ce
Table 1-3. (continued)
.sp
.ix CP/M-8000 commands
.ll 60
.in 21
.ti -16
Command Description
.sp
.qs
.fi
.sp
.pp
Table 1-4 describes commands used in the \c
.ul
CP/M-8000 Operating System User's Guide.
.qu
.sp 2
.ce
.sh
Table 1-4. CP/M-8000 Commands (User's Guide)
.sp
.in 22
.ll 60
.ti -16
Command Description
.qs
.sp
.ti -15
DIR* Displays the directory of files on a specified disk.
.sp
.ix DIR*
.ti -15
DIRS* Displays the directory of system files on a
specified disk.
.sp
.ix DIRS*
.ti -15
ED Invokes the CP/M-8000 text editor.
.sp
.ix CP/M-8000 text editor
.ti -15
ERA* Erases one or more specified files.
.sp
.ix ERA*
.ti -15
PIP Copies, combines, and transfers specified files between
peripheral devices.
.sp
.ix PIP
.ti -15
REN* Renames an existing file to the new name specified in the
command line.
.sp
.ix REN*
.ti -15
SUBMIT* Executes a file of CP/M commands.
.sp
.ix SUBMIT*
.ti -15
TYPE* Displays the contents of an ASCII file on the
console.
.mb 5
.fm 1
.sp
.ix TYPE*
.ti -15
USER* Displays or changes the current user number.
.ix USER*
.sp
.in 0
.ll 65
.fi
.pp 5
* CP/M-8000 built-in commands
.bp
.mb 6
.fm 2
.pp
Table 1-5 describes commands used in the \c
.ul
C Programming Guide for CP/M-8000.
.sp 2
.ce
.sh
Table 1-5. CP/M-8000 Commands (C Manual)
.sp
.in 22
.ti -17
.ll 60
.nf
Command Description
.fi
.sp
.ti -15
========= C COMMANDS NEED WRITEUP ===========
C Invokes a submit file that invokes the C
compiler for compiling CP/M-8000 C source files.
.sp
.fi
.tc 1.5 CP/M-8000 File Specification
.he CP/M-8000 Programmer's Guide 1.5 File Specification
.sh
1.5 CP/M-8000 File Specification
.qs
.ix CP/M-8000 file specification
.pp
The CP/M-8000 file specification is compatible with other
CP/M systems. The format contains three fields: a 1-character drive
select code (d), a 1- through 8-character filename (f...f), and
a 1- through 3-character filetype (ttt) field as shown below.
.nf
.sp
Format d:ffffffff.ttt
.sp
Example B:MYRAH.DAT
.pp
.ix drive select code
.ix filetype fields
.fi
The drive select code and filetype fields are optional. A
colon (:) delimits the drive select field. A period (.)
delimits the filetype field. These delimiters are required only when
the fields they delimit are specified.
.pp
Values for the drive select code range from A through P
when the BIOS implementation supports 16 drives, the maximum
number allowed. The range for
the drive code is dependent on the BIOS implementation. Drives
are labeled A through P to correspond to the 1 through 16 drives
supported by CP/M-8000. However, not all BIOS implementations
support the full range.
.pp
The characters in the filename and filetype fields cannot contain
delimiters (the colon and period) and must be upper-case for the
CCP to parse the file specification. The CCP cannot access a
file that contains delimiters or lower-case characters. A command
line and its file specifications, if any, that are entered at the
CCP level are automatically put in upper-case internally before the CCP
parses them.
.ix delimiter characters
.pp
However, not all commands and file specifications are entered at the
CCP level. CP/M-8000 does not prevent you from including
delimiters or lower-case characters in file specifications
that are created or referenced by functions that bypass the CCP.
For example, the BDOS Make File Function (22) allows you to create a
file specification that includes delimiters and lower-case
characters, although the CCP cannot parse and access such a file.
.pp
In addition to the delimiter characters already mentioned, you
should avoid using the delimiter characters in Table 1-6 in the
file specification of a file you create. Several
CP/M-8000 built-in commands and utilities have special uses for
these characters.
.sp 2
.ce
.sh
Table 1-6. Delimiter Characters
.sp 2
.nf
Character Description
.sp
.qs
[] square brackets
.br
() parentheses
.br
<> angle brackets
.br
= equals sign
.br
* asterisk
.br
& ampersand
.br
, comma
.br
! exclamation point
.br
| bar
.br
? question mark
.br
/ slash
.br
$ dollar sign
.br
. period
.br
: colon
.br
; semicolon
.br
+ plus sign
.br
- minus sign
.sp 2
.fi
.he CP/M-8000 Programmer's Guide 1.6 Wildcards
.sp 2
.tc 1.6 Wildcards
.sh
1.6 Wildcards
.qs
.ix wildcards
.pp
CP/M-8000 supports two wildcards, the question mark (?) and the
asterisk (*). Several utilities and BDOS functions allow you
to specify wildcards in a file specification to perform the
operation or function on one or more files. However, BDOS
functions support only the ? wildcard.
.pp
The ? wildcard matches any character in the character
position occupied by this wildcard. For example, the file
specification M?RAH.DAT indicates the second letter of the
filename can be any alphanumeric character if the remainder of
file specification matches. Thus, the ? wildcard matches exactly one
character position.
.pp
The * wildcard matches one or more characters in the
field or remainder of a field that this wildcard occupies. CP/M-8000
internally pads the field or remaining portion of the field
occupied by the * wildcard with ?
wildcards before searching for a match. For example, CP/M-8000
converts the file B*.DAT to B???????.DAT before searching for a matching
file specification. Thus, any file that starts with the letter B
and has a filetype of DAT matches this file specification.
.pp
For details on wildcard support by a specific BDOS function, refer to
the description of the function in Section 4 of this guide. For
additional details on these wildcards and support by CP/M-8000 utilities,
refer to the \c
.ul
CP/M-8000 Operating System User's Guide.
.qu
.sp 2
.he CP/M-8000 Programmer's Guide 1.7 CP/M-8000 Terminology
.tc 1.7 CP/M-8000 Terminology
.sh
1.7 CP/M-8000 Terminology
.qs
.pp
Table 1-7 lists the terminology used throughout this guide to describe
CP/M-8000 values and program components.
.sp 2
.ce
.sh
Table 1-7. CP/M-8000 Terminology
.sp
.ix CP/M-8000 terminology
.in 5
.nf
Term Meaning
.qs
.fi
.ll 60
.in 28
.ti -23
.sp
Nibble 4-bit value
.sp
.ix nibble
.ti -23
Byte 8-bit value
.sp
.ix byte
.ti -23
Word 16-bit value
.sp
.ix word
.ti -23
Longword 32-bit value
.sp
.ix longword
.ti -23
Address 32-bit value that specifies a location in storage
.sp
.ix address
.ti -23
Offset A fixed displacement defined by the user to reference
a location in storage, other data source, or destination.
.sp
.ix offset
.ti -23
Text Segment The section of a program that contains the program
instructions.
.sp
.ix text segment
.ti -23
Data Segment The section of a program that contains initialized data.
.sp
.ix data segment
.ti -23
Block Storage The section of a program that
.sp 0
Segment (bss) contains uninitialized data.
.ix block storage segment (bss)
.ix bss
.ix segment, block
.ix segment, text
.ix segment, data
===================== POSSIBLY ADD DEFS FOR SEGMENTED ADDRESSES ==========
.fi
.ll 65
.in 0
.sp 2
.ce
End of Section 1
.bp
.he CP/M-8000 Programmer's Guide End of Section 1
.sp 50
.nx two

View File

@@ -0,0 +1,336 @@
.bp odd
.cs 5
.he
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.he
.ce 2
.tc 2 The CCP and Transient Programs
.sh
Section 2
.sp
.sh
The CCP and Transient Programs
.qs
.sp 2
.pp 5
This section discusses the Console Command
Processor (CCP), built-in and transient commands, loading and exiting
transient programs, and CP/M-8000 memory models.
.sp 2
.he CP/M-8000 Programmer's Guide 2.1 Built-in and Transient Commands
.tc 2.1 CCP Built-In and Transient Commands
.sh
2.1 CCP Built-in and Transient Commands
.qs
.pp
After an initial cold start, CP/M-8000 displays a sign-on message
at the console. Drive A, containing the system disk, is logged
in automatically. The standard prompt (>), preceded by the letter
A for the drive, is displayed on the console screen. This prompt
informs the user that CP/M-8000 is ready to receive a command line
from the console.
.pp
In response to the prompt, a user types the filename of a command
file and a command tail, if required. CP/M-8000 supports two types
of command files, built-in commands and transient commands.
Built-in commands are configured and reside in memory with
CP/M-8000. Transient commands are loaded in the TPA and do not
reside in memory allocated to CP/M-8000. The list below contains
the seven built-in commands that CP/M-8000 supports.
.ix built-in commands
.sp
.in 8
.nf
DIR
DIRS
ERA
REN
TYPE
USER
SUBMIT
.fi
.in 0
.ix transient command
.pp
A transient command is a machine-readable executable program file
in memory. A transient command file is loaded from disk to memory.
Section 3 describes the format of transient command files.
.pp
When the user enters a command line, the CCP parses it and tries to execute
the file specified. The CCP assumes a file is a command file when it has
any filetype other than .SUB. When the user specifies only the filename but
not the filetype, the CCP searches for and tries to execute a file with a
matching filename and a filetype of either 8000 or three blanks. The CCP
searches the current user number and user number 0 for a matching file. If
a command file is not found, but the CCP finds a matching file with a
filetype of SUB, the CCP executes it as a submit file.
.bp
.he CP/M-8000 Programmer's Guide 2.2 Loading A Program In Memory
.tc 2.2 Loading A Program In Memory
.sh
2.2 Loading A Program In Memory
.qs
.ix loading a program in memory
.ix program segments
.ix a user stack
.ix base page
.ix program, loading
.pp
Either the CCP or a transient program can load a program in
memory with the BDOS Program Load Function (59) described in Section 4.5.
After the program is loaded, the TPA contains, the program
segments (text, data, and bss), a user stack, and a base page. A
base page exists for each program loaded in memory. The base page
is a 256-byte data structure that defines a program's operating
environment. Unlike other CP/M systems, the base page in
CP/M-8000 does not
reside at a fixed absolute address prior to being loaded. The
BDOS Program Load Function (59) determines the absolute address
of the base page when the program is loaded into memory. The BDOS Program Load
Function (59) and the CCP or the transient program initialize the
contents of the base page and the program's stack as described
below.
.sp 2
.he CP/M-8000 Programmer's Guide 2.2 Loading A Program in Memory
.tc 2.2.1 Base Page Initialization By The CCP
.sh
2.2.1 Base Page Initialization By The CCP
.qs
.ix base page initialization
.pp
The CCP parses up to two filenames following the command in the input
command line. The CCP places the properly formatted FCBs in the base page.
The default DMA address is initialized at an offset of 0080H in the base
page. The default DMA buffer occupies the second half of the base page. The
CCP initializes the default DMA buffer to contain the command tail, as
shown in Figure 2-1. The CCP invokes the BDOS Program Load Function (59) to
load the transient program before the CCP parses the command line.
.pp
Program Load, Function 59, allocates space for the base page and
initializes base page values at offsets 0000H through 0024H from the
beginning of the base page (see Appendix C). Values at offsets 0025H
through 0037H are not initialized; but the space is reserved. The CCP
parses the command line and initializes values at offsets 0038H through
00FFH. Before the CCP gives control to the loaded program, the CCP pushes
the address of the transient program's base page and a return address
within the CCP on the user stack. When the program is invoked, the top of
the stack contains a return address within the CCP, which is pointed to by
the stack pointer, register A7. The address of the program's base page is
located at a 4-byte offset from the stack pointer.
.sp 2
.tc 2.2.2 Loading Multiple Programs
.sh
2.2.2 Loading Multiple Programs
.qs
.ix loading multiple programs
.pp
Multiple programs can reside in memory, but the CCP can load only
one program at a time. However, a transient program, loaded by
the CCP, can load one or more additional programs in memory. A
program loads another program in memory by invoking the BDOS
Program Load Function (59). Normally, the CCP supplies FCBs and
the command tail to this function. The transient program must
provide this information, if required, for any additional
programs it loads when the CCP is not present.
.ix file, loading
.ix multiple programs, loading
.bp
.tc 2.2.3 Base Page Initialization By A Transient Program
.sh
2.2.3 Base Page Initialization By A Transient Program
.qs
.pp
A transient program invokes the BDOS Program Load Function (59) to
load an additional program. The BDOS Program Load Function allocates space
and initializes base page values at offsets 0000H through 0024H for the
program as described in
Section 2.2.1. The transient program must initialize the base
page values that the CCP normally supplies, such as FCBs, the DMA
address, and the command tail, if the program being loaded requires these
values. The command tail contains the command parameters but not
the command. The format of the command tail in the base page
consists of a 1-byte character count, followed by the characters
in the command tail, and terminated by a null byte as shown in
Figure 2-1. The command tail cannot contain more than 126 bytes
plus the character count and the terminating null character.
.ix command tail
.sp 3
Count Characters in the Command Tail 0
1 byte N bytes <\b_ 126 bytes
.sp 2
.ce
.sh
Figure 2-1. Format of the Command Tail in the DMA Buffer
.qs
.sp 2
.pp
.fi
Unlike the CCP, a transient program does not necessarily push the address
of its base page and a return address on the user stack before giving
control to the program that it loads with the Program Load Function. The
transient program can be designed to push these addresses on the user stack
of the program it loads if the program uses the base page.
.pp
The address of the base page for the loaded program is not pushed on the
user stack by the Program Load Function (59). Instead, it is returned in the
load parameter block
(LPB), which is used by the BDOS Program Load Function. Appendix
C summarizes the offsets and contents of a base page. Appendix B
contains two examples, an assembly language program and a
C language program, which illustrate how a transient program
loads another program with the BDOS Program Load Function (59),
but without the CCP.
.sp 2
.he CP/M-8000 Programmer's Guide 2.3 Exiting Transient Programs
.tc 2.3 Exiting Transient Programs
.sh
2.3 Exiting Transient Programs
.qs
.ix exiting transient programs
.pp
CP/M-8000 supports the two ways listed below to exit a transient
program and return control to the CCP.
.sp 2
.in 5
.ix transient programs, exiting
.ti -2
o Interactively, the user types CTRL-C at the console, the default I/O
device
.bp
.sp
.ti -2
o Program a return to the CCP with:
.sp
.in 8
1) the BDOS System Reset Function (0)
.sp
.qi
.ne 10
.pp
A user typing CTRL-C from the console returns control to the CCP
only if the program uses any of the BDOS functions listed below.
.sp
.in 3
.nf
o Console Output (2)
o Print String (9)
o Read Console Buffer (10)
.fi
.sp
.in 0
On input, CTRL-C must be the first character that the user types
on the line. CTRL-C terminates execution of the main program and
any additional programs loaded beyond the CCP level. For example, a user
who types CTRL-C while debugging a program terminates
execution of the program being debugged and DDT-8000 before the
CCP regains control.
.pp
Typing CTRL-C in response to
the system prompt resets the status of all disks to read-write.
.pp
To program a return to the CCP, specify
the BDOS System Reset Function (0). (In programs written in C,
a subroutine return from the main program to the run-time package will cause
this function to be executed.)
.pp
Invoking the BDOS System Reset Function (0) described in Section 4.5 is
equivalent to programming a return to the CCP. This function
performs a warm boot, which terminates the execution of a program
before it returns program control to the CCP.
.ix BDOS System Reset Function (0)
.sp 2
.he CP/M-8000 Programmer's Guide 2.4 Transient Program Models
.tc 2.4 Transient Program Execution Model
.sh
2.4 Transient Program Execution Model
.qs
.pp
The memory model shown in Figure 2-2 illustrates the normal
configuration of the CP/M-8000 operating system after the CCP
loads a transient program. CP/M-8000 divides memory in two categories:
System and the Transient Program Area (TPA).
.mb 5
.fm 1
.pp
CP/M-8000 System memory contains the Basic Disk Operating
System (BDOS), the Basic I/O System (BIOS), the Console Command
Processor (CCP), and Exception Vectors. The bootstrap program
initializes the memory locations in which these
components reside. These the remaining components can
reside anywhere in a single memory segment, provided the BDOS and CCP are
contiguous.
.ix Basic Disk Operating System (BDOS)
.ix Basic I/O System (BIOS)
.ix Console Command Processor (CCP)
.ix exception vectors
.pp
The TPA consists of memory segments that are not
occupied by the CP/M-8000 operating system. A user stack, a base
page, the three program segments: a text segment, an initialized
data segment, and a block storage segment (bss) exist for each
transient program loaded in the TPA. The BDOS Program Load
Function (59) loads a transient program in the TPA. If memory
locations are not specified when the transient program is linked,
the program is loaded in the TPA as shown in Figure 2-2.
.sp 3
.in 5
.mb 6
.fm 2
.nf
======================= REPLACE WITH FIGURE FROM FRED'S TALK ===========
High Memory
BIOS
System CP/M-8000 BDOS
CCP
USER STACK
Transient FREE MEMORY
Program
Area
(TPA) BSS
DATA
TEXT
BASE PAGE
System EXCEPTION VECTORS
.fi
.in 0
.sp 2
.ce
.sh
Figure 2-2. CP/M-8000 Default Memory Model
.ix CP/M-8000 default memory model
.qs
.sp 2
.pp
Some systems can configure and load CP/M-8000 in such a manner that
one or more portions of memory cannot be addressed by the
CP/M-8000 operating system (see Figure 2-3). CP/M-8000 cannot
access this memory. CP/M-8000 does not know the memory
exists and cannot define or configure the memory in the BIOS.
However, a transient program that knows this memory exists can
access it. Also, note that CP/M-8000 does not support or require
memory management.
.sp 2
.ce
End of Section 2
.nx three

View File

@@ -0,0 +1,437 @@
.bp odd
.cs 5
.he
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.he
.ce 2
.tc 3 Command File Format
.sh
Section 3
.qs
.sp
.sh
Command File Format
.qs
.he CP/M-8000 Programmer's Guide 3.1 Command File Format
.sp 2
.pp 5
This section describes the format of a command file.
The linker processes one or more compiled or assembled files to
produce an executable machine-readable file called a command
file. By default, a command file has a filetype of 8000.
.ix command file
.ix symbol table
.pp
A command file always contains a header, two program segments
(a text segment and an initialized data segment), and optionally
contains a symbol table and relocation information. These components are
described in the following sections.
============ THE ENTIRE REMAINDER OF THIS SECTION MUST BE ==========
============ RE-WRITTEN BASED ON INFORMATION IN X.OUT.H ==========
.sp 2
.tc 3.1 The Header and Program Segments
.sh
3.1 The Header and Program Segments
.ix header
.ix program segments
.qs
.pp
The header, the first component in the file, specifies
the size and starting address of the other components in the command
file, which are listed below.
.sp 2
.in 5
.ti -2
o Program segments:
.sp
text: contains the program instructions.
.sp
.in 12
.ti -7
data: contains data initialized within the command file.
.sp
.ti -7
block storage segment (bss):
.sp 0
specifies space for uninitialized data generated by the program during
execution. Although space for the bss is specified in the source command
file, the space is not allocated until the command file is loaded in memory.
Therefore, the source command file on the disk contains no uninitialized data.
.sp
.in 5
.ti -2
o Symbol table: defines referenced symbols.
.sp
.ti -2
o Relocation information:
.sp 0
.in 12
specifies the relative relocation of
each word within each program segment, if required.
.in 0
.sp
.ix command file format
.pp
The command file format supports two types of headers. The size
and content of each type differs. The contiguity of the program
segments determines which type of header a command file contains.
When the program segments must be contiguous, the file contains a
14-word header in the format shown in Figure 3-1. When the
program segments can be noncontiguous, the file contains an
18-word header in the format shown in Figure 3-2. The first word
of each header contains a hexadecimal integer that defines which
type of header the file contains.
.sp 3
.po 5
.nf
Byte Sample Values Size Contents
Offset
1 Word Integer 601AH denotes text,
0H 601AH data, and bss are contiguous
2H 2376H 1 Longword Number of bytes in text segment
6H 422H 1 Longword Number of bytes in data segment
0AH 1806H 1 Longword Number of bytes in bss
0EH 142H 1 Longword Number of bytes in symbol table
12H 0000H 1 Longword Reserved; always zero
16H 500H 1 Longword Beginning of text segment and
of program execution
1AH 00H
1 Word Integer flag for relocation
bits; if 0, relocation bits
exist; if not 0, no relocation
bits exist.
.fi
.po 10
.ce
.sh
Figure 3-1. Header for Contiguous Program Segments
.qs
.sp 2
.pp
To create a file that can contain noncontiguous program segments,
specify the -T, -D, and -B linker options described in
Section 6 when you link the files. The header, identified by
601BH denotes the size and location of each program
segment. Note that this header indicates the program segments
can be noncontiguous and does not imply the segments must be
noncontiguous. See Figure 3-2.
.sp 2
.ne 32
.nf
.po 5
Byte Sample Values Size Contents
Offset
1 Word Integer 601BH denotes text, data,
0H 601BH and bss can be noncontiguous
2H 57864H 1 Longword Number of bytes in text segment
6H 446H 1 Longword Number of bytes in data segment
0AH 2568H 1 Longword Number of bytes in bss
0EH 69H 1 Longword Number of bytes in symbol table
12H 0000H 1 Longword Reserved; always zero
16H 500H 1 Longword Beginning of text segment
1AH 00H
1 Word Integer flag for relocation bits;
if 0, relocation bits exist; if
not 0, no relocation bits exist.
1CH 57D64H 1 Longword Starting address of data segment
20H 581AAH 1 Longword Starting address of bss
.fi
.po 10
.sp 2
.ce
.sh
Figure 3-2. Header for Noncontiguous Program Segments
.sp
.qs
.he CP/M-8000 Programmer's Guide 3.2 The Symbol Table
.sp
.pp
The linker computes the size of the segments in bytes. The result is always
rounded up to an even number. For example, the linker adds a byte to a program
segment that contains an odd number of bytes. The linker does not include the
size of the header when it computes the size of the segments.
.pp
After a program is linked and loaded in memory, it contains three
program segments:
text, initialized data, and uninitialized data (bss).
The BDOS Program Load Function (59) zeroes the
bss when a program is loaded. A program begins
execution at the beginning of the text segment. See Figures 3-1 and 3-2
above.
.sp 2
.tc 3.2 The Symbol Table
.he CP/M-8000 Programmer's Guide 3.2 The Symbol Table
.sh
3.2 The Symbol Table
.qs
.pp
The symbol table lists all the symbols specified in a program.
Each symbol in the table consists of a 7-word entry that describes the symbol
name, type, and value. See Figure 3-3.
.bp
.ix symbol table
.in 3
.nf
Field BYTE
N A WORD
M E
Name
Null Null
Null Null
Type A400H
Value A6F0H
.sp
.fi
.in 0
.ce
.sh
Figure 3-3. Entry in Symbol Table
.sp 2
.pp
The name
field, the first four words, contains the ASCII name of the
symbol. This field is padded with null characters when the ASCII
name is less than eight characters. The fifth word contains the
symbol type. Valid values are listed in Table 3-1.
.sp 2
.ce
.sh
Table 3-1. Values For Symbol Types
.sp
Type Value
.sp
.qs
defined 8000H
.sp
equated 4000H
.sp
global 2000H
.sp
equated register 1000H
.sp
external reference 800H
.sp
data based relocatable 400H
.sp
text based relocatable 200H
.sp
bss based relocatable 100H
.sp
.pp
When specifying a symbol type with multiple characteristics, the
linker uses an OR instruction to combine several of the above
values. For example, to specify a defined, global, data based,
relocatable symbol, the linker combines the values of each
characteristic for a value of A400H.
.ix symbol type
.pp
The last field in an entry is the value field. It consists of a
longword that contains the value of the symbol. The value can be
an address, a register number, the value of an expression, or
some other value. When the value field is nonzero and the type
field contains an external symbol, the linker
interprets the symbol to be a common region in which the size of
the region equals the value of the symbol.
.sp 2
============= ALL PRINTING OF OBJECT FILE INFO DONE WITH XDUMP =========
.ix symbol table, printing
.tc 3.2.1 Printing The Symbol Table
.sh
3.2.1 Printing The Symbol Table
.qs
.pp
Use the NM68 Utility to print the symbol table of an object or
command file. To invoke this utility, specify
the NM68 command and filename as shown below.
.sp
.ti 8
NM68 filename.O [>filespec]
.pp
You must enter the filename of an object file or a command
file. You can optionally redirect the NM68 output from your console to a
file. To redirect the NM68 output to a file, specify a
greater than sign (>) followed by a file specification after
the filename and filetype of the file from which NM68 prints the
symbol table.
.pp
The NM68 utility does not sort the symbols; it prints them in the order in
which they appear in the file. Each symbol name is printed, followed by its
value and one or more of the type descriptors listed below:
.sp 2
.nf
.in 3
o equ (equated)
o global
o equreg (equated register)
o external
o data
o text
o bss
o abs (absolute)
.fi
.in 0
.sp 2
.he CP/M-8000 Programmer's Guide 3.3 Relocation Information
.tc 3.3 Relocation Information
.sh
3.3 Relocation Information
.qs
.ix relocation information
.pp
Relocation information is optional. The header relocation word,
the last word in the header, indicates whether relocation
information exists. When its value is zero, relocation
information exists. None exists when the its value is nonzero.
.pp
Relocation information specifies the relocation of words in program
segments. One word of relocation information, called a relocation word,
exists for each word in each of the program segments. The assembler and
compiler generate relocation words for external symbols and address
constants referenced in the text and data program segments. The linker and
sometimes the BDOS Program Load Function (59) use these relocation words as
described below.
.pp
The linker resolves external symbols when
linking files by modifying bits 0 through 2 of each relocation
word that references an external symbol.
After being modified, the relocation word indicates the program
segment that the symbol references. Therefore, instead
of referencing an external symbol, the relocation word references
a word located in one of the program segments. Because the
linker only modifies relocation words that refer to external
symbols, relocation words that do not reference this type of
symbol have the same value in the source file input to the linker
and the
executable file output by the linker.
.ix relocation words
.pp
================= RELOCATION ON LOADING IS NOT SUPPORTED =============
The BDOS Program Load Function uses relocation words when it
loads a program in a location other than the one at which it was
linked. The Program Load Parameter Block (LPB) used by the
Program Load Function specifies where the program is loaded. When
the LPB specifies a location other than the linked location, the
BDOS computes a bias (the difference between where a program
segment is linked and where it will be loaded in memory). When
loading the program, the BDOS adds the bias as indicated by the
relocation words to the address of the relocatable words in the
text and/or data segments. However, when the BDOS loads the
program in the memory locations at which it was linked, the BDOS
does not use the relocation words.
.ix Program Load Parameter Block (LPB)
.sp 2
.tc 3.3.1 The Format of A Relocation Word
.sh
3.3.1 The Format Of A Relocation Word
.qs
.pp
A relocation word is a 16-bit quantity. Bits 0 through 2 in each
relocation word indicate the type of address referenced and, if
applicable, designate the segment to which the relocation word
refers. Values for these bits are described in Table 3-2.
.sp 2
.sh
.ce
Table 3-2. Relocation Word Values (bits 0 through 2)
.sp
.in 5
.ll 60
Value Description
.in 12
.ti -5
.sp
00 no relocation information required; the reference is absolute
.sp
.ti -5
01 reference relative to the base address of the data segment
.sp
.ti -5
02 reference relative to the base address of the text segment
.sp
.ti -5
03 reference relative to the base address of the bss
.sp
.ti -5
04 references an undefined symbol
.sp
.ti -5
05 references the upper word of a longword; the next relocation word
contains the value determining whether the reference is absolute or
dependent on the base address of the text or data segments, or the bss.
.bp
.in 0
.ll 65
.sh
.ce
Table 3-2. (continued)
.sp
.in 5
.ll 60
Value Description
.in 12
.sp
.ti -5
06 16-bit PC-relative reference
.sp
.ti -5
07 indicates the first word of an instruction, which does not
require relocation information.
.in 0
.ll 65
.mb 6
.fm 2
.pp
The remaining bits, 3 through 15, are not used unless the program
references an external symbol. In that case, these bits contain
an index to the symbol table. The index specifies the entry
number of the symbol listed in the symbol table. Entry numbers in the
symbol table are numbered sequentially starting with zero.
.he CP/M-8000 Programmer's Guide 3.3 Relocation Words
.sp 2
.ce
End of Section 3
.bp
.he CP/M-8000 Programmer's Guide End of Section 3
.sp 50
.nx four

View File

@@ -0,0 +1,533 @@
.bp odd
.pn 23
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.he
.ce 2
.tc 4 Basic Disk Operating System Functions
.sh
Section 4
.sp
.sh
Basic Disk Operating System (BDOS) Functions
.qs
.he CP/M-8000 Programmer's Guide 4 BDOS Functions
.sp
.pp 5
To access a file or a drive, to output characters to the console, or
to reset the system, your program must access the CP/M-8000
file system through the Basic Disk Operating System (BDOS).
The BDOS provides functions that allow your program to perform
these tasks. Table 4-1 summarizes the BDOS functions.
.sp 2
.ce
.sh
Table 4-1. CP/M-8000 BDOS Functions
.qs
.sp
.ix BDOS functions
.in 1
.nf
F# Function Type
.sp
0 System Reset System/Program Control
1 Console Input Character I/O, Console Operation
2 Console Output Character I/O, Console Operation
3 Auxiliary Input* Character I/O, Additional Serial I/O
4 Auxiliary Output* Character I/O, Additional Serial I/O
5 List Output Character I/O, Additional Serial I/O
6 Direct Console I/O Character I/O, Console Operation
7 Get I/O Byte* I/O Byte
8 Set I/O Byte* I/O Byte
9 Print String Character I/O, Console Operation
10 Read Console Buffer Character I/O, Console Operation
11 Get Console Status Character I/O, Console Operation
12 Return Version Number System Control
13 Reset Disk System Drive
14 Select Disk Drive
15 Open File File Access
16 Close File File Access
17 Search for First File Access
18 Search for Next File Access
19 Delete File File Access
20 Read Sequential File Access
21 Write Sequential File Access
22 Make File File Access
23 Rename File File Access
24 Return Login Vector Drive
25 Return Current Disk Drive
26 Set DMA Address File Access
28 Write Protect Disk Drive
29 Get Read-Only Vector Drive
30 Set File Attributes File Access
31 Get Disk Parameters Drive
32 Set/Get User Code System/Program Control
33 Read Random File Access
34 Write Random File Access
35 Compute File Size File Access
* Must be implemented in the BIOS
.bp
.in 0
.fi
.ce
.sh
Table 4-1. (continued)
.qs
.sp
.in 1
.nf
F# Function Type
.sp
36 Set Random Record File Access
37 Reset Drive Drive
40 Write Random With File Access
Zero Fill
46 Get Disk Free Space Drive
47 Chain To Program System/Program Control
48 Flush Buffers System/Program Control
50 Direct BIOS Call System/Program Control
59 Program Load System/Program Control
61 Set Exception Vector Exception
62 Set Supervisor State Exception
63 Get/Set TPA Limits Exception
.in 0
.fi
.sp 2
.tc 4.1 BDOS Functions and Parameters
.he CP/M-86K Programmer's Guide 4.1 BDOS Functions
.sh
4.1 BDOS Functions and Parameters
.qs
.pp
To invoke a BDOS function, you must specify one or more parameters. Each
BDOS function is identified by a number, which is the first parameter you
must specify. The function number is loaded in register R5.
Some functions require a second parameter, which is
loaded, depending on its size, in word register R7 or longword register RR6.
Byte parameters are passed as 16-bit words.
The low order byte contains the data, and the high order byte should be
zeroed. For example, the second parameter for the Console Output Function
(2) is an ASCII character, which is a byte parameter. The character is
loaded in the low order byte of R7. Some BDOS
functions return a value, which is passed in
register R7. The hexadecimal value FFFF is returned in register R7
when you specify an invalid function number in your program. Table 4-2
illustrates
the syntax and summarizes the registers that BDOS functions use.
.ix BDOS parameters
.sp 2
.ce
.sh
Table 4-2. BDOS Parameter Summary
.sp
.in 13
.nf
BDOS Parameter Register
.sp
Function Number R5
Word Parameter R7
Longword Parameter RR6
Return Value, if any R7
.fi
.in 0
.sp 2
.tc 4.1.1 Invoking BDOS Functions
.sh
4.1.1 Invoking BDOS Functions
.qs
.pp
After the parameters for a function are loaded in the appropriate
registers, the program must specify a SC #2 (system call) instruction to
access the BDOS and invoke the function. The example below
illustrates the assembler syntax required to invoke the Console
Output Function (2).
.ix BDOS functions, invoking
.sp
.nf
ld r5,#2 ;Moves the function number to R5
.sp
ld r7,#'U' ;Moves the ASCII character upper-case U
;to R7
.sp
sc #2 ;Accesses the BDOS to invoke the function.
.sp
.fi
.pp
The example above outputs the ASCII character upper-case U to the
console. The assembler moves instructions load register R5 with
the number 2 for the BDOS Console Output Function and register
R7 with the ASCII character upper-case U. A pair of single ('') or
double ("") quotation marks must enclose an ASCII character. The
SC #2 instruction
invokes the BDOS Output Console Function, which echos the
character on the console's screen.
.ix Invoking BDOS Functions
.ix SC #2 Instruction
.ix BDOS output console function
.sp 2
.he CP/M-8000 Programmer's Guide 4.1 BDOS Functions
.tc 4.1.2 Organization Of BDOS Functions
.ix BDOS Functions, organization of
.sh
4.1.2 Organization Of BDOS Functions
.qs
.pp
The parameters and operation performed by each BDOS function are
described in the following sections. Each BDOS function is
categorized according to the function it performs. The categories
are listed below.
.sp
.in 3
.nf
o File Access
o Drive Access
o Character I/O
o System/Program Control
o Exception
.fi
.in 0
.pp
As you read the description of the functions, notice that some
functions require an address parameter designating the starting location
of the direct memory access (DMA) buffer or file control block (FCB).
The DMA buffer is an area in memory where a 128-byte record
resides before a disk write function and after a disk read
operation. Functions often use the DMA buffer to obtain or
transfer data. The FCB is a 33- or 36-byte data structure that file
access functions use. The FCB is described in
Section 4.2.1.
.sp 2
.he CP/M-8000 Programmer's Guide 4.2 File Access Functions
.tc 4.2 File Access Functions
.sh
4.2 File Access Functions
.qs
.ix file access functions
.pp
This section describes file access functions that create, delete,
search for, read, and write files. They include the
functions listed in Table 4-3.
.bp
.ce
.sh
Table 4-3. File Access Functions
.sp
.in 1
.nf
Function Function Number
.qs
.sp
Open File 15
.sp
Close File 16
.sp
Search For First 17
.sp
Search For Next 18
.sp
Delete File 19
.sp
Read Sequential 20
.sp
Write Sequential 21
.sp
Make File 22
.sp
Rename File 23
.sp
Set DMA Address 26
.sp
Read Random 33
.sp
Write Random 34
.sp
Compute File Size 35
.sp
Write Random With
Zero Fill 40
.fi
.in 0
.sp 2
.tc 4.2.1 A File Control Block (FCB)
.sh
4.2.1 A File Control Block (FCB)
.qs
.pp
Most of the file access functions in Table 4-3 require the
address of a File Control Block (FCB). A FCB is a 33- or 36-byte
data structure that provides file access information. The FCB can
be 33 or 36 bytes when a file is accessed sequentially, but it must be
36 bytes when a file is accessed randomly. The last three bytes
in the 36-byte FCB contain the random record number, which is
used by random I/O functions and the Compute File Size Function
(35). The starting location of a FCB must be an even-numbered
address. The format of a FCB and definitions of each of its
fields are below.
.bp
.nf
Field dr f1 f2 ... f8 t1 t2 t3 ex s1 s2 rc d0 ... dn cr r0 r1 r2
.sp
Byte 00 01 02 ... 08 09 10 11 12 13 14 15 16 ... 31 32 33 34 35
.sp
.nf
dr drive code (0 - 16)
0 => use default drive for file
1 => auto disk select drive A,
2 => auto disk select drive B,
...
16=> auto disk select drive P.
f1...f8 contain the filename in ASCII
upper-case. High bit should equal 0
when the file is opened.
t1,t2,t3 contain the filetype in ASCII
upper-case. The high bit should equal 0
when the file is opened. For the Set File
Attributes Function (see Section 4.2.13),
t1', t2', and t3' denote the high bit. The
list below indicates which attributes are set
when these bits are set and equal the value 1.
t1' = 1 => Read-Only file
t2' = 1 => SYS file
t3' = 1 => Archive
ex contains the current extent number,
normally set to 00 by the user, but is in the
range 0 - 31 (decimal) for file I/O
s1 reserved for internal system use
s2 reserved for internal system use, set to zero for
Open (15), Make (22), Search (17,18) file functions.
rc record count field, reserved for system use
d0...dn filled in by CP/M, reserved for
system use
cr current record to be read or written;
for a sequential read or write file
operation, the program normally sets
this field to zero to access the first
record in the file
r0,r1,r2 optional, contain random record number
in the range 0-3FFFFH; bytes r0, r1, and r2
are a 24-bit value with the most significant
byte r0 and the least significant byte r2.
Random I/O functions use the random record
number in this field.
.fi
.pp
For users of other versions of CP/M, note that both CP/M-80
Version 2.2 and CP/M-8000 perform directory operations in a
reserved area of memory that does not affect the DMA buffer
contents, except for the Search For First (17) and Search For
Next (18) Functions in which the directory record is copied to
the current DMA buffer.
.sp 2
.tc 4.2.2 File Processing Errors
.sh
4.2.2 File Processing Errors
.qs
.ix file processing errors
.pp
When a program calls a BDOS function to process a file, an error condition can
cause the BDOS to return one of five error messages to the console:
.sp
.in 3
.nf
o CP/M Disk read error
o CP/M Disk write error
o CP/M Disk select error
o CP/M Disk change error
o CP/M Disk file error: ffffffff.ttt is read-only.
.fi
.in 0
.ix disk read error
.ix disk write error
.ix disk select error
.ix disk change error
.ix disk file error
.sp
.in 0
Except for the CP/M Disk file error, CP/M-8000 displays the error message at
the console in the format:
.sp
.ti 8
"error message text" on drive x
.sp
The "error message text" is one of the error messages listed above. The
variable x is a one-letter drive code that indicates the drive on which
CP/M-8000 detects the error. CP/M-8000 displays the CP/M Disk file error in
the format shown above.
.pp
When CP/M-8000 detects one of these errors, the BDOS traps it.
CP/M-8000 displays a message indicating the error and, depending on the
error, allows you to abort the program, retry the operation, or continue
processing. Each of these errors and their options are described below.
.ix read error
.ix write error
.pp
CP/M issues a CP/M Disk read or write error when the BDOS receives a
hardware error from the BIOS. The BDOS specifies BIOS read and write
sector commands when the BDOS executes file-related system functions. If
the BIOS read or write routine detects a hardware error, the BIOS returns
an error code to the BDOS that results in CP/M-8000 displaying a disk
read or write error message at your console. In addition to the error
message, CP/M-8000 also displays the option message:
.sp
.nf
Do you want to Abort (A), Retry (R), or Continue with bad data (C)?
.fi
.sp
In response to the option message, you type one of the
letters enclosed in parentheses and a RETURN. Each of these
options is described below.
.bp
.ce
.sh
Table 4-4. Read-Write Error Message Response Options
.qs
.in 5
.sp
.nf
Option Action
.fi
.sp
.ll 60
.in 18
.ti -10
A The A option or CTRL-C aborts the program and returns control to
the CCP. CP/M-8000 returns the system prompt (>) preceded by the drive code.
.sp
.ti -10
R The R option retries the operation that caused the error. For
example, it rereads or rewrites the sector.
If the operation succeeds, program execution continues
as if no error occurred. However, if the operation fails, the error
message and option message is displayed again.
.sp
.ti -10
C The C option ignores the error that occurred and continues
program execution. The C option is not an appropriate response for all
types of programs. Program execution should not be continued in some cases.
For example, if you are updating a data base and receive a read or write
error but continue program execution, you can corrupt the index fields and
the entire data base. For other programs, continuing program execution is
recommended. For example, when you transfer a long text file and receive an
error because one sector is bad, you can continue transferring the file.
After the file is transferred, review the file. Using an editor, add the
data that was not transferred due to the bad sector.
.in 0
.ll 65
.sp
.pp
Any response other than an A, R, C, or CTRL-C is invalid. The BDOS
reissues the option message if you enter any other response.
.pp
The CP/M Disk select error occurs when you select a disk but
you receive an error due to one of the conditions below.
.sp
.in 3
.nf
o You specified a disk drive not supported by the BIOS.
o The BDOS receives an error from the BIOS.
o You specified a disk drive outside the range A through P.
.sp
.mt 4
.hm 1
.in 0
.fi
Before the BDOS issues a read or write function to
the BIOS, the BDOS issues a disk select function to the BIOS. If the BIOS
does not support the drive specified in the function, or if an error occurs,
the BIOS returns an error to the BDOS, which in turn, causes CP/M-8000 to
display the disk select error at your console. If the error is caused by
a BIOS error, CP/M-8000 returns the option message:
.sp
.in 8
Do you want to Abort (A) or Retry (R)?
.sp
.qi
To select one of the options in the message, specify one of the letters
enclosed in parentheses. The A option terminates the program and
returns control to the CCP. The R option tries to select the disk
again. If the disk select function fails, CP/M-8000 redisplays the disk
select error message and the option message.
.pp
.mb 5
.fm 1
However, if the error is caused because you specify a disk drive outside
the range A through P, only the CP/M Disk select error is
displayed. CP/M-8000 aborts the program and returns control to the CCP.
.pp
Your console displays the CP/M Disk change error message when the BDOS
detects the disk in the drive is not the same disk that was logged in
previously. Your program cannot recover
from this error. Your program
terminates. CP/M-8000 returns program control to the CCP.
.pp
You log in a disk by accessing the disk or resetting the disk
or disk system. The Select Disk Function (14) resets a disk. The Reset Disk
System Function (13) resets the disk system. Files
cannot be open when your program invokes either of these functions.
.ix disk file error
.pp
You receive the CP/M Disk file error and option messages (shown below) if
you call the BDOS to write to a file that is set to read-only status.
Either a STAT command or the BDOS Set File Attributes Function (30) sets a
file to read-only status.
.sp
.in 8
CP/M Disk file error: ffffffff.ttt is read-only.
.sp
Do you want to: Change it to read/write (C), or Abort (A)?
.sp
.qi
The variable ffffffff.ttt in the error message denotes the filename and
filetype. To select one of the options, specify one of the letters
enclosed in parentheses. Each option is described below.
.sp 2
.ce
.sh
Table 4-5. Disk File Error Response Options
.qs
.in 5
.sp
.nf
Option Action
.fi
.ll 60
.in 16
.sp
.ti -8
C Changes the status of this file from read-only to
read-write and continues executing the program that was being
processed when this error occurred.
.sp
.mt 5
.hm 2
.ti -8
A Terminates execution of the program that was being processed
and returns program control to the CCP. The status of the file remains
read-only. If you enter a CTRL-C, it has the same effect as specifying the
A option.
.in 0
.ll 65
.sp
.pp
CP/M-8000 reprompts with the option message if you enter any response
other than those described above.
.mb 6
.fm 2
.nx fourb

View File

@@ -0,0 +1,475 @@
.bp
.pn 31
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.tc 4.2.3 Open File Function
.sh
4.2.3 Open File Function
.qs
.sp
.ix open file function
.nf
.sp 3
FUNCTION 15: OPEN FILE
Entry Parameters:
Register R5: 0FH
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H - 03G
error: FFH
.sp 2
.fi
.pp 5
The Open File Function matches the filename and filetype fields of the FCB
specified in register RR6 with these fields of a directory entry for an
existing file on the disk. When a match occurs, the BDOS sets the FCB
extent (ex) field and the second system (S2) field to zero before the BDOS
opens the file. Setting these one-byte fields to zero opens the file at the
base extent, the first extent in the file. In CP/M-8000, files can be opened
only at the base extent. In addition, the physical I/O mapping information,
which allows access to the disk file through subsequent read and write
operations, is copied to fields d0 through dn of the FCB. A file cannot be
accessed until it has been opened successfully. The open function returns
an integer value ranging from 00H through 03H in R7 when the open
operation is successful. The value FFH is returned in register R7 when
the file cannot be found.
.ix wildcard
.pp
The question mark (?) wildcard can be specified
for the filename and filetype fields of the FCB referenced by
register RR6. The ? wildcard has the value 3FH. For each position
containing a ? wildcard, any character constitutes a match. For
example, if the filename and filetype fields of the FCB
referenced by RR6 contain only ? wildcards, the BDOS accesses the
first directory entry. However, you should not create a FCB of all wildcards
for this function because you cannot ensure which file this function
opens.
.pp
Note that the current record field (cr) in the FCB must be set to
zero by the program for the first record in the file to be
accessed by subsequent sequential I/O functions. However, setting the
current record field to zero is not required to open the file.
.ix wildcard
.ix open file
.bp
.tc 4.2.4 Close File Function
.sh
4.2.4 Close File Function
.qs
.ix close file function
.sp
.nf
.sp 3
FUNCTION 16: CLOSE FILE
Entry Parameters:
Register R5: 10H
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H - 03H
error: FFH
.sp 2
.fi
.pp
The Close File Function performs the inverse of the Open File
Function. When the FCB passed in RR6 was opened previously by either
an Open File (15) or Make File (22) Function, the close function
updates the FCB in the disk directory. The
process used to match the FCB with the directory entry is
identical to the Open File Function (15). An integer value
ranging from 00H though 03H is returned in R7 for a successful
close operation. The value FFH is returned in R7 when the file
cannot be found in the directory. When only read functions access
a file, closing the file is not required. However, a file must be
closed to update its disk directory entry when write functions access the
file.
.ix close file
.bp
.tc 4.2.5 Search For First Function
.sh
4.2.5 Search For First Function
.qs
.sp 3
.ix search for first function
.nf
FUNCTION 17: SEARCH FOR FIRST
Entry Parameters:
Register R5: 11H
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H - 03H
error: FFH
.sp 2
.fi
.pp
The Search For First Function scans the disk directory allocated
to the current user number to match the filename and filetype of
the FCB addressed in register RR6 with the filename and filetype
of a directory entry. The value FFH is returned in register R7
when a matching directory entry cannot be found. An
integer value ranging from 00H through 03H is returned in
register R7 when a matching directory entry is found.
.ix disk directory
.pp
The directory record containing the matching entry is copied to
the buffer at the current DMA address. Each directory record
contains four directory entries of 32 bytes each. The integer value returned in
R7 indexes the relative location of the matching directory
entry within the directory record. For example, the value 01H
indicates that the matching directory entry is the second one in the directory
record in the buffer. The relative starting position of the directory
entry within the buffer is computed by multiplying the value
in R7 by 32 (decimal), which is equivalent to shifting the
binary value of R7 left 5 bits.
.ix search for first
.pp
When the drive (dr) field contains a ? wildcard, the auto disk
select function is disabled and the default disk is searched. All
entries including empty entries for all user numbers in the
directory are searched. The search function returns any matching
entry, allocated or free, that belongs to any user number. An
allocated directory entry contains the filename and filetype of
an existing file. A free entry is not assigned to an existing
file. If the first byte of the directory entry is E5H, the entry
is free. A free entry is not always empty. It can contain the
filename and filetype of a deleted file because the directory
entry for a deleted file is not zeroed.
.bp
.tc 4.2.6 Search For Next Function
.sh
4.2.6 Search For Next Function
.qs
.sp
.ix search for next function
.nf
.sp 3
FUNCTION 18: SEARCH FOR NEXT
Entry Parameters:
Register R5: 12H
Returned Values:
Register R7: Return Code
success: 00H - 03H
error: FFH
.fi
.sp 2
.pp
The Search For Next Function scans the disk directory for an
entry that matches the FCB and follows the last matched entry, found
with this or the Search For First Function (17).
.pp
A program must invoke a Search For First Function before invoking
this function for the first time. Subsequent Search For Next
Functions can follow, but they must be specified
without other disk related BDOS functions intervening. Therefore,
a Search For Next Function must follow either itself or a Search
For First Function.
.pp
The Search For Next
Function returns the
value FFH in R7 when no more directory entries match.
.ix search for next
.bp
.tc 4.2.7 Delete File Function
.sh
4.2.7 Delete File Function
.qs
.ix delete file function
.sp 3
.nf
FUNCTION 19: DELETE FILE
Entry Parameters:
Register R5: 13H
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H
error: FFH
.fi
.sp 2
.pp
The Delete File Function removes files and deallocates the
directory entries for and space allocated to files that match the
filename in the FCB pointed to by the address passed in RR6. The
filename and filetype can contain wildcards, but the drive select
code cannot be a wildcard as in the Search For First (17) and
Search For Next (18) Functions. The value FFH is returned in
register R7 when the referenced file cannot be found. The
value 00H is returned in R7 when the file is found.
.ix delete file
.bp
.tc 4.2.8 Read Sequential Function
.sh
4.2.8 Read Sequential Function
.qs
.sp 3
.ix read sequential function
.nf
FUNCTION 20: READ SEQUENTIAL
Entry Parameters:
Register R5: 14H
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H
error: 01H
.sp 2
.fi
.pp
The Read Sequential Function reads the next 128-byte record in a
file. The FCB passed in register RR6 must have been opened by
an Open File (15) or the Make File Function (22) before this
function is invoked. The program must set the current record
field to zero following the open or make function to ensure the
file is read from the first record in the file. After the file
is opened, the Read
Sequential Function reads the 128-byte record specified by the
current record field from the disk
file to the current DMA buffer. The FCB current record (cr) and
extent (ex) fields indicate the location of the record
that is read. The current record field is automatically
incremented to the next record in the extent after a read
operation.
.pp
When the current record field overflows, the next
logical extent is automatically opened and the current record
field is reset to zero before the read operation is performed. After
the first record in the new extent is read, the current record field
contains the value 01H.
.pp
The value 00H is returned in register R7 when the read
operation is successful. The value of 01H is returned in R7
when the record being read contains no data. Normally, the no data
situation is encountered at the end of a file. However, it can
also occur when this function tries to read either a previously
unwritten data block or a nonexistent extent. These situations
usually occur with files created or appended with the BDOS
Write Random Function (34).
.ix read sequential
.bp
.tc 4.2.9 Write Sequential Function
.sh
4.2.9 Write Sequential Function
.qs
.ix write sequential function
.sp 3
.nf
FUNCTION 21: WRITE SEQUENTIAL
Entry Parameters:
Register R5: 15H
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H
error: 01H or 02H
.sp 2
.fi
.pp
The Write Sequential Function writes a 128-byte record from the
DMA buffer to the disk file whose FCB address is passed in
register RR6. The FCB must be opened by either an Open File (15)
or Make File (22) Function before your program invokes
the Write Sequential Function. The record is written
to the current record, specified in the FCB current record (cr)
field.
.pp
The current record field is automatically incremented to the next record.
When the current record field overflows, the next logical extent of the
file is automatically opened and the current record field is reset to zero
before the write operation. After the write operation, the current record
field in the newly opened extent is set to 01H.
.pp
Records can be written to an existing file. However, newly
written records can overlay existing records in the file because the
current record field usually is set to zero after a file is
opened or created to ensure a subsequent sequential I/O function accesses
the first record in the file.
.pp
The value 00H is returned in register R7 when the
write operation is successful. A nonzero value in register
R7 indicates the write operation is unsuccessful
due to one of the conditions described below.
.bp
.ce
.sh
Table 4-6. Unsuccessful Write Operation Return Codes
.qs
.sp
.in 5
.ll 60
.nf
Value Meaning
.fi
.sp
.in 13
.ti -7
01 No available directory space - This condition occurs when
the write command attempts to create a new extent that requires a
new directory entry and no available directory entries exist on
the selected disk drive.
.sp
.ti -7
02 No available data block - This condition is encountered when
the write command attempts to allocate a new data block to the
file and no unallocated data blocks exist on the selected disk drive.
.ix write sequential
.in 0
.ll 65
.bp
.tc 4.2.10 Make File Function
.sh
4.2.10 Make File Function
.qs
.sp 3
.ix make file function
.nf
FUNCTION 22: MAKE FILE
Entry Parameters:
Register R5: 16H
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H - 03H
error: FFH
.sp 2
.fi
.pp
The Make File Function creates and opens a new file on a
specified disk or the default disk. The address of the FCB for the
file is passed in register RR6. You must ensure the FCB contains
a filename that does not already exist in the
referenced disk directory. The drive field (dr) in the FCB
indicates the drive on which the directory resides. The disk
directory is on the default drive when the FCB drive field
contains a zero.
.pp
The BDOS creates the file and initializes the directory and
the FCB in memory to indicate an empty file. The program must ensure that no
duplicate filenames occur. Invoking the Delete File Function
(19) prior to the Make File Function excludes the possibility of
duplicate filenames.
.pp
Register R7 contains an integer value in the range 00H through
03H when the function is successful. Register R7 contains the
value FFH when a file cannot be created due to insufficient directory
space.
.ix make file
.bp
.tc 4.2.11 Rename File Function
.sh
4.2.11 Rename File Function
.qs
.ix rename file function
.sp 3
.nf
FUNCTION 23: RENAME FILE
Entry Parameters:
Register R5: 17H
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H
error: FFH
.sp 2
.fi
.pp
The Rename File Function uses the FCB specified in register RR6
to change the filename and filetype of all directory entries for
a file. The first 12 bytes of the FCB contains the file
specification for the file to be renamed as shown in Figure 4-1.
Bytes 16 through 27 (d0 through d12) contain the new name of the
file. The filenames and filetypes specified must be valid for
CP/M. Wildcards cannot be specified in the filename and filetype
fields. The FCB drive field (dr) at byte position 0 selects the
drive. This function ignores the drive field at byte position 16,
if it is specified for the new filename. Register R7 contains the value
zero when the rename function is successful. It contains the
value FFH when the first filename in the FCB cannot be found
during the directory scan.
.ix rename
.sp 3
.nf
FCB byte position
.sp
0 1 2 3 4 5 6 7 8 9 10 11...16 17 18 19 20 21 22 23...27...
.sp
dr f1 f2 f3 f4 f5 f6 f7 f8 t1 t2 t3...d0 d1 d2 d3 d4 d5 d6 d7...d12...
old file specification new file specification
.fi
.sp 2
.sh
.ce
Figure 4-1. FCB Format for Rename Function
.qs
.sp 2
.pp
In the above figure, horizontal ellipses indicate FCB fields that are not
required for this function. Refer to Section 4.1.2 for a description of
all FCB fields.
.bp
.tc 4.2.12 Set Direct Memory Access (DMA) Address
.sh
4.2.12 Set Direct Memory Access (DMA) Address Function
.ix set direct memory access (DMA address function
.sp 3
FUNCTION 26: SET DMA ADDRESS
Entry Parameters:
Register R5: 1AH
Register RR6: DMA Address
Returned Values:
Register R7: 00H
.sp 2
.fi
.pp
The Set DMA Address Function sets the starting address of the
128-byte DMA buffer. DMA is an acronym for Direct Memory Access,
which often refers to disk controllers that directly access
memory to transfer data to and from the disk subsystem. Many
computer systems use nonDMA access in which the data is
transferred through programmed I/O operations. In CP/M the
term DMA is used differently. The DMA address in
CP/M-8000 is the beginning address of a 128-byte data buffer,
called the DMA buffer. The DMA buffer is the area in memory
where a data record resides before a disk write operation and after a
disk read operation. The DMA buffer can begin on
an even or odd address.
.ix set DMA address
.ix DMA buffer
.nx fourc

View File

@@ -0,0 +1,472 @@
.bp
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he CP/M-8000 Programmer's Guide 4.2 File Access Functions
.ft All Information Presented Here is Proprietary to Digital Research
.tc 4.2.13 Set File Attributes Function
.sh
4.2.13 Set File Attributes Function
.qs
.ix set file attributes function
.sp 3
.nf
FUNCTION 30: SET FILE ATTRIBUTES
Entry Parameters:
Register R5: 1EH
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H
error: FFH
.sp 2
.fi
.pp
The Set File Attributes Function sets or resets file attributes
supported by CP/M-8000 and user defined attributes for application
programs. CP/M-8000 supports read-only, system, and archive
attributes.
.pp
The high bit of each character in the ASCII filename (f1 through
f8) and filetype (t1 through t3) fields in the FCB denotes
whether attributes are set. When the high bit in any of these
fields has the value 1, the attribute is set. Table 4-7 denotes
the FCB fields and their attributes.
.pp
The address of the
FCB is passed in register RR6. Wildcards cannot be specified in
the filename and filetype fields.
.pp
This function searches the directory on the disk drive, specified
in the FCB drive field (dr), for directory entries that match the
FCB filename and filetype fields. All matching directory entries
are updated with the attributes this function sets.
.pp
A zero is returned in register R7 when the attributes are set.
However, if a matching entry cannot be found, register R7 contains
FFH.
.bp
.ix file attributes
.ce
.sh
Table 4-7. File Attributes
.sp
.in 5
.nf
Field Attribute
.fi
.qs
.sp
.ll 60
.in 20
.ti -15
f1 through f4 User-defined attributes for application
programs.
.sp
.ti -15
f5 through f8 Reserved for future use by CP/M-8000.
.sp
.ti -15
t1 The Read-Only attribute indicates the file
status is Read-Only. The BDOS does not allow write commands
to write to a file whose status is Read-Only. The BDOS does not
permit a Read-Only file to be deleted.
.sp
.ti -15
t2 The System attribute indicates the file is a system file.
Some built-in commands and system utilities differentiate
between system and user files. For example, the DIRS command
provides a directory of system files. The DIR command provides a
directory of user files for the current user number. For
details on these commands, refer to the \c
.ul
CP/M-8000 Operating System User's Guide.
.qu
.sp
.ti -15
t3 The Archive attribute is reserved but not used by CP/M-8000.
If set, it indicates that the file has been written to backup storage by
a user-written archive program. To implement this facility, the archive
program sets this attribute when it copies a file to backup storage;
any programs updating or creating files reset this
attribute. The archive program backs up only those files that have
the Archive attribute reset. Thus, an automatic backup facility restricted to
modified files can be implemented easily.
.ix open file function
.ix close file function
.in 0
.ll 65
.sp
.pp
The Open File (15) and Close File (16) Functions do not use the high bit in
the filename and filetype fields when matching filenames.
However, the high bits in these fields should equal zero when you
open a file. Also, the Close File Function does not update the
attributes in the directory entries when it closes a file.
.ix set file attributes
.bp
.tc 4.2.14 Read Random Function
.sh
4.2.14 Read Random Function
.qs
.ix read random function
.sp 3
.nf
FUNCTION 33: READ RANDOM
Entry Parameters:
Register R5: 21H
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H
error: 01H, 03H
04H, 06H
.sp 2
.fi
.pp
The Read Random Function reads records randomly, rather than
sequentially. The file must be opened with an Open File Function
(15) or a Make File Function (22) before this function is
invoked. The address of a 36-byte FCB is passed in register RR6.
The FCB random record field denotes the record
this function reads. The random record field is a 24-bit field,
with a value ranging from 00000H through 3FFFFH. This field spans
bytes r0, r1, and r2 which are bytes 33 through 35 of the FCB. The
most significant byte is first, r0, and the least significant
byte, r2, is last. This byte sequence is consistent with the
addressing conventions for the Z8000 microprocessor but differs
from other versions of CP/M.
.ix read random
.ix random record number
.ix random record field
.pp
The random record number must be stored in the FCB random record
field before the BDOS is called to read the record. After
reading the record, register R7 either contains an error code
(see Table 4-8), or the value 00H which indicates the read operation
was successful. In the latter case, the current DMA buffer
contains the randomly accessed record.
The record number is not incremented. The FCB extent and current
record fields are updated to correspond to the location of the
random record that was read. A subsequent Read Sequential (20)
or Write Sequential (21) Function starts from the record which was
randomly accessed. Therefore, the randomly read
record is reread when a program switches from randomly
reading records to sequentially reading records. This is also
true for the Write Random Functions (34, 40). The last record written is
rewritten if the program switches from randomly writing records
to sequentially writing records with the Write Sequential
Function (21). However, a program can obtain
the effect of sequential I/O operations by incrementing the random
record field following each Read Random Function (33) or Write Random
Function (34, 40).
.ne 27
.pp
Numeric codes returned in register R7 following a random
read operation are listed in Table 4-8.
.sp 2
.ll 60
.ce
.sh
Table 4-8. Read Random Function Return Codes
.sp
.nf
Code Meaning
.qs
.fi
.sp
.in 13
.ti -7
00 Success - returned in R7 when the Read Random Function
succeeds.
.sp
.ti -7
01 Reading unwritten data - returned when a random read operation
accesses a previously unwritten data block.
.sp
.ti -7
03 Cannot close current extent - returned when the BDOS cannot
close the current extent prior to moving to the new extent
containing the FCB random record number. This error can be
caused by an overwritten FCB or a read random operation on an FCB
that has not been opened.
.sp
.ti -7
04 Seek to unwritten extent - returned when a random read
operation accesses a nonexistent extent. This error situation is
equivalent to error 01.
.sp
.ti -7
06 Random record number out of range - returned when the value of
the FCB random record field is greater than 3FFFFH.
.in 0
.ll 65
.bp
.tc 4.2.15 Write Random Function
.ll 65
.sh
4.2.15 Write Random Function
.sp 3
.ix write random function
.nf
FUNCTION 34: WRITE RANDOM
Entry Parameters:
Register R5: 22H
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H
error: 02H, 03H
05H, 06H
.sp 2
.fi
.pp
The Write Random Function writes a 128-byte record from the
current DMA address to the disk file that matches the
FCB referenced in register RR6. Before this function is invoked,
the file must be opened with either the Open File Function (15)
or the Make File Function (22).
.pp
This function requires a 36-byte FCB. The last three bytes of the
FCB contain the random record field. It contains the record number of
the record that is written to the file. To append to an existing file, the
Compute File Size Function (35) can be used to write the random
record number to the FCB random record field. For a new file,
created with the Make File Function (22), you do not need to use
the Compute File Size Function to write the first record in the
newly created file. Instead, specify the value 00H
in the FCB random record field. The first record written
to the newly created file is zero.
.pp
When an extent or data block must be allocated for the record, the
Write Random Function allocates it before writing the record to
the disk file. The random record number is not changed following a
Write Random Function. Therefore, a new random record number must
be written to the FCB random record field before each Write random
Function is invoked.
.pp
However, the logical extent number and current record field of
the FCB are updated and correspond to the random record number
that is written. Thus, a Read Sequential (20) or Write Sequential
(21) Function that
follows a Write Random Function, either rereads or rewrites the
record that was accessed by the Read or Write Random Function. To avoid
overwriting the previously written record and simulate sequential
write functions, increment the
random record number after each Write Random Function.
.ix write random
.pp
After the random write function completes, register R7 contains
either an error code (see Table 4-9), or the value 00H that
indicates the operation was successful.
.sp 2
.ll 60
.ce
.sh
Table 4-9. Write Random Function Return Codes
.sp
.nf
Code Meaning
.qs
.fi
.sp
.in 13
.ti -7
00 Success - returned when the Write Random Function succeeds
without error.
.sp
.ti -7
02 No available data block - occurs when
the Write Random function attempts to allocate a new data block to the
file, but the selected disk does not contain any unallocated data blocks.
.sp
.ti -7
03 Cannot close current extent - occurs when the BDOS cannot
close the current extent prior to moving to the new extent that
contains the record specified by the FCB random record field.
This error can be caused by an overwritten FCB or a write random
operation on an FCB that has not been opened.
.sp
.ti -7
05 No available directory space - occurs when
the write function attempts to create a new extent that requires a
new directory entry but the selected disk drive does not have any
available directory entries.
.sp
.ti -7
06 Random record number out of range - returned when
the value of the FCB random record field is greater than 3FFFFH.
.in 0
.ll 65
.bp
.tc 4.2.16 Compute File Size Function
.sh
4.2.16 Compute File Size Function
.qs
.ix compute file size function
.sp 3
.nf
FUNCTION 35: COMPUTE FILE SIZE
Entry Parameters:
Register R5: 23H
Register RR6: FCB Address
Returned Values:
Register R7: 00H
success: File Size written
to FCB random
Record Field
error: Zero written to
FCB Random Record
Field
.sp 2
.fi
.pp
The Compute File Size Function computes the size of a file and writes
it to the random record field of the 36-byte FCB whose address is passed in
register RR6.
.ix compute file size
.pp
The FCB filename and filetype are used to scan the directory for
an entry with a matching filename and filetype. If a match cannot be found,
the value zero is written to the FCB random record field. However, when a match
occurs, the virtual file size is written in the FCB random
record field.
.ix virtual file size
.ix physical file size
.ix file size
.ix sparse files
.mb 5
.fm 1
.pp
The virtual file size is the record number of the
record following the end of the file. The virtual size of a file
corresponds to the physical size when the file is written
sequentially. However, the virtual file size may not equal the
physical file size when the records in the file were created by
random write functions. The Compute File Size Function computes
the file size by adding the value 1 to the record number of last
record in a file. However, for files that contain randomly
written records, the record number of the last record does not
necessarily indicate the number of records in a file. For
example, the number of the last record in a sparse file does not
denote the number of records in the file. Record numbers for
sparse files are not usually sequential. Therefore, gaps can exist
in the record numbering sequence. You can create sparse files with
the Write Random Functions (34 and 40).
.pp
In addition to computing the file size, you can use this function to
determine the end of an existing file. For example, when you append data
to a file, this function writes the record number of the first unwritten
record to the FCB random record field. When you use the Write Random (34)
or the Write Random With Zero Fill (40) Function, your program more
efficiently appends data to the file because the FCB already contains the
appropriate record number.
.bp
.mb 6
.fm 2
.tc 4.2.17 Set Random Record Function
.sh
4.2.17 Set Random Record Function
.qs
.ix set random record function
.sp 3
.nf
FUNCTION 36: SET RANDOM RECORD
Entry Parameters:
Register R5: 24H
Register RR6: FCB Address
Returned Values:
Register RR6: 00H
Register FCB: Random Record
Field Set
.sp 2
.fi
.ix random record number
.pp
The Set Random Record Function calculates the random record number of the
current position in the file. The current position in
the file is defined by the last operation performed on the file.
Table 4-10 lists the current position relative to operations
performed on the file.
.sp 2
.ce
.sh
Table 4-10. Current Position Definitions
.sp
.in 3
.nf
Operation Function Current Position
.sp
Open file Open File (15) record 0
.sp
Create file Make File (22) record 0
.sp
Random read Read Random (33) last record read
.sp
Random write Write Random (34) last record
Write Random With written
Zero Fill (40)
.sp
Sequential read Read Sequential (20) record following
the last record
read
.sp
Sequential write Write Sequential (21) record following
the last record
written
.fi
.in 0
.sp 2
This function writes the random record number in the random record field
of the 36-byte FCB whose address your program passes in register RR6.
.ix random record field
.pp
You can use this function to set the random record field of the
next record your program accesses when it switches from
accessing records sequentially to accessing them randomly. For
example, your program sequentially reads or writes 128-byte data records to an
arbitrary position in the file that is defined by your program. Your program
then invokes this function to set the random record field in the FCB.
The next random read or write operation that your program performs
accesses the next record in the file.
.ix set random record
.pp
Another application for this function is to create a key list from a file
that you read sequentially. Your program sequentially reads and scans a
file to extract the positions of key fields. After your program locates
each key, it calls this function to compute the random record position for
the record following the record containing the key. To obtain the random
record number of the record containing the key, subtract one from
the random record number that this function calculates. CP/M-8000 reads and
writes 128-byte records. If your record size is also 128 bytes, your
program can insert the record position minus one into a table with the key
for later retrieval. By using the random record number stored in the table
when your program performs a random read or write operation, your program
locates the desired record more efficiently.
.pp
Note that if your data records are not equal to 128 bytes, your program
must store the random record number and an offset into the physical record.
For example, you must generalize this scheme for variable-length records.
To find the starting position of key records, your program stores the
buffer-relative position and the random record number of the records
containing keys.
.nx fourd

View File

@@ -0,0 +1,426 @@
.bp
.pn 51
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he CP/M-8000 Programmer's Guide 4.2 File Access Functions
.ft All Information Presented Here is Proprietary to Digital Research
.tc 4.2.18 Write Random With Zero Fill Function
.sh
4.2.18 Write Random With Zero Fill Function
.qs
.sp 3
.nf
FUNCTION 40: WRITE RANDOM WITH ZERO FILL
Entry Parameters:
Register R5: 28H
Register RR6: FCB Address
Returned Values:
Register R7: Return Code
success: 00H
error: 02H, 03H
05H, 06H
.sp 2
.fi
.pp
The Write Random With Zero Fill Function, like the Random Write
Function (34), writes a 128-byte record from the current DMA
buffer to the disk file. The address of a 36-byte FCB is passed
in register RR6. The last three bytes contain the FCB random record
field. This field specifies the record number of the record that
this write random function writes to the file. Refer to Write Random
Function (34) for details on the FCB and setting its
random record field.
.pp
Like the Write Random Function, this function allocates a data
block before writing the record when a block is not already allocated.
However, in addition to allocating the data block, this
function also initializes the block with zeroes before writing the
record. If your program uses this function to write random records to
files, it
ensures that the contents of unwritten records in the block are
predictable.
.pp
After the random write function completes, register R5 contains
either an error code (see Table 4-9), or the value 00H, which
indicates the operation was successful.
.bp
.he CP/M-8000 Programmer's Guide 4.3 Drive Functions
.tc 4.3 Drive Functions
.sh
4.3 Drive Functions
.qs
.ix drive functions
.pp
This section describes drive functions that reset the disk system, select
and write-protect disks, and return vectors. They include the
functions listed in Table 4-11.
.sp 2
.ce
.sh
Table 4-11. Drive Functions
.sp
.nf
.in 7
Function Function Number
.sp
Reset Disk System 13
.sp
Select Disk 14
.sp
Return Login Vector 24
.sp
Return Current Disk 25
.sp
Write Protect Disk 28
.sp
Get Read-Only Vector 29
.sp
Get Disk Parameters 31
.sp
Reset Drive 37
.sp
Get Disk Free Space 46
.bp
.in 0
.fi
.tc 4.3.1 Reset Disk System Function
.sh
4.3.1 Reset Disk System Function
.qs
.ix reset disk system function
.sp 3
.nf
FUNCTION 13: RESET DISK SYSTEM
Entry Parameters:
Register R5: 0DH
Returned Values:
Register R7: 00H
.sp 2
.fi
.pp
The Reset Disk System Function restores the file system to a reset
state. All disks are set to read-write (see Write Protect Disk
(28) and Get Read-Only Vector (29) Functions),
and all the disk drives are logged out. This function can be used by
an application program that requires disk changes during
operation. The Reset Drive Function (37) can also be used for this
purpose. All files must be closed before your program invokes this
function.
.ix reset disk
.bp
.tc 4.3.2 Select Disk Function
.sh
4.3.2 Select Disk Function
.qs
.ix select disk function
.sp 3
.nf
FUNCTION 14: SELECT DISK
Entry Parameters:
Register R5: 0EH
Register R7: Disk Number
Returned Values:
Register R7: 00H
.sp 2
.fi
.pp 5
The Select Disk Function designates the disk drive specified in
register R7 as the default disk for subsequent file operations.
The decimal numbers 0 through 15 correspond to drives A through
P. For example, R7 contains a 0 for drive A, a 1 for drive
B, and so forth through 15 for a full 16-drive system. In
addition, the designated drive is logged-in if it is currently in
the reset state. Logging in a drive places it in an on-line
status which activates the drive's directory until the next cold
start, or Reset Disk System (13) or Reset Drive (37) Function.
.pp
When the FCB drive code equals zero (dr = 0H), this function
references the currently selected drive. However, when the FCB drive code
value is between 1 and 16, this function references drives A through P.
.pp
If this function fails, CP/M-8000 returns a CP/M Disk select
error, which is described in Section 4.2.2.
.ix select disk
.bp
.tc 4.3.3 Return Login Vector Function
.sh
4.3.3 Return Login Vector Function
.qs
.sp 3
.ix return login vector function
.nf
FUNCTION 24: RETURN LOGIN VECTOR
Entry Parameters:
Register R5: 18H
Returned Values:
Register R7: Login Vector
.sp 3
.fi
.pp
The Return Login Vector Function returns in register R7 a 16-bit value
that denotes the log-in status of the drives. The least significant bit
corresponds to the first drive A, and the high order bit corresponds to the
sixteenth drive, labeled P. Each bit has a value of zero or one. The value
zero indicates the drive is not on-line. The value one denotes the drive
is on-line. When a drive is logged in, its bit in the log-in vector has a
value of one. Explicitly or implicitly logging in a drive sets its bit
in the log-in vector. The Select Disk Function (14) explicitly logs in a
drive. File operations implicitly log in a drive when the FCB drive field
(dr) contains a nonzero value.
.ix login vector
.bp
.tc 4.3.4 Return Current Disk Function
.sh
4.3.4 Return Current Disk Function
.qs
.sp 3
.ix return current disk function
.nf
FUNCTION 25: RETURN CURRENT DISK
Entry Parameters:
Register R5: 19H
Returned Values:
Register R7: Current Disk
.sp 2
.fi
.pp
The Return Current Disk Function returns the current default disk
number in register R7. The disk numbers range from 0 through
15, which correspond to drives A through P. Note that this
numbering convention differs from the FCB drive
field, which specifies integers 1 through 16
correspond to drives labeled A through P.
.ix return current disk
.ix current default disk numbers
.bp
.tc 4.3.5 Write Protect Disk Function
.sh
4.3.5 Write Protect Disk Function
.qs
.ix write protect disk function
.sp 3
.nf
FUNCTION 28: WRITE PROTECT DISK
Entry Parameters:
Register R5: 1CH
Returned Values:
Register R7: 00H
.sp 2
.fi
.pp
The disk write protect function provides temporary write protection for the
currently selected disk. Any attempt
to write to the disk, before the next cold start, warm start,
disk system reset, or drive reset operation produces the message:
.sp
.ti 8
Disk change error on drive x
.ix write protect disk
.ix disk change error
.sp
Your program terminates when this error occurs. Program control returns
to the CCP.
.bp
.tc 4.3.6 Get Read-Only Vector Function
.sh
4.3.6 Get Read-Only Vector Function
.qs
.ix get Read-Only vector function
.sp 3
.nf
FUNCTION 29: GET READ-ONLY VECTOR
Entry Parameters:
Register R5: 1DH
Returned Values:
Register R7: Read-Only
Vector Value
.sp 2
.fi
.ix read-only bit
.pp
The Get Read-Only Vector Function returns a 16-bit vector in register R7.
The vector denotes drives that have the temporary read-only bit set. Similar
to the Return Login Vector Function (24), the least significant bit
corresponds to drive A, and the most significant bit corresponds to drive
P. The Read-Only bit is set either by an explicit call to the Write Protect
Disk Function (28), or by the automatic software mechanisms within CP/M-8000
that detect changed disks.
.ix get read-only vector
.bp
.tc 4.3.7 Get Disk Parameters Function
.sh
4.3.7 Get Disk Parameters Function
.qs
.ix get disk parameters function
.sp 3
.nf
FUNCTION 31: GET DISK PARAMETERS
Entry Parameters:
Register R5: 1FH
Register RR6: CDPB Address
Returned Values:
Register R7: 00H
Register CDPB: Contains DPB
Values
.sp 2
.fi
.ix DPB
.ix CDPB
.pp
The Get Disk Parameters Function writes a copy of the 16-byte
BIOS Disk Parameter Block (DPB) for the current default disk,
called the CDPB, at the address specified in register RR6.
Figure 4-2 illustrates the format of the DPB and CDPB. The
values in the CDPB can be extracted and used for display and
space computation purposes. Normally, application programs do
not use this function. For more details on the BIOS DPB, refer to
the \c
.ul
CP/M-8000 Operating System System Guide.
.qu
.sp 3
.nf
SPT BSH BLM EXM RES DSM DRM RES CKS OFF
16 8 8 8 8 16 16 16 16 16
.sp 2
.fi
.ce
.sh
Figure 4-2. DPB and CDBP
.qs
.bp
.pp
Table 4-12 lists the fields in the DPB and CDPB.
.sp 2
.ce
.sh
Table 4-12. Fields in the DPB and CDPB
.qs
.sp
.nf
.in 5
Field Description
.fi
.sp
.ll 60
.in 18
.ti -12
.qs
SPT Number of 128-byte logical sectors per track
.sp
.ti -12
BSH Block shift factor
.sp
.ti -12
BLM Block mask
.sp
.ti -12
EXM Extent mask
.sp
.ti -12
RES Reserved byte
.sp
.ti -12
DSM Total number of blocks on the disk
.sp
.ti -12
DRM Total number of directory entries on the disk
.sp
.ti -12
RES Reserved for system use
.sp
.ti -12
CKS Length (in bytes) of the checksum vector
.sp
.ti -12
OFF Track offset to disk directory
.in 0
.ll 65
.ix get address of disk parameter block
.bp
.tc 4.3.8 Reset Drive Function
.sh
4.3.8 Reset Drive Function
.qs
.ix reset drive function
.sp 3
.nf
FUNCTION 37: RESET DRIVE
Entry Parameters:
Register R5: 25H
Register R7: Drive Vector
Returned Values:
Register R7: 00H
.sp 2
.fi
.pp
The Reset Drive function restores specified drives to the reset
state. A reset drive is not logged-in and its status is read-write.
Register R7 contains a 16-bit vector indicating the
drives this function resets. The least significant bit corresponds
to the first drive, A. The high order bit corresponds to the
sixteenth drive, labeled P. Bit values of 1 indicate the
drives this function resets.
.ix reset drive
.pp
To maintain compatibility with other Digital Research operating
systems, this function returns the value zero in register R7.
.bp
.tc 4.3.9 Get Disk Free Space Function
.sh
4.3.9 Get Disk Free Space Function
.qs
.ix get disk free space function
.sp 3
.nf
FUNCTION 46: GET DISK FREE SPACE
Entry Parameters:
Register R5: 2EH
Register R7: Disk Number
Returned Values:
Register DMA Buffer: Free Sector Count
.fi
.sp 2
.ix free sector count
.pp
The Get Free Disk Space Function returns the free sector count,
the number of free 128-byte sectors on a specified drive, in the
first four bytes of the current DMA buffer. The drive number
is passed in register R7. CP/M-8000 assigns disk
numbers sequentially from 0 through 15 (decimal). Each
number corresponds to a drive in the range A through P. For
example, the disk number for drive A is 0 and for drive B, the
number is 1.
.pp
Note that these numbers do not correspond to those
in the drive field of the FCB. The FCB drive field (dr) uses the
numbers 1 through 16 (decimal) to designate drives.
.nx foure

View File

@@ -0,0 +1,577 @@
.sp 2
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.tc 4.3 Character I/O Functions
.he CP/M-8000 Programmer's Guide 4.4 Character I/O Functions
.sh
4.4 Character I/O Functions
.qs
.ix character I/O functions
.ix I/O functions, character
.pp
Character I/O functions read or write characters serially to a
peripheral device. Character I/O functions supported in CP/M-8000
are described in this section and listed in Table 4-13.
.sp 2
.sh
.ce
Table 4-13. Character I/O Functions
.sp
.nf
Function Function Number
.sp
Console Operations
.sp
Console Input 1
.sp
Console Output 2
.sp
Direct Console I/O 6
.sp
Print String 9
.sp
Read Console Buffer 10
.sp
Get Console Status 11
.bp
.pn 63
.sh
.ce
Table 4-13. (continued)
.sp
.nf
Function Function Number
.sp
Additional Serial I/O
.sp
Auxiliary Input 3
.sp
Auxiliary Output 4
.sp
List Output 5
.sp 2
I/O Byte
.sp 2
Get I/O Byte 7
.sp
Set I/O Byte 8
.ix functions, console
.fi
.in 0
.ll 65
.bp
.tc 4.4.1 Console I/O Functions
.sh
4.4.1 Console I/O Functions
.qs
.ix console I/O functions
.pp
This section describes functions that read from, write to, and
report the status of the logical device CONSOLE.
.sp 2
.tc Console Input Function
.ul
Console Input Function
.qu
.sp 3
.nf
FUNCTION 1: CONSOLE INPUT
Entry Parameters:
Register R5: 01H
Returned Values:
Register R7: ASCII Character
.sp 2
.fi
.ix logical console device
.ix tab characters
.pp
The Console Input function reads the next character from the
logical console device (CONSOLE) to register R7. Printable
characters, along with carriage return, line feed, and backspace
(CTRL-H), are echoed to the console. Tab characters (CTRL-I)
are expanded into columns of eight characters. Other CONTROL
characters, such as CTRL-C, are processed. The BDOS does not
return to the calling program until a character has been typed.
Thus, execution of the program is suspended until a character is ready.
.ix console input
.bp
.tc Console Output Function
.ul
Console Output Function
.qu
.ix console output function
.sp 3
.nf
FUNCTION 2: CONSOLE OUTPUT
Entry Parameters:
Register R5: 02H
Register R7: ASCII Character
Returned Values:
Register R7: 00H
.sp 2
.fi
.pp
The ASCII character from R7 is sent to the logical console.
Tab characters expand into columns of eight characters. In addition, a
check is made for stop scroll (CTRL-S), start scroll (CTRL-Q),
and the printer switch (CTRL-P). This function also processes
CTRL-C, which aborts the operation and warm boots the system. If the console
is busy,
execution of the calling program is suspended until the console
accepts the character.
.ix console output
.ix stop scroll
.ix start scroll
.ix printer switch
.bp
.tc Direct Console I/O Function
.ul
Direct Console I/O Function
.qu
.ix direct console I/O function
.sp 3
.nf
FUNCTION 6: DIRECT CONSOLE I/O
Entry Parameters:
Register R5: 06H
Register R7: 0FFH (input)
0FEH (status)
or
Character (output)
Returned Values:
Register R7: Character or Status
.sp 2
.fi
.ix I/O, direct console
.ix BDOS function, direct console I/O
.ix direct console I/O
.pp
Direct Console I/O is supported under CP/M-8000 for those specialized
applications where character-by-character console input and output are
required without the control character functions CP/M-8000 supports. This
function bypasses all of CP/M-8000's normal CONTROL character functions such
as CTRL-S, CTRL-Q, CTRL-P, and CTRL-C.
.pp
Upon entry to the Direct Console I/O Function, register R7
contains one of the values listed below.
.sp 2
.ce
.sh
Table 4-14. Direct Console I/O Function Values
.qs
.sp
.in 5
.ll 60
.nf
Value Meaning
.fi
.sp
.in 18
.ti -13
FFH denotes a CONSOLE input request
.sp
.ti -13
FEH denotes a CONSOLE status request
.sp
.ti -13
ASCII
.sp 0
.ti -13
character output to CONSOLE where CONSOLE is the logical console device
.in 0
.ll 65
.sp
.pp
.fi
When the input value is FFH, the Direct Console I/O Function calls the BIOS
Conin Function, which returns the next console input character in R7 but
does not echo the character on the console screen. The BIOS Conin function
waits until it receives a character. Thus, execution of the calling program
remains suspended until a character is ready.
.pp
When the input value is FEH, the Direct Console I/O Function returns
the status of the console input in register R7. When register R7
contains the value zero, no console input exists. However, when
the value in R7 is nozero, console input is ready to be read by
the BIOS Conin Function.
.pp
When the input value in R7 is neither FEH nor FFH, the Direct
Console I/O Function assumes that R7 contains a valid ASCII
character, which is sent to the console.
.bp
.tc Print String Function
.ul
Print String Function
.qu
.ix print string function
.sp 3
.nf
FUNCTION 9: PRINT STRING
Entry Parameters:
Register R5: 09H
Register RR6: String Address
Returned Values:
Register R7: 00H
.sp 2
.fi
.pp
The Print String function sends the character string stored in
memory at the location given in register RR6 to the logical
console device (CONSOLE) until a dollar sign ($) is encountered
in the string. Tabs are expanded as in the Console Output
Function (2), and checks are made for stop scroll (CTRL-S),
start scroll (CTRL-Q), and the printer switch (CTRL-P).
.ix print string
.bp
.tc Read Console Buffer Function
.ul
Read Console Buffer Function
.qu
.ix read console buffer function
.ix console buffer
.sp 3
.nf
FUNCTION 10: READ CONSOLE BUFFER
Entry Parameters:
Register R5: 0AH
Register RR6: Buffer Address
Returned Values:
Register R7: 00H
Register Buffer: Character Count
and Characters
.sp 2
.fi
.ix logical console device
.pp
The Read Buffer function reads a line of edited console input from the
logical console device (CONSOLE) to a buffer address passed in register
RR6. Console input is terminated when the input buffer is filled, or, a
RETURN (CTRL-M) or a line feed (CTRL-J) character is entered. The input
buffer addressed by RR6 takes the form:
.sp 2
.nf
RR6: +0 +1 +2 +3 +4 +5 +6 +7 +8 . . . +n
mx nc c1 c2 c3 c4 c5 c6 c7 . . . ??
.fi
.sp
The variable mx is the maximum number of characters the buffer holds. The
variable nc is the total number of characters placed in the buffer. Your
program must set the mx value prior to invoking this function. The mx value
can range in value from 1 through 255 (decimal). The characters entered
from the keyboard follow the nc value. The value nc is returned to the
buffer. It can range from 0 to the value of mx. If the nc value is less
than the mx value, uninitialized characters follow the last character.
Uninitialized
characters are denoted by the double question marks (??) in the above
figure. A terminating RETURN or line feed character is not placed in the
buffer and is not included in the total character count nc.
.ix read buffer
.pp
This function supports several editing control functions, which
are briefly described in Table 4-15.
.ix editing control functions
.bp
.ce
.sh
Table 4-15. Line Editing Controls
.ix line editing controls
.sp
.in 5
.nf
Keystroke Result
.sp
.ll 60
.fi
.in 19
.ti -14
RUB/DEL removes and echoes the last character
.sp
.ti -14
CONTROL-C reboots when it is the first character on a line
.sp
.ti -14
CONTROL-E causes physical end-of-line
.sp
.ti -14
CONTROL-H backspaces one character position
.sp
.ti -14
CONTROL-J (line feed) terminates input line
.sp
.ti -14
CONTROL-M (return) terminates input line
.sp
.ti -14
CONTROL-P starts and stops the echoing of console output to the logical
LIST device
.sp
.ti -14
CONTROL-Q restarts console I/O after CTRL-S halts it
.sp
.ti -14
CONTROL-R retypes the current line on the next line
.sp
.ti -14
CONTROL-S halts console I/O and waits for CTRL-Q to restart it
.sp
.ti -14
CONTROL-U echoes a pound sign (#) indicating ignore characters previously
input on the current line before it positions the cursor on the next line
.sp
.ti -14
CONTROL-X backspaces to beginning of current line
.fi
.ll 65
.in 0
.sp 2
Certain functions that position the cursor to the leftmost position
(for example, CONTROL-X) move the cursor to the column position where the
cursor
was prior to invoking the Read Console Buffer Function. This convention
makes your data
input and line correction more legible.
.bp
.tc Get Console Status Function
.ul
Get Console Status Function
.qu
.ix get console status function
.sp 3
.nf
FUNCTION 11: GET CONSOLE STATUS
Entry Parameters:
Register R5: 0BH
Returned Values:
Register R7: Console Status
.sp 2
.fi
.ix console status
.pp
The Get Console Status Function checks whether a character has been
typed at the logical console device (CONSOLE). If a character is
ready, a nonzero value is returned in register R7; otherwise the
value 00H is returned in R7.
.ix console status
.bp
.tc 4.4.2 Additional Serial I/O Functions
.sh
4.4.2 Additional Serial I/O Functions
.qs
.ix additional serial I/O functions
.ix serial I/O functions
.pp
This section describes additional serial I/O functions that read and
write data to devices defined by I/O Byte Functions (7,8).
.sp 2
.tc Auxiliary Input Function
.ul
Auxiliary Input Function
.qu
.ix auxiliary input function
.ix auxiliary input device
.sp 3
.nf
FUNCTION 3: AUXILIARY INPUT
Entry Parameters:
Register R5: 03H
Returned Values:
Register R7: ASCII Character
.sp 2
.fi
.pp
The Auxiliary Input function reads the next character from the
auxiliary input device into register R7. Execution of the
calling program remains suspended until the character is read.
This function assumes the BIOS
implements its Auxiliary Input Function. When more than one
auxiliary input port exists, the BIOS should implement the
I/O Byte Function. For details on the
BIOS Auxiliary Input and I/O Byte Functions, refer
to the \c
.ul
CP/M-8000 Operating System System Guide.
.qu
.ix auxiliary input
.bp
.tc Auxiliary Output Function
.ul
Auxiliary Output Function
.qu
.sp 3
.ix auxiliary output function
.nf
FUNCTION 4: AUXILIARY OUTPUT
Entry Parameters:
Register R5: 04H
Register R7: ASCII Character
Returned Values:
Register R7: 00H
.sp 2
.fi
.ix auxiliary output device
.pp
The Auxiliary Output function sends a character from register
R7 to the auxiliary output device. Execution of the calling
program remains suspended until the hardware buffer receives the
output character. This function assumes the BIOS
implements its Auxiliary Output Function. When more than one
auxiliary output port exists, the BIOS should implement the
I/O Byte Function. For details on the
BIOS Auxiliary Output and I/O Byte Functions, refer
to the \c
.ul
CP/M-8000 Operating System System Guide.
.qu
.ix auxiliary output
.bp
.tc List Output Function
.ul
List Output Function
.qu
.ix list output function
.sp 3
.nf
FUNCTION 5: LIST OUTPUT
Entry Parameters:
Register R5: 05H
Register R7: ASCII Character
Returned Values:
Register R7: 00H
.sp 2
.ix logical list device (LIST)
.fi
.pp
The List Output function sends the ASCII character in register
R7 to the logical list device (LIST).
.ix list output
.sp 2
.tc 4.4.3 I/O Byte Functions
.sh
4.4.3 I/O Byte Functions
.qs
.ix I/O byte functions
.pp
This section describes the I/O Byte Functions. The I/O Byte is
an 8-bit value that assigns physical devices, represented by 2-bit
fields, to each of the logical
devices: CONSOLE, AUXILIARY INPUT, AUXILIARY OUTPUT, and LIST as
shown in Figure 4-3. The I/O Byte functions allow programs to
access the I/O byte to determine its current value (Get I/O Byte)
or to modify it (Set I/O Byte). These functions are valid only
if the BIOS implements its I/O Byte Function. Refer to the \c
.ul
CP/M-8000 Operating System System Guide
.qu
for details on implementing the I/O Byte Function.
.sp 3
.nf
most significant least significant
I/O Byte LIST AUXILIARY OUTPUT AUXILIARY INPUT CONSOLE
bits 7,6 5,4 3,2 1,0
.ix IOBYTE
.fi
.sp 2
.ce
.sh
Figure 4-3. I/O Byte
.qs
.sp 2
.pp
The value in each field ranges from 0-3. The value defines the
assigned source or destination of each logical device, as shown in Table
4-16.
.bp
.ce
.sh
Table 4-16. I/O Byte Field Definitions
.qs
.sp
.in 14
.ll 60
.li
.ti -9
CONSOLE field (bits 1,0)
.ti -5
0 - console is assigned to the console printer (TTY:)
.ti -5
1 - console is assigned to the CRT device (CRT:)
.ti -5
2 - batch mode: use the AUXILIARY INPUT as the CONSOLE input, and the
LIST device as the CONSOLE output (BAT:)
.ti -5
3 - user defined console device (UC1:)
.sp
.ti -9
AUXILIARY INPUT field (bits 3,2)
.ti -5
0 - AUXILIARY INPUT is the Teletype device (TTY:)
.ti -5
1 - AUXILIARY INPUT is the high-speed reader device (PTR:)
.ti -5
2 - user defined reader # 1 (UR1:)
.ti -5
3 - user defined reader # 2 (UR2:)
.sp
.ti -9
AUXILIARY OUTPUT field (bits 5,4)
.ti -5
0 - AUXILIARY OUTPUT is the Teletype device (TTY:)
.ti -5
1 - AUXILIARY OUTPUT is the high-speed punch device (PTP:)
.ti -5
2 - user defined punch # 1 (UP1:)
.ti -5
3 - user defined punch # 2 (UP2:)
.sp
.ti -9
LIST field (bits 7,6)
.ti -5
0 - LIST is the Teletype device (TTY:)
.ti -5
1 - LIST is the CRT device (CRT:)
.ti -5
2 - LIST is the line printer device (LPT:)
.ti -5
3 - user defined list device (UL1:)
.in 0
.ll 65
.sp
.pp
The implementation of the BIOS I/O Byte Function is optional. PIP
and STAT are the only CP/M-8000 utilities that use the I/O Byte.
PIP accesses physical devices. STAT designates and displays
logical to physical device assignments. For details on implementing
the I/O Byte Function, refer to the \c
.ul
CP/M-8000 Operating System System Guide.
.qu
.nx fourf

View File

@@ -0,0 +1,528 @@
.bp
.pn 76
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he CP/M-8000 Programmer's Guide 4.4 Character I/O Functions
.ft All Information Presented Here is Proprietary to Digital Research
.tc Get I/O Byte Function
.ul
Get I/O Byte Function
.qu
.ix get I/O byte function
.sp 3
.nf
FUNCTION 7: GET I/O BYTE
Entry Parameters:
Register R5: 07H
Returned Values:
Register R7: I/O Byte Value
.sp 2
.fi
.pp 5
The Get I/O Byte Function returns the current value of I/O Byte
in register R7. The I/O Byte contains the current assignments
for the logical devices CONSOLE, AUXILIARY INPUT, AUXILIARY
OUTPUT, and LIST. Note that this function is valid only if the
BIOS implements its I/O Byte Function. Refer to the \c
.ul
CP/M-8000 Operating System System Guide \c
.qu
for details on implementing the
BIOS I/O Byte Function.
.ix get I/O byte
.bp
.tc Set I/O Byte Function
.ul
Set I/O Byte Function
.qu
.ix set I/O byte function
.sp 3
.nf
FUNCTION 8: SET I/O BYTE
Entry Parameters:
Register R5: 08H
Register R7: I/O Byte Value
Returned Values:
Register R7: 00H
.sp 2
.fi
.pp
The Set I/O Byte Function changes the system I/O Byte value to
the value passed in register R7. This function allows programs
to modify the current assignments for the logical devices
CONSOLE, AUXILIARY INPUT, AUXILIARY OUTPUT, and LIST in the I/O
Byte. This function is valid only if the BIOS
implements its I/O Byte Function. Refer to the \c
.ul
CP/M-8000 Operating System System Guide \c
.qu
for details on implementing the I/O Byte Function.
.ix set I/O byte
.sp 2
.he CP/M-8000 Programmer's Guide 4.5 System Control Functions
.tc 4.5 System/Program Control Functions
.sh
4.5 System/Program Control Functions
.qs
.ix system/program control functions
.pp
The System and program control functions described in this
section warm boot the system, return the operating system version number, call
the Basic I/O System (BIOS) functions, and, terminate and load programs.
These functions are listed in Table 4-17.
.sp 2
.ce
.sh
Table 4-17. System and Program Control Functions
.sp
.nf
.in 13
Function Function Number
.sp
System Reset 0
.sp
Return Version Number 12
.sp
Set/Get User Code 32
.sp
Chain to Program 47
.sp
Flush Buffers 48
.sp
Direct BIOS Call 50
.sp
Program Load 59
.ix program control functions
.ix system control functions
.in 0
.bp
.tc 4.5.1 System Reset Function
.sh
4.5.1 System Reset Function
.qs
.ix system reset function
.sp 3
.nf
FUNCTION 0: SYSTEM RESET
Entry Parameters:
Register R5: 00H
Returned Values: Function Does Not
Return to Calling
Program
.sp 2
.fi
.pp
The System Reset Function terminates the current program and returns
program control to the CCP command level.
.ix system reset
.bp
.tc 4.5.2 Return Version Number Function
.sh
4.5.2 Return Version Number Function
.qs
.ix return version number function
.sp 3
.nf
FUNCTION 12: RETURN VERSION NUMBER
Entry Parameters:
Register R5: 0CH
Returned Values:
Register R7: Version Number
.fi
.sp 2
.ix version dependent programming
.ix version numbers
.pp
The Return Version Number Function provides information that
allows version dependent programming. The one-word value 2022H is
the version number returned in register R7 for Release 1.1 of CP/M-8000.
Table 4-18 lists the version numbers this function returns
for Digital Research operating systems.
.sp 2
.ce
.sh
Table 4-18. Version Numbers
.qs
.sp
.nf
Operating System Version Version Number
.sp
CP/M-8000 1.1 2022H
.sp
CP/M-80 1.4 0014H
.sp
CP/M-80 2.2 0022H
.sp
CP/M-80 3.0 0031H
.sp
MP/M-80 1.1 0122H
.sp
MP/M-80 2.0 0130H
.sp
MP/M-80 2.1 0130H
.sp 2
CP/M-86 1.0 1022H
.sp
CP/M-86 1.1 1022H
.sp
MP/M-86 2.0 1130H
.sp
MP/M-86 2.1 1130H
.sp 2
Concurrent CP/M-86 1.0 1430H
(for the IBM
Personal Computer)
.sp
Concurrent CP/M-86 2.0 1431H
.sp
.pp
.fi
Add the hexadecimal value 0200 to any version number when the
system implements CP/NET. For example, CP/M-80 Release 2.2
returns the version 0222H when the system implements CP/NET.
.ix version number, return
.he CP/M-8000 Programmer's Guide 4.5 System Control Functions
.bp
.tc 4.5.3 Set/Get User Code
.sh
4.5.3 Set/Get User Code
.qs
.ix Set/Get user code
.sp 3
.nf
FUNCTION 32: SET/GET USER CODE
Entry Parameters:
Register R5: 20H
Register R7: FFH (get)
or
User Code
(set)
Returned Values:
Register R7: Current User
Number
.sp 2
.fi
.ix user number
.pp
An application program can change or obtain the currently active
user number by calling the Set/Get User Code Function. If the
value in register R7 is FFH, the value of the current user number
is returned in register R7. The value ranges from 0 to 15
(decimal). If register R7 contains a value in the range
0 through 15 (decimal), the current user number is changed to
the value in register R7. When the program terminates and
control returns to the CCP, the user number reverts to the BDOS
default user number. The BDOS assumes the default is zero unless
you explicitly specify the USER command to set an alternate default.
.ix get or set user code
.bp
.tc 4.5.4 Chain To Program Function
.sh
4.5.4 Chain To Program Function
.qs
.ix chain to program function
.sp 3
FUNCTION 47: CHAIN TO PROGRAM
Entry Parameters:
Register R5: 2FH
Returned Values:
Register R7: Function Does Not
Return to Calling
Program
.sp 2
.fi
.pp
The Chain to Program Function terminates the current program and
executes the command line stored in the current DMA buffer. The
format of the command line consists of a one-byte character count
(N), the command line characters, and a null byte as shown in
Figure 4-4. The character count contains the number of
characters in the command line. The count must be no more than
126
characters. If an error occurs, you receive one of the CCP errors
described in Appendix E.
.sp 3
.nf
N Command Line (N characters) 0
1 byte N bytes <\b_ 126 bytes 1 byte
.fi
.sp 2
.ce
.sh
Figure 4-4. Command Line Format in the DMA Buffer
.bp
.tc 4.5.5 Flush Buffers Function
.sh
4.5.5 Flush Buffers Function
.qs
.ix flush buffers function
.sp 3
.nf
FUNCTION 48: FLUSH BUFFERS
Entry Parameters:
Register R5: 30H
Returned Values:
Register R7: Return Code
success: 00H
error: nonzero
value
.fi
.sp 2
.pp
The Flush Buffers Function calls a BIOS Flush Buffers Function
(21), which forces the system to write the contents of any
unwritten or modified disk buffers to the appropriate disks.
Control and editing applications use this function to ensure
data is periodically physically written to the appropriate disks.
When the buffers are successfully flushed, this function returns
the value 00H in register R7. However, if an error occurs, and
this function does not complete successfully, this function returns
a nonzero value in register R7.
.bp
.tc 4.5.6 Direct BIOS Call Function
.sh
4.5.6 Direct BIOS Call Function
.qs
.ix direct BIOS call function
.ix BIOS return code
.ix BIOS parameter block (BPB)
.sp 3
.nf
FUNCTION 50: DIRECT BIOS CALL
Entry Parameters:
Register R5: 32H
Register RR6: BPB Address
Returned Values:
Register R7: BIOS Return Code
(if any)
.sp 2
.fi
.pp
Function 50 allows a program to call a BIOS function and
transfers control through the BDOS to the BIOS. The RR6
register contains the address of the BIOS Parameter Block (BPB),
a 5-word memory area containing
two BIOS function parameters, P1 and P2, as shown in Figure 4-5.
When a BIOS function returns a value, it is returned in register
R7.
.pp
Like other BDOS functions, your program must specify a SC #2
Instruction to invoke this BDOS function after the
registers are loaded with the appropriate parameters. The
starting location of the BPB must be an even-numbered address.
.sp 3
.nf
Field Size
Function Number 1 word
Value P1 1 longword
Value P2 1 longword
.fi
.sp 2
.ce
.sh
Figure 4-5. BIOS Parameter Block (BPB)
.qs
.sp 3
In the above figure, the function number is a BIOS function
number. See Appendix A. The two values, P1 and P2, are
32-bit BIOS parameters, which are passed in
registers RR6 and D2.L before your program invokes the BIOS function.
Appendix A contains a list of BIOS functions. For more details
on BIOS functions, refer to the \c
.ul
CP/M-8000 Operating System System Guide.
Note that if the parameters are addresses, they are
.ul
not
mapped, so that the caller can specify addresses in any part
of memory.
.qu
.ix direct BIOS call
.bp
.tc 4.5.7 Program Load Function
.sh
4.5.7 Program Load Function
.qs
.ix program load function
.sp 3
FUNCTION 59: PROGRAM LOAD
Entry Parameters:
Register R5: 3bH
Register RR6: LPB Address
Returned Values:
Register R7: Return Code
success: 00H
error: 01H - 03H
.fi
.sp 2
.ix function code
.ix load parameter block (LPB)
.pp
The Program Load function loads an executable command file into
memory. In addition to the function code, passed in register
R5, the address of the Load Parameter Block (LPB) is passed in
register RR6. After a program is loaded, the BDOS returns one
of the return codes listed below in register R7.
.sp 2
.ce
.sh
Table 4-19. Program Load Function Return Codes
.qs
.sp
.in 5
.nf
Code Meaning
.fi
.ll 60
.in 14
.ti -8
.sp
00 the function is successful
.sp
.ti -8
01 insufficient memory exists to load the file or the header is bad
.sp
.ti -8
02 a read error occurs while the file is loaded in memory
.sp
.ti -8
03 bad relocation bits exist in the program file
.sp
.in 0
.ll 65
.fi
.pp
The LPB describes the program and denotes the address at which it is loaded.
The format of the LPB is outlined in Figure 4-6. The starting location of
the LPB must be an even-numbered address.
.bp
.nf
Byte Content Size
Offset
0H address of FCB of successfully opened program file 1 longword
4H lowest address of area in which to load program 1 longword
8H highest address of area in which to load program +1 1 longword
CH address of base page (returned by BDOS) 1 longword
10H default user stack pointer (returned by BDOS) 1 longword
14H loader control flags 1 word
.fi
.sp 2
.ce
.sh
Figure 4-6. Format of the Load Parameter Block (LPB)
.sp 2
.ix load parameter block (LPB)
.pp
Before a program specifies the Program Load function, the file
must be opened with an Open File Function (15).
The memory addresses specified for the program in the LPB must
lie within the TPA. When the CCP calls the Program
Load function to load a transient program, the LPB
addresses are the boundaries of the TPA.
.pp
The loader control flags in the LPB select loader options as shown
in Table 4-20.
========= ACTUALLY, THE LOAD ADDRESSES GET IGNORED ===========
========= IN THE PRESENT VERSION. ALSO, THE LOW ===========
========= AND HIGH ADDRESSES WILL BE CHANGED TO ===========
========= REFLECT THE SEGMENT ACTUALLY USED. ===========
.sp 2
.ce
.sh
Table 4-20. Load Parameter Block Options
.sp
.ix load parameter block options
.nf
.in 5
.ll 60
Bit Number Value Meaning
.sp
.in
.ti -
0 (least 0 load program in the lowest
significant possible part of the
byte) supplied address space
.sp
1 load program in the highest
possible part of the
supplied address space
.sp
1 - 15 (decimal) 0 Reserved, should be set to
zero.
.sp
.in 0
.ll 65
.ix CCP
.fi
.pp
The CCP uses the Program Load Function to load a command file.
The CCP places the base page address on the
program's stack. The base page address is located at the
the address pointed to by register R15 (non-segmented) or
RR14 (segmented), the stack pointer. The program must return
to the CCP by executing the BDOS function 0 (Reset).
.ix base page
.pp
The BDOS allocates memory for the base page within the limits set
by the low and high addresses in the LPB and returns the address
of the allocated base page in the LPB. Locations 0000H - 0024H
of the base page are initialized by the BDOS. Locations 0025H
through 0037H are not initialized but are allocated and reserved
by the BDOS. The CCP initializes the remaining base page values
when it loads a program.
.ix initial stack pointer
.pp
The BDOS allocates a user stack located in the highest address of the TPA.
The maximum size of the stack equals the address of the stack pointer minus
the last address of the program plus 1. The value of the initial
stack pointer is passed to the LPB by the BDOS.
.pp
For programs loaded by a transient program rather than
the CCP, refer to Section 2.2.3.
============= THE FOLLOWING EXAMPLES HAVE TO BE COOKED UP ========
Appendix B contains two examples, an assembly language program
and a C language program, that illustrate how a transient program
loads another program with the Program Load Function but without the CCP.
.ix program load
.nx fourg

View File

@@ -0,0 +1,433 @@
.cs 5
.pn
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.sp 2
.he CP/M-8000 Programmer's Guide 4.6 Exception Functions
.tc 4.6 Exception Functions
.sp 2
.sh
4.6 Exception Functions
.qs
.ix exception functions
.pp 5
This section describes the Set Exception (61), Set Supervisor State,
(62), and the Get/Set TPA Limits Functions that set exceptions for error
handling and other exception processing.
.bp
.pn 88
.tc 4.6.1 Set Exception Vector Function
.sh
4.6.1 Set Exception Vector Function
.qs
.ix set exception vector function
.sp 3
.nf
FUNCTION 61: SET EXCEPTION VECTOR
Entry Parameters:
Register R5: 3DH
Register RR6: EPB Address
Returned Values:
Register R7: Return Code
success: 00H
error: FFH
.fi
.sp 2
.pp
The Set Exception Vector Function allows a program to reset
current exception vectors, set new exception vectors, and create
exception handlers for the Z8000 microprocessor.
The exception numbers used are the same as the exception numbers
used in CP/M-68000, for portability.
.ix exception vectors
.ix exception handlers
.ix exception parameter block (EPB)
.pp
In addition to passing the function number in register R5, a
program must pass the address of the Exception Parameter Block
(EPB) in register RR6. The EPB is a 10-byte data structure
containing a one-word vector number and two longword vector
values. See Figure 4-7. The EPB specifies the exception and
the address of the new exception handler.
Table 4-21 lists valid exceptions that correspond to Z8000
microprocessor hardware. The starting location of the
EPB must be an even-numbered address.
.sp 2
.nf
.sh
Field Size
.qs
.sp
Vector Number 1 word
New Defined Vector Value 1 longword
Old Vector Value Returned by BDOS 1 longword
.fi
.sp 2
.ce
.sh
Figure 4-7. Exception Parameter Block (EPB)
.qs
.sp 2
.ix vector number
.ix vector values
.pp
The vector number identifies the exception. The New Vector Value specifies
the address of the new exception handler for the specified exception. The
BDOS returns in the Old Vector Value Field, the value that the exception
vector contained before this function was invoked. The BDOS replaces the
old vector value with the new vector value in its table of exception
handlers and returns the address of the old exception handler to the old
vector value in the EPB. After the BDOS sets the new exception vector, it
passes the value 00H in register R7. However, if an error, such as a bad
vector, occurs while the vector is being set, this function passes the
value FFH in register R7. The bad vector error occurs when a vector
other than one listed in Table 4-21 is specified for this function.
.ix bad vector error
.ix system state
.pp
When an exception occurs, before the BIOS passes control to the BDOS
exception handler, it saves the registers on the system stack
in a form suitable for use with the control-transfer (XFER) system
call provided by the BIOS (as described in the CP/M-8000 Operating
System Guide). It then calls the BDOS exception handler as a subroutine,
in system, segmented mode. The BDOS exception handler restores the
status to that of the program that was executing when the exception
occurred (usually normal, non-segmented mode), and places a copy
of the context block on the appropriate (system or normal) stack.
The exception handler must return control to the interrupted program
by means of an XFER system call.
.ix exception handler
.ix logical console device (CONSOLE)
.pp
If an exception handler does not exist for an exception, when
that exception occurs, the BDOS default exception handler returns
an exception message to the logical console device (CONSOLE)
before it aborts the program. The BDOS exception message format is
defined below:
.sp 2
.ix resident system extensions (RSXs)
.nf
Exception nn at user address aaaaaaaa. Aborted.
.fi
.sp
.in 10
.ti -10
where:
.sp
.ti -10
nn is a hexadecimal number in the range 2 through 17 or 24
through 2F that defines all exceptions excluding reset,
hardware interrupts, and system Traps 0 through 3.
.sp
.ti -10
aaaaaaaa is the address of the instruction following the one
that caused the exception.
.qi
.sp 2
Except for exceptions handled by resident system extensions (RSXs), the
BDOS reinitializes all vectors to the default exception handler when the
BDOS System Reset Function (0) is invoked. Any exception vectors, which
your program sets, are reset after the BDOS warm boots the system. An RSX
is a program that is not configured in the operating system but remains
resident in memory after it is loaded. RSXs normally provide additional
system functions. The Get/Set TPA Limits Function (63) allows you to create
an area in the TPA in which one or more RSXs can reside.
.ix RSX
.ix resident system extension
.bp
.ce
.sh
Table 4-21. Valid Vectors and Exceptions
.qs
.sp
.nf
Vector Exception
.sp
0 Non-Maskable Interrupt
.sp
1 EPU Trap
.sp
2 Segment Violation
.sp
8 Privilege Violation
.sp
32* System Call 0 (debugger breakpoint)
.sp
36** System Call 4
.sp
37** System Call 5
.sp
38** System Call 6
.sp
39** System Call 7
.sp
.fi
.in 6
.ti -4
* Vectors reserved for Resident System Extensions (RSX)
implemented with the Get/Set TPA Limits Function (63).
.sp
.ti -4
** Recommended Trap vectors for applications.
.bp
.in 0
.tc 4.6.2 Set Supervisor State
.sh
4.6.2 Set Supervisor State
.qs
.ix set supervisor state
.sp 3
.nf
FUNCTION 62: SET SUPERVISOR STATE
Entry Parameters:
Register R5: 3EH
Returned Values:
Register R7: 00H
.fi
.sp 2
.ix supervisor state
.pp
The Set Supervisor Function puts the calling program in supervisor
(system) state. If running on a segmented processor (Z8001 or Z8003),
it also puts the program into segmented mode.
This function should not be used by novice
programmers and experienced programmers should be careful when
invoking this function.
.ix supervisor stack
.pp
The user stack is swapped when the program enters supervisor state.
On return from this function, the stack pointer, register RR14, is the
supervisor stack pointer and not the user stack pointer. Thus, you
cannot use register RR14 to reference the user stack, but must use
the user stack pointer (accessible with the LDCTL instruction).
.pp
The supervisor stack is used by the BDOS and BIOS. The
size of this stack is unpredictable, and the percent of the stack used
by the system is dependent on the operation being performed and
those previously performed. Therefore, you cannot predict
how much of the stack is available for program operations. To
avoid stack overflow and overwriting the system, you should not
push more than a few dozen bytes onto the stack, especially when
you call BDOS and BIOS functions.
.pp
An alternate method of avoiding stack overflow is to switch to a private
supervisor stack. You create the stack by loading into RR14 the address of an
area in memory that you use as the supervisor stack. The address must be an
even address. If you call BDOS and BIOS functions, your private supervisor
stack should be 300 longwords more than the space required by the program.
If your program exits supervisor mode, make sure your program restores the
system stack pointer to its original value. The supervisor stack is
reinitialized when the system warm boots.
.pp
Note that in future CP/M-8000 upward compatible systems, this
function may not exist, or will require privilege for the calling
process to access this function, or the function will fail. If it fails
the value FFH will be passed to R7. However, no
privilege is currently necessary. The function is always
successful and the value 00H is passed in register R7.
.bp
.tc 4.6.3 Get/Set TPA Limits
.sh
4.6.3 Get/Set TPA Limits
.qs
.sp 3
.ix get/set TPA limits
.nf
FUNCTION 63: GET-SET TPA LIMITS
Entry Parameters:
Register R5: 3FH
Register RR6: TPAB Address
Returned Values:
Register R7: 00H
Register TPAB: Contains TPA
Values
.sp 2
.fi
.ix Transient Program Area (TPA)
.ix Transient Program Area block (TPAB)
.ix Transient Program Area (TPA), boundaries
.pp
The Get/Set TPA Limits Function allows you to obtain or set the
boundaries of the Transient Program Area (TPA). You must load
the address of the Transient Program Area Block (TPAB) in
register RR6. The TPAB is a 5-word data structure consisting
of one word and two longwords. You create the TPAB in
the TPA as illustrated in Figure 4-8.
=============== THIS IS PRESENTLY NOT IMPLEMENTED RIGHT =========
=============== IT IS NOT CLEAR WHAT IT SHOULD DO IN A =========
=============== SEGMENTED ADDRESS SPACE. =========
.sp 3
.in 2
.nf
Byte Offset Field Size
00H Parameters 1 word
02H Low TPA address 1 longword
06H High TPA address + 1 1 longword
.fi
.in 0
.sp 2
.ce
.sh
Figure 4-8. Transient Program Parameter Block
.qs
.sp 2
.pp
The value of the first two bits in the one-word Parameters Field
determines whether
this function gets or sets the TPA limits and which fields you
supply. Figure 4-9 illustrates the
format of the parameters field.
.bp
.in 6
.nf
Parameters 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Field
reserved bits (2-15) = 0
bits: 1 0
values = 1/0 1/0
.fi
.in 0
.sp 2
.ce
.sh
Figure 4-9. Parameters Field in TPAB
.sp 2
.pp
Bit Zero determines whether you get or set the TPA limits. When
the value of bit zero is zero, the BDOS returns the current TPA
boundaries in the Low and High Address fields of the TPAB. When the value of
bit zero is one, the BDOS sets new TPA
boundaries. The BDOS uses the values that you specify in the Low
and High TPA address fields of the TPAB to set the new TPA
boundaries.
.pp
When you set the TPA boundaries, bit one determines whether the boundaries
are temporary or permanent. When the value of bit one is zero,
the TPA boundaries that you set are temporary; when the system warm boots,
the previous TPA limits are restored. When the value of bit one is
one, the TPA values that you set are permanent; they are not
changed when the system warm boots.
.pp
Bits 2 through 15 contain zeroes. These bits are reserved for future use.
Table 4-22 summarizes the values of bits zero and one.
.sp 2
.ce 2
.sh
Table 4-22.
.sp 0
.sh
Values For Bits 0 and 1 in the TPAB Parameters Field
.qs
.ix TPAB parameters field
.sp
.in 5
.ll 60
.nf
Bit Value Explanation
.sp
.fi
.in 23
.ti -18
0 0 Return boundaries of current TPA in TPAB Low and High
Address Fields.
.sp
.ti -18
1 Set new TPA boundaries with the values loaded in TPAB Low
and High address fields.
.sp
.ti -18
1 0 Restore previous TPA values when the system warm boots.
.sp
.ti -18
1 Permanently replace the TPA boundaries with the ones you
specify in the Low and High TPAB Address Fields.
.bp
.in 0
.ll 65
The examples below illustrate and explain values for bits zero and
one.
.sp
Examples:
.sp 2
.in 8
.ti -4
1) Get TPA Limits
.sp
.nf
1 0
0 0
.fi
.sp
This function returns the boundaries of the current TPA in the
Low and High Address Fields of the TPAB when the value of bit
zero equals 0.
.ne 10
.sp
.ti -4
2) Temporarily Set TPA Limits
.sp
.nf
1 0
0 1
.fi
.sp
This function temporarily sets the TPA boundaries to the
boundaries that you supply in the Low and High Address Fields of
the TPAB when bit zero equals 1 and bit one equals 0. The TPA
boundaries are reset when the system
warm boots.
.sp
.ti -4
3) Permanently Set TPA Limits
.sp
.nf
1 0
1 1
.fi
.sp
This function permanently sets the TPA boundaries to the values
that you supply in the Low and High Address Fields of the TPAB
when the value of bit zero equals 1 and bit one equals 1. The
TPA limits remain set until this function is called to reset the
boundaries or you cold boot system.
.in 0
.sp 2
.ce
End of Section 4
.nx five

View File

@@ -0,0 +1,834 @@
.pn 95
.bp odd
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he
.ft All Information Presented Here is Proprietary to Digital Research
.tc 5 AS68 Assembler
.ce 2
=================== ENTIRE SECTION MUST BE RE-WRITTEN ===============
=================== STARTING WITH McCLURE'S STUFF ===============
.sh
Section 5
.qs
.sp
.sh
AS68 Assembler
.qs
.sp 3
.he CP/M-8000 Programmer's Guide 5.1 Assembler Operation
.tc 5.1 Assembler Operation
.sh
5.1 Assembler Operation
.qs
.ix assembler (AS68) operation
.pp 5
The CP/M-8000 Assembler, AS68, assembles an assembly language source program
for execution on the a Z8000 microprocessor. It produces a relocatable
object file and, optionally, a listing. The assembly language
accepted by AS68 is identical to that of the Zilog Z8000 assembler
described in the Zilog manuals: \c
.ul
MZ8000 Resident Structured Assembler Reference Manual M8000MASM(D4) \c
.qu
and the \c
.ul
16-bit Microprocessor User's Manual, \c
.qu
third edition Z8000UM(AD3). Appendix D contains a summary of the
instruction set. Exceptions and additions are described in Sections 5.6
and 5.7.
.sp 2
.tc 5.2 Initializing AS68
.he CP/M-8000 Programmer's Guide 5.2 Initializing AS68
.sh
5.2 Initializing AS68
.pp
If the file AS68SYM.DAT is not on your disk, you must create this file
to initialize AS68 before you can use AS68 to assemble files. To
initialize AS68, specify the AS68 command, the -I option, and the filename
AS68INIT as shown below.
.sp
.ti 10
AS68 -I AS68INIT
.sp
AS68 creates the output file AS68SYMB.DAT, which AS68 requires
when it assembles programs. After you create this file, you need not
specify this command line again unless you reconfigure your
system to have different TPA boundaries.
.sp 2
.tc 5.3 Invoking the Assembler (AS68)
.he CP/M-8000 Programmer's Guide 5.3 Invoking the Assembler (AS68)
.sh
5.3 Invoking the Assembler (AS68)
.qs
.pp
Invoke AS68 by entering a command of the following form:
.sp 2
.in 8
.nf
AS68 [-F d:] [-P] [-S d:] [-U] [-L] [-N] [-I]
[-O object filename]
source filename [>listing filename]
.fi
.in 0
.bp
.ce
.sh
Table 5-1. Assembler Options
.sp
.in 5
.ll 60
.nf
Option Meaning
.fi
.sp
.in 14
.ti -9
-F d:
.sp
The -F option specifies the drive on which temporary files are
created. The variable d: is the drive designation, which must be
followed by a colon. If this option is not specified, the temporary files
that AS68 creates are created on the current drive.
.sp 2
.ti -9
-I
.sp
The -I option initializes the assembler. See Section 5.2 for
details.
.sp 2
.ti -9
-P
.sp
If specified, AS68 produces and prints a listing on the standard
output device which, by default, is the console. You can redirect the listing,
including error messages, to a file by using the >listing filename
parameter. Note that error messages are produced whether or not the -P
option is specified. No listing is produced, however, unless you specify
the -P option.
.sp 2
.ti -9
-S d:
.sp
The -S option indicates the drive on which the assembler
initialization
file, AS68SYMB.DAT, resides. This file is created when you initialize AS68.
See Section 5.2. AS68 reads the file AS68SYMB.DAT before it assembles a
source file. The variable, d:, is the drive designation; it must be
followed by a colon. If you do not specify this option, AS68 assumes
the initialization file is on the default drive.
.sp 2
.ti -9
-U
.sp
Causes all undefined symbols in the assembly to be treated as
global references.
.in 0
.ll 65
.bp
.ce
.sh
Table 5-1. (continued)
.sp
.in 5
.ll 60
.nf
Option Meaning
.fi
.sp
.in 14
.ti -9
-L
.sp
Ensures all address constants are generated as
longwords. Use the -L option for programs that require more than
64K for execution or if the TPA is not contained in the first 64K bytes of
memory. If -L is not specified, the program is assembled to
run in the first 64K bytes of memory. If an address in the assembly
does not fit within one word an error occurs. Appendix E describes
all AS68 errors.
.sp 2
.ti -9
-N
.sp
Disables optimization of branches on forward references. Normally,
wherever possible, AS68 uses the 2-byte form of the conditional branch and
the 4-byte BSR instruction to speed program execution and reduce the
instruction size instead of the 6-byte JSR instruction.
.sp 2
.ti -9
source filename
.sp
This is the only required parameter. It is the file specification
of the assembly language source program to be assembled.
.sp 2
.ti -9
>listing filename
.sp
If specified, the listing requested with the -P option is directed
to the specified file rather than to your console terminal, the standard
output
device. The error messages are produced in the listing file. Note that if
you do not request a listing file, you can still redirect the error messages
to a file by specifying the greater than symbol (>) immediately followed by a
file specification.
.ll 65
.bp
.in 0
.he CP/M Programmer's Guide 5.4 Assembly Language Directives
.tc 5.4 Assembly Language Directives
.sh
5.4 Assembly Language Directives
.qs
.ix assembly language directives
.pp
This section alphabetically lists and briefly describes the directives AS68
supports.
.sp 2
.ce
.sh
Table 5-2. Assembly Language Directives
.qs
.sp
.in 5
.ll 60
.nf
Directive Meaning
.fi
.sp
.in 17
.ti -12
comm label, expression
.ix common directive (comm)
.sp
The common directive (comm) specifies the label and size of a common area,
which can be shared by separately assembled programs.
The linker, LO68, links all common areas with the same label to the same
address. The size of the common area is determined by the value of the
largest expression when more than one common area with the same label
exists.
.sp 2
.ti -12
data
.sp
.ix data directive
The data directive instructs AS68 to change the assembler base segment to the
data segment.
.sp 2
.ti -12
bss
.sp
.ix bss directive
The bss directive instructs AS68 to change the assembler base segment to the
block storage segment (bss).
Instructions and data cannot be assembled in the bss.
However, symbols can be defined and storage can be reserved
with the .ds directive in the bss.
.sp 2
.ti -12
dc operand [,operand, ...]
.sp
.mb 5
.fm 1
.ix define constant directive (dc)
The define constant directive (dc) defines one or more constants in memory.
When you specify more than one operand, separate each with a comma.
The operand can contain a symbol or an expression that is
assigned a numeric value by AS68, or the value of the constant in decimal,
hexadecimal, or ASCII notation. If you specify an ASCII value, you must
enclose the string in single quotes ('). Although an ASCII character is
only seven bits in length, each character is assigned a byte of memory. The
eighth bit always equals zero.
.in 0
.ll 65
.bp
.ce
.sh
Table 5-2. (continued)
.qs
.sp
.in 5
.ll 60
.nf
Directive Meaning
.fi
.sp
.in 17
.pp
You can specify the constants to be bytes, words, or longwords.
The list below illustrates the notation for each of these size
specifications and describes the rules that apply to them.
.mb 6
.fm 2
.sp 2
.in 23
.ti -6
dc.b The constants are byte constants. If you specify an odd number of
bytes, AS68 fills the odd byte on the right with zeroes unless the next
statement is another dc.b directive. When the next statement is
a dc.b directive, the dc.b uses the odd byte. Byte constants are not
relocatable.
.sp
.ti -6
dc.w The constants are word constants. If you specify an odd
number of bytes, AS68 fills the last word on the right with zeroes to
force an even byte count. The only way to specify an odd number of bytes
is with an ASCII constant. Word constants can be relocated.
.sp
.ti -6
dc.l The constants are longword constants. If less than a
multiple of four bytes is entered, AS68 fills the last longword on the
right with zeroes to force a multiple of four bytes. Longword constants
can be relocated.
.sp 2
.in 17
.ti -12
ds operand
.sp
The define storage directive (ds) reserves memory locations. The contents of
the memory that it reserves is not initialized. The operand specifies the
number of bytes, words, or longwords that this directive reserves.
The notation for these size specifications is shown below.
.ix define storage directive (ds)
.sp
.nf
ds.b reserves memory locations in bytes
.sp
ds reserves memory locations in words
.sp
ds.l reserves memory locations in
longwords
.fi
.in 0
.ll 65
.bp
.ce
.sh
Table 5-2. (continued)
.qs
.sp
.in 5
.ll 60
.nf
Directive Meaning
.fi
.sp
.in 17
.ti -12
end
.sp
The end directive informs AS68 that no more source code follows this
directive. Code, comments, or multiple carriage returns cannot follow this
directive.
.ix end directive
.sp 2
.ti -12
endc
.sp
The endc directive denotes the end of the code that is conditionally
assembled. It is used with other directives that conditionally assemble
code.
.ix endc directive
.sp 2
.ti -12
equ expression
.sp
.ix equate directive (equ)
The equate directive (equ) assigns the value of the expression in the
operand field to the symbol in the label field that precedes the
directive. The syntax for
the equate directive is below.
.sp
label EQU expression
.sp
The label and operand fields are required. The label must be unique;
it cannot be defined anywhere else in the program. The expression cannot
include an undefined symbol or one that is defined following the
expression. Forward references to symbols are not allowed for this
directive.
.sp 2
.ti -12
even
.sp
.ix even directive
The even directive increments the location counter to force an even
boundary. For
example, if specified when the location counter is odd, the location
counter is incremented by one so that the next instruction or data field
begins on an even boundary in memory.
.in 0
.ll 65
.bp
.ce
.sh
Table 5-2. (continued)
.qs
.sp
.in 5
.ll 60
.nf
Directive Meaning
.fi
.sp
.in 17
.nf
.ti -12
globl label[,label...]
.ti -12
xdef label[,label...]
.ti -12
xref label[,label...]
.fi
.sp
These directives make the label(s) external. If the labels are defined
in the current assembly, this statement makes them available
to other routines during a load by LO68. If the labels are not
defined in the current assembly, they become undefined external
references, which LO68 links to external values with the same label
in other routines. If you specify the -U option, the assembler
makes all undefined labels external.
.sp 2
.nf
.ti -12
ifeq expression
.ti -12
ifne expression
.ti -12
ifle expression
.ti -12
iflt expression
.ti -12
ifge expression
.ti -12
ifgt expression
.fi
.sp
.ix conditional directives
All of the directives listed above are conditional directives in which the
expression is tested against zero for the condition specified by
the directive. If the expression is true, the code following is
assembled; otherwise, the code is ignored until an end conditional
directive (endc) is found. The directives and the conditions they test are
listed below.
.sp
.nf
ifeq equal to zero
ifne not equal to zero
ifle less than or equal to zero
iflt less than zero
ifge greater or equal to zero
ifgt greater than zero
.fi
.sp 2
.ti -12
ifc 'string1', 'string2'
.sp 0
.ti -12
ifnc 'string1', 'string2'
.sp
.ix conditional string directive
The conditional string directive compares two strings.
The 'c' condition is true if the strings are
exactly the same. The 'nc' condition is true if they do not match.
.in 0
.ll 65
.bp
.ce
.sh
Table 5-2. (continued)
.qs
.sp
.in 5
.ll 60
.nf
Directive Meaning
.fi
.sp
.in 17
.ti -12
offset expression
.sp
.ix offset directive
The offset directive creates a dummy storage section by defining a table of
offsets with the define storage directive (ds). The storage definitions
are not passed to the linker. The offset table begins at the address
specified in the expression. Symbols defined in the offset table are
internally maintained. No instructions or code-generating directives,
except the equate (equ) and register mask (reg) directives, can be used in
the table. The offset directive is terminated by one of the following
directives:
.sp
.nf
bss
data
end
section
text
.fi
.sp 2
.ti -12
org expression
.sp
.ix absolute origin directive (org)
The absolute origin directive (org) sets the location counter to the
value of the expression. Subsequent statements are assigned absolute
memory locations with the new value of the location counter. The
expression cannot contain any forward, undefined, or external references.
.sp 2
.ti -12
page
.sp
.ix page directive
The page directive causes a page break which forces text to print on the top
of the next page. It does not require an operand or a label and
it does not generate machine code.
.pp
The page directive allows you to set the page length for a listing of code.
If you use this directive and print the source code by specifying the -P
option in the AS68 command line, pages break at predefined rather than
random places. The page directive does not appear on the printed program
listing.
.in 0
.ll 65
.bp
.ce
.sh
Table 5-2. (continued)
.qs
.sp
.in 5
.ll 60
.nf
Directive Meaning
.fi
.sp
.in 17
.ti -12
reg reglist
.sp
.ix register mask directive
The register mask directive
builds a register mask that can be used by movem instruction. One
or more registers can be listed in ascending order in the format:
.sp
R?[-R[/R?[-R?...]...]]
.sp
Replace the R in the above format with a register reference.
Any of the following mnemonics are valid:
.sp
.nf
A0-A7
D0-D7
R0-R15
.fi
.sp
The example below illustrates a sample register list.
.sp
A2-A4/A7/D1/D3-D5
.sp
You can also use commas to separate registers as shown
below.
.sp
A1,A2,D5,D7
.sp 2
.ti -12
section #
.sp
.ix section directive
The section directive defines a base segment. The sections can be numbered
from 0 to 15 inclusive. Section 14 always maps to data. Section 15 is
bss. All other section numbers denote text sections.
.sp 2
.ti -12
text
.sp
.ix text directive
The text directive instructs AS68 to change the assembler base segment to
the text segment. Each assembly of a program begins with the first word in
the text segment.
.bp
.in 0
.fi
.ll 65
.tc 5.5 Sample Commands Invoking AS68
.sh
5.5 Sample Commands Invoking AS68
.qs
.he CP/M-8000 Programmer's Guide 5.5 Sample Commands Invoking AS68
.sp 2
.ti 8
A>\c
.sh
AS68 -U -L TEST.S
.qs
.ix invoking AS68
.ix AS68, invoking
.sp
.pp
This command assembles the source file TEST.S and produces the object file
TEST.O. Error messages appear on the screen. Any undefined symbols are
treated as global.
.sp 2
.ti 8
A>\c
.sh
AS68 -P SMPL.S >SMPL.L
.qs
.sp
.pp
This command assembles the source file SMPL.S and produces the object file
SMPL.O. The program must run in the first 64K of memory; that is,
no address can be larger than 16 bits. Error messages and the listing are
directed to the file SMPL.L.
.sp 2
.tc 5.6 Assembly Language Differences
.sh
5.6 Assembly Language Differences
.qs
.he CP/M-8000 Programmer's Guide 5.6 Assembly Language Differences
.pp
.ix AS68 assembly language
The syntax differences between the AS68 assembly language and Zilog's
assembly language are listed below.
.in 8
.sp
.ti -3
1) All assembler directives are optionally preceded by a period (.). For
example,
.sp
.nf
.ti -1
.equ or equ
.ti -1
.ds or ds
.sp
.ti -3
2) AS68 does not support the following Zilog directives:
.sp
.nf
comline
mask2
idnt
opt
.fi
.sp
.ti -3
3) The Zilog .set directive is implemented as the equate
directive (equ).
.sp
.ti -3
4) AS68 accepts upper- and lower-case characters. You can specify
instructions and directives in either case. However, labels and variables
are case sensitive. For example, the label START and Start are not
equivalent.
.sp
.ti -3
5) For AS68, all labels must terminate with a colon (:). For example,
.sp
.nf
A:
FOO:
.fi
.sp
However, if a label begins in column one, it need not terminate with a
colon (:).
.sp
.ti -3
6) For AS68, ASCII string constants can be enclosed in either single or
double quotes. For example,
.sp
.nf
'ABCD'
"ac14"
.fi
.sp
.ti -3
7) For AS68, registers can be referenced with the following mnemonics:
.sp
.nf
r0-r15
R0-R15
d0-d7
D0-D7
a0-a7
A0-A7
.fi
.sp
Upper- and lower-case references are equivalent.
Registers R0-R7 are the same as D0-D7 and R8-R15 are the same as
A0-A7.
.ne 10
.sp
.ti -3
8) For AS68, comment lines cannot begin with an asterisk that is immediately
followed
by an equals sign (*=), since the location counter can be
manipulated with a statement of the form:
.sp
.nf
*=expr
.fi
.sp
.ti -3
9) Use caution when manipulating the location counter forward. An expression
can move the counter forward only.
The unused space is filled with zeros in the text or data
segments.
.sp
.ti -4
10) For AS68, comment lines can begin with an asterisk followed by an equals
sign (* =)
but only if one or more spaces exist between the asterisk and the
equals sign as shown below.
.sp
.nf
* = This command loads R1 with zeros.
.sp
* = Branch to subroutine XYZ
.fi
.sp
.ti -4
11) For AS68, the syntax for short form branches is bxx.b rather
than bxx.s
.sp
.ti -4
12) The Zilog assembler supports a programming model in which
a program consists of a maximum of 16 separately relocatable
sections and an optional absolute section. AS68 distributed
with CP/M-8000 does not support this model. Instead, AS68
supports a model in which a program contains three segments,
text, data, and bss as described in Sections 2 and 3 of this
guide.
.in 0
.fi
.ll 65
.bp
.tc 5.7 Assembly Language Extensions
.sh
5.7 Assembly Language Extensions
.qs
.he CP/M-8000 Programmer's Guide 5.7 Assembly Language Extensions
.sp
.ix assembly language extensions
.pp
The enhancements listed below have been added to AS68 to aid the assembly
language programmer by making the assembly language more efficient:
.sp 2
.in 8
.ti -3
1) When the instructions add, sub, cmp are used with an address register
in the source or destination, they generate adda, suba, and cmpa.
When the clr instruction is used with an address register (Ax),
it generates sub Ax, Ax.
.sp
.ti -3
2) add, and, cmp, eor,
or, sub are allowed with immediate first operands and actually generate addi,
andi, cmpi, eori, ori, subi, instructions if the second operand is not
register direct.
.sp
.ti -3
3) All branch instructions generate short relative branches where possible,
including forward references.
.ix branch instructions
.sp
.ti -3
4) Any shift instruction with no shift count specified assumes a shift count
of one. For example, "asl rl" is equivalent to "asl #1,rl".
.ix shift instruction
.sp
.ti -3
5) A jsr instruction is changed to a bsr instruction if the
resulting bsr is shorter than the jsr instruction.
.ix jsr instruction
.ix bsr instruction
.sp
.ti -3
6) The .text directive causes the assembler to begin assembling instructions
in the text segment.
.ix .text directive
.sp
.ti -3
7) The .data directive causes the assembler to begin assembling initialized
data in the data segment.
.ix .data directive
.sp
.ti -3
8) The .bss directive instructs the assembler to begin defining storage
in the bss. No instructions or constants can be place in the bss because
it is for uninitialized data only. However, the .ds directives can be
used to define storage locations, and the location counter (*) can be
incremented.
.ix .bass directive
.sp
.ti -3
9) The .globl directive in the form:
.ix .globl directive
.sp
.ti -1
.globl label[,label] ...
.sp
makes the labels external. If they are otherwise defined (by assignment or
appearance as a label) they act within the assembly exactly as if the .globl
directive was not given. However, when linking this program with
other programs, these symbols are available to other programs. Conversely,
if the given symbols are not defined within the current assembly, the
linker can combine the output of this assembly with that of others which
define the symbols.
.bp
.ti -4
10) The common directive (comm) defines a common region, which can be accessed
by programs that are assembled separately. The syntax for the common
directive is below.
.ix common directive (comm)
.sp
.ti -1
.comm label, expression
.pp
The expression specifies the number of bytes that is allocated in the common
region. If several programs specify the same label for a common region,
the size of the region is determined by the value of the largest
expression.
.pp
The common directive assumes the label is an undefined external symbol
in the current assembly. However, the linker, LO68, is special-cased, so
all external symbols, which are not otherwise defined, and which have a
nonzero value, are defined to be in the bss, and enough space is left after
the symbol to hold expression bytes. All symbols which become defined in
this way are located before all the explicitly defined bss locations.
.sp
.ix .even directive
.ti -4
11) The .even directive causes the location counter (*), if positioned
at an odd address, to be advanced by one byte so the next statement is
assembled at an even address.
.sp
.ti -4
12) The instructions, move, add, and sub, specified with an immediate first
operand and a data (D) register as the destination, generate Quick
instructions, where possible.
.in 0
.ll 65
.sp 2
.tc 5.8 Error Messages
.sh
5.8 Error Messages
.qs
.he CP/M-8000 Programmer's Guide 5.8 AS68 Error Messages
.pp
Appendix E lists the error messages generated by AS68.
.sp 2
.ce
End of Section 5
.bp
.he CP/M-8000 Programmer's Guide End of Section 5
.sp 50
.nx six

View File

@@ -0,0 +1,276 @@
.he
.bp odd
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.he
.tc 6.0 L068 Linker
.ce 2
=================== REPLACE/RE-WRITE ENTIRE SECTION ================
=================== DOCUMENT ON LD8K ATTACHED ================
.sh
Section 6
.qs
.sp
.sh
L068 Linker
.qs
.he CP/M-8000 Programmer's Guide 6.0 L068 Linker
.sp 3
.tc 6.1 Linker Operation
.sh
6.1 Linker Operation
.qs
.he CP/M-8000 Programmer's Guide 6.1 Linker Operation
.ix linker (L068) operation
.pp 5
L068 is the CP/M-8000 Linker that combines several AS68 assembled
(object) programs into one executable command file. All external
references are resolved. The linker must be used to create
executable programs, even when a single object program contains
no unresolved references. The argument routines are concatenated
in the order specified. The entry point of the output is the
first instruction of the first routine.
.sp 2
.tc 6.2 Invoking the Linker (L068)
.sh
6.2 Invoking the Linker (L068)
.qs
.he CP/M-8000 Programmer's Guide 6.2 Invoking the Linker
.ix Linker, invoking
.pp
Invoke L068 by entering a command of the following form:
.sp 2
.nf
L068 [-F d:] [-R] [-S] [-I] [-Umodname]
[-O filename] [-X] [-Zaddress]
[-Daddress] [-Baddress] object filename [object filename]
[>message filename]
.fi
.sp 2
.ce
.sh
Table 6-1. Linker Command Options
.qs
.sp
.in 5
.ll 60
.nf
Option Meaning
.fi
.in 15
.ti -10
.sp
-F d:
.sp
The -F option specifies the drive on which temporary files
are created. The variable d: is the drive designation.
.ix -F option (L068)
.sp 2
.ti -10
-R
.sp
.ix -R option (L068)
The -R option preserves the relocation bits so the resulting
executable program is relocatable.
.sp 2
.ti -10
-S
.ix -S option (L068)
.sp
If specified, the output is stripped; the symbol table and relocation
bits are removed to save memory space.
.bp
.in 0
.ll 65
.ce
.sh
Table 6-1. (continued)
.qs
.sp
.in 5
.ll 60
.nf
Option Meaning
.fi
.sp
.in 15
.ti -10
-I
.sp
.ix -I option (L068)
If -I is specified, no 16-bit address overflow messages
are generated. When you assemble a program without the AS68 -L option, the
linker may generate address overflow messages if the program contains
addresses longer than 16 bits.
.sp 2
.ti -10
-Umodname
.sp
.ix -Umodname option (L068)
Links a module within the library with other modules in the command line.
The module name, specified by the modname parameter, cannot exceed eight
characters. You can use this option to create a program from modules
within a library, if the module following the U option calls other modules
in the library.
.sp 2
.ti -10
-O filename
.sp
.ix -O option (L068)
If specified, the object file produced by L068 has the filename that you
specify following the -O option. The -O option and filename are separated
by one or more spaces. If you do not specify a filename, the object
file has the name C.OUT.
.sp 2
.ti -10
-X
.sp
.ix -X option (L068)
If specified, the symbol table includes all local
symbols except those that begin with the letter L. If not specified, L068
puts only global symbols in the symbol table. This option is
provided so that you can discard compiler internally-generated labels
that begin with the letter L while retaining symbols local to routines.
.bp
.in 0
.ll 65
.ce
.sh
Table 6-1. (continued)
.qs
.sp
.in 5
.ll 60
.nf
Option Meaning
.fi
.sp
.in 15
.ti -10
-Taddress
.sp 0
.ti -10
-Zaddress
.sp
.ix -Taddress (L068)
.ix -Zaddress (L068)
.ix -Daddress (L068)
.ix -Baddress (L068)
The -T and -Z options are equivalent. If specified, the hexadecimal
address given is defined by L068 as the beginning address for the text
segment. This address defaults to zero, or it can be specified as any
hexadecimal number between 0 and FFFFFFFFH. This option is especially
useful for stand-alone programs, or for putting programs in R0M.
Hexadecimal characters can be in upper-case or lower-case.
.sp 2
.ti -10
-Daddress
.sp
If specified, the hexadecimal address given is defined by L068 as the
beginning address for the data segment. This address defaults to the next
byte after the end of the text segment, or it can be specified as any
hexadecimal number between 0 and FFFFFFFF. This option is especially
useful for stand-alone programs or for putting programs in ROM. Hexadecimal
address characters can be in upper-case or lower-case.
.sp 2
.ti -10
-Baddress
.sp
If specified, the hexadecimal address given is defined by L068 as the
beginning address for the bss. This address defaults to the next
byte after the end of the data segment, or it can be specified as
any hexadecimal number between 0 and FFFFFFFF.
.sp 2
.ti -10
object filename [object filename]
.sp
.ix object filename option (L068)
The name of one or more object files produced by the assembler AS68.
These are the object files that L068 links.
.bp
.in 0
.ll 65
.ce
.sh
Table 6-1. (continued)
.qs
.sp
.in 5
.ll 60
.nf
Option Meaning
.fi
.sp
.in 15
.ti -10
>message filename
.sp
.ix >message filename (L068)
If specified, error messages produced by L068 are redirected to the file
that you specify immediately after the greater than (>) sign. If
you do not specify a filename, error messages are written to the
standard default output device, which typically is your console terminal.
.in 0
.ll 65
.sp 2
.tc 6.3 Sample Commands Invoking L068
.ne 10
.sh
6.3 Sample Commands Invoking L068
.qs
.he CP/M-8000 Programmer's Guide 6.3 Commands Invoking L068
.sp 2
.ti 8
A>\c
.sh
L068 -S -0 TEST.8000 TEST.O
.qs
.sp
.in 0
.pp
This command links assembled file TEST.O into file TEST.8000 and strips out
the symbol table and relocation bits.
.sp 2
.ti 8
A>\c
.sh
L068 -T4000 -D8000 -BC000 A.O B.O C.O
.qs
.sp
.pp
This command links assembled files A.O, B.O, and C.O to the default output
file C.OUT. The text segment starts at location 4000H; the
data segment starts at location 8000H; and the bss starts at
location C000H.
.sp 2
.ti 8
A>\c
.sh
L068 -I -O TEST.8000 TEST.O TEST1.0 >ERROR
.qs
.sp
.pp
This command links assembled files TEST.O and TEST1.O to file TEST.8000.
Any 16-bit address overflow errors are ignored; error messages are
directed to the file ERROR.
.sp 2
.tc 6.4 L068 Error Messages
.sh
6.4 L068 Error Messages
.qs
.he CP/M-8000 Programmer's Guide 6.4 L068 Error Messages
.pp
Appendix E lists the error messages that L068 displays.
.sp 2
.ce
End of Section 6
.nx seven

View File

@@ -0,0 +1,112 @@
================= DRI FORMATTING NEEDED ================
ld8k(1) Loader/linker ld8k(1)
DESCRIPTION
ld8k - loader/linker
SYNOPSIS
ld8k [option] file ...
DESCRIPTION
Ld8k combines several object programs into one. It is capable
of linking both segmented and non-segmented Z8000 object
modules. However, all of the modules linked must be of the same
type. Ld8k also has facilities for searching libraries in the
format prepared by ar8k. Normally, the output (default = x.out)
is prepared for execution, however the -r option may be used to
preserve relocation information so that the output can be used
as further input to ld8k.
If no errors occur during the execution of ld8k, the output
module is marked with a magic word that indicates that it is
executable.
Arguments to ld8k are processed in the order that they appear in
the command line. Libraries are searched exactly once at the
point at which they appear in the command. Only routines that
resolve at least one external reference are loaded. Therefore
ordering of libraries is important.
Whether segmented or non-segmented linking is done depends on
the type of the first object module encountered, since no mixing
of types is permissible. In searching archives, only entry
points in modules having the correct type are considered. Hence
archives can have modules with duplicated entry point names so
long as they are in different object module types.
There are several options. Except for library specification (-
lxx), all should appear before any file names.
-i Prepare the object file for "split I and D" space. That
is, start the data addresses at zero, and in the case of
segmented loads, segment numbers can also be reused.
-lxx Search the library name "/lib/libxx.x" or if does not
exist, the library "/usr/lib/libxx.a". This may appear
anywhere in the command line.
-n Mark the text read only so that it may be shared. This is
meaningful only for non-segmented loads. The data boundary
is moved up to the next 8K byte boundary.
-o The next argument is taken as the name of the object file
instead of "x.out".
-r Preserve relocation information in the output even if all
references are resolved.
-s "Strip" the output by removing the symbol table and
relocation information to save space in the object file.
-S The next argument is a decimal number that sets the size of
the stack segment.
-u Enter the next argument as an undefined reference so that
loading can be accomplished solely from an archive file.
-D The next argument is taken to be a file name containing
segment numbers and name correspondences. In this way
specific segment numbers can be assigned to named segments,
or the loader can be forced to ignore specific segment
numbers. The format of the descriptor file is a sequence
of ASCII lines as follows:
<number>=<name>[,<name>]
or
<number>
The first form requires the named segments to be assigned
the given number. If all of the named segments will not
fit into 64KB, an error message will be issued. The order
in which the named segments are assigned to the numbered
segment is the order in which the names appear in the
control line. The second form effectively reserves the
segment number and does not permit the loader to use it. A
given segment number may only appear in a descriptor file
once. In the absence of a descriptor file, the default
named segments are processed in the order: __text, __data,
and __bss.
-D"descriptor line" this is a shorthand form of the preceding
control in which one line will suffice. -D commands may be
repeated, in which case they are processed in the order
they are encountered.
FILES
/lib/lib*.a libraries /usr/lib/lib*.a libraries
x.out object file

View File

@@ -0,0 +1,674 @@
.bp
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he
.ft All Information Presented Here is Proprietary to Digital Research
.ce
.sh
Section 7
.sp
.ce
.sh
Programming Utilities
.qs
.he CP/M-8000 Programmer's Guide 7.1 Archive Utility
.ix programming utilities
.ix AR68
.ix DUMP
.ix XDUMP
.ix archive (AR8K) utility, syntax
.sp 2
.pp 5
CP/M-8000 supports five programming utilities: Archive
(AR8K), DUMP, and object-file dump (XDUMP).
AR8K allows you to create and modify libraries. DUMP displays the
contents of files in hexadecimal and ASCII notation.
XDUMP displays the contents of object files in a variety of formats.
.qu
This section describes each of these utilities in a
separate subsection.
.sp 2
.tc 7.1 Archive Utility
.he CP/M-8000 Programmer's Guide 7.1 Archive Utility
.sh
7.1 Archive Utility
.qs
.pp
.ix AR8K
.ix Archive Utility
The Archive Utility, AR8K, creates a library or replaces, adds,
deletes, lists, or extracts object modules in an existing
library. AR8K can be used on the C Run-Time Library distributed
with CP/M-8000 and documented in the \c
.ul
C Language Reference Manual \c
.qu
for the Z8000 microprocessor.
================= CHECK AGAINST AR8K DOCUMENT ============
.sp 2
.tc 7.1.1 AR8K Syntax
.sh
7.1.1 AR8K Syntax
.qs
.ix invoking AR8K
.pp
To invoke AR8K, specify the components of the command line shown
below. Optional components are enclosed in square brackets ([]).
.sp
AR8K DRTWX[AV][F D:] [OPMOD] ARCHIVE OBMOD1 [OBMOD2...][>filespec]
.qs
.sp
.qi
You can specify multiple object modules in a command line
provided the command line does not exceed 127 bytes. The
delimiter character between components consists of one or more
spaces.
.sp 2
.ce
.sh
Table 7-1. AR8K Command Line Components
.qs
.sp
.in 5
.nf
Component Meaning
.sp
.fi
.ll 60
.in 18
.ti -13
AR8K
.sp
invokes the Archive Utility. However, if you
specify only the AR8K command, AR8K returns the command line
syntax and the system prompt as shown below.
.sp
A>AR8K
.sp 0
.nf
usage: AR8K DRTWX[AV][F D:] [OPMOD] ARCHIVE OBMOD1 [OBMOD2...][>filespec]
.sp
.fi
A>
.bp
.in 0
.ll 65
.ce
.sh
Table 7-1. (continued)
.qs
.sp
.in 5
.nf
Component Meaning
.sp
.fi
.ll 60
.in 18
.ti -13
DRTWX
.sp
indicates you must specify one of these letters as
an AR8K command. Each of these one-letter commands and
their options are described in Section 7.1.3.
.sp 2
.ti -13
AV
.sp
indicates you can specify one or both of these
one-letter options. These options are described with the commands
in Section 7.1.3.
.sp 2
.ti -13
OPMOD
.sp
is an object module within the library that you specify.
The OPMOD parameter indicates the position in which additional object modules
reside when you incorporate modules in the library and specify the
A option.
.sp 2
.ti -13
F D:
.sp
specifies the drive on which the temporary file
created by AR8K resides. The variable D is the drive select
code; it must be followed by a colon (:). AR8K creates a
temporary file called AR8K.TMP that AR8K uses as a scratchpad
area.
.sp 2
.ti -13
ARCHIVE
.sp
is the file specification of the library.
.sp 2
.ti -13
OBMOD1 [OBMOD2 ...]
.sp
indicates one or more object modules in a library that AR8K
deletes, adds, replaces, or extracts.
.bp
.in 0
.ll 65
.ce
.sh
Table 7-1. (continued)
.qs
.sp
.in 5
.nf
Component Meaning
.sp
.fi
.ll 60
.in 18
.ti-13
>filespec
.sp
redirects the output to the file specification that you specify,
rather than sending the output to the standard output device,
which is usually the console device (CONSOLE). You can redirect
the output for any of the AR8K commands described in Section 7.1.3.
.in 0
.ll 65
.sp 2
.tc 7.1.2 AR8K Operation
.sh
7.1.2 AR8K Operation
.qs
.ix AR8K operation
.pp
AR8K sequentially parses the command line only once. AR8K
searches for, inserts, replaces, or deletes object modules in
the library in the sequence in which you specify them in the
command line. Section 7.1.3 describes each of the commands
AR8K supports.
.pp
When AR8K processes a command, it creates a temporary file called AR8K.TMP.
AR8K creates and uses AR8K.TMP when it processes AR8K commands. After
the operation is complete AR8K erases AR8K.TMP. However, depending on when
an error occurs, AR8K.TMP is not always erased. If this occurs, erase
AR8K.TMP with the ERA command and refer to Appendix E for error messages
output by AR8K.
.sp 2
.tc 7.1.3 AR8K Commands and Options
.sh
7.1.3 AR8K Commands and Options
.qs
.ix AR8K commands
.ix AR8K options
.ix commands, AR8K
.ix options, AR8K
.pp
This section describes AR8K commands and their options. Examples
illustrate the effect and interaction between each command and the
options it supports.
.sp 2
.ce
.sh
Table 7-2. AR8K Commands and Options
.qs
.in 5
.ll 60
.sp
.nf
Command/Option Meaning
.fi
.in 23
.ti -12
.sp
D deletes from the library one or more object modules
specified in the command. You can specify
the V option for this command.
.ix D command (AR8K)
.sp 2
.ti -12
V lists the modules in the library and indicates which modules
are retained and deleted by the D command. The V option precedes
modules retained in the library with the lower-case letter c and modules
deleted from the library with the lower-case letter d as shown below.
.ix V option (AR8K)
.bp
.in 0
.ll 65
.ce
.sh
Table 7-2. (continued)
.qs
.in 5
.ll 60
.sp
.nf
Command/Option Meaning
.fi
.sp
.in 23
.nf
A>\c
.sh
AR8K DV MYRAH.ARC ORC.O
.qs
.sp 0
c red.o
c blue.o
d orc.o
c white.o
.sp
A>
.fi
.sp
The D command deletes the module ORC.O from the library MYRAH.ARC.
In addition to listing the modules in the library, the V option
indicates which modules are retained and deleted.
.sp 2
.ix R command (AR8K)
.ti -12
R creates a library when the one specified in the command line
does not exist or, replaces or adds object modules to an existing
library. You must specify one or more object modules.
.pp
You can replace more than one object module in the library by
specifying their module names in the command line. However, when the
library contains more than one module with the same name, AR8K
replaces only the first module it finds that matches the one
specified in the command line. AR8K replaces modules
already in the library only if you specify their names prior to
the names of new modules to be added to the library. For
example, if you specify the name of a module that you want
replaced after the name of a module that you are adding to the
library, AR8K adds both modules to the end of the library.
.pp
By default, the R command adds new modules to the end of the
library. The R command adds an object module to a library if:
.bp
.in 0
.ll 65
.ce
.sh
Table 7-2. (continued)
.qs
.in 5
.ll 60
.sp
.nf
Command/Option Meaning
.fi
.sp
.in 23
.in 28
.ti -2
o The object module does not already exist in the
library.
.sp
.ti -2
o You specify the A option in the command line.
.sp
.ti -2
o The name of a module follows the name of module
that does not already exist in the library.
.in 23
.pp
The A option indicates
where AR8K adds modules to the library. You specify the relative
position by including the OPMOD parameter with the A option.
.pp
In addition to the A option, the R command also
supports the V option, which lists the modules in the library and
indicates the result of the operation performed on the library.
All options are described below. Examples illustrate their use.
.sp 2
.ix A command (AR8K)
.ti -12
A adds one or more object modules following the module
specified in the command line as shown below.
.sp
.nf
A>\c
.sh
AR8K RAV SDAV.O MYRAH.ARC WORK.O MAIL.O
.qs
.sp 0
c much.o
c sdav.o
a work.o
a mail.o
c less.o
.fi
.sp
The RAV command adds the object modules WORK.O and
MAIL.O after the module SDAV.O in the library MYRAH.ARC.
The V option, described below, lists all the modules in the
library. New modules are preceded by the lower-case letter a
and existing modules are preceded by the lower-case letter c.
.bp
.in 0
.ll 65
.ce
.sh
Table 7-2. (continued)
.qs
.in 5
.ll 60
.sp
.nf
Command/Option Meaning
.fi
.sp
.in 23
.ti -12
V lists the object modules that the R command replaces or adds.
.ix V option (AR8K)
.sp
.nf
A>\c
.sh
AR8K RV JNNK.MAN NAIL.O WRENCH.O
.qs
.sp 0
c saw.o
c ham.o
r nail.o
c screw.o
a wrench.o
.sp
A>
.fi
.sp
The R command replaces the object module NAIL.O and adds the
module WRENCH.O to the library JNNK.MAN. The V option lists
object modules in the library and indicates which modules are
replaced or added. Each object module that is replaced is
preceded with the lower-case letter r and each one that is added
is preceded with the lower-case letter a.
.sp 2
.ix T command (AR8K)
.ti -12
T requests AR8K print a table of contents or a list of
specified modules in the library. The T command prints a table
of contents of all modules in the library only when you do not
specify names of object modules in the command line.
.sp 2
.ti -12
V displays the size of each file in the table of contents as
shown in the example below.
.sp
.nf
A>\c
.sh
AR8K TV WINE.BAD
.qs
.sp 0
rw-rw-rw- 0/0 6818 rose.o
rw-rw-rw- 0/0 2348 white.o
rw-rw-rw- 0/0 396 red.o
.sp
A>
.fi
.sp 2
.bp
.in 0
.ll 65
.ce
.sh
Table 7-2. (continued)
.qs
.in 5
.ll 60
.sp
.nf
Command/Option Meaning
.fi
.sp
.in 23
The T command prints a table of contents in the library WINE.BAD.
In addition to listing the modules in the library, the V option
indicates the size of each module. The character string rw-rw-rw-
0/0 that precedes the module size is meaningless for CP/M-8000.
However, if the file is transferred to a UNIX \ \ system, the
character string denotes the file protection and file
owner. The size
specified by the decimal number that precedes the object module name
indicates the number of bytes in the module.
.ix V option (AR8K)
.sp 2
.ix W command (AR8K)
.ti -12
W writes a copy of an object module in the library to the
>filespec parameter specified in the command line. This command
allows you to extract a copy of a module from a library and
rename the copy when you write it to another disk, as shown below.
For this command, the >filespec parameter is not optional.
.sp
.nf
A>\c
.sh
AR8K W GO.ARC NOW.O >B:NEWNAME.O
.qs
.fi
.sp
The W command writes a copy of
the object module NOW.O from the library GO.ARC to the
file NEWNAME.O on drive B.
.sp 2
.ti -12
X extracts a copy of one or more object modules from a library
and writes them to the default disk. If no object modules are
specified in the command line, the X command extracts a copy of
each module in the library.
.bp
.in 0
.ll 65
.ce
.sh
Table 7-2. (continued)
.qs
.in 5
.ll 60
.sp
.nf
Command/Option Meaning
.fi
.sp
.in 23
.ix X command (AR8K)
.ti -12
V Lists only those modules the X command extracts from the
library. It precedes each extracted module with the lower-case
letter as shown below.
.ix V option (AR8K)
.sp
.nf
A>\c
.sh
AR8K XV JNNK.MAN SAW.O HAM.O SCREW.O
.qs
.sp 0
x saw.o
x ham.o
x screw.o
.fi
.sp
The V option with the X command lists only the modules SAW.O,
HAM.O, and SCREW.O that the X command extracts from the library
JNNK.MAN and precedes each of these modules with the lower-case
letter x.
.tc 7.1.4 Errors
.sp 2
.in 0
.ll 65
.sh
7.1.4 Errors
.ix AR8K errors
.ix errors, AR8K
.qs
.pp
When AR8K incurs an error during an operation, the
operation is not completed. The original library is not modified
if the operation would have modified the library. Thus, no modules
in the library are deleted, replaced, added, or extracted.
Refer to Appendix E for error messages output by AR8K.
.pp
When you specify the >filespec parameter in the command line to
redirect the output and one or more errors occur, the error
messages are sent to the output file. Thus, you cannot detect the
errors without displaying or printing the file to which the
output was sent. If the contents of the output
file is an object file (see the W command), you must use the
DUMP Utility described in Section 7.2 to read any error messages.
.sp 2
.he CP/M-8000 Programmer's Guide 7.2 DUMP Utility
.tc 7.2 DUMP Utility
.sh
7.2 DUMP Utility
.qs
.ix DUMP utility, invoking
.pp 5
The DUMP Utility (DUMP) displays the contents of a CP/M file in both
hexadecimal and ASCII notation. You can use DUMP to display any CP/M file
regardless of the format of its contents (binary data, ASCII text, an
executable file).
=================== THIS IS PROBABLY OK ===============
.sp 2
.tc 7.2.1 Invoking DUMP
.sh
7.2.1 Invoking DUMP
.qs
.ix invoking DUMP
.pp
Invoke DUMP by entering a command in the following format.
.sp
.ti 8
DUMP [ -sxxxx ] filename1 [ >filename2 ]
.bp
.ce
.sh
Table 7-3. DUMP Command Line Components
.qs
.ll 60
.in 5
.nf
.sp
Component Meaning
.fi
.sp
.in 20
.ti -15
-sxxxx xxxx is an optional offset (in hexadecimal) into the file.
If specified, DUMP starts dumping the contents of the file from the
byte-offset xxxx and continues until it displays the contents of the entire
file. By default, DUMP starts dumping the contents of the file from the
beginning of the file until it dumps the contents of the entire file.
.sp
.ti -15
filename1 is the name of the file you want to dump.
.sp
.ti -15
>filename2 the greater than sign (>) followed by a filename or
logical device optionally redirects
the output of DUMP. You can specify
any valid CP/M specification, or one of the logical device names CON:
(console) or LST: (list device). If you do not specify this optional
parameter, DUMP sends its output to the console.
.in 0
.ll 65
.sp 2
.tc 7.2.2 DUMP Output
.sh
7.2.2 DUMP Output
.qs
.ix DUMP output
.pp
DUMP sends the output to the console (or to a file or device, if
specified), 8 words per line, in the following format:
.sp 2
.nf
rrrr oo (ffffff): hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh *aaaaaaaaaaaaaaaa*
.fi
.sp 2
.ce
.sh
Table 7-4. DUMP Output Components
.qs
.sp
.in 5
.ll 60
.nf
Component Meaning
.fi
.sp
.in 20
.ti -15
rrrr is the record number (CP/M records are 128 bytes)
of the current line of the display.
.sp
.ti -15
oo is the offset (in hex bytes) from the beginning of
the CP/M record.
.sp
.ti -15
ffffff is the offset (in hex bytes) from the beginning of
the file.
.sp
.mb 5
.fm 1
.ti -15
hhhh is the contents of the file displayed in hexadecimal.
.sp
.ti -15
aaaaaaaa is the contents of the file displayed as ASCII
characters. If any character is not representable in
ASCII, it is diplayed as a period (.).
.in 0
.ll 65
.bp
.tc 7.2.3 DUMP Examples
.sh
7.2.3 DUMP Examples
.qs
.sp 2
An example of the DUMP Utility is shown below. The example shows
the contents of a command file that contains both binary and ASCII
information.
.sp
.nf
A>\c
.sh
dump dump.Z8K
.qs
.sp
0000 00 (000000): 601a 0000 1b34 0000 011d 0000 0e5e 0000 *`....4.......^..*
0000 10 (000010): 0000 0000 0000 0000 0900 ffff 6034 4320 *............`4C *
0000 20 (000020): 5275 6e74 696d 6520 436f 7079 7269 6768 *Runtime Copyrigh*
0000 30 (000030): 7420 3139 3832 2062 7920 4469 6769 7461 *t 1982 by Digita*
0000 40 (000040): 6c20 5265 7365 6172 6368 2056 3031 2c30 *l Research V01.0*
0000 50 (000050): 3320 206f 0004 2268 0018 2649 d3e8 001c *3 o.."h..&ISh..*
. . . . (and so on) . . .
.sp 2
.fi
.he CP/M-8000 Programmer's Guide 7.3 Relocation Utility
.tc 7.3 XDUMP Utility
.sh
7.3 XDUMP Utility
.ix XDUMP utility
.pp 5
============== INSERT XDUMP DOCUMENT HERE ==================
.sp 2
.ce
End of Section 7
.bp
.he CP/M-8000 Programmer's Guide End of Section 7
.sp 50
.nx eight

View File

@@ -0,0 +1,132 @@
ar8k(1) archive/librarian ar8k(1)
NAME
ar8k - archive and library maintainer
SYNOPSIS
ar8k key afile [name ...]
DESCRIPTION
The primary purpose of ar8k is to prepare and maintain files for
the linker, ld8k. However, it may be used to prepare and main-
tain collections of files for any other purpose.
The format of the files is the same as that used by UNIX 7th Ed-
ition.
Key is one character from the set d-r-q-t-x, plus optionally v.
Afile is the archive file.
The [names ...] are files in the archive file, or files to be
included in the archive file.
Meaning of the key letters is as follows:
d Delete the named files from the archive file
r Replace the named files in the archive file. If the named
files are not currently in the archive file, they are placed
at the end.
q Quickly append the named files to the end of the archive
file. No checking is done to see whether the files are al-
ready in the archive.
t Print a table of contents. If no names are given, the entire
archive is listed, otherwise only the indicated files are
listed.
x Extract the named files. If there is no name list, the en-
tire archive is extracted. The archive file is not modified.
v Verbose. With t, a long listing about each component is pro-
duced. With any other letter, a blow-by-blow description of
all activity is produced.
- 1 -
ar8k(1) archive/librarian ar8k(1)
FILES
/tmp/ar8k* temporary files
- 2 -

View File

@@ -0,0 +1,743 @@
.bp odd
.cs 5
.bp odd
.he
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.he
.tc 8 DDT-8000
.ce 2
=================== RE-WRITE USING DATA FROM THORN'S ===============
=================== PORTABLE DEBUGGER WRITEUP ===============
.sh
Section 8
.sp
.sh
DDT-8000
.qs
.sp 3
.he CP/M-8000 Programmer's Guide 8.1 DDT-8000 Operation
.tc 8.1 DDT-8000 Operation
.sh
8.1 DDT-8000 Operation
.qs
.ix DDT-8000 operation
.pp
DDT-8000\ \allows you to test and debug programs
interactively in a CP/M-8000 environment. You should be familiar with
the Z8000 Microprocessor, the assembler (AS68) and the CP/M-8000 operating
system.
.sp 2
.tc 8.1.1 Invoking DDT-8000
.sh
8.1.1 Invoking DDT-8000
.qs
.pp
Invoke DDT-8000 by entering one of the following commands:
.sp
.in 8
.nf
DDT
DDT filename
.in 0
.fi
.pp 5
The first command loads and executes DDT-8000. After
displaying its sign-on message and the hyphen (-) prompt
character. DDT-8000 is ready to accept commands. The second
command invokes DDT-8000 and loads the file specified by filename.
If the filetype is not specified, it defaults to the 8000 filetype.
The second form of the command is equivalent to the sequence:
.nf
.sp
.in 8
A>\c
.sh
DDT
.qs
.in 8
DDT-8000
.in 8
Copyright 1982, Digital Research
.in 8
-Efilename
.in 0
.sp
.fi
At this point, the program that was loaded is ready for execution.
.sp 2
.tc 8.1.2 DDT-8000 Command Conventions
.sh
8.1.2 DDT-8000 Command Conventions
.qs
.ix DDT-8000 command conventions
.pp 5
When DDT-8000 is ready to accept a command, it prompts you with a
hyphen (-). In response, you can type a command line or a CONTROL-C
(^C) to end the debugging session (see Section 8.1.4). A command
line can have as many as 64 characters, and must be terminated with a
RETURN. While entering the command, use standard CP/M line-editing
functions to correct typing errors. See Table 4-12. DDT-8000 does
not process the command line until you enter a RETURN.
.pp 5
The first nonblank character of each command line determines the command
action.
Table 8-1 summarizes DDT-8000 commands. They are defined
individually in Section 8.2.
.bp
.ix DDT-8000 command summary
.sh
.ce
Table 8-1. DDT-8000 Command Summary
.sp
.nf
Command Action
D display memory in hexadecimal and ASCII
E load program for execution
F fill memory block with a constant
G begin execution with optional breakpoints
H hexadecimal arithmetic
I set up file control block and command tail
L list memory using Z8000 mnemonics
M move memory block
R read disk file into memory
S set memory to new values
T trace program execution
U untrace program monitoring
V show memory layout of disk file read
W write contents of memory block to disk
X examine and modify CPU state
.fi
.sp
.pp
The command character may be followed by one or more arguments,
which may be hexadecimal values, filenames, or other information,
depending on the command. Some commands can operate on byte,
word, or longword data. The letter W for word or a L for
longword must be appended to the command character for commands
that operate on multiple data lengths. Details for specific
commands are provided with the command descriptions. Arguments
are separated from each other by commas or spaces.
.sp 2
.sh
.tc 8.1.3 Specifying Address
8.1.3 Specifying Addresses
.qs
.pp
Most DDT-8000 commands require one or more addresses as operands. All
addresses are entered as hexadecimal numbers of up to eight hexadecimal
digits (32 bits)
.sp 2
.sh
.tc 8.1.4 Terminating DDT-8000
8.1.4 Terminating DDT-8000
.qs
.ix DDT-8000, terminating
.ix terminating DDT-8000
.pp
Terminate DDT-8000 by typing a ^\b|C in response to the hyphen prompt.
This returns control to the CCP.
.sp 2
.sh
.tc 8.1.5 DDT-8000 Operation with Interrupts
8.1.5 DDT-8000 Operation with Interrupts
.qs
.pp
DDT-8000 operates with interrupts enabled or disabled, and preserves the
interrupt state of the program being executed under DDT-8000. When DDT-8000
has control of the CPU, either when it is initially invoked, or when it
regains control from the program being tested, the condition of the
interrupt mask is the same as it was when DDT-8000 was invoked, except for a
few critical regions where interrupts are disabled. While the program
being tested has control of the CPU, the user's CPU state, which can be
displayed with the X command, determines the state of the interrupt
mask.
.pp
Note that DDT-8000 uses the Trace and Illegal Instruction
exceptions. Therefore, programs debugged under test should not
use these.
.sp 2
.he CP/M-8000 Programmer's Guide 8.2 DDT-8000 Commands
.sh
.tc 8.2 DDT-8000 Commands
8.2 DDT-8000 Commands
.qs
.mb 5
.fm 1
.ix DDT-8000 commands
.pp
This section defines DDT-8000 commands and their arguments. DDT-8000
commands give you control of program execution and allow you to display
and modify system memory and the CPU state.
.sp 2
.sh
.tc 8.2.1 The D (Display) Command
8.2.1 The D (Display) Command
.qs
.ix D (Display) command (DDT-8000)
.pp
The D command displays the contents of memory
as 8-bit, 16-bit, or 32-bit hexadecimal values and in ASCII.
The forms are:
.sp
.nf
.in 8
D
Ds
Ds,f
DW
DWs
DWs,f
DL
DLS
DLS,f
.in 0
.fi
.sp
where s is the starting address, and f is the last address that DDT-8000
displays.
.pp
Memory is displayed on one or more lines. Each line shows
the values of up to 16 memory locations. For the first three forms, the
display line appears as follows:
.mb 6
.fm 2
.sp
.ti 8
aaaaaaaa bb bb ... bb cc ... cc
.sp
where aaaaaaaa is the address of the data being displayed. The bb's
represent the contents of the memory locations in hexadecimal, and the c's
represent the contents of memory in ASCII. Any nongraphic ASCII characters
are represented by periods.
.pp
In response to the DS form of the D command, shown above, DDT-8000 displays 12
lines that start from the
current address.
Form Ds,f displays the memory block between locations s and f. Forms DW, DWs,
and DWs,f are identical to D, Ds, and Ds,f except the contents of
memory are displayed as 16-bit values, as shown below:
.sp
.ti 8
aaaaaaaa wwww wwww ... wwww cccc ... cc
.pp
Forms DL, DLs, and DLs,f are identical to D, Ds, and Ds,f except the
contents of memory are displayed as 32-bit or longword values, as shown below:
.sp
.ti 8
aaaaaaaa llllllll llllllll ... llllllll cccccccc ...
.pp
During a display, the D command may be aborted by typing any character
at the console.
.sp 2
.sh
.tc 8.2.2 The E (Load for Execution) Command
8.2.2 The E (Load for Execution) Command
.qs
.ix E (Load for Execution) command (DDT-8000)
.pp
The E command loads a file in memory so that a subsequent G, T or U command
can begin program execution. The syntax for the E command is:
.sp
.ti 8
E<filename>
.sp
where <filename> is the name of the file to be loaded. If no file type is
specified, the filetype 8000 is assumed.
.pp
An E command reuses memory used by any previous E command. Thus, only one
file at a time can be loaded for execution.
.pp
When the load is complete, DDT-8000 displays the starting and
ending addresses of each segment in the file loaded.
Use the V command to display this information at
a later time.
.pp
If the file does not exist or cannot be successfully loaded in the available
memory, DDT-8000 displays an error message. See Appendix E for error
messages returned by DDT-8000.
.sp 2
.sh
.tc 8.2.3 The F (Fill) Command
8.2.3 The F (Fill) Command
.qs
.ix F (Fill) command (DDT-8000)
.pp
The F command fills an area of memory with a byte, word, or longword
constant. The forms are
.sp
.ti 8
Fs,f,b
.ti 8
FWs,f,w
.ti 8
FLs,f,l
.sp
where s is the starting address of the block to be filled, and f is the
address of the final byte of the block within the segment specified in s.
.pp
In response to the first form, DDT-8000 stores the 8-bit value b in locations
s through f. In the second form, the 16-bit value w is stored in locations
s through f in standard form: the high 8 bits are first, followed by the low
8 bits.
In the third form, the 32-bit value l is stored in locations s through f with
the most significant byte first.
.pp
If s is greater than f, DDT-8000 responds
with a question mark. Also, if b is greater than FF hexadecimal (255), w
is greater than FFFF hexadecimal (65,535), or l is greater than FFFFFFFF
hexadecimal (4,294,967,295), DDT-8000 responds with a question mark. DDT-8000
displays an error message if the value stored in memory cannot be read back
successfully. This error indicates a faulty or nonexistent RAM location.
.bp
.sh
.tc 8.2.4 The G (Go) Command
8.2.4 The G (Go) Command
.qs
.ix G (Go) command (DDT-8000)
.pp
The G command transfers control to the program being tested, and optionally
sets one to ten breakpoints. The forms are
.sp
.nf
.in 8
G
G,b1,...b10
Gs
Gs,b1,...b10
.in 0
.fi
.sp
where s is the address where program begins executing and b1 through b10
are addresses of breakpoints.
.pp
In the first two forms, no starting address is specified. DDT-8000
starts executing the program at the address specified by the program counter
(PC). The first form transfers control to
your program without setting any breakpoints. The second form sets
breakpoints before passing control to your program. The next two forms are
analogous to the first two except that the PC is first set to s.
.ix program counter (PC)
.pp
Once control has been transferred to the program under test, it
executes in real time until a breakpoint is encountered. At this
point, DDT-8000 regains control, clears all breakpoints, and
displays the CPU state in the same form as the X command. When a
breakpoint returns control to DDT-8000, the instruction at the
breakpoint address has not yet been executed. To set a
breakpoint at the same address, you must specify a T or U command
first.
.sp 2
.sh
.tc 8.2.5 The H (Hexadecimal Math) Command
8.2.5 The H (Hexadecimal Math) Command
.qs
.ix H (Hexadecimal Math) command (DDT-8000)
.pp
The H command computes the sum and difference of two 32-bit values. The form
is:
.sp
.ti 8
Ha,b
.sp
where a and b are the values whose sum and difference DDT-8000 computes.
DDT-8000 displays the sum (ssssssss) and the difference (dddddddd) truncated
to 16 bits on the next line as shown below:
.sp
.ti 8
ssssssss dddddddd
.sp 2
.sh
.tc 8.2.6 The I (Input Command Tail) Command
8.2.6 The I (Input Command Tail) Command
.qs
.ix I (Input Command Tail) command (DDT-8000)
.pp
The I command prepares a file control block (FCB) and command tail
buffer in DDT-8000's base page, and copies the information in the
base page of the last file loaded with the E command. The form
is
.sp
.ti 8
I<command tail>
.bp
where <command tail> is the character string which usually
contains one or more filenames. The first filename is parsed
into the default file control block at 005CH. The optional
second filename, if specified, is parsed into the second
default file control block beginning at 0038H. The
characters in the <command tail> are also copied to the default
command buffer at 0080H. The length of the <command tail> is
stored at 0080H, followed by the character string terminated with
a binary zero.
.pp
If a file has been loaded with the E command, DDT-8000 copies the
file control block and command buffer from the base page of
DDT-8000 to the base page of the program loaded.
.sp 2
.sh
.tc 8.2.7 The L (List) Command
8.2.7 The L (List) Command
.qs
.ix L (List) command (DDT-8000)
.pp
The L command lists the contents of
memory in assembly language. The forms are
.sp
.ti 8
L
.ti 8
Ls
.ti 8
Ls,f
.sp
where s is the starting address, and f is the last address
in the list.
.pp
The first form lists 12 lines of disassembled machine code from the
current address. The second form sets the list address to s and then
lists 12 lines of code. The last form lists disassembled code from s
through f. In all three cases, the list address is set to the next unlisted
location in preparation for a subsequent L command. When DDT-8000 regains
control from a program being tested (see G, T and U commands), the list
address is set to the address in the program counter (PC).
.pp
Long displays can be aborted by typing any key during the list process. Or,
enter CONTROL-S (^\b|S) to halt the display temporarily. A
CONTROL-Q (^\b|Q) restarts the
display after ^\b|S halts it.
.pp
The syntax of the assembly language statements produced by the L command is
described in the \c
.ul
Zilog 16-Bit Microprocessor User's Manual, \c
.qu
third edition, Z8000UM(AD3).
.sp 2
.sh
.tc 8.2.8 The M (Move) Command
8.2.8 The M (Move) Command
.qs
.ix M (Move) command (DDT-8000)
.pp
The M command moves a block of data values from one area of memory to
another. The form is
.sp
.ti 8
Ms,f,d
.sp
where s is the starting address of the block to be moved, f is the address of
the final byte to be moved, and d is the address of the first byte of the
area to receive the data. Note that if d is between s and f, part of the
block being moved will be overwritten before it is moved, because data is
transferred starting from location s.
.sp 2
.sh
.tc 8.2.9 The R (Read) Command
8.2.9 The R (Read) Command
.qs
.ix R (Read) command (DDT-8000)
.pp
The R command reads a file to a contiguous block in memory. The
format is
.sp
.ti 8
R<filename>
.sp
where <filename> is the name and type of the file to be read.
.pp
DDT-8000 read the file in memory and displays the starting and
ending addresses of the block of memory occupied by the file. A
Value (V) command can redisplay the information at a later time. The
default display pointer (for subsequent Display (D) commands) is set to
the start of the block occupied by the file.
.sp 2
.sh
.tc 8.2.10 The S (Set) Command
8.2.10 The S (Set) Command
.qs
.ix S (Set) command (DDT-8000)
.pp
The S command can change the contents of bytes, words, or longwords in
memory. The forms are
.sp
.ti 8
Ss
.ti 8
SWs
.ti 8
SLs
.sp
where s is the address where the change is to occur.
.pp
DDT-8000 displays the memory address and its current contents on the following
line. In response to the first form, the display is
.sp
.ti 8
aaaaaaaa bb
.sp
In response to the second form, the display is
.sp
.ti 8
aaaaaaaa wwww
.sp
In response to the third form, the display is
.sp
.ti 8
aaaaaaaa llllllll
.sp
where bb, wwww, and llllllll are the contents of memory in byte, word,
and longword formats, respectively.
.pp
In response to one of the above displays, you can alter the
memory location or leave it unchanged. If a valid hexadecimal value is
entered, the contents of the byte, word, or longword in memory is replaced
with the value entered. If no value is entered, the contents of memory are
unaffected and the contents of the next address are displayed. In either
case, DDT-8000 continues to display successive memory addresses and values
until either a period or an invalid value is entered.
.pp
DDT-8000 displays an error message if the value stored in memory cannot be
read back successfully. This error indicates a faulty or nonexistent RAM
location.
.sp 2
.sh
.tc 8.2.11 The T (Trace) Command
8.2.11 The T (Trace) Command
.qs
.ix T (Trace) command (DDT-8000)
.pp
The T command traces program execution for 1 to 0FFFFFFFFH program steps.
The forms are
.ix program execution, tracing of
.sp
.nf
.in 8
T
Tn
.in 0
.fi
.sp
where n is the number of instructions to execute before returning control
to the console.
.pp
After DDT-8000 traces each instruction, it displays the current CPU state
and the disassembled instruction in the same form as the X command display.
.pp
Control transfers to the program under test at the address indicated in the
PC. If n is not specified, one instruction is executed. Otherwise,
DDT-8000 executes n instructions and displays the CPU state before each
step. You can abort a long trace before all the steps have been executed
by typing any character at the console.
.pp
After a Trace (T) command, the list address used in the L command is set to the
address of the next instruction to be executed.
.pp
Note that DDT-8000 does not trace through a BDOS interrupt instruction, since
DDT-8000 itself makes BDOS calls and the BDOS is not reentrant. Instead, the
entire sequence of instructions from the BDOS interrupt through the return
from BDOS is treated as one traced instruction.
.sp 2
.tc 8.2.12 The U (Untrace) Command
.sh
8.2.12 The U (Untrace) Command
.qs
.ix U (Untrace) command (DDT-8000)
.pp
The U command is identical to the Trace (T) command
except that the CPU state is displayed only after the last instruction is
executed, rather than after every step.
The forms are
.sp
.nf
.in 8
U
Un
.in 0
.fi
.sp
where n is the number of instructions to execute before control returns
to the console. You can abort the Untrace (U) command before all the steps
have been executed by typing any key at the console.
.sp 2
.ne 10
.sh
.tc 8.2.13 The V (Value) Command
8.2.13 The V (Value) Command
.qs
.ix V (Value) command (DDT-8000)
.pp
The V command displays information about the last file loaded with the
Load For Execution (E) or Read (R) commands. The form is
.sp
.ti 8
V
.pp
If the last file was loaded with the E command, the V command displays the
starting address and length of each of the segments contained in the file, the
base page pointer, and the initial stack pointer. The format of the display
is
.sp 2
.ti 3
Text base=00000500 data base=00000B72 bss base=00003FDA
.ti 3
text length=00000672 data length=00003468 bss length=0000A1B0
.ti 3
base page address=00000400 initial stack pointer=000066D4
.sp 2
If no file has been loaded, DDT-8000 responds to the V command with a
question mark (?).
.sp 2
.sh
.tc 8.2.14 The W (Write) Command
8.2.14 The W (Write) Command
.qs
.ix W (Write) command (DDT-8000)
.pp
The W command writes the contents of a contiguous block of memory
to disk. The forms are
.sp
.ti 8
W<filename>
.br
.ti 8
W<filename>,s,f
.sp
The <filename> is the file specification of the disk file
that receives the data. The letters s and f are the first and
last addresses of the block to be written. If f does not
specify the last address, DDT-8000 uses the same value that was
used for s.
.pp
If the first form is used, DDT-8000 assumes the values for s and f
from the last file read with a R command. If no file is read by
an R command, DDT-8000 responds with a question mark (?). This
form is useful for writing out files after patches have been
installed, assuming the overall length of the file is unchanged.
.pp
If the file specified in the W command already exists on disk, DDT-8000
deletes the existing file before it writes the new file.
.sp 2
.sh
.tc 8.2.15 The X (Examine CPU State) Command
8.2.15 The X (Examine CPU State) Command
.qs
.ix X (Examine CPU State) command (DDT-8000)
.ix CPU, state of
.mb 5
.fm 1
.pp
The X command displays the entire state of the CPU, including the
program counter (PC), user stack pointer (usp), system stack pointer (ssp),
status register
(by field), all eight data registers, all eight address registers, and the
disassembled instruction at the memory address currently in the PC.
The forms are
.sp 2
.nf
.in 8
X
Xr
.in 0
.fi
.sp 2
where r is one of the following registers:
.mb 6
.fm 2
.sp 2
.ti 8
D0-D7, A0 to A7, PC, USP, or SSP
.sp 2
.in 0
The first form displays the CPU state as follows:
.sp 2
.ti 8
PC=00016000 USP=00001000 SSP=00002000 ST=FFFF=> (etc.)
.ti 8
D 00001000 00000D01 ... 00000001
.ti 8
A 000B0A00 000A0010 ... 00000000
.ti 8
lea $16028,A0
.sp 2
The first line includes:
.sp 2
.ti 8
PC Program Counter
.ti 8
USP User Stack Pointer
.ti 8
SSP System Stack Pointer
.ti 8
ST Status Register
.ix program counter
.ix user stack pointer
.ix system stack pointer
.ix status register
.sp 2
Following the Status Register contents on the first display
line, the values of each bit in the status register are displayed. A sample
is
shown below:
.sp 2
.ti 8
TR SUP IM=7 EXT NEG ZER OFL CRY
.sp 2
This sample display includes:
.sp 2
.nf
TR Trace Bit
SUP Supervisor Mode Bit
IM=7 Interrupt Mask=7
EXT Extend
NEG Negative
ZER Zero
OFL Overflow
CRY Carry
.fi
.sp
.pp
The second form, Xr, allows you to change the value in the registers
of the program being tested. The r denotes the register.
DDT-8000 responds by displaying the current contents of the register, leaving
the cursor on that line. If you type a RETURN, the value is not
changed. If you type a new valid value and a RETURN, the register is
changed to the new value. The contents of all registers
except the Status Register can be changed.
.sp 2
.he CP/M-8000 Programmer's Guide 8.3 Assembly Language Syntax
.sh
.tc 8.3 Assembly Language Syntax for A and L Commands
8.3 Assembly Language Syntax for the L Command
.qs
.ix L command (DDT-8000)
.pp
In general, the syntax of the assembly language statements used in the L
command is standard Zilog Z8000 assembly language. Several minor
exceptions are
listed below.
.sp
.in 5
.ti -2
o DDT-8000 prints all numeric values in hexadecimal.
.ti -2
o DDT-8000 uses lower-case mnemonics.
.ti -2
o DDT-8000 assumes word operations unless a byte or longword specification
is explicitly stated.
.sp 2
.ce
End of Section 8
.bp
.he CP/M-8000 Programmer's Guide End of Section 8
.sp 50
.nx appa

View File

@@ -0,0 +1,97 @@
.bp odd
.pn 141
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.he
.ce 2
.sh
Appendix A
.sp
.sh
Summary of BIOS Functions
.sp 2
.he CP/M-8000 Programmer's Guide A Summary BIOS Functions
.pp 5
Table A-1 lists the BIOS functions supported by CP/M-8000. For
more details on these functions, refer to the \c
.ul
CP/M-8000 Operating System System Guide.
.qu
.sp 2
============= ADD OR REFERENCE DESCRIPTION OF MEMORY MANAGEMENT ==========
============= AND CONTEXT SWITCH FUNCTIONS DONE WITH SC #1 ==========
============= (mem_cpy, map_adr, xfer) ==========
.ce
.sh
Table A-1. Summary of BIOS Functions
.qs
.sp 2
.ix Init function
.ix Warm Boot function
.ix Const function
.ix Conin function
.ix Conout function
.ix List function
.ix Auxiliary Output function
.ix Auxiliary Input function
.ix Home function
.ix Seldsk function
.ix Settrk function
.ix Setsec function
.ix Setdma function
.ix Read function
.ix Write function
.ix Listst function
.ix Sectran function
.ix Get Memory Region Table Address function
.ix Get I/O Byte function
.ix Set I/O Byte function
.ix Flush Buffers function
.ix Set Exception Vector function
.nf
Function F# Description
.sp
Init 0 Called for Cold Boot
Warm Boot 1 Called for Warm Start
Const 2 Check for Console Character
Ready
Conin 3 Read Console Character In
Conout 4 Write Console Character Out
List 5 Write Listing Character Out
Auxiliary Output 6 Write Character to Auxiliary
Output Device
Auxiliary Input 7 Read from Auxiliary Input
Device
Home 8 Move to Track 00
Seldsk 9 Select Disk Drive
Settrk 10 Set Track Number
Setsec 11 Set Sector Number
Setdma 12 Set DMA Offset Address
Read 13 Read Selected Sector
Write 14 Write Selected Sector
Listst 15 Return List Status
Sectran 16 Sector Translate
Get Memory Region
Table Address 18 Address of Memory Region
Table
Get I/O Byte 19 Get I/O Mapping Byte
Set I/O Byte 20 Set I/O Mapping Byte
Flush Buffers 21 Writes Modified Buffers
Set Exception Vector 22 Sets Exception Vector
.sp 2
.ce
End of Appendix A
.bp
.he CP/M-8000 Programmer's Guide End of Appendix A
.sp 50
.nx appb

View File

@@ -0,0 +1,429 @@
.bp odd
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.he
.ce 2
.sh
Appendix B
.sp
================== REPLACE WITH go.c FROM CCP ===============
.sh
Transient Program Load Examples
.sp 2
.he CP/M-8000 Programmer's Guide B Transient Program Load Examples
.fi
.pp 5
This appendix contains two examples, an assembly language program
and a C language program. Both illustrate how a transient program
loads another program with the BDOS Program Load Function (59) but
without the CCP.
.sp 2
Examples:
.sp
.in 8
.ti -3
1) The example below is an AS68 assembly language program
that loads another program into the TPA.
.in 0
.po 4
.sp 2
.nf
* BDOS Function Definitions
*
reboot = 0
printstr = 9
open = 15
setdma = 26
pgmldf = 59
gettpa = 63
.text
*
* OPEN file to be loaded
*
start: link a6,#0 *mark stack frame
move.l 8(a6),a0 *get the address of the base page
lea $5c(a0),a1 *get address of 1st parsed FCB in base page
move.l a1,d1 *put that address in register d1
move.w #open,d0 *put BDOS function number in register d0
trap #2 *try to open the file to be loaded
cmpi #255,d0 *test d0 for BDOS error return code
beq openerr *if d0 = 255 then goto openerr
*
* Compute Address to Load File
*
.mb 5
.fm 1
move.l $18(a0),d2 *get starting address of bss from base page
move.l $1c(a0),d3 *get length of bss
add.l d2,d3 *compute first free byte of memory
*after bss
move.l $20(a0),d4 *get length of free memory after bss
sub #$100,d4 *leave some extra room
move.l d4,d5 *save that length in register d5
add.l d3,d4 *compute high end of free memory after bss
move.l d3,a3 *get the starting address of free memory
*into a3
.fi
.po 10
.sp 2
.ce
.sh
Listing B-1. Transient Load Program Example 1
.qs
.bp
.nf
.po 4
sub #1,d5 *adjust loop counter
clear: clr.b (a3)+ *clear out free memory
dbf d5,clear *decrement loop counter and loop until
* *negative
*
* FILL the LPB
*
* Low address becomes first free byte of memory after bss
* High address of area in which to load program becomes
* the Low address plus length of free memory
* --------------------------------------------------------------
*
move.l d3,lowadr *get low end of area in which to load
* *program
move.l d4,hiadr *get high end of area in which to load
* *program
move.l a1,LPB *put address of open FCB into LPB
move.w #pgmldf,d0 *get BDOS program load function number
move.l #LPB,d1 *put address of LPB into register d1
trap #2 *do the program load
tst d0 *was the load successful?
bne lderr *if not then print error message
*
* Set default DMA address
*
move.l baspag,d1 *d1 points to new program's base page
add #$80,d1 *d1 points to default dma in base page
move.w #setdma,d0 *get BDOS function number
trap #2 *set the default dma address
*
* Now push needed addresses on stack
*
movea.l usrstk,a7 *set up user stack pointer
move.l baspag,a1 *get address of base page
move.l a1,-(sp) *push base page address
move.l #cmdrtn,-(sp) *push return address
move.l 8(a1),-(sp) *push address to jump to
rts *jump to new program
*
* Print ERROR message
*
openerr:
move.l #openmsg,d1 *get address of error message
* *to be printed
bra print
lderr: move.l #loaderr,d1 *get address of error message to
*be printed
print: move.w #printstr,d0 *get BDOS function number
trap #2 *print the message
cmdrtn: move.w #reboot,d0 *get BDOS function number
trap #2 *warmboot and return to the CCP
.fi
.po 10
.sp 2
.ce
.sh
Listing B-1. (continued)
.qs
.bp
.nf
.po 4
*
* DATA
*
.data
.even
*
* LOAD PARAMETER BLOCK
*
LPB: .ds.l 1 *FCB address of program file
lowadr: .ds.l 1 *Low boundary of area in which
* *to load program
hiadr: .ds.l 1 *High boundary of area in which to
* *to load program
baspag: .ds.l 1 *Base page address of loaded program
usrstk: .ds.l 1 *Loaded program's initial stack pointer
flags: .dc.w 0 *Load program function control flags
*
* TPA Parameter Block
*
.even
TPAB: .dc.w 0
low: .ds.l 1
high: .ds.l 1
.even
loaderr: .dc.b 13,10,'Program Load Error$'
openmsg: .dc.b 13,10,'Unable to Open File$'
.end
.fi
.po 10
.sp 2
.ce
.sh
Listing B-1. (continued)
.bp
.in 8
.ti -3
2) The example below is a C language transient program that loads
another program in the TPA without the assistance of the CCP.
The C language program calls an AS68 assembly language routine
to perform tasks not permitted by the C language.
.sp 2
.po 4
.nf
/*------------------------------------------------------------*
| |
| 'C' Language Program to Load Another |
| Program into the TPA |
| |
*------------------------------------------------------------*/
/* DEFINES */
#define BSS_OFFSET (long)0x18
#define FCB_OFFSET (long)0x5C
#define BSS_LENGTH (long)0x1C
#define FREE_MEMORY (long)0x20
#define DMA_OFFSET (long)0x80
#define ROOM (long)0x100
#define NULL '\0'
#define CR (long)13
#define LF (long)10
#define REBOOT 0
#define CON_OUT 2
#define PRINTSTR 9
#define OPEN 15
#define SETDMA 26
#define PGMLDF 59
#define GETTPA 63
/* Error Messages */
char openmsg[20] = "Unable to Open File$";
char loadmsg[19] = "Program Load Error$";
/* Load Parameter Block */
extern long LPB,lowadr,hiadr,baspag,usrstk;
extern int flags;
/* TPA Parameter Block */
extern int TPAB;
extern long low,high;
.sp 2
.po 10
.fi
.ce
.sh
Listing B-2. Transient Program Load Example 2
.qs
.sp 3
.po 4
.nf
.bp
openfile(baseaddr) /********************************/
register char *baseaddr; /* base page address */
{ /* */
register long *t1,*t2; /* pointers to long word values */
register long count; /* long word value */
register char *ptr1,*ptr2; /* pointers to character values */
/* */
/* */
ptr1 = baseaddr + FCB_OFFSET; /* get address of FCB */
if(bdos(OPEN,ptr1) <= 3) /* try to open the file */
{ /* */
t1 = baseaddr + /* set pointer to STARTING addr */
BSS_OFFSET; /* of the BSS segment */
t2 = baseaddr + /* set pointer to LENGTH of */
BSS_LENGTH; /* the BSS segment */
lowadr = *t1 + *t2; /* compute the first free byte */
/* address of memory after the */
/* BSS segment */
ptr2 = lowadr /* *ptr2 now points to first */
/* free byte in memory */
t2 = baseaddr + /* get length of free memory */
FREE_MEMORY; /* after the BSS segment */
/* */
hiadr = *t2 + lowadr /* compute high end of available*/
/* memory */
count = *t2 - ROOM /* Leave some extra room in Mem */
while(count--) /* Clear out available Memory */
*ptr2++ = NULL; /* with NULL byte values */
LPB = ptr1; /* first long of parameter blk */
/* gets the address of the FCB */
/********************************/
/*------------------------------------------------------*
| If the Load is Successful |
| ========================= |
| |
| 1. Set the Default DMA address |
| 2. Call Assembly Code to push |
| the base page address, the |
| return address, and the |
| address you wish to jump to. |
| |
*------------------------------------------------------*/
if(bdos(PGMLDF,&LPB) == 0)
{
bdos(SETDMA,(baspag + DMA_OFFSET));
push();
}
else
error(PGMLDF);
.sp 2
.po 10
.fi
.ce
.sh
Listing B-2. (continued)
.qs
.po 4
.nf
.bp
}
else
error(OPEN);
}
error(flag)
int flag;
{
bdos(CON_OUT,CR);
bdos(CON_OUT,LF);
if(flag == OPEN)
bdos(PRINTSTR,openmsg);
else
bdos(PRINTSTR,loadmsg);
bdos(REBOOT,(long)0);
}
main()
{
bdos(REBOOT,(long)0);
}
**********************************************************
* *
* Assembly Language Module Needed to *
* Assist 'C' code to Load a Program into the TPA *
* *
**********************************************************
*
* Make All these labels GLOBAL
*
.globl _bdos
.globl _LPB
.globl _lowadr
.globl _hiadr
.globl _baspag
.globl _usrstk
.globl _flags
.globl _TPAB
.globl _low
.globl _high
.globl _start
.globl _openfile
.globl _push
.globl _main
*
* Get the address of the base page
*
.sp 2
.po 10
.fi
.ce
.sh
Listing B-2. (continued)
.qs
.po 4
.nf
.bp
_start:
link a6,#0 *link and allocate
move.l 8(a6),-(sp) *push the address of the base page
jsr _openfile *jump to 'C' code to open the file
*
* Call the BDOS
*
_bdos:
move.w 4(sp),d0 *get the BDOS function number
move.l 6(sp),d1 *get the BDOS parameter
trap #2 *call the BDOS
rts *return
*
* Push the needed addresses on to the stack
*
_push:
movea.l _usrstk,a7 *set up the user stack pointer
move.l _baspag,a1 *get address of user base page
move.l a1,-(sp) *push base page address
move.l #_main,-(sp) *push return address
move.l 8(a1),-(sp) *push address to jump to
rts *jump to new program
*
* DATA
*
.data
.even
*
* Load Parameter Block
*
_LPB: .ds.l 1 *FCB address of program file
_lowadr: .ds.l 1 *Low boundary of area in which
* *to load program
_hiadr: .ds.l 1 *High boundary of area in which to
* *to load program
_baspag: .ds.l 1 *Base page address of loaded program
_usrstk: .ds.l 1 *loaded program's initial stack pointer
_flags: .dc.w 0 *Load program function control flags
*
* TPA Parameter Block
*
.even
_TPAB: .dc.w 0
_low: .ds.l 1
_high: .ds.l 1
*
* END of Assembly Language Code
*
.end
.fi
.po 10
.in 0
.sp 2
.ce
.sh
Listing B-2. (continued)
.sp 2
.ce
End of Appendix B
.bp
.he CP/M-8000 Programmer's Guide End of Appendix B
.sp 50
.nx appc

View File

@@ -0,0 +1,85 @@
.bp odd
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.he
.ce 2
.sh
Appendix C
.sp
.sh
Base Page Format
.sp 2
.he CP/M-8000 Programmer's Guide C Base Page Format
.pp 5
Table C-1 shows the format of the base page. The base page
describes a program's environment. The Program Load Function
(59) allocates space for a base page when this function is
invoked to load an executable command file. For more details,
on the Program Load Function and command files, refer to the
appropriate sections in this manual.
.mb 5
.fm 1
.ix base page format
.sp 2
.sh
.ce
Table C-1. Base Page Format: Offsets and Contents
.sp 2
.in 1
.nf
Offset Contents
------ --------
0000 - 0003 Lowest address of TPA (from LPB)
0004 - 0007 1 + Highest address of TPA
(from LPB)
0008 - 000B Starting address of the Text
Segment
000C - 000F Length of Text Segment (bytes)
0010 - 0013 Starting address of the Data
Segment (initialized data)
0014 - 0017 Length of Data Segment
0018 - 001B Starting address of the bss
(uninitialized data)
001C - 001F Length of bss
0020 - 0023 Length of free memory after bss
0024 - 0024 Drive from which the program was
loaded
0025 - 0037 Reserved, unused
0038 - 005B 2nd parsed FCB from Command Line
005C - 007F 1st parsed FCB from Command Line
0080 - 00FF Command Tail and Default DMA
Buffer
.fi
.in 0
.sp 2
.ce
End of Appendix C
.bp
.mb 6
.fm 2
.he CP/M-8000 Programmer's Guide End of Appendix C
.sp 50
.nx appd

View File

@@ -0,0 +1,187 @@
.bp odd
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.ft All Information Presented Here is Proprietary to Digital Research
.he
.ce 2
.sh
Appendix D
.sp
===================== DELETE OR REPLACE WITH Z8000 INSTR. SET =============
.sh
Instruction Set Summary
.sp 2
.he CP/M-8000 Programmer's Guide D Instruction Set Summary
.ix AS68 instruction set
.pp 5
This appendix contains two tables that describe the assembler
instruction set distributed with CP/M-8000.
Table D-1 summarizes the assembler (AS68) instruction set.
Table D-2 lists variations on the
instruction set listed in Table D-1. For details on specific
instructions, refer to Zilog's \c
.ul
16-Bit Microprocessor User's Manual, \c
.qu
third edition, Z8000UM(AD3).
.sp 2
.ce
.sh
Table D-1. Instruction Set Summary
.sp
.nf
Instruction Description
.sp
abcd Add Decimal with Extend
add Add
and Logical AND
asl Arithmetic Shift Left
asr Arithmetic Shift Right
.sp
bcc Branch Conditionally
bchg Bit Test and Change
bclr Bit Test and Clear
bra Branch Always
bset Branch Test and Set
bsr Branch to Subroutine
btst Bit Test
.sp
chk Check Register Against Bounds
clr Clear Operand
cmp Compare
.sp
dbcc Test Condition, Decrement and Branch
divs Signed Divide
divu Unsigned Divide
.sp
eor Exclusive Or
exg Exchange Registers
ext Sign Extend
.sp
jmp Jump
jsr Jump to Subroutine
.sp
lea Load Effective Address
link Link Stack
lsl Logical Shift Left
lsr Logical Shift Right
.fi
.bp
.sp 2
.ce
.sh
Table D-1. (continued)
.sp
.nf
Instruction Description
.sp
move Move
movem Move Multiple Registers
movep Move Peripheral Data
muls Signed Multiply
mulu Unsigned Multiply
.sp
nbcd Negate Decimal with Extend
neg Negate
nop No Operation
no Ones Complement
.sp
or Logical OR
.sp
pea Push Effective Address
.sp
reset Reset External Devices
rol Rotate Left without Extend
ror Rotate Right without Extend
roxl Rotate Left with Extend
roxr Rotate Right with Extend
rte Return From Exception
rtr Return and Restore
rts Return from Subroutine
.sp
sbcd Subtract Decimal with Extend
scc Set Conditional
stop Stop
sub Subtract
swap Swap Data Register Halves
.sp
tas Test and Set Operand
trap Trap
trapv Trap on Overflow
tst Test
.sp
unlk Unlink
.fi
.bp
.ce
.sh
Table D-2. Variations of Instruction Types
.sp
.nf
Instruction Variation Description
.sp
add add Add
adda Add address
addq Add Quick
addi Add Immediate
addx Add with Extend
.sp
and and Logical AND
andi AND Immediate
andi to ccr AND Immediate to Condition
Code
andi to sr AND Immediate to Status
Register
.sp
cmp cmp Compare
cmpa Compare Address
cmpm Compare Memory
cmpi Compare Immediate
.sp
eor eor Exclusive OR
eori Exclusive OR Immediate
eori to ccr Exclusive Immediate to
Condition Codes
eori to sr Exclusive OR Immediate to
Condition Codes
.sp
move move Move
movea Move Address
moveq Move Quick
move to ccr Move to Condition Codes
move to sr Move to Status Register
move from sr Move from Status Register
move to usp Move to User Stack Pointer
.sp
neg neg Negate
negx Negate with Extend
.sp
or or Logical OR
ori OR Immediate
ori to ccr OR Immediate to Condition
Codes
ori to sr OR Immediate to Status
Register
.sp
sub sub Subtract
suba Subtract Address
subi Subtract Immediate
subq Subtract Quick
subx Subtract with Extend
.fi
.sp 2
.ce
End of Appendix D
.bp
.he CP/M-8000 Programmer's Guide End of Appendix D
.sp 50
.nx appe1

View File

@@ -0,0 +1,837 @@
.bp odd
.pn 157
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he
.ft All Information Presented Here is Proprietary to Digital Research
.ce 2
.sh
Appendix E
.sp
.sh
Error Messages
.sp 2
.pp
This appendix lists the error messages returned by the internal
components of CP/M-8000 and by the CP/M-8000 programmer's utilities.
The sections are arranged alphabetically by the name of the
internal component or utility. The error messages are listed
alphabetically within each section, with explanations and
suggested user responses.
.ix AR68 error messages
.ix error messages, AR68 fatal
.sp 2
.tc E.1 AR68 Error Messages
.he CP/M-8000 Programmer's Guide E.1 AR68 Error Messages
.sh
E.1 AR68 Error Messages
.pp 5
The CP/M-8000 Archive Utility, AR68, returns two types of fatal error
messages: diagnostic and logic. Both types of fatal error messages are
returned at the console as they occur.
.ix fatal diagnostic error messages
.sp 2
.tc E.1.1 Fatal Diagnostic Error Messages
.sh
E.1.1 Fatal Diagnostic Error Messages
.pp
The AR68 errors are listed below in alphabetic order with explanations
and suggested user responses.
.sp 2
.ce
.sh
Table E-1. Fatal Diagnostic Error Messages
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
filename not in archive file
.sp
The object module indicated by the variable "filename" is not in
the library. Check the filename before you reenter the command line.
.sp 2
.ti -15
cannot create filename
.mb 5
.fm 1
.sp
The drive code for the file indicated by the variable
"filename" is invalid, or the disk to which AR68 is writing is full. Check
the drive code. If it is valid, the disk
is full. Erase unnecessary files, if any, or insert a new disk before
you reenter the command line.
.bp
.in 0
.ll 65
.ce
.sh
Table E-1. (continued)
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
cannot open filename
.sp
The file indicated by the variable "filename" cannot be opened
because the filename or the drive code is incorrect. Check the drive code
and the filename before you reenter the command line.
.mb 6
.fm 2
.sp 2
.ti -15
invalid option flag: x
.sp
The symbol, letter, or number in the command line indicated by the
variable "x" is an invalid option. Refer to the section of this manual on
AR68 for an explanation of the command line options. Specify a valid
option and reenter the command line.
.sp 2
.ti -15
not archive format: filename
.sp
The file indicated by the variable "filename" is not a library. Ensure that
you are using the correct filename before you reenter the command line.
.sp 2
.ti -15
not object file: filename
.sp
The file indicated by the variable "filename" is not an object file,
and cannot be added to the library. Any file added to the library must be an
object file, output by the
assembler, AS68, or the compiler. Assemble or compile the file before
you reenter the AR68 command line.
.sp 2
.ti -15
one and only one of DRTWX flags required
.sp
The AR68 command line requires one of the D, R, T, W, or
X commands, but not more than one. Reenter the command line with the correct
command. Refer to the section of this manual on AR68 for an explanation
of the AR68 commands.
.bp
.in 0
.ll 65
.ce
.sh
Table E-1. (continued)
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
filename not in library
.sp
The object module indicated by the variable "filename" is not in
the library. Ensure that you are requesting the filename of an
existing object module before you reenter the command line.
.sp 2
.ti -15
Read error on filename
.sp
The file indicated by the variable
"filename" cannot be read. This message means one of three things: the file
listed at "filename" is corrupted; a hardware error has occurred; or when the
file was created, it was not
correctly written by AR68 due to an
error in the internal logic of AR68.
.sp
Cold start the system and retry the operation. If you receive this error
message again, you must erase and recreate the file. Use your backup file,
if you maintained one. If the error reoccurs, check for a hardware error.
If the error persists, contact the place you purchased your system for
assistance. You should provide the following information:
.sp
.in 22
.ti -2
o Indicate which version of the operating system you are using.
.sp
.ti -2
o Describe your system's hardware configuration.
.sp
.ti -2
o Provide sufficient information to reproduce the error. Indicate
which program was running at the time the error occurred. If possible,
you should also provide a disk with a copy of the program.
.in 20
.sp 2
.ti -15
temp file write error
.sp
The disk to which AR68 was writing the temporary file is full. Erase
unnecessary files, if any, or insert a new disk before
you reenter the command line.
.bp
.in 0
.ll 65
.ce
.sh
Table E-1. (continued)
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
.nf
usage: AR68 DRTWX[AV][F D:] [OPMOD] ARCHIVE OBMOD1 [OBMOD2...][>filespec]
.fi
.sp
This message indicates a syntax error in the command line. The correct
format for
the command line is given, with the possible options in brackets. Refer
to the section in this manual on AR68 for a more detailed explanation of
the command line.
.sp 2
.ti -15
Write error on filename
.sp
The disk to which AR68 is writing the file indicated by the
variable "filename" is full. Erase unnecessary files, if any, or insert a
new disk before you reenter the command line.
.in 0
.ll 65
.sp 2
.tc E.1.2 AR68 Internal Logic Error Messages
.sh
E.1.2 AR68 Internal Logic Error Messages
.pp
This section lists messages indicating fatal errors in the internal logic of
AR68. If you receive one of these messages, contact the place
you purchased your system for assistance.
You should provide the following information:
.sp 2
.in 8
.ti -3
1) Indicate which version of the operating system you are using.
.sp
.ti -3
2) Describe your system's hardware configuration.
.sp
.ti -3
3) Provide sufficient information to reproduce the error. Indicate
which program was running at the time the error occurred. If possible,
you should also provide a disk with a copy of the program.
.in 0
.sp
cannot reopen filename
.sp
seek error on library
.sp
Seek error on tempname
.sp
Unable to re-create--library is in filename
.sp
.sp 0
.sh
Note: \c
.qs
for the above error, "Unable to re-create--library is in
filename," you should rename the temporary file indicated by the
variable "filename." AR68 used the library to create the
temporary file and then deleted the library in order to replace
it with the updated temporary file. This error occurred
because AR68 cannot write the temporary file back to the
original location. The entire library is in the temporary file.
.sp 2
.he CP/M-8000 Programmer's Guide E.2 AS68 Error Messages
.tc E.2 AS68 Error Messages
.sh
E.2 AS68 Error Messages
.ix AS68 error messages
.ix error message, AS68
.pp 5
The CP/M-8000 assembler, AS68, returns both nonfatal, diagnostic error messages
and fatal error messages. Fatal errors stop the assembly of your program.
There are two types of fatal errors: user-recoverable fatal errors and
fatal errors in the internal logic of AS68.
.sp 2
.tc E.2.1 AS68 Diagnostic Error Messages
.sh
E.2.1 AS68 Diagnostic Error Messages
.pp
Diagnostic messages report errors in the syntax and context of the program
being assembled without interrupting assembly. Refer to the
Zilog \c
.ul
16-Bit Microprocessor User's Manual \c
.qu
for a full discussion of the assembly language syntax.
.pp
Diagnostic error messages
appear in the following format:
.sp
.ti 10
& line no. error message text
.sp
The ampersand (&) indicates that the message comes from AS68. The "line no."
indicates the line in the source code where the error occurred. The "error
message text" describes the error. Diagnostic error messages are printed at
the console after assembly, followed by a message indicating the
total number of
errors. In a printout, they are printed on the line preceding the error.
The AS68 diagnostic error messages are listed below in alphabetic order.
.sp 2
.ce
.sh
Table E-2. AS68 Diagnostic Error Messages
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
& line no. backward assignment to *
.sp
The assignment statement in the line indicated illegally assigns
the location counter (*) backward. Change the location counter to a forward
assignment and reassemble the source file.
.sp 2
.ti -15
& line no. bad use of symbol
.sp
A symbol in the source line indicated has been defined as both
global and common. A symbol can be either global or common, but not both.
Delete one of the directives and reassemble the source file.
.bp
.in 0
.ll 65
.ce
.sh
Table E-2. (continued)
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
& line no. constant required
.sp
An expression on the line indicated requires a constant. Supply a constant
and reassemble the source file.
.sp 2
.ti -15
& line no. end statement not at end of source
.sp
The end statement must be at the end of the source code. The end statement
cannot be followed by a comment or more than one carriage return.
Place the end statement at the end of the source code, followed by
a single carriage return only, and reassemble the source file.
.sp 2
.ti -15
& line no. illegal addressing mode
.sp
The instruction on the line indicated has an invalid addressing
mode. Provide a valid addressing mode and reassemble the source file.
.sp 2
.ti -15
& line no. illegal constant
.sp
The line indicated contains an illegal constant. Supply a valid constant
and reassemble the source file.
.sp 2
.ti -15
& line no. illegal expr
.sp
The line indicated contains an illegal expression. Correct the expression
and reassemble the source file.
.sp 2
.ti -15
& line no. illegal external
.sp
The line indicated illegally contains an external
reference to an 8-bit quantity. Rewrite the source code to define the
reference
locally or use a 16-bit reference and reassemble the source file.
.bp
.in 0
.ll 65
.ce
.sh
Table E-2. (continued)
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
& line no. illegal format
.sp
An expression or instruction in the line indicated is illegally
formatted. Examine the line. Reformat where necessary and reassemble
the source file.
.sp 2
.ti -15
& line no. illegal index register
.sp
The line indicated contains an invalid index register. Supply a valid
register and reassemble the source file.
.sp 2
.ti -15
& line no. illegal relative address
.sp
An addressing mode specified is not valid for the instruction in
the line indicated. Refer to the Zilog 16-Bit Microprocessor User's Manual
for valid register modes for the specified instruction.
Rewrite the source code to use a valid mode and reassemble the file.
.sp 2
.ti -15
& line no. illegal shift count
.sp
The instruction in the line indicated shifts a quantity more
than 31 times. Modify the source code to correct the error and reassemble
the source file.
.sp 2
.ti -15
& line no. illegal size
.sp
The instruction in the line indicated requires one of the following
three size specifications: b (byte), w (word), or l (longword). Supply the
correct size specification and reassemble
the source file.
.sp 2
.ti -15
& line no. illegal string
.sp
The line indicated contains an illegal string. Examine the line. Correct
the string and
reassemble the source file.
.bp
.in 0
.ll 65
.ce
.sh
Table E-2. (continued)
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
& line no. illegal text delimiter
.sp
The text delimiter in the line indicated is in the wrong format. Use single
quotes ('text') or double quotes ("text")
to delimit the text and
reassemble the source file.
.sp 2
.ti -15
& line no. illegal 8-bit displacement
.sp
The line indicated illegally contains a displacement larger than
8-bits. Modify the code and reassemble the source file.
.sp 2
.ti -15
& line no. illegal 8-bit immediate
.sp
The line indicated illegally contains an immediate operand larger
than 8-bits. Use the 16- or 32-bit form of the instruction and
reassemble the source file.
.sp 2
.ti -15
& line no. illegal 16-bit displacement
.sp
The line indicated illegally contains a displacement larger than
16-bits. Modify the code and reassemble the source file.
.sp 2
.ti -15
& line no. illegal 16-bit immediate
.sp
The line indicated illegally contains an immediate operand
larger than 16-bits. Use the 32-bit form of the instruction and
reassemble the source file.
.sp 2
.ti -15
& line no. invalid data list
.sp
One or more entries in the data list in the line indicated
is invalid. Examine the line for the invalid entry. Replace it
with a valid entry and reassemble the source file.
.bp
.in 0
.ll 65
.ce
.sh
Table E-2. (continued)
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
& line no. invalid first operand
.sp
The first operand in an expression in the line indicated
is invalid. Supply a valid operand and reassemble the source file.
.sp 2
.ti -15
& line no. invalid instruction length
.sp
The instruction in the line indicated requires one of the
following three size specifications:
b (byte), w (word), or l (longword). Supply the correct size specification
and reassemble the source file.
.sp 2
.ti -15
& line no. invalid label
.sp
A required operand is not present in the line
indicated, or a label reference in the line is not in the
correct format. Supply a valid label and reassemble the source file.
.sp 2
.ti -15
& line no. invalid opcode
.sp
The opcode in the line indicated is nonexistent or invalid. Supply a valid
opcode and reassemble the source file.
.sp 2
.ti -15
& line no. invalid second operand
.sp
The second operand in an expression in the line indicated
is invalid. Supply a valid operand and reassemble the source file.
.sp 2
.ti -15
& line no. label redefined
.sp
This message indicates that a label has been defined twice. The
second definition occurs in the line indicated. Rewrite the source code to
specify a unique label for each
definition and reassemble the source file.
.bp
.in 0
.ll 65
.ce
.sh
Table E-2. (continued)
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
& line no. missing )
.sp
An expression in the line indicated is missing a right parenthesis. Supply
the missing parenthesis and reassemble the source file.
.sp 2
.ti -15
& line no. no label for operand
.sp
An operand in the line indicated is missing a label. Supply a label and
reassemble the source file.
.sp 2
.ti -15
& line no. opcode redefined
.sp
A label in the line indicated has the same mnemonics as a
previously specified opcode. Respecify the label so that it does not have
the same spelling as
the mnemonic for the opcode. Reassemble the source file.
.sp 2
.ti -15
& line no. register required
.sp
The instruction in the line indicated requires either a
source or destination register. Supply the appropriate register and
reassemble the source file.
.sp 2
.ti -15
& line no. relocation error
.sp
An expression in the line indicated contains more than one
externally defined global symbol. Rewrite the source code. Either make one
of the externally defined global symbols a local
symbol, or evaluate the expression within the code. Reassemble
the source file.
.sp 2
.ti -15
& line no. symbol required
.sp
A statement in the line indicated requires a symbol. Supply a valid symbol
and reassemble the source file.
.bp
.in 0
.ll 65
.ce
.sh
Table E-2. (continued)
.sp
.nf
.ll 60
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
& line no. undefined symbol in equate
.sp
One of the symbols in the equate directive in the line indicated
is undefined. Define the symbol and reassemble the source file.
.sp 2
.ti -15
& line no. undefined symbol
.sp
The line indicated contains an undefined symbol that has not been
declared global. Either define the symbol within the module or define it
as a global
symbol and reassemble the source file.
.in 0
.ll 65
.sp 2
.tc E.2.2 User-recoverable Fatal Error Messages
.sh
E.2.2 User-recoverable Fatal Error Messages
.pp
Described below are the fatal error messages for AS68.
When an error occurs because the disk is full, AS68 creates a
partial file. You should erase the partial file to ensure that
you do not try to link it.
.sp 2
.ce
.sh
Table E-3. User-recoverable Fatal Error Messages
.nf
.in 5
.sp
.ll 60
Message Meaning
.fi
.in 20
.ti -15
.sp
& cannot create init: AS68SYMB.DAT
.sp
AS68 cannot create the initialization file because the drive code is
incorrect or the disk to which it was writing the file is full. If you used
the -S switch to redirect the symbol table
to another disk, check the drive code. If it is correct, the disk
is full. Erase unnecessary files, if any, or insert a new disk before
you reinitialize AS68. Erase the partial file that was created on the
full disk to ensure that you do not try to link it.
.sp 2
.ti -15
& expr opstk overflow
.sp
An expression in the line indicated contains too many operations
for the operations stack. Simplify the expression before you reassemble the
source code.
.bp
.in 0
.ll 65
.ce
.sh
Table E-3. (continued)
.nf
.in 5
.sp
.ll 60
Message Meaning
.fi
.sp
.in 20
.ti -15
& expr tree overflow
.sp
The expression tree does not have space for the number of terms
in one of the expressions in the indicated line of source code. Rewrite the
expression to use fewer terms before you reassemble the source file.
.sp 2
.ti -15
& I/O error on loader output file
.sp
The disk to which AS68 was writing the loader output
file is full. AS68 wrote a partial file. Erase unnecessary files, if any,
or insert a new disk and
reassemble the source file. Erase the partial file that was created on the
full disk to ensure that you do not try to link it.
.sp 2
.ti -15
& I/O write error on it file.
.sp
The disk to which AS68 was writing the intermediate text file is
full. AS68 wrote a partial file. Erase unnecessary files, if any, or insert
a new disk and
reassemble the source file. Erase the partial file that was created on the
full disk to ensure that you do not try to link it.
.sp 2
.ti -15
& it read error itoffset= no.
.sp
The disk to which AS68 was writing the intermediate text
file is full. AS68 wrote a partial file. The variable "Itoffset= no."
indicates the first zero-relative byte number not read. Erase unnecessary
files, if any, or insert a new disk and
reassemble the source file. Erase the partial file that
was created on the full disk
to ensure that you do not try to link it.
.bp
.in 0
.ll 65
.ce
.sh
Table E-3. (continued)
.nf
.in 5
.sp
.ll 60
Message Meaning
.fi
.sp
.in 20
.ti -15
& Object file write error
.sp
The disk to which AS68 was writing the object file
is full. AS68 wrote a partial file. Erase unnecessary files, if any, or
insert a new disk and
reassemble the source file. Erase the partial file that was created on the
full disk to ensure that you do not try to link it.
.sp 2
.ti -15
& line no. overflow of external table
.sp
The source code uses too many externally defined global symbols
for the size of the external symbol table. Eliminate some externally defined
global symbols and
reassemble the source file.
.sp 2
.ti -15
& Read Error On Intermediate File: ASXXXXn
.sp
The disk to which AS68 was writing the intermediate
text file ASXXXX is full. AS68 wrote a partial file. The variable "n"
indicates the drive on which ASXXXX is located. Erase unnecessary files, if
any, or insert a new disk and
reassemble the source file. Erase the partial file that was created
on the full disk
to ensure that you do not try to link it.
.sp 2
.ti -15
& symbol table overflow
.sp
The program uses too many symbols for the symbol table. Eliminate some
symbols before you reassemble the
source code.
.sp 2
.ti -15
& Unable to open file filename
.sp
The source filename indicated by the variable "filename" is invalid
or, has an invalid drive code or user number. Check the filename, drive
code, and user number. Respecify the
command line before you reassemble the source file.
.mt 4
.hm 1
.bp
.in 0
.ll 65
.ce
.sh
Table E-3. (continued)
.nf
.in 5
.sp
.ll 60
Message Meaning
.fi
.sp
.in 20
.ti -15
& Unable to open input file
.sp
The filename in the command line indicated does not exist, or, has
an invalid drive code or user number. Check the filename, drive code, and
user number. Respecify the
command line before you reassemble the source file.
.mt 5
.hm 2
.mb 5
.fm 1
.sp 2
.ti -15
& Unable to open temporary file
.sp
Invalid drive code or the disk to which AS68 was writing
is full. Check the drive code. If it is correct, the disk is full.
Erase unnecessary files, if any, or insert a new disk before you
reassemble the source file.
.sp 2
.ti -15
& Unable to read init file: AS68SYMB.DAT
.sp
The drive code or user number used to specify the
initialization file is invalid or the
assembler has not been initialized. Check the drive code and user number.
Respecify the
command line before you reassemble the source file. If the
assembler has not been
initialized, refer to the section in this manual on AS68 for
instructions.
.sp 2
.ti -15
& Write error on init file: AS68SYMB.DAT
.sp
The disk to which AS68 was writing the
initialization file is full. AS68 wrote a partial file. Erase unnecessary
files, if any, or insert a new disk and
reassemble the source file. Erase the partial file that was created on the
full disk to ensure that you do not try to link it.
.sp 2
.ti -15
& write error on it file
.sp
The disk to which AS68 was writing the intermediate
text is full. AS68 wrote a partial file. Erase unnecessary files, if any,
or insert a new disk.
Erase the partial file that was created on the
full disk to ensure that you do not try to link it.
Reassemble the source file.
.in 0
.ll 65
.nx appe2

View File

@@ -0,0 +1,972 @@
.bp
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he CP/M-8000 Programmer's Guide E.2 AS68 Error Messages
.ft All Information Presented Here is Proprietary to Digital Research
.tc E.2.3 AS68 Internal Logic Error Messages
.sh
E.2.3 AS68 Internal Logic Error Messages
.pp 5
This section lists messages indicating fatal errors in the
internal logic of AS68.
If you receive one of these messages, contact the place you
purchased your system for assistance. You should provide the
information below.
.mb 6
.fm 2
.sp
.in 8
.ti -3
1) Indicate which version of the operating system you are using.
.sp
.ti -3
2) Describe your system's hardware configuration.
.sp
.ti -3
3) Provide sufficient information to reproduce the error. Indicate
which program was running at the time the error occurred. If possible,
you should also provide a disk with a copy of the program.
.in 0
.sp 2
Errors:
.sp
.nf
.in 5
.ti -2
o & doitrd: buffer botch pitix=nnn itbuf=nnn end=nnn
.ti -2
.sp
o & doitwr: it buffer botch
.ti -2
.sp
o & invalid radix in oconst
.ti -2
.sp
o & i.t. overflow
.ti -2
.sp
o & it sync error itty=nnn
.ti -2
.sp
o & seek error on it file
.ti -2
.sp
o & outword: bad rlflg
.fi
.in 0
.sp 2
.tc E.3 BDOS Error Messages
.he CP/M-8000 Programmer's Guide E.3 BDOS Error Messages
.sh
E.3 BDOS Error Messages
.pp 5
The CP/M-8000 Basic Disk Operating System, BDOS, returns fatal
error messages at the console. The BDOS error messages are
listed below in alphabetic order with explanations and suggested
user responses.
.bp
.ce
.sh
Table E-4. BDOS Error Messages
.nf
.ll 60
.in 5
.sp
Message Meaning
.fi
.sp
.in 20
.ti -15
CP/M Disk change error on drive x
.sp
The disk in the drive indicated by the variable "x" is
not the same disk the system logged in previously. When the
disk was replaced you did not enter a CTRL-C to log in the
current disk. Therefore, when you attempted
to write to, erase, or rename a file on the current disk, the BDOS set the
drive status to read-only and warm booted the system.
The current disk in the drive was not overwritten. The drive status
was returned to read-write when the system was warm booted. Each time a
disk is changed, you must type a CTRL-C to log in
the new disk.
.sp 2
.ti -15
CP/M Disk file error: filename is Read-Only.
.ti -15
.sp 0
.nf
Do you want to: Change it to read/write (C),
.ti -15
.sp 0
or Abort (A)?
.fi
.sp
You attempted to write to, erase, or rename a file
whose status is Read-Only. Specify one of the options enclosed in parentheses.
If you specify the C option, the BDOS changes the status of
the file to read-write and continues the operation. The
read-only protection previously assigned to the file is lost.
.pp
If you specify the A option or a CTRL-C, the program terminates
and CP\M-8000 returns the system prompt.
.sp 2
.ti -15
CP/M Disk read error on drive x
.sp 0
.nf
.ti -15
Do you want to: Abort (A), Retry (R), or Continue
.ti -15
with bad data (C)?
.fi
.sp
.in 20
BDOS. This message indicates a hardware error. Specify one of the options
enclosed in parentheses. Each option is described below.
.in 0
.ll 65
.bp
.ce
.sh
Table E-4. (continued)
.nf
.ll 60
.in 5
.sp
Message Meaning
.fi
.sp
.in 20
.nf
Option Action
.fi
.sp
.in 34
.ti -14
A or CTRL-C Terminates the operation and CP/M-8000 returns the
system prompt.
.sp
.ti -14
R Retries the operation. If the retry fails, the
system reprompts with the option message.
.sp
.ti -14
C Ignores the error and continues program execution.
Be careful if you use this option. Program execution should
not be continued for some types of programs. For example, if
you are updating a data base and receive this error but continue
program execution, you can corrupt the index fields and the entire
data base. For other programs, continuing program execution is
recommended. For example, when you transfer a long text file and
receive an error because one sector is bad, you can continue
transferring the file. After the file is transferred, review
the file, and add the data that was not transferred due to the
bad sector.
.sp 2
.in 20
.ti -15
CP/M Disk write error on drive x
.sp 0
.ti -15
.nf
Do you want to: Abort (A), Retry (R), or
.ti -15
Continue with bad data (C)?
.fi
.sp
BDOS. This message indicates a hardware error. Specify one of the options
enclosed in parentheses. Each option is described below.
.in 0
.ll 65
.bp
.ce
.sh
Table E-4. (continued)
.nf
.ll 60
.in 5
.sp
Message Meaning
.fi
.sp
.in 20
.nf
Option Action
.fi
.sp
.in 34
.ti -14
A or CTRL-C Terminates the operation and CP/M-8000 returns the
system prompt.
.sp
.ti -14
R Retries the operation. If the retry fails, the
system reprompts with the option message.
.sp
.ti -14
C Ignores the error and continues program execution.
Be careful if you use this option. Program execution should
not be continued for some types of programs. For example, if
you are updating a data base and receive this error but continue
program execution, you can corrupt the index fields and the entire
data base. For other programs, continuing program execution is
recommended. For example, when you transfer a long text file and
receive an error because one sector is bad, you can continue
transferring the file. After the file is transferred, review
the file, and add the data that was not transferred due to the
bad sector.
.sp 2
.in 20
.ti -15
CP/M Disk select error on drive x
.sp 0
.ti -15
Do you want to: Abort (A), Retry (R)
.sp
There is no disk in the drive or the disk is not
inserted correctly. Ensure that the disk is
securely inserted in the drive. If you enter the R option, the system
retries the operation. If you enter the A option or CTRL-C
the program terminates and CP\M-8000 returns the system prompt.
.in 0
.ll 65
.bp
.ce
.sh
Table E-4. (continued)
.nf
.ll 60
.in 5
.sp
Message Meaning
.fi
.sp
.in 20
.ti -15
CP/M Disk select error on drive x
.sp
The disk selected in the command line is outside the
range A through P. CP/M-8000 can support up to 16 drives, lettered A through
P. Check
the documentation provided by the manufacturer to find out which drives your
particular system configuration supports. Specify the
correct drive code and reenter the command line.
.sp 2
.in 0
.ll 65
.tc E.4 BIOS Error Messages
.he CP/M-8000 Programmer's Guide E.4 BIOS Error Messages
.sh
E.4 BIOS Error Messages
.pp 5
The CP/M-8000 BIOS error messages are listed below in alphabetic order
with explanations and
suggested user responses.
.ix BIOS error messages
.ix error messages, BIOS
.sp 2
.ce
.sh
Table E-5. BIOS Error Messages
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
BIOS ERROR -- DISK X NOT SUPPORTED
.sp
The disk drive indicated by the variable "X" is not supported by
the BIOS. The BDOS supports a maximum of 16 drives, lettered A through
P. Check the manufacturer's documentation for your system configuration to
find out which of the BDOS drives your BIOS implements. Specify the
correct drive code and reenter the command line.
.sp 2
.ti -15
BIOS ERROR -- Invalid Disk Status
.sp
The disk controller returned unexpected or
incomprehensible information to the BIOS. Retry the operation. If the error
persists,
check the hardware. If the error
does not come from the hardware, it is caused by an error in the internal
logic of the BIOS. Contact the place you purchased your
system for assistance.
You should provide the information below.
.in 0
.ll 65
.bp
.ce
.sh
Table E-5. (continued)
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 23
.ti -3
1) Indicate which version of the operating system you are using.
.sp
.ti -3
2) Describe your system's hardware configuration.
.sp
.ti -3
3) Provide sufficient information to reproduce the error. Indicate
which program was running at the time the error occurred. If possible,
you should also provide a disk with a copy of the program.
.in 0
.ll 65
.sp 2
.tc E.5 CCP Error Messages
.he CP/M-8000 Programmer's Guide E.5 CCP Error Messages
.sh
E.5 CCP Error Messages
.pp 5
The CP/M-8000 Console Command Processor, CCP, returns two types of
error messages at the console: diagnostic and internal logic
error messages.
.sp 2
.tc E.5.1 Diagnostic Error Messages
.sh
E.5.1 Diagnostic Error Messages
.pp
The CCP error messages are listed below in alphabetic order
with explanations and suggested user responses.
.sp 2
.ce
.sh
Table E-6. CCP Diagnostic Error Messages
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
bad relocation information bits
.sp
This message is a result of a BDOS Program Load Function
(59) error. It indicates that the file specified in the command line is
not a valid
executable command file, or that the file has been corrupted. Ensure that
the file is a command file. Section 3 of this manual
describes the format of a command file. If the file has been
corrupted, reassemble, or recompile the source file, and relink the file before you reenter
the command line.
.in 0
.ll 65
.bp
.ce
.sh
Table E-6. (continued)
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
File already exists
.sp
This error occurs during a REN command. The name specified in the
command line as the new filename already exists. Use the ERA command to
delete the existing file if you
wish to replace it with the new file.
If not, select another filename and reenter the REN command line.
.sp 2
.ti -15
insufficient memory or bad file header
.sp
This error could result from one of three causes:
.sp
.in 23
.ti -3
1) The file is not a valid executable command file. Ensure that you are
requesting the correct file. This error can occur
when you enter the filename before you enter the command for a
utility. Check the appropriate section of this manual or the
CP/M-8000 Operating System User's Guide for the correct
command syntax before you reenter the command line. If you are trying to run
a program when this error occurs, the program file may
have been corrupted. Reassemble or recompile the source file
and relink the file before you reenter the command line.
.sp
.ti -3
2) The program is too large for the available memory. Add more memory boards
to the system configuration, or rewrite the
program to use less memory.
.sp
.ti -3
3) The program is linked to an absolute location in memory that cannot be
used. The program must be made relocatable, or linked to a usable
memory location. The BDOS Get/Set TPA Limits Function (63) returns
the high and low boundaries of the memory space that is
available for loading programs.
.in 0
.ll 65
.bp
.ce
.sh
Table E-6. (continued)
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
No file
.sp
The filename specified in the command line does not exist. Ensure that you
use the correct filename and reenter the
command line.
.sp 2
.ti -15
No wildcard filenames
.sp
The command specified in the command line does not accept
wildcards in file specifications. Retype the command line using a specific
filename.
.sp 2
.ti -15
read error on program load
.sp
This message indicates a premature end-of-file. The file is
smaller than the header information indicates. Either the file header has
been corrupted or the file was only partially written. Reassemble, or
recompile the source file, and relink the file before you reenter the
command line.
.sp 2
.ti -15
SUB file not found
.sp
The file requested either does not exist, or does not have a
filetype of SUB. Ensure that you are requesting the correct file.
Refer to the section on SUBMIT in the \c
.ul
CP/M-8000 Operating System User's Guide \c
.qu
for information on creating and using submit files.
.sp 2
.ti -15
Syntax: REN newfile=oldfile
.sp
The syntax of the REN command line is incorrect. The correct
syntax is given in the error message. Enter the REN command followed by a
space, then the new filename,
followed immediately by an equals
sign (=) and the name of the file you want to rename.
.in 0
.ll 65
.bp
.ce
.sh
Table E-6. (continued)
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
Too many arguments: argument?
.sp
The command line contains too many arguments.
The extraneous arguments are indicated by the variable "argument." Refer to
the \c
.ul
CP/M-8000 Operating System User's Guide \c
.qu
for the correct syntax for the
command. Specify only as many arguments as the command syntax allows
and reenter the command line. Use a second command line for the remaining
arguments, if appropriate.
.sp 2
.ti -15
User # range is [0-15]
.sp
The user number specified in the command line is not supported
by the BIOS. The valid range is enclosed in the square brackets in
the error message. Specify a user number between 0 and 15 (decimal) when you
reenter the command line.
.in 0
.ll 65
.sp 2
.tc E.5.2 CCP Internal Logic Error Messages
.sh
E.5.2 CCP Internal Logic Error Messages
.pp
The following message indicates an undefined failure of the BDOS Program Load
Function (59).
.sp
Program Load Error
.sp
If you receive this message, contact the place you purchased your
system for assistance.
You should provide the information below.
.sp 2
.in 8
.ti -3
1) Indicate which version of the operating system you are using.
.sp
.ti -3
2) Describe your system's hardware configuration.
.sp
.ti -3
3) Provide sufficient information to reproduce the error. Indicate
which program was running at the time the error occurred. If possible,
you should also provide a disk with a copy of the program.
.in 0
.bp
.tc E.6 DDT-8000 Error Messages
.he CP/M-8000 Programmer's Guide E.6 DDT-8000 Error Messages
.sp
.sh
E.6 DDT-8000 Error Messages
.ix DDT-8000 error messages
.ix error message, DDT-8000
.pp 5
The CP/M-8000 debugger, DDT-8000, returns two types of error messages:
nonfatal diagnostic error messages and fatal errors in the internal logic
of DDT-8000.
.sp 2
.tc E.6.1 Diagnostic Error Messages
.sh
E.6.1 Diagnostic Error Messages
.pp
Diagnostic error messages are returned at the console as the error occurs.
The DDT-8000 error messages are listed below in alphabetic order
with explanations and suggested user responses.
.sp 2
.ce
.sh
Table E-7. DDT-8000 Diagnostic Error Messages
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
Bad or non-existent RAM at HEX no.
.sp
This error occurs in response to a Set (S), Set Word (SW),
or Set Longword (SL) command. The message indicates one of two
things.
.in 23
.ti -3
.sp
1) The memory location at "HEX no." is read-only, an I/O port,
or nonexistent. Use another location.
.ti -3
.sp
2) The memory location is damaged. Check the hardware.
.sp 2
.in 20
.ti -15
Bad relocation bits
.sp
This message is returned from the BDOS Program Load Function
(59), and means one of two things.
.in 23
.ti -3
.sp
1) The command file has been corrupted. Rebuild the file. Reassemble or
recompile the source file, and relink the file before you reenter the
DDT-8000 command line.
.in 0
.ll 65
.bp
.ce
.sh
Table E-7. (continued)
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 23
.ti -3
2) The file is linked to an absolute location in memory that is already
occupied by DDT-8000. Link the file to another location: DDT-8000 occupies
approximately 20K
of memory, and resides at the highest addresses within the TPA. The
recommended location for linking your file is the base address of
the TPA + 100H. BDOS Function 63, Get/Set TPA Limits, returns
the high and low boundaries of the TPA.
.sp 2
.in 20
.ti -15
Cannot create file
.sp
This error occurs during a Write (W) command. The disk to
which DDT-8000 is writing has no more directory space available: in effect,
the disk is full. If you have another drive available, reenter the Write
(W) command and direct the file to the disk
on that drive. If you do not have another drive available, you
must exit DDT-8000 (and lose the contents of memory). Erase unnecessary
files, if any, or insert a new disk.
.sp 2
.ti -15
Cannot open file
.sp
This error occurs during a Read (R) command. It indicates an
incorrect user number, drive code, or filename. Check the user number, drive
code, and filename before you reenter the command line.
.sp 2
.ti -15
Cannot open program file
.sp
This message occurs in response to a Load for Execution (E)
command. It indicates
an incorrect user number, drive code, or filename. Check the user number,
drive code, and filename before
you reenter the command line.
.in 0
.ll 65
.bp
.ce
.sh
Table E-7. (continued)
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
ERROR, no program or file loaded.
.sp
This error message occurs in response to a Value (V)
command when you specify the command but no file is loaded. Load a file
before you reenter the V command. The file can
be loaded with a Load for Execution (E) or Read (R) command, or by
specifying the filename when you invoke DDT-8000.
.sp 2
.ti -15
File too big -- read truncated
.sp
This message occurs during a Read (R) command when the
file being read is too large to fit in memory. DDT-8000 reads only
the portion of the file
that can be read into the existing memory. To debug this program, additional
memory boards must be added to the system configuration.
.sp 2
.ti -15
File write error
.sp
The disk to which DDT-8000 is writing is full or the
disk contains a bad sector. Retry the command. If the error persists, and
you have another
disk drive available, redirect the output to the disk on that
drive. If you
do not have another drive available, you must exit DDT-8000.
Use the STAT command to check the space on the disk. If it is full,
erase unnecessary files, if any, or insert a new disk. Because the contents
of memory
are lost when you exit DDT-8000, you must reload the file
in memory. If the disk was not full, it has a bad sector. You
should replace the disk.
.in 0
.ll 65
.bp
.ce
.sh
Table E-7. (continued)
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
**illegal size field
.sp
This error occurs during a List (L) command. The size field of the
instruction being disassembled has an illegal value. Use a Display (D)
command to display the location of the error. This error could be
caused by one of three things:
.sp
.in 23
.ti -3
1) The memory location being disassembled does not contain an
instruction. Ensure that the area selected is an instruction. If not,
reenter the L
command with a correct location.
.sp
.ti -3
2) The size field of the instruction has been corrupted. Use the debugging
commands in DDT-8000 to look for an error that causes the
program to overwrite itself. Refer to the section in this manual
on DDT-8000 for a complete description of the DDT-8000 commands and
options.
.sp
.ti -3
3) An invalid instruction was generated by the compiler or assembler used to
create the program. Recompile or reassemble the source file before you
reinvoke DDT-8000.
.sp 2
.in 20
.ti -15
Insufficient memory or bad file header
.sp
This message occurs in response to a Load for Execution (E) command. The error
could be caused by one of three things:
.in 0
.ll 65
.bp
.ce
.sh
Table E-7. (continued)
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 20
.in 23
.sp
.ti -3
1) The system you are using does not have enough memory available. Ensure
that the program and DDT-8000 fit into the TPA.
Exit DDT-8000. Use the SIZE68 Utility to display the
amount of space your program occupies in memory. DDT-8000 is
approximately 20K bytes. The BDOS Get/Set TPA
Limits Function (63) returns the
high and low boundaries of the TPA. If you do not have sufficient
space in the TPA to execute your
command file and DDT-8000 simultaneously, additional memory boards
must be added to the system configuration.
.sp
.ti -3
2) The file is not a command file or has a corrupted header. If the command
file does not run, but
you are sure that your memory space is adequate, use the R command to look at
the file and check the format. You may be trying to debug a file that is not
a command file. If it is a command file, the header may have been corrupted.
Reassemble or recompile the source file before you reenter the E command line.
If the error persists, it may be caused by an error in the internal
logic of DDT-8000. Contact the place you purchased your system for
assistance.
You should provide the information below.
.sp
.in 26
.ti -3
a. Indicate which version of the operating system you are using.
.sp
.ti -3
b. Describe your system's hardware configuration.
.sp
.ti -3
c. Provide sufficient information to reproduce the error. Indicate
which program was running at the time the error occurred. If possible,
you should also provide a disk with a copy of the program.
.in 0
.ll 65
.bp
.ce
.sh
Table E-7. (continued)
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 23
.sp
.ti -3
3) The command file you are debugging is linked to an absolute location in
memory that is already occupied by DDT-8000. DDT-8000 is approximately 20K
bytes, and usually resides in the highest
addresses of the TPA. The recommended location for linking your file is the
base address of the TPA + 100H. The BDOS Get/Set TPA
Limits Function (63) returns the high and low boundaries of the TPA.
.in 20
.sp 2
.ti -15
Read error
.sp
This message may indicate one of three things. Try the operation again. If
the error persists, try the responses indicated:
.sp
.in 23
.ti -3
1) A write error at the time the file was created. You must recreate the
file. If the error reoccurs, or if
you cannot write to the disk, the disk is bad.
.sp
.in 23
.ti -3
2) A bad disk. Use PIP or COPY to copy the file from the bad
disk to a new disk. Any files that cannot be copied must be
recreated or replaced from backup files. Discard the damaged
disk.
.sp
.ti -3
3) A hardware error. If the error persists, check your hardware.
.in 20
.sp 2
.ti -15
unknown opcode
.sp
This error occurs in response to a List (L) command if
the memory location being disassembled does not contain a valid instruction.
The error may have been caused by one of three things:
.sp
.in 0
.ll 65
.bp
.ce
.sh
Table E-7. (continued)
.nf
.ll 60
.sp
.in 5
Message Meaning
.fi
.sp
.in 23
.ti -3
1) You gave the L command the wrong address. Reenter the L command with the
correct address.
.sp
.ti -3
2) The file is not a command file. Ensure that the file you specify is a
command file and reenter the L command.
.sp
.ti -3
3) The command file has been corrupted. Reassemble or recompile the source
file
before you reread it into memory with a Load for Execution (E) or
Read (R) command, as appropriate. If the problem persists, use the
debugging commands in DDT-8000 to look for an error in the program
that causes it to overwrite itself. Refer to the section in this manual
on DDT-8000 for a complete description of the DDT-8000 commands and
options.
.in 0
.ll 65
.sp 2
.tc E.6.2 DDT-8000 Internal Logic Error Messages
.sh
E.6.2 DDT-8000 Internal Logic Error Messages
.pp
This section lists fatal errors in the internal logic of DDT-8000. If you
receive one of these messages, contact the place you purchased
your system for assistance.
You should provide the information below.
.sp 2
.in 8
.ti -3
1) Indicate which version of the operating system you are using.
.sp
.ti -3
2) Describe your system's hardware configuration.
.sp
.ti -3
3) Provide sufficient information to reproduce the error. Indicate
which program was running at the time the error occurred. If possible,
you should also provide a disk with a copy of the program.
.in 0
.sp 2
Errors:
.sp
.in 3
.nf
o illegal instruction format #
.sp
o Unknown program load error
.fi
.in 0
.bp
.tc E.7 DUMP Error Messages
.he CP/M-8000 Programmer's Guide E.7 DUMP Error Messages
.sh
E.7 DUMP Error Messages
.pp 5
.ix DUMP error messages
.ix error message, DUMP
DUMP returns fatal, diagnostic error messages at the
console. The DUMP error messages are listed below in alphabetic order with
explanations and suggested user responses.
.sp 2
.ce
.sh
Table E-8. DUMP Error Messages
.ll 60
.in 5
.sp
.nf
Message Meaning
.fi
.sp
.in 20
.ti -15
Unable to open filename
.sp
Either the drive code for the input file indicated by the variable
"filename" is incorrect, or the filename is misspelled. Check the filename
and drive code before you reenter the DUMP command line.
.sp 2
.ti -15
Usage: dump [-shhhhhh] file
.sp
The command line syntax is incorrect. The correct syntax is given in the
error message. Specify the DUMP command and the filename. If you want to
display the contents of the file from a specific address in the
file, specify the -S option followed by the address. Refer to
the section in this manual on the DUMP Utility for a
discussion of the DUMP command line and options.
.in 0
.ll 65
.sp 2
.tc E.8 LO68 Error Messages
.he CP/M-8000 Programmer's Guide E.8 LO68 Error Messages
.sh
E.8 LO68 Error Messages
.pp 5
.ix LO68 error messages
.ix error messages, LO68
The CP/M-8000 Linker, LO68, returns two types of fatal error messages:
diagnostic and logic. Both types of fatal error
messages have the following format:
.sp
.ti 8
: error message text
.sp
The colon (:) indicates that the error message comes from LO68. The "error
message
text" describes the error.
.nx appe3

View File

@@ -0,0 +1,595 @@
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he CP/M-8000 Programmer's Guide E.8 LO68 Error Messages
.ft All Information Presented Here is Proprietary to Digital Research
.sp 2
.tc E.8.1 Fatal Diagnostic Error Messages
.sh
E.8.1 Fatal Diagnostic Error Messages
.pp
A fatal diagnostic error prevents your program from linking. When the error
is caused by a full disk, erase the partial file that LO68 created on the
disk that received the error to ensure that you do not use the file.
The LO68 diagnostic errors are listed below in alphabetic order
with explanations and suggested user responses.
.bp
.ce
.sh
Table E-9. LO68 Fatal Diagnostic Error Messages
.ll 60
.in 5
.sp
.nf
Message Meaning
.fi
.sp
.in 20
.ti -15
: duplicate definition in p,filename
.sp
The symbol indicated by the variable "p" is defined twice.
The variable "filename" indicates
the file in which the second definition occurred. Rewrite the source code.
Provide a unique definition for each
symbol and reassemble or recompile the source code before you relink the file.
.sp 2
.ti -15
: file format error: filename
.sp
The file indicated by the variable "filename" is either not an
object file or the file has been corrupted. Ensure that the file is an
object file, output by the assembler or
compiler. Reassemble or recompile the file before you relink it.
.sp 2
.ti -15
: File Format Error: Invalid symbol flags = flags
.sp
LO68 does not recognize the symbol flags indicated by the variable
"flags." The file LO68 read is either not an object file or it has been
corrupted. Ensure that the file is an object file, output by the assembler or
compiler. Reassemble or recompile the file before you relink it.
.sp 2
.ti -15
: File Format Error: invalid relocation flag in filename
.sp
The contents of the file indicated by the variable
"filename" are incorrectly formatted. The file either is not an object file
or has been corrupted. Ensure that the file is an object file, output by the
assembler or
compiler. If the file is an object file but this error occurs, the file
has been corrupted. Reassemble or recompile the file before you relink it.
.in 0
.ll 65
.bp
.ce
.sh
Table E-9. (continued)
.ll 60
.in 5
.sp
.nf
Message Meaning
.fi
.sp
.in 20
.ti -15
: File Format Error: no relocation bits in filename
.sp
The file indicated by the variable "filename" either is not an
object file or has been corrupted. Ensure that the file is an object file,
output by the assembler or
compiler. If the file is an object file but this error occurs, then the file
has been corrupted. Reassemble or recompile the file before you relink it.
.sp 2
.ti -15
: Illegal option p
.sp
The option in the command line indicated by the variable "p" is
invalid. Supply a valid option and relink.
.sp 2
.ti -15
: Invalid lo68 argument list
.sp
This message indicates format errors or invalid options in the
command line. Examine the command line to locate the error. Correct the
error and relink.
.sp 2
.ti -15
: output file write error
.sp
The disk to which LO68 is writing is full. Erase unnecessary files, if any,
or insert a new disk before you reenter the LO68 command line.
.sp 2
.ti -15
: read error on file: filename
.sp
The object file indicated by the variable "filename," does not
have enough bytes.
The file either is incorrectly formatted or has been corrupted. This error
is commonly caused when the input to LO68 is a partially
assembled or compiled object file. The assembler, AS68, and some
compilers create partial object files
when they receive the "disk full abort" message while assembling or
compiling a file. Ensure that the file is a complete object file.
Reassemble or recompile the file before you relink it.
.in 0
.ll 65
.bp
.ce
.sh
Table E-9. (continued)
.ll 60
.in 5
.sp
.nf
Message Meaning
.fi
.sp
.in 20
.ti -15
: symbol table overflow
.sp
The object code contains too many symbols for the size of the
symbol table. Rewrite the source code to use fewer symbols. Reassemble or
recompile the source code before you relink the file.
.sp 2
.ti -15
: Unable to create filename
.sp
Either the output file indicated by "filename" has an invalid drive
code, or the disk to which LO68 is writing is full. Check the drive code.
If it is correct,
the disk is full. Erase unnecessary files, if any, or insert a new disk
before you reenter the LO68 command line.
.sp 2
.ti -15
: unable to open filename
.sp
The filename indicated by the variable "filename" is invalid,
or the file does not exist. Check the filename before you reenter the LO68
command line.
.sp 2
.ti -15
: Unable to open temporary file: filename
.sp
Either the file, indicated by "filename", has an invalid drive
code, specified by the "f" option, or the disk to which LO68 is writing
is full. Check the drive code. If it is correct, the disk is full. Erase
unnecessary files, if any, or insert a new disk before you
reenter the LO68 command line.
.sp 2
.ti -15
: Undefined symbol(s)
.sp
The symbol or symbols which are listed one per line on the lines
following the error message are undefined. Provide a valid definition and
reassemble the source code before you reenter the LO68 command line.
.in 0
.ll 65
.bp
.tc E.8.2 LO68 Internal Logic Error Messages
.sh
E.8.2 LO68 Internal Logic Error Messages
.pp
This section lists messages indicating fatal errors in the internal
logic of LO68. If you receive one of these messages, contact the place you
purchased your system for assistance. You should provide the information
below.
.sp
.in 8
.ti -3
1) Indicate which version of the operating system you are using.
.sp
.ti -3
2) Describe your system's hardware configuration.
.sp
.ti -3
3) Provide sufficient information to reproduce the error. Indicate
which program was running at the time the error occurred. If possible,
you should also provide a disk with a copy of the program.
.in 0
.sp 2
Errors:
.sp
.nf
.in 3
o : asgnext botch
o : finalwr: text size error
o : relative address overflow at lx in sn
o : seek error on file filename
o : short address overflow in filename
o : unable to reopen filename
.fi
.in 0
.sp 2
.tc E.9 NM68 Error Messages
.he CP/M-8000 Programmer's Guide E.9 NM68 Error Messages
.sh
E.9 NM68 Error Messages
.pp 5
.ix NM68 error messages
.ix error messages, NM68
NM68 returns fatal diagnostic error messages at the console. The NM68 error
messages are listed below in alphabetic order with explanations and suggested
user responses.
.bp
.ce
.sh
Table E-10. NM68 Error Messages
.ll 60
.in 5
.sp
.nf
Message Meaning
.fi
.sp
.in 20
.ti -15
file format error: filename
.sp
The input file indicated by the variable "filename" is neither an
object file nor a command file. This message can also indicate a corrupted
file. NM68 prints the symbol table of an object file or a command
file. Ensure that the file is one of these types of file. If the
file is an object or
command file and you receive this message, the file is corrupted.
Rebuild the file with the compiler or assembler. If the file is a
command file, relink it. Reenter the NM68 command line.
.sp 2
.ti -15
read error on file: filename
.sp
The input file indicated by the variable "filename" is truncated. Rebuild
the file with the compiler or assembler. If the file is a
command file, relink it. Reenter the NM68 command line.
.sp 2
.ti -15
unable to open filename
.sp
The filename indicated by the variable "filename" is incorrect. Check the
spelling of the filename and reenter the command line.
.sp 2
.ti -15
Usage: nm68 objectfile
.sp
The command line syntax is incorrect. Use the syntax given in the error
message and reenter the command line.
.in 0
.ll 65
.sp 2
.tc E.10 RELOC Error Messages
.he CP/M-8000 Programmer's Guide E.10 RELOC Error Messages
.sh
E.10 RELOC Error Messages
.pp 5
.ix RELOC error messages
.ix error message, RELOC
The Relocation Utility (RELOC) returns fatal error messages at the
console. RELOC error messages are listed below in alphabetic order with
explanations and suggested user responses.
.bp
.ce
.sh
Table E-11. RELOC Error Messages
.ll 60
.sp
.nf
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
create filename
.sp
Either the drive code for the output file indicated by the
variable "filename" is incorrect, or the disk to which RELOC is writing
is full. Check the drive code. If it is correct, the disk is full. Erase
unnecessary files, if any, or insert a new disk before you reenter the RELOC
command line.
.sp 2
.ti -15
Cannot open filename
.sp
The input file indicated by the variable "filename" does not
exist. Ensure that you type the correct filename when you reenter the
RELOC command line.
.sp 2
.ti -15
Cannot re-open filename
.sp
This error message indicates a hardware error. Check the hardware for
errors. This error most often occurs in the disk, disk drive, or memory.
.sp 2
.ti -15
File format error: filename
.sp
This error occurs because the first word in the header record of the
command file must contain the value 601AH and the file must contain
relocation bits. If your file does not meet these criteria, you cannot use
RELOC.
.sp
.in 23
.ti -3
1) The file indicated by the variable "filename" is not a command file with
contiguous program segments (the first word in the header record is
601AH). If the file is an object file, link it before you reenter the RELOC
command line.
.sp
.ti -3
2) The file does not have relocation bits because it is already linked
to an absolute location. Use the original source file that contains
relocation bits with RELOC.
.in 0
.ll 65
.bp
.ce
.sh
Table E-11. (continued)
.ll 60
.sp
.nf
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
Illegal base address=hex no.
.sp
The odd base address indicated by the variable "hex no." is invalid
under CP/M-8000. Base addresses must be even. Specify an even base address
and reenter the RELOC command line.
.sp 2
.ti -15
Illegal option: x
.sp
The option specified for the RELOC command must be -b. The invalid
option is indicated by the variable "x". Replace the invalid option with -b
and reenter the RELOC command line.
.sp 2
.ti -15
Illegal reloc = x at address
.sp
This message may indicate one of two things:
.in 23
.sp
.ti -3
1) The command file is truncated or corrupted. RELOC recognized the
error because the relocation value indicated by the variable "x" is invalid.
The variable "address" indicates the location in memory of the invalid
relocation value. Rebuild the file. Reassemble, or recompile, and relink
the file before you reenter the RELOC command line.
.sp
.ti -3
2) The file has no relocation bits. Use the original source code with
relocation bits and try again.
.in 20
.sp 2
.ti -15
Read error on filename
.sp
The input file indicated by the variable "filename" is truncated or
corrupted. Rebuild the file. Reassemble, or recompile, and relink
the file before you reenter the RELOC command line.
.in 0
.ll 65
.bp
.ce
.sh
Table E-11. (continued)
.ll 60
.sp
.nf
.in 5
Message Meaning
.fi
.sp
.in 20
.ti -15
16-bit overflow at address
.sp
The address indicated by the variable "address" cannot contain a
16-bit quantity. Source code that uses 16-bit offsets must fit in the first
64K bytes of memory. BDOS Function 63, Get/Set TPA Limits, returns the high
and low boundaries of the memory available for loading programs. SIZE68
displays the amount of memory space a program occupies. Use the
Get/Set TPA Limits Function and SIZE68 to ensure that the program
fits in the first 64K of memory. If the program does not fit, you
must rewrite the source code to use 32-bit offsets.
.sp 2
.ti -15
.nf
Usage: reloc -bhhhhhh input output
.ti -15
where: hhhhhh is new base address
.ti -15
input is relocatable file
.ti -15
output is absolute file
.fi
.sp
This message indicates a syntax error in the RELOC command line.
The correct syntax is given in the error message. Retype the command line
with the correct syntax. Refer to the section in this manual on
the RELOC Utility for more detailed information on the command line syntax.
.sp 2
.ti -15
Write error on filename Offset = x data = x error = x
.sp
The disk to which RELOC is writing is full. Erase unnecessary files, if any,
or insert a new disk before you reenter the RELOC command line.
.in 0
.ll 65
.sp 2
.tc E.11 SENDC68 Error Messages
.he CP/M-8000 Programmer's Guide E.11 SENDC68 Error Messages
.sh
E.11 SENDC68 Error Messages
.pp 5
.ix SENDC68 error messages
.ix error messages, SENDC68
SENDC68 returns two types of fatal error messages: diagnostic and internal
logic error messages.
.bp
.tc E.11.1 Diagnostic Error Messages
.sh
E.11.1 Diagnostic Error Messages
.pp
The SENDC68 diagnostic error messages are listed below in alphabetic order
with explanations and suggested user responses.
.sp 2
.ce
.sh
Table E-12. SENDC68 Diagnostic Error Messages
.ll 60
.in 5
.nf
.sp
Message Meaning
.fi
.sp
.in 20
.ti -15
file format error: filename
.sp
The file indicated by the variable "filename" is not a command file.
The file input to SENDC68 must be a command file, output by the linker
(LO68). Ensure that the file specified is a command file.
.sp 2
.ti -15
read error on file: filename
.sp
The file indicated by the variable "filename" is truncated. Rebuild the file
by recompiling or reassembling, and relink it before you reenter the SENDC68
command line.
.sp 2
.ti -15
unable to create filename
.sp
This message indicates an invalid drive code for the
output file indicated by the variable "filename". It can also mean that the
disk to which SENDC68 is writing is full. Check the drive code. If it is
correct, the disk is full.
Erase unnecessary files, if any, or insert a new disk before you reenter the
SENDC68 command line.
.sp 2
.ti -15
unable to open filename
.sp
The input file indicated by the variable "filename"
does not exist. Check the filename and retype the SENDC68 command line.
.sp 2
.mb 5
.fm 1
.ti -15
Usage: sendc68 [-] commandfile [outputfile]
.sp
This message indicates a syntax error in the SENDC68 command line.
The correct syntax is given in the error message. Retype the command line
using the correct syntax.
.in 0
.ll 65
.bp
.mb 6
.fm 2
.tc E.11.2 SENDC68 Internal Logic Error Messages
.sh
E.11.2 SENDC68 Internal Logic Error Messages
.pp
The following is a fatal error in the internal logic of SENDC68.
.sp
.ti 8
INTERNAL LOGIC ERROR: seek error on file filename
.sp
If you receive this message, contact the place you purchased your
system for assistance.
You should provide the information below.
.sp 2
.in 8
.ti -3
1) Indicate which version of the operating system you are using.
.sp
.ti -3
2) Describe your system's hardware configuration.
.sp
.ti -3
3) Provide sufficient information to reproduce the error. Indicate
which program was running at the time the error occurred. If possible,
you should also provide a disk with a copy of the program.
.in 0
.sp 2
.tc E.12 SIZE68 Error Messages
.he CP/M-8000 Programmer's Guide E.12 SIZE68 Error Messages
.sh
E.12 SIZE68 Error Messages
.pp 5
.ix SIZE68 error messages
.ix error messages, SIZE 68
SIZE68 returns fatal, diagnostic error messages at the console. The SIZE68
error messages are listed below in alphabetic order with explanations and
suggested user responses.
.sp 2
.ce
.sh
Table E-13. SIZE68 Error Messages
.ll 60
.in 5
.nf
.sp
Message Meaning
.fi
.sp
.in 20
.ti -15
File format error: filename
.sp
The file indicated by the variable "filename" is neither an
object file nor a command file. SIZE68 requires either an object file,
output by the assembler or
the compiler, or a command file, output by the linker. Ensure that the
file specified is one of these and reenter the SIZE68 command line.
.sp 2
.ti -15
read error on filename
.sp
The file indicated by the variable "filename" is truncated. Rebuild the
file. Reassemble or recompile, and relink the
source file before you reenter the SIZE68 command line.
.in 0
.ll 65
.bp
.ce
.sh
Table E-13. (continued)
.ll 60
.in 5
.nf
.sp
Message Meaning
.fi
.sp
.in 20
.ti -15
unable to open filename
.sp
Either the drive code is incorrect, or the file indicated by the
variable "filename" does not exist. Check the drive code and filename.
Reenter the SIZE68 command line.
.in 0
.ll 65
.sp 2
.ce
End of Appendix E
.nx appf

View File

@@ -0,0 +1,166 @@
.bp odd
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.pp 5
.hm 2
.fm 2
.he
.ft All Information Presented Here is Proprietary to Digital Research
.ce 2
.tc F New Functions and Implementation Changes
.sh
Appendix F
.sp
.sh
New Functions and Implementation Changes
.sp 2
.pp 5
CP/M-8000 has six new Basic Disk Operating System (BDOS) functions
and additional implementation changes in the BDOS functions and
data structures that differ from other CP/M systems.
.sp 2
.ce
.sh
Table F-1. New BDOS Functions
.nf
.sp
.in 11
.ll 60
Function Number
.sp
Get Free Disk Space 46
.sp
Chain to Program 47
.sp
Flush Buffers 48
.sp
Set Exception Vector 61
.sp
Set Supervisor State 62
.sp
Get/Set TPA Limits 63
.sp 2
.in 0
.fi
.tc F.1 BDOS Function and Data Structure Changes
.he CP/M-8000 Programmer's Guide F.1 BDOS Function Changes
.sh
F.1 BDOS Function and Data Structure Changes
.pp
Implementation changes in CP/M-8000 BDOS functions and data structures
are described in the following table:
.sp 2
.sh
.ce
Table F-2. BDOS Function Implementation Changes
.sp
.ll 60
.in 5
.nf
BDOS Function Number Implementation
Change
.sp
.in 36
.ti -32
.fi
Return Version Number 12 Contains the version number 2022H indicating
CP/M-8000 Version 1.1.
.sp
.ti -32
Reset Disk System 14 Does not log in disk drive A when it resets
the disk system.
.sp
.ti -32
Open File 15 Opens a file only at extent 0, the base extent.
.sp
.ti -32
Get Disk Parameters 31 Returns a copy of the Disk Parameter Block
(DPB).
.in 0
.fi
.sp 2
.in 5
.nf
.sh
Table F-3. BDOS Data Structure Implementation Changes
.qs
.sp
.ll 60
Structure Implementation
Change
.fi
.sp
.in 28
.ti -23
Base Page Additional information has been added. The base page
is no longer located at a fixed address. Appendix C outlines the structure
of the base page.
.sp
.ti -23
File Control Block The byte sequence for the Random Record Field has
changed. The most significant byte (r0) is first and the least significant
byte (r2) is last.
.in 0
.sp 2
.tc F.2 BDOS Functions Not Supported By CP/M-8000
.he CP/M-8000 Programmer's Guide F.2 Unsupported BDOS Functions
.sh
F.2 BDOS Functions Not Supported By CP/M-8000
.qs
.pp
The list below contains functions and commands supported by other CP/M
systems, but that are not supported by CP/M-8000.
.sp 2
.ce
.sh
Table F-4. BDOS Functions Not Supported by CP/M-8000
.qs
.nf
.sp
.ll 60
.in 7
BDOS Function Number
.nf
.sp
.in 7
Get Address of Allocation Vector 27
.sp
Set DMA Base+ 51
.sp
Get DMA Base+ 52
.sp
Get Maximum Memory* 53
.sp
Get Absolute Memory* 54
.sp
Allocate Absolute Memory* 55
.sp
Free Memory* 56
.sp
Free All Memory* 57
.fi
.in 7
.sp 2
.ti -2
+ The Z8000 microprocessor does not have a segmented
architecture. Therefore, functions involving segment registers are not
relevant to CP/M-8000.
.sp
.ti -2
* CP/M-8000 does not have memory management functions.
.in 0
.sp
.mb 5
.fm 1
.fi
.pp
DDT-8000 does not support the Assemble (A) command.
.sp 2
.ce
End of Appendix F
.nx index

View File

@@ -0,0 +1,532 @@
.bp odd
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he
.ft
.ce
.sh
Index
.qs
.sp 3
.nf
.sp
.sh
A
.qs
.sp
A command (AR68), 117
a user stack, 10
absolute file, 122
absolute origin directive
(org), 102
access operating system, 2
additional serial I/O
functions, 72
address, 7
address errors, 89
AR68, 3, 113
commands, 115
error messages, 157
errors, 122
archive utility (AR68), 3, 113
AS68, 3
assembly language, 104
error messages, 161
instruction set, 153
invoking, 95, 104
assembler (AS68) operation,
3, 95
assembly language directives,
98
assembly language extensions,
106
auxiliary input, 72, 141
auxiliary output, 73, 141
.sp
.sh
B
.qs
.sp
-Baddress (L068), 113
bad vector error, 89
base page, 2, 10, 87, 151
Basic Disk Operating System
(BDOS), 1, 12
Basic I/O System (BIOS), 1, 12
.cc @
.bass directive, 108
@cc .
BDOS, 1
functions, 23
direct console I/O, 66
error messages, 171
invoking, 24
organization of, 25
output console function, 25
parameters, 24
system reset function, (0), 12
.bp
.sp 4
BIOS, 1
error messages, 175
functions, 141
parameter block (BPB), 84
return code, 84
block storage segment (bss), 7
branch instructions, 108
bsr instruction, 108
bss, 7
bss directive, 98
built-in commands, 9
bus errors, 89
.sp
.sh
C
.qs
.sp
CCP, 1, 86
CDPB, 59
chain to program function, 82
character I/O functions, 62
close file function, 32, 43
cold start loader, 1
command file format, 2, 15
command tail, 11
common directive (comm), 98, 107
compute file size function, 48
conditional directives, 101
Conin function, 141
Conout function, 141
console buffer, 69
Console Command Processor
(CCP), 1, 12
console I/O functions, 64-65
Const function, 141
CP/M-8000,
architecture, 1
commands, 3, 4
default memory model, 13
file specification, 5
operating system, 1
terminology, 7
text editor, 4
CPM.SYS file, 1
CPU, state of, 139
current default disk numbers,
56
.sp
.sh
D
.qs
.sp
D (Display) command (DDT-8000),
131
D command (AR68), 115
-Daddress (L068), 113
data directive, 98, 108
data segment, 7
DDT-8000, 3
command conventions, 129
command summary, 130
error messages, 180
operation, 129
terminating, 130
define constant directive
(dc), 98
define storage directive (ds),
99
delete file function, 35
delimiter characters, 5
DIR*, 4
direct BIOS call function, 84
direct console I/O function,
66
DIRS*, 4
disk
change error, 28, 57
directory, 33
file error, 28, 30
read error, 28
select error, 28
write error, 28
DMA buffer, 41
DPB, 59
drive functions, 52
drive select code, 5
DUMP, 3, 113, 120
DUMP
error messages, 187
invoking, 120
output, 121
.sp
.sh
E
.qs
.sp
E (Load for Execution) command
(DDT-8000), 132
editing control functions, 69
end directive, 100
endc directive, 100
equate directive (equ), 100
ERA*, 4
error messages
AR68 fatal, 157
AS68, 161
BDOS, 171
BIOS, 175
DDT-8000, 180
DUMP, 187
LO68, 187
NM68, 191
RELOC, 192
SENDC68, 195
SIZE 68, 197
errors,
address, 89
AR68, 120
bus, 89
even directive, 102, 100
exception functions, 87
exception handler, 88, 89
exception parameter block
(EPB), 88
exception vectors, 1, 12, 88
exiting transient programs, 11
.sp
.sh
F
.qs
.sp
F (Fill) command (DDT-8000),
132
-F option (L068), 111
file access functions, 25
file attributes, 43
File Control Block (FCB), 26
file processing errors, 28
file size, 48
file structure, 1
file system access, 2
file loading, 10
filetype fields, 5
flush buffers function, 83, 141
free sector count, 62
function code, 85
functions
BDOS, 23
console, 63
.sp
.sh
G
.qs
.sp
G (Go) command (DDT-8000), 133
get address of disk parameter
block, 60
get console status function, 71
get disk free space function, 62
get disk parameters function, 59
get I/O byte function, 76, 141
get memory region table
address function, 141
get or set user code, 81
get Read-Only vector function,
58
get/set TPA limits, 92
.cc @
.globl directive, 108
@cc .
.bp
.sh
H
.qs
.sp
H (Hexadecimal Math) command
(DDT-8000), 133
header, 15
home function, 141
.sp
.sh
I
.qs
.sp
I (Input Command Tail) command
(DDT-8000), 133
I/O byte functions, 74
I/O functions
character, 62
direct console, 66
-I option (L068), 112
init function, 141
initial stack pointer, 87
instruction set summary,
(AS68), 153
invoking AR68, 113
invoking AS68, 104
invoking BDOS functions, 25
invoking DUMP, 120
invoking RELOC, 122
invoking SIZE68, 124
IOBYTE, 74
.sp
.sh
J
.qs
.sp
jsr instruction, 108
.sp
.sh
L
.qs
.sp
L (List) command (DDT-8000),
134, 141
line editing controls, 70
linker (L068) operation, 109
List
function, 141
output function, 74
Listst function, 141
LO68, 3
error messages, 187
load parameter block (LPB),
85, 86
loading a program in memory,
10
logical console device, 64,
69, 89
logical list device (LIST), 74
login vector, 55
longword, 7
.bp
.sh
M
.qs
.sp
M (Move) command (DDT-8000),
134
make file function, 39
message filename (L068), 114
multiple programs, loading, 10
.sp
.sh
N
.qs
.sp
nibble, 7
NM68
error messages, 191
utility, 3
.sp
.sh
O
.qs
.sp
object filename option (L068),
111
offset directive, 7, 102
-O option (L068), 112
open file function, 31, 43
operating system access, 2
options, AR68, 117
.sp
.sh
P
.qs
.sp
page directive, 102
physical file size, 48
PIP, 4
print string function, 68
printer switch, 65
program control functions, 77
program counter (PC), 133,
138
program execution
tracing of, 136
program load function, 85, 87
program load parameter block
(LPB), 20
program segments, 10, 15
program
loading, 10
programming tools and
commands, 2
programming utilities, 113
.sp
.sh
R
.qs
.sp
R (Read) command (DDT-8000),
135
R command (AR68), 116
random record field and
number, 44, 49
.bp
read console buffer function,
69
read error, 28
Read function, 141
read random function, 44
read sequential function, 36
read-only bit, 58
register mask directive, 103
RELOC error messages, 192
relocation information, 19
relocation utility (RELOC)
invoking, 4, 124, 113, 122
relocation words, 20
REN*, 4
rename file function, 40
reset disk system function, 53
reset drive function, 61
resident system extensions
(RSXs), 89
return current disk function, 56
return from subroutine (RTS), 86
return login vector function, 55
return version number function,
79
-R option (L068), 111
RSX, 89
.sp
.sh
S
.qs
.sp
S (Set) command (DDT-8000), 135
search for first function, 33
search for next function, 34
section directive, 103
Sectran function, 141
segment
block, 7
data, 7
text, 7
Seldsk function, 141
select disk function, 54
SENDC68
error messages, 195
utility, 4, 113, 126
serial I/O functions, 72
set direct memory access (DMA)
address function, 41
set exception vector function,
88, 141
set file attributes function,
42, 43
set I/O byte function, 77, 141
set random record function,
49, 50
set supervisor state, 91
Set/Get user code, 81
Setdma function, 141
Setsec function, 141
Settrk function, 141
shift instruction, 108
SIZE68
error messages, 197
output, 124
utility, 4, 126
-S option (L068), 111
sparse files, 48
start scroll, 65
status register, 138
stop scroll, 65
SUBMIT*, 4
supervisor stack and state, 91
symbol table, 15, 17
printing, 19
symbol type, 18
system control functions, 77
system reset function, 78
system stack pointer, 138
system state, 89
system/program control
functions, 77
.sp
.sh
T
.qs
.sp
-Taddress (L068), 113
T (Trace) command (DDT-8000),
136
T command (AR68), 118
tab characters, 64
terminating DDT-8000, 130
text directive, 108
text directive, 103
text segment, 7
TPAB parameters field, 93
transient command, 9
transient program area
(TPA), 92
transient programs, 2
exiting, 11
Trap 2 instruction, 25
TYPE*, 4
.sp
.sh
U
.qs
.sp
-Umodname option (L068), 112
U (Untrace) command (DDT-8000),
136
user number, 81
user stack pointer, 138
USER*, 4
.bp
.sh
V
.qs
.sp
V (Value) command (DDT-8000),
137
V option (AR68), 115, 118-121
vector number and values, 88
version dependent programming,
79
version numbers, 79
return, 80
virtual file size, 48
.sp
.sh
W
.qs
.sp
W (Write) command (DDT-8000),
137
W command (AR68), 119
warm boot function, 141
wildcards, 6, 31
word, 7
write
error, 28
function, 141
protect disk function, 57
random function, 46
sequential function, 37, 38
.sp
.sh
X
.qs
.sp
X (Examine CPU State) command
(DDT-8000), 139
X command (AR68), 122
-X option (L068), 112
.sp
.sh
Z
.sp
-Zaddress (L068), 113

View File

@@ -0,0 +1,168 @@
.nf
1 Introduction to CP/M-8000 . . . . . . . . . . . . . . . . . 1
1.1 CP/M-8000 System Architecture . . . . . . . . . . . . 1
1.2 Transient Programs . . . . . . . . . . . . . . . . . . 2
1.3 File System Access . . . . . . . . . . . . . . . . . 2
1.4 Programming Tools and Commands . . . . . . . . . . . 2
1.5 CP/M-8000 File Specification . . . . . . . . . . . . . 5
1.6 Wildcards . . . . . . . . . . . . . . . . . . . . . . 6
1.7 CP/M-8000 Terminology . . . . . . . . . . . . . . . . . 7
2 The CCP and Transient Programs . . . . . . . . . . . . . . 9
2.1 CCP Built-In and Transient Commands . . . . . . . . . 9
2.2 Loading A Program In Memory . . . . . . . . . . . . . . 10
2.2.1 Base Page Initialization By The CCP . . . . . 10
2.2.2 Loading Multiple Programs . . . . . . . . . . 10
2.2.3 Base Page Initialization By A Transient Progra 11
2.3 Exiting Transient Programs . . . . . . . . . . . . . . 11
2.4 Transient Program Execution Model . . . . . . . . . . 12
3 Command File Format . . . . . . . . . . . . . . . . . . . 15
3.1 The Header and Program Segments . . . . . . . . . . . 15
3.2 The Symbol Table . . . . . . . . . . . . . . . . . . 17
3.2.1 Printing The Symbol Table . . . . . . . . . . 19
3.3 Relocation Information . . . . . . . . . . . . . . . 19
3.3.1 The Format of A Relocation Word . . . . . . . 20
4 Basic Disk Operating System Functions . . . . . . . . . . 23
4.1 BDOS Functions and Parameters . . . . . . . . . . . . 24
4.1.1 Invoking BDOS Functions . . . . . . . . . . . . 24
4.1.2 Organization Of BDOS Functions . . . . . . . . 25
4.2 File Access Functions . . . . . . . . . . . . . . . . 25
4.2.1 A File Control Block (FCB) . . . . . . . . . . 26
4.2.2 File Processing Errors . . . . . . . . . . . . 28
4.2.3 Open File Function . . . . . . . . . . . . . . 31
4.2.4 Close File Function . . . . . . . . . . . . . . 32
4.2.5 Search For First Function . . . . . . . . . . 33
4.2.6 Search For Next Function . . . . . . . . . . . 34
4.2.7 Delete File Function . . . . . . . . . . . . . 35
4.2.8 Read Sequential Function . . . . . . . . . . . 36
4.2.9 Write Sequential Function . . . . . . . . . . 37
4.2.10 Make File Function . . . . . . . . . . . . . 39
4.2.11 Rename File Function . . . . . . . . . . . . 40
4.2.12 Set Direct Memory Access (DMA) Address . . . 41
4.2.13 Set File Attributes Function . . . . . . . . 42
4.2.14 Read Random Function . . . . . . . . . . . . 44
4.2.15 Write Random Function . . . . . . . . . . . . 46
4.2.16 Compute File Size Function . . . . . . . . . . 48
4.2.17 Set Random Record Function . . . . . . . . . 49
4.2.18 Write Random With Zero Fill Function . . . . 51
4.3 Drive Functions . . . . . . . . . . . . . . . . . . . 52
4.3.1 Reset Disk System Function . . . . . . . . . . 53
4.3.2 Select Disk Function . . . . . . . . . . . . . 54
4.3.3 Return Login Vector Function . . . . . . . . . 55
4.3.4 Return Current Disk Function . . . . . . . . . 56
4.3.5 Write Protect Disk Function . . . . . . . . . 57
4.3.6 Get Read-Only Vector Function . . . . . . . . 58
4.3.7 Get Disk Parameters Function . . . . . . . . . 59
4.3.8 Reset Drive Function . . . . . . . . . . . . . 61
4.3.9 Get Disk Free Space Function . . . . . . . . . 62
4.3 Character I/O Functions . . . . . . . . . . . . . . . 62
4.4.1 Console I/O Functions . . . . . . . . . . . . 64
Console Input Function . . . . . . . . . . . . 64
Console Output Function . . . . . . . . . . . 65
Direct Console I/O Function . . . . . . . . . 66
Print String Function . . . . . . . . . . . . 68
Read Console Buffer Function . . . . . . . . . 69
Get Console Status Function . . . . . . . . . 71
4.4.2 Additional Serial I/O Functions . . . . . . . . 72
Auxiliary Input Function . . . . . . . . . . . 72
Auxiliary Output Function . . . . . . . . . . 73
List Output Function . . . . . . . . . . . . . 74
4.4.3 I/O Byte Functions . . . . . . . . . . . . . . 74
Get I/O Byte Function . . . . . . . . . . . . 76
Set I/O Byte Function . . . . . . . . . . . . 77
4.5 System/Program Control Functions . . . . . . . . . . 77
4.5.1 System Reset Function . . . . . . . . . . . . 78
4.5.2 Return Version Number Function . . . . . . . . 79
4.5.3 Set/Get User Code . . . . . . . . . . . . . . 81
4.5.4 Chain To Program Function . . . . . . . . . . 82
4.5.5 Flush Buffers Function . . . . . . . . . . . . 83
4.5.6 Direct BIOS Call Function . . . . . . . . . . 84
4.5.7 Program Load Function . . . . . . . . . . . . 85
4.6 Exception Functions . . . . . . . . . . . . . . . . . 87
4.6.1 Set Exception Vector Function . . . . . . . . 88
4.6.2 Set Supervisor State . . . . . . . . . . . . . 91
4.6.3 Get/Set TPA Limits . . . . . . . . . . . . . . 92
5 AS68 Assembler . . . . . . . . . . . . . . . . . . . . . . 97
5.1 Assembler Operation . . . . . . . . . . . . . . . . . 97
5.2 Initializing AS68 . . . . . . . . . . . . . . . . . . 97
5.3 Invoking the Assembler (AS68) . . . . . . . . . . . . 97
5.4 Assembly Language Directives . . . . . . . . . . . . 100
5.5 Sample Commands Invoking AS68 . . . . . . . . . . . . 106
5.6 Assembly Language Differences . . . . . . . . . . . . 106
5.7 Assembly Language Extensions . . . . . . . . . . . . 108
5.8 Error Messages . . . . . . . . . . . . . . . . . . . 109
6.0 L068 Linker . . . . . . . . . . . . . . . . . . . . . . 111
6.1 Linker Operation . . . . . . . . . . . . . . . . . . 111
6.2 Invoking the Linker (L068) . . . . . . . . . . . . . 111
6.3 Sample Commands Invoking L068 . . . . . . . . . . . . 114
6.4 L068 Error Messages . . . . . . . . . . . . . . . . . 114
7.1 Archive Utility . . . . . . . . . . . . . . . . . . . 115
7.1.1 AR68 Syntax . . . . . . . . . . . . . . . . . 115
7.1.2 AR68 Operation . . . . . . . . . . . . . . . . 117
7.1.3 AR68 Commands and Options . . . . . . . . . . 117
7.1.4 Errors . . . . . . . . . . . . . . . . . . . . 122
7.2 DUMP Utility . . . . . . . . . . . . . . . . . . . . . 122
7.2.1 Invoking DUMP . . . . . . . . . . . . . . . . 122
7.2.2 DUMP Output . . . . . . . . . . . . . . . . . 123
7.2.3 DUMP Examples . . . . . . . . . . . . . . . . 124
7.3 Relocation Utility . . . . . . . . . . . . . . . . . 124
7.3.1 Invoking RELOC . . . . . . . . . . . . . . . . 124
7.3.2 RELOC Examples . . . . . . . . . . . . . . . . 125
7.4 SIZE68 Utility . . . . . . . . . . . . . . . . . . . 126
7.4.1 Invoking SIZE68 . . . . . . . . . . . . . . . 126
7.4.2 SIZE68 Output . . . . . . . . . . . . . . . . 126
7.4.3 SIZE68 Examples . . . . . . . . . . . . . . . 127
7.5 SENDC68 Utility . . . . . . . . . . . . . . . . . . . 128
7.5.1 Invoking SENDC68 . . . . . . . . . . . . . . . 128
7.5.2 SENDC68 Example . . . . . . . . . . . . . . . 129
8 DDT-8000 . . . . . . . . . . . . . . . . . . . . . . . . . 131
8.1 DDT-8000 Operation . . . . . . . . . . . . . . . . . . 131
8.1.1 Invoking DDT-8000 . . . . . . . . . . . . . . . 131
8.1.2 DDT-8000 Command Conventions . . . . . . . . . 131
8.1.3 Specifying Address . . . . . . . . . . . . . . 132
8.1.4 Terminating DDT-8000 . . . . . . . . . . . . . 132
8.1.5 DDT-8000 Operation with Interrupts . . . . . . 132
8.2 DDT-8000 Commands . . . . . . . . . . . . . . . . . . 133
8.2.1 The D (Display) Command . . . . . . . . . . . 133
8.2.2 The E (Load for Execution) Command . . . . . . 134
8.2.3 The F (Fill) Command . . . . . . . . . . . . . 134
8.2.4 The G (Go) Command . . . . . . . . . . . . . . 135
8.2.5 The H (Hexadecimal Math) Command . . . . . . . 135
8.2.6 The I (Input Command Tail) Command . . . . . . 135
8.2.7 The L (List) Command . . . . . . . . . . . . . 136
8.2.8 The M (Move) Command . . . . . . . . . . . . . 136
8.2.9 The R (Read) Command . . . . . . . . . . . . . 137
8.2.10 The S (Set) Command . . . . . . . . . . . . . 137
8.2.11 The T (Trace) Command . . . . . . . . . . . . 138
8.2.12 The U (Untrace) Command . . . . . . . . . . . 138
8.2.13 The V (Value) Command . . . . . . . . . . . . 139
8.2.14 The W (Write) Command . . . . . . . . . . . . 139
8.2.15 The X (Examine CPU State) Command . . . . . . 139
8.3 Assembly Language Syntax for A and L Commands . . . . 141
E.1 AR68 Error Messages . . . . . . . . . . . . . . . . . 157
E.1.1 Fatal Diagnostic Error Messages . . . . . . . 157
E.1.2 AR68 Internal Logic Error Messages . . . . . . 160
E.2 AS68 Error Messages . . . . . . . . . . . . . . . . . 161
E.2.1 AS68 Diagnostic Error Messages . . . . . . . . 161
E.2.2 User-recoverable Fatal Error Messages . . . . 167
E.2.3 AS68 Internal Logic Error Messages . . . . . . 171
E.3 BDOS Error Messages . . . . . . . . . . . . . . . . . 171
E.4 BIOS Error Messages . . . . . . . . . . . . . . . . . 175
E.5 CCP Error Messages . . . . . . . . . . . . . . . . . 176
E.5.1 Diagnostic Error Messages . . . . . . . . . . 176
E.5.2 CCP Internal Logic Error Messages . . . . . . 179
E.6 DDT-8000 Error Messages . . . . . . . . . . . . . . . 180
E.6.1 Diagnostic Error Messages . . . . . . . . . . 180
E.6.2 DDT-8000 Internal Logic Error Messages . . . . 186
E.7 DUMP Error Messages . . . . . . . . . . . . . . . . . 187
E.8 LO68 Error Messages . . . . . . . . . . . . . . . . . 187
E.8.1 Fatal Diagnostic Error Messages . . . . . . . 187
E.8.2 LO68 Internal Logic Error Messages . . . . . . 191
E.9 NM68 Error Messages . . . . . . . . . . . . . . . . . 191
E.10 RELOC Error Messages . . . . . . . . . . . . . . . . 192
E.11 SENDC68 Error Messages . . . . . . . . . . . . . . . 195
E.11.1 Diagnostic Error Messages . . . . . . . . . . 196
E.11.2 SENDC68 Internal Logic Error Messages . . . . 197
E.12 SIZE68 Error Messages . . . . . . . . . . . . . . . . 197
F New Functions and Implementation Changes . . . . . . . . . 199
F.1 BDOS Function and Data Structure Changes . . . . . . 199
F.2 BDOS Functions Not Supported By CP/M-8000 . . . . . . 200

View File

@@ -0,0 +1,78 @@
.pl 66
.po 5
.ll 69
.lt 69
.nr in 5
.de i0
.in \n(in
..
.de lp
.i0
.ta \\$2+1
.in \\$1
.ti -\\$2
..
.de s1
.sp 1
.ne 4
..
.de s2
.sp 1
..
.de s3
.sp 1
..
.de fo
'sp 2
'tl ''- % -''
'bp
..
.de th
.de x1
'sp 2
'tl '\\$1(\\$2)'\\$3'\\$1(\\$2)'
'sp 2
\\..
.wh -6 fo
.wh 0 x1
.in \n(in
..
.de sh
.s1
.ne 5
.ti 0
\\$1
.br
..
.de bd
.tr __
.ul
\\$1
..
.de bn
.tr __
.ul
\\$1\\t
..
.de it
.tr __
.ul
.li
\\$1
..
.de dt
.ta 8 16 24 32 40 48 56 64
..
.ds b B
.ds G G
.ds a '
.ds - -
.ds _ _
.ds v |
.ds p J
.ds r
.ds g `
.ds X X
.ds u u
.ds > ->
.ds |

View File

@@ -0,0 +1,40 @@
.TH XCON 1 local
.SH NAME
xcon \- convert Unidot Z8000 object file to x.out format
.SH SYNOPSIS
.B xcon
[
.B \-o
outfile
] [
.B \-s
]
.RB file .obj
.SH DESCRIPTION
.I Xcon
reads the Unidot object file
.IB file .obj
and outputs the equivalent file in x.out format.
If the
.B \-o
option is given, the output goes to the specified
.IR outfile ;
otherwise the default
.B x.out
is used.
The output file is executable if it contains no unresolved external
references.
.PP
.I Xcon
marks its output file as segmented if it encounters any Z8001-only
relocation entries during the conversion; otherwise the output
is marked as non-segmented.
The
.B \-s
option will force a segmented output file regardless of the input.
.SH FILES
x.out
.SH SEE ALSO
asz8k(1), x.out(5)
.SH DIAGNOSTICS
Self-explanatory.

View File

@@ -0,0 +1,66 @@
XCON(1) Zilog XCON(1)
NAME
xcon - convert Unidot Z8000 object file to x.out format
SYNOPSIS
xcon [ -o outfile ] [ -s ] file.obj
DESCRIPTION
_X_c_o_n reads the Unidot object file _f_i_l_e.obj and outputs the
equivalent file in x.out format. If the -o option is given,
the output goes to the specified _o_u_t_f_i_l_e; otherwise the
default x.out is used. The output file is executable if it
contains no unresolved external references.
_X_c_o_n marks its output file as segmented if it encounters any
Z8001-only relocation entries during the conversion; other-
wise the output is marked as non-segmented. The -s option
will force a segmented output file regardless of the input.
FILES
x.out
SEE ALSO
asz8k(1), x.out(5)
DIAGNOSTICS
Self-explanatory.
1 local 1

View File

@@ -0,0 +1,330 @@
x.out(5) Object Module Format x.out(5)
NAME
x.out - Z8000 C Compiler, assembler, and link editor output
SYNOPSIS
#include <x.out.h>
DESCRIPTION
_x._o_u_t is the output file of the Z8000 C Compiler _c_8_k, assembler
_a_8_k, and the link editor _l_8_k. The same format is used as input
to the link editor. It is capable of describing object modules
both for the Z8001 and the Z8002. The layout of the file is the
folllowing:
+----------------------+
| header |
+----------------------+
| segment |
| description |
+----------------------+
| code and |
| data |
| segments |
+----------------------+
| relocation |
| data |
| (if present) |
+----------------------+
| symbol |
| table |
| (if present) |
+----------------------+
There can be a multiplicity of code and data segments which will
appear in the file in the order that they are described in the
header. The normal output of the linker will have all the code
segments preceding the data segments, but this may not neces-
sarily be the case for output of the compiler and the assembler.
Each of these sections will now be described.
- 1 -
x.out(5) Object Module Format x.out(5)
_H_e_a_d_e_r
struct x_hdr {
short x_magic; /* magic number */
short x_nseg; /* number of segments in file */
long x_init; /* length of initialized part of file */
long x_reloc; /* length of relocation part of file */
long x_symb; /* length of symbol table part of file */
};
_S_e_g_m_e_n_t _D_e_s_c_r_i_p_t_i_o_n_s
struct x_sg {
char x_sg_no; /* assigned number of segment */
char x_sg_typ; /* type of segment */
unsigned x_sg_len; /* length of segment */
} x_sg[]; /* array of size x_nseg */
Valid magic numbers:
#define X_SU_MAGIC 0xEE00 /* segmented, non executable */
#define X_SX_MAGIC 0xEE01 /* segmented, executable */
#define X_NU_MAGIC 0xEE02 /* non-seg, non executable */
#define X_NXN_MAGIC 0xEE03 /* non-seg, executable, non-shared */
#define X_NXS_MAGIC 0xEE07 /* non-seg, executable, shared */
#define X_NXI_MAGIC 0xEE0B /* non-seg, executable, split ID */
The number of segments in the file is a count of the number of
entries in the array of segment information that immediately
following the base portion of the header. The length of the in-
itialized portion of the file is the byte count (which is always
even) of the code, constant pool, and initialized data in the
file.
The length of the relocation portion of the file is the byte
count (always even) of the size of the relocation data. If the
file has been finally linked, this will normally be zero. The
length of the symbol table portion of the file is the byte count
(always even) of the size of the symbol table. If the file has
been stripped, this will be zero.
The segment number in the segment information array is either a
pre-assigned segment number in the range of 0-127, or the number
255. A segment number of 255 indicates that it may be assigned
any segment desired by the linker or the loader.
- 2 -
x.out(5) Object Module Format x.out(5)
The segment type indicates the content of the associated seg-
ments in the file in accordance with the following keys:
#define X_SG_BSS 1 /* non-initialized data segment,
the corresponding portion of
the file is not present */
#define X_SG_STK 2 /* stack segment, no data in file */
#define X_SG_COD 3 /* code segment */
#define X_SG_CON 4 /* constant pool */
#define X_SG_DAT 5 /* initialized data */
#define X_SG_MXU 6 /* mixed code-data, not protectable */
#define X_SG_MXP 7 /* mixed code-data, protectable */
The bss and stack types have no associated data in the file.
The execution length is given by s_sg_len.
The mixed types are for convenience in "romming" code and data.
Clearly no mixed segment is allowed if the Z8000 is being
operated as a split I and D space machine. A mixed type that is
not protectable indicates that the code may need to store into
the data items. A mixed type that is protectable may be safely
put into ROM.
_R_e_l_o_c_a_t_i_o_n _S_e_c_t_i_o_n
The relocation section of the file consists of a series of
structures each describing some item to be relocated. The relo-
cation items are in the following form:
struct x_rel { /* relocation item */
char x_rl_sgn; /* segment with item to be relocated */
char x_rl_flg; /* relocation type (see below) */
unsigned x_rl_loc; /* location of item to be relocated */
unsigned x_rl_bas; /* number of (external) element in symbol table
or (internal) segment by which to relocate */
};
The segment number referred to in the preceding is the ordinal
(starting with 0) of the segment, in this file, containing the
item to be relocated. This number must be less than x_segn in
the header.
The relocation flags are interpreted as follows:
#define X_RL_OFF 1 /* adjust a 16 bit offset value only */
#define X_RL_SSG 2 /* adjust a short form seg plus offset */
#define X_RL_LSG 3 /* adjust a long form (32 bit) seg plus off */
#define X_RL_XOF 5 /* adjust a 16 bit offset by an external */
#define X_RL_XSSG 6 /* adjust a short seg ref by an external */
#define X_RL_XLSG 7 /* adjust a long seg ref by an external */
- 3 -
x.out(5) Object Module Format x.out(5)
The first three cases above are references between segments in
the current file, hence the relocation value is that of the
relevant segment number where the segment number is that by
which the segment is known in this file. The last three cases
reference some item not defined in this file and must be made by
reference to the symbol table. Note particularly that while
provision is made for constructing a short external segment
reference, there is no way that the C compiler can generate
such.
_S_y_m_b_o_l _T_a_b_l_e
#define XNAMELN 8 /* length of a symbol */
struct x_sym {
char x_sy_sg; /* the segment number */
char x_sy_fl; /* the type of entry */
unsigned x_sy_val; /* the value of this entry */
char x_sy_name[XNAMELN]; /* the symbol name, null padded */
};
The segment number is the segment number (in this file) contain-
ing the symbol if it is defined in this file. Tt is 255 if ei-
ther the value is absolute, or the value is an external refer-
ence.
The type of entry is defined by the following flags:
#define X_SY_LOC 1 /* local symbol (for debug only) */
#define X_SY_UNX 2 /* undefined external entry */
#define X_SY_GLB 3 /* global definition */
#define X_SY_SEG 4 /* segment name */
Interpretation of the flags:
local symbol -- this merely makes a symbol table entry for
the use of the debugging system, and does
not influence linking.
und external -- this represents a reference to an external
symbol that should be present in some other
module. If the associated value field is
not zero, however, the linker is requested
to allocate space for it.
global -- this represents a symbol (either absolute or
relocatable) that is defined in the current
module.
The value field is either the amount of space to be allocated
(for undefined external) or the offset in the segment where the
symbol is located.
- 4 -
x.out(5) Object Module Format x.out(5)
_S_e_g_m_e_n_t _N_a_m_e_s
The default names for the standard sections are
__text first (or only) text segment
__text[1..] subsequent text segments
__data first data segment
__data[1..] subsequent data segments
__bss first uninitialized data (bss) segment
__bss[1...] subsequent bss segments
Of course, the assembler makes provision for naming segments.
This is for the purpose of prescribing to the loader which seg-
ments are to be jointly loaded. However, the segment numbers
that are assigned to the segments during assembly are not neces-
sarily the final segment numbers that are produced by the
loader. There will be a loader provision for forcing the
correspondence between segment names and numbers.
_F_i_l_e _S_i_z_e
The size of the object file (in bytes) is given by
sizeof( struct x_hdr )
+ x_nseg * sizeof( struct x_sg )
+ x_init
+ x_reloc
+ x_symb
- 5 -

View File

@@ -0,0 +1,273 @@
.de pp
.fi
.sp1
.ne2
..
.th x.out 5 "Object Module Format"
.na
.sh NAME
x.out - Z8000 C Compiler, assembler, and link editor output
.sh SYNOPSIS
#include <x.out.h>
.sh
DESCRIPTION
.ul
x.out
is the output file of the Z8000 C Compiler
.ul
c8k,
assembler
.ul
a8k,
and the link
editor
.ul
l8k.
The same format is used as input to the link editor. It is capable
of describing object modules both for the Z8001 and the Z8002. The
layout of the file is the folllowing:
.in+15
.nf
+----------------------+
| header |
+----------------------+
| segment |
| description |
+----------------------+
| code and |
| data |
| segments |
+----------------------+
| relocation |
| data |
| (if present) |
+----------------------+
| symbol |
| table |
| (if present) |
+----------------------+
.fi
.in-15
There can be a multiplicity of code and data segments which will appear
in the file in the order that they are described in the header. The
normal output of the linker will have all the code segments preceding
the data segments, but this may not necessarily be the case for output
of the compiler and the assembler.
.sp3
Each of these sections will now be described.
.bp
.ul
Header
.nf
struct x_hdr {
short x_magic; /* magic number */
short x_nseg; /* number of segments in file */
long x_init; /* length of initialized part of file */
long x_reloc; /* length of relocation part of file */
long x_symb; /* length of symbol table part of file */
};
.ul
Segment Descriptions
struct x_sg {
char x_sg_no; /* assigned number of segment */
char x_sg_typ; /* type of segment */
unsigned x_sg_len; /* length of segment */
} x_sg[]; /* array of size x_nseg */
Valid magic numbers:
#define X_SU_MAGIC 0xEE00 /* segmented, non executable */
#define X_SX_MAGIC 0xEE01 /* segmented, executable */
#define X_NU_MAGIC 0xEE02 /* non-seg, non executable */
#define X_NXN_MAGIC 0xEE03 /* non-seg, executable, non-shared */
#define X_NXS_MAGIC 0xEE07 /* non-seg, executable, shared */
#define X_NXI_MAGIC 0xEE0B /* non-seg, executable, split ID */
.pp
The number of segments in the file is a count of the number of entries in
the array of segment information that immediately following the base
portion of the header.
The length of the initialized portion of the file is the byte count (which
is always even) of the code, constant pool, and initialized data in the
file.
.pp
The length of the relocation portion of the file is the byte count (always
even) of the size of the relocation data. If the file has been finally
linked, this will normally be zero.
The length of the symbol table portion of the file is the byte count (always
even) of the size of the symbol table. If the file has been stripped,
this will be zero.
.pp
The segment number in the segment information array is either a
pre-assigned segment number in the range of 0-127, or the number 255.
A segment number of 255 indicates that it
may be assigned any segment desired by the linker or the loader.
.bp
.pp
The segment type indicates the content of the associated segments in
the file in accordance with the following keys:
.nf
#define X_SG_BSS 1 /* non-initialized data segment,
the corresponding portion of
the file is not present */
#define X_SG_STK 2 /* stack segment, no data in file */
#define X_SG_COD 3 /* code segment */
#define X_SG_CON 4 /* constant pool */
#define X_SG_DAT 5 /* initialized data */
#define X_SG_MXU 6 /* mixed code-data, not protectable */
#define X_SG_MXP 7 /* mixed code-data, protectable */
.pp
The bss and stack types have no associated data in the file.
The execution length is given by s_sg_len.
.pp
The mixed types are for convenience in "romming" code and data.
Clearly no mixed segment is allowed if the Z8000 is being operated as a split
I and D space machine. A mixed type that is not protectable indicates
that the code may need to store into the data items. A mixed type that
is protectable may be safely put into ROM.
.ul
Relocation Section
.pp
The relocation section of the file consists of a series of structures
each describing some item to be relocated. The relocation items are
in the following form:
.nf
struct x_rel { /* relocation item */
char x_rl_sgn; /* segment with item to be relocated */
char x_rl_flg; /* relocation type (see below) */
unsigned x_rl_loc; /* location of item to be relocated */
unsigned x_rl_bas; /* number of (external) element in symbol table
or (internal) segment by which to relocate */
};
.pp
The segment number referred to in the preceding is the ordinal (starting
with 0) of the segment, in this file, containing the item to be relocated.
This number must be less than x_segn in the header.
.pp
The relocation flags are interpreted as follows:
.nf
#define X_RL_OFF 1 /* adjust a 16 bit offset value only */
#define X_RL_SSG 2 /* adjust a short form seg plus offset */
#define X_RL_LSG 3 /* adjust a long form (32 bit) seg plus off */
#define X_RL_XOF 5 /* adjust a 16 bit offset by an external */
#define X_RL_XSSG 6 /* adjust a short seg ref by an external */
#define X_RL_XLSG 7 /* adjust a long seg ref by an external */
.pp
The first three cases above are references between segments in the current
file, hence the relocation value is that of the relevant segment number
where the segment number is that by which the segment is known in this file.
The last three cases reference some item not defined in this file
and must be made by reference to the symbol table.
Note particularly that while provision is made for
constructing a short external segment reference, there is no way that
the C compiler can generate such.
.ul
Symbol Table
.nf
#define XNAMELN 8 /* length of a symbol */
struct x_sym {
char x_sy_sg; /* the segment number */
char x_sy_fl; /* the type of entry */
unsigned x_sy_val; /* the value of this entry */
char x_sy_name[XNAMELN]; /* the symbol name, null padded */
};
.pp
The segment number is the segment number (in this file) containing the
symbol if it is defined in this file. Tt is 255 if either the value is
absolute, or the value is an external reference.
.pp
The type of entry is defined by the following flags:
.nf
#define X_SY_LOC 1 /* local symbol (for debug only) */
#define X_SY_UNX 2 /* undefined external entry */
#define X_SY_GLB 3 /* global definition */
#define X_SY_SEG 4 /* segment name */
.fi
Interpretation of the flags:
.in+20
.ti-16
local symbol -- this merely makes a symbol table entry for the use of
the debugging system, and does not influence linking.
.ti-16
und external -- this represents a reference to an external symbol that
should be present in some other module. If the associated
value field is not zero, however, the linker is requested
to allocate space for it.
.ti-16
global -- this represents a symbol (either absolute or relocatable)
that is defined in the current module.
.in-20
The value field is either the amount of space to be allocated (for
undefined external) or the offset in the segment where the symbol is
located.
.ul
Segment Names
.pp
The default names for the standard sections are
.in+10
.nf
__text first (or only) text segment
__text[1..] subsequent text segments
__data first data segment
__data[1..] subsequent data segments
__bss first uninitialized data (bss) segment
__bss[1...] subsequent bss segments
.in-10
.fi
.pp
Of course, the assembler makes provision for naming segments. This is
for the purpose of prescribing to the loader which segments are to be
jointly loaded. However, the segment numbers that are assigned to the
segments during assembly are not necessarily the final segment numbers
that are produced by the loader. There will be a loader provision for
forcing the correspondence between segment names and numbers.
.ul
File Size
.pp
The size of the object file (in bytes) is given by
.nf
sizeof( struct x_hdr )
+ x_nseg * sizeof( struct x_sg )
+ x_init
+ x_reloc
+ x_symb

View File

@@ -0,0 +1,132 @@
zcc(1) C Compiler for Z8000 zcc(1)
NAME
zcc - C compiler
SYNOPSIS
zcc [ option ] ... file ...
DESCRIPTION
zcc is a fast optimizing C compiler. Its interface is nearly
completely compatible with most UNIX C compilers though there
are substantial differences in internal strategy. The language
supported is that of the Kernighan and Ritchie book referenced
below with the addition of field initialization and structure
assignment.
zcc is capable of operating in several modes. It can generate
code for both the Z8001 (segmented) and the Z8002 (non-
segmented) versions of the Z8000. See the -m option for de-
tails.
zcc accepts several types of arguments: Arguments whose names
end with `.c' are taken to be C source programs; they are com-
piled, and each object program is left on the file whose name is
that of the source with `.o' substituted for `.c'. Under CP/M,
only one C source file may be compiled per execution of zcc.
The following options are interpreted by zcc:
-c Suppress the loading phase of the compilation, and force
an object file to be produced even if only one program
is compiled.
-m<digit>
This is used to set the mode of the compiler. The digit
is interpreted in the following way:
0 - Z8001, 16 bit ints, 32 bit pointers, x.out output
1 - Z8002, 16 bit ints, 16 bit pointers, x.out output (default)
2 - Z8002, 16 bit ints, 32 bit pointers, x.out output
-w Suppress most of the warning messages in the compiler.
This turns off stringent type checking that is now
fashionable.
-s Compile the named C programs, and leave pseudo-assembly
language output on corresponding files suffixed `.s'.
As cc8k generates binary load modules directly without
an intermediate assembly language representation, this
option produces a disassembly listing of the generated
- 1 -
zcc(1) C Compiler for Z8000 zcc(1)
code.
-o output Name the final output file _o_u_t_p_u_t. If this op-
tion is used the file `x.out' will be left undisturbed.
-d name=def
-d name
Define the _n_a_m_e to the preprocessor, as if by `#define'.
If no definition is given, the name is defined as 1.
-u name
Remove any initial definition of _n_a_m_e.
-[0123]string
Pass _s_t_r_i_n_g as debug flags to subsequent passes of the
compiler. Flags for pass one begin with the digit `1';
flags for pass two with `2', and so forth. The digit
`0' is used for debug flags to the _z_c_c control program
itself. Flags for multiple passes may be concatenated.
FILES
file.c input file
file.o object file
p2file compiler temporary (transient)
treefile compiler temporary (transient)
p3file compiler temporary (transient)
zcc.z8k compiler command interpeter
zcc[123].z8k compiler executable files
SEE ALSO
B. W. Kernighan and D. M. Ritchie, _T_h_e _C _P_r_o_g_r_a_m_m_i_n_g
_L_a_n_g_u_a_g_e, Prentice-Hall, 1978
D. M. Ritchie, C Reference Manual
ld8k(1), asz8k(1), ar8k(1)
DIAGNOSTICS
The diagnostics produced by C itself are intended to be
self-explanatory.
BUGS
No support for unsigned types other than short integers.
- 2 -

View File

@@ -0,0 +1,125 @@
.th zcc 1 "C Compiler for Z8000"
.na
.sh NAME
zcc \- C compiler
.sh SYNOPSIS
zcc [ option ] ... file ...
.sh DESCRIPTION
zcc is a fast optimizing C compiler.
Its interface is nearly completely compatible with most UNIX C
compilers though there are substantial differences in internal
strategy.
The language supported is that of the Kernighan and Ritchie
book referenced below with the addition of field initialization
and structure assignment.
zcc is capable of operating in several modes. It can generate code
for both the Z8001 (segmented) and the Z8002 (non-segmented) versions
of the Z8000. See the -m option for details.
zcc accepts several types of arguments:
Arguments whose names end with `.c' are taken to be
C source programs; they are compiled, and
each object program is left on the file
whose name is that of the source with `.o' substituted
for `.c'.
Under CP/M, only one C source file may be compiled per execution
of zcc.
The following options are interpreted by zcc:
.in+8
.ti-5
-c\ \ \ Suppress the loading phase of the compilation, and force
an object file to be produced even if only one program is compiled.
.ti-5
-m<digit>
.br
This is used to set the mode of the compiler. The digit is interpreted
in the following way:
.nf
0 - Z8001, 16 bit ints, 32 bit pointers, x.out output
1 - Z8002, 16 bit ints, 16 bit pointers, x.out output (default)
2 - Z8002, 16 bit ints, 32 bit pointers, x.out output
.fi
.ti-5
-w\ \ \ Suppress most of the warning messages in the compiler. This
turns off stringent type checking that is now fashionable.
.ti-5
-s\ \ \ Compile the named C programs, and leave
pseudo-assembly language output on corresponding files suffixed `.s'.
As cc8k generates binary load modules directly without
an intermediate assembly language representation, this option
produces a disassembly listing of the generated code.
.ti-5
-o output\ \ \ Name the final output file
.ul
output.
If this option is used the file `x.out' will be left undisturbed.
.ti-5
-d name=def
.ti-5
-d name
.br
Define the
.ul
name
to the preprocessor,
as if by `#define'.
If no definition is given, the name is defined as 1.
.ti-5
-u name
.br
Remove any initial definition of
.ul
name.
.ti-5
-[0123]string
.br
Pass
.ul
string
as debug flags to subsequent passes of the compiler. Flags for pass
one begin with the digit `1'; flags for pass two with `2', and so forth.
The digit `0' is used for debug flags to the
.ul
zcc
control program itself.
Flags for multiple passes may be concatenated.
.sh FILES
file.c input file
.br
file.o object file
.br
\ p2file compiler temporary (transient)
.br
\ treefile compiler temporary (transient)
.br
\ p3file compiler temporary (transient)
.br
zcc.z8k compiler command interpeter
.br
zcc[123].z8k compiler executable files
.sh "SEE ALSO"
B. W. Kernighan and D. M. Ritchie,
.ul
ThIq
This directory contains documents from the System Guide, edited to change