Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CP/M info program

260 views
Skip to first unread message

Volker Pohlers

unread,
Oct 26, 2009, 3:00:32 PM10/26/09
to
Hi,

does anyone knows a little information program that shows CPM version,
TPA size, usable drive letters, I/O-stat, ... ?

greetings
Volker

Mr Emmanuel Roche, France

unread,
Oct 26, 2009, 6:14:42 PM10/26/09
to
Hello, Volker!

> Does anyone knows a little information program that shows CPM version,


> TPA size, usable drive letters, I/O-stat, ... ?

I must explain that I am a fan of CP/M Plus, not CP/M 2.2 (probably
the OS that you use on your "DDR-Homecomputer"?). But I happen to have
the documentation of the last version of CP/M 2.2 on this Internet
computer. So, I just copied some things.

1) CP/M Version

BDOS Function 12: Return Version Number
Entry parameters:
Register C: 0CH
Returned value:
Register HL: Version number 0028H

The RETURN VERSION NUMBER function provides information that allows
version-independent programming. A 2-byte value is returned, with H =
00H designating the CP/M release. Return version numbers 20H through
27H are designated for all previous CP/M Release 2 versions; 28H
is designated for Personal CP/M Release 1.0. Personal CP/M returns
a hexadecimal 28 in register L. Function 12 is useful for writing
application programs that must run on multiple CP/M products.

2) TPA size

+-----------+
| FDOS |
FBASE: +--+-----+--+
| | CCP | |
| +-----+ |
| |
| TPA |
TBASE: +-----------+
| Page Zero |
BOOT: +-----------+

Figure 1-1. Personal CP/M memory organization

The memory address corresponding to FBASE varies from version to
version, and
is described in the "Personal CP/M System Guide". As seen from the
preceding
diagram, TBASE=0100H and BOOT=0000H, which is the base of Random
Access Memory (RAM). At location BOOT, there is a jump to the
machine code in the BIOS, which performs a system warm start. The
BIOS warm start routine loads and initializes the program
variables necessary to return control to the CCP.
Thus, transient programs need only jump to location BOOT to return
control to
Personal CP/M at the command level. The principal entry point to the
FDOS is
at location 0005H, where there is a jump to FBASE. The address field
at 0006H
contains the value of FBASE, and can be used to determine the
size of
available memory, assuming that a transient program is overlaying the
CCP.


3) Usable drive letters

BDOS Function 24: Return Login Vector
Entry parameters:
Register C: 18H
Returned value:
Register HL: Login vector

The login vector value returned by Personal CP/M is a 16-bit value in
register
pair HL, where the least significant bit of L corresponds to the
first drive
A, and the high-order bit of H corresponds to the 16th drive, P.
A 0 bit
indicates that the drive is not on-line, while a 1 bit marks a drive
that is
actively on-line as a result of an explicit disk drive
selection, or an
implicit drive selec caused by a file operation that specified a non-
zero DR
field. The user should note that compatibility is maintained with
previous
CP/M products, because register A and L contain the same value upon
return.

(ROCHE> The "usable drive letters" change, depending on "logged-in"
drives. Some drives may be physically present, but not logged-in, so
not known to the BDOS. The BIOS has a table of available disk drives,
but BIOS = not portable.)


4) I/O-stat

BDOS Function 7: Auxiliary Input Status
Entry parameters:
Register C: 07H
Returned value:
Register A: Auxiliary input status
00H = no character for input
0FFH = character ready for input

The AUXILIARY INPUT STATUS function returns the value 0FFH in register
A if a
character is ready for input from the logical auxiliary input device,
AUXIN:.
If no character is ready for input, the value 00H is returned.


BDOS Function 8: Auxiliary Output Status
Entry parameters:
Register C: 08H
Returned value:
Register A: Auxiliary Output Status
00H = device not ready for output
0FFH = device ready for output

The AUXILIARY OUTPUT STATUS function returns the value 0FFH in
register A if
the logical auxiliary output device, AUXOUT:, is ready to accept a
character
for output. If the device is not ready for output, the value 00H is
returned.


5) ... ?

Sorry, I did not understood. You will have to practice more your
English.

"Does anyone knows a little information program that..." Well, there
are TONS of old programs in the old CP/M Software Libraries, FOG, and
SIGM. One place is:

http://www.retroarchive.org/cpm/cdrom/

The problem is that what you ask is too general. It is simpler just to
load SID, then try a few subroutines interactively, to see what your
particular version of CP/M 2.2 will return. (If you are really stuck,
ask with a specific question.)

Yours Sincerely,
Mr. Emmanuel Roche, France

Volker Pohlers

unread,
Oct 27, 2009, 8:18:48 AM10/27/09
to
Hello,

Mr Emmanuel Roche, France schrieb:


> I must explain that I am a fan of CP/M Plus, not CP/M 2.2 (probably
> the OS that you use on your "DDR-Homecomputer"?).

That's right.

> But I happen to have
> the documentation of the last version of CP/M 2.2 on this Internet
> computer. So, I just copied some things.

Thank you for that work.

Of course, I know the programmer interfaces of CP/M; the BDOS and BIOS
calls. It is easy to write a short program in assembler that shows cp/m
version number, calculates TPA size and so on.

I need only such a simple program to see the most important details of
the concrete cp/m implementation.

The background is that I am testing different BIOS implementations and
wants to know what I'm dealing with currently.

I think that probably already exists such a program in order not to have
to reinvent, but nothing suitable in oak archive with "info", "cpminfo"
etc. found.

Volker

Message has been deleted

Mr Emmanuel Roche, France

unread,
Oct 27, 2009, 1:11:14 PM10/27/09
to
Hello, Volker!

> I need only such a simple program to see the most important details of

> the concrete CP/M implementation.

Hahaha! The problem is simple: define what is, exactly, "the most
important details of the concrete CP/M implementation"? Me, I wrote
some simple BASIC programs (so as to be portable), describing the
"Page Zero", the RSX and SCB of CP/M Plus, the BDOS and BIOS of CP/M
Plus. Normally, to be portable, a CP/M 2.2 program should only know
the "Page Zero" and the BDOS system calls. As soon as your program
takes into account the BIOS subroutines of a particular computer, it
is system-dependent. However, if you know the version of CP/M, you
can, for example, list the "vectors" of the BIOS. (But if the "system
integrator" added one or more BIOS functions, only the paper doc will
tell you...)

> The background is that I am testing different BIOS implementations and
> wants to know what I'm dealing with currently.

At the time of CP/M and the 8080/Z-80, the documentation was inside
outside physical paper manuals, not inside a HLP file or a register.
Again, you must be more precise. Each (CP/M) BIOS is different. That's
why there are "CP/M BIOS Collections".

> I think that probably already exists such a program in order not to have
> to reinvent, but nothing suitable in oak archive with "info", "cpminfo"
> etc. found.

I am tired, and busy, so I will not scan another time the files
available. Sorry. The way to search is not by looking for "info", but
reading the small explanations on the right side.

To finish, I repeat:

> The problem is that what you ask is too general.

> (If you are really stuck, ask with a *SPECIFIC* question.)

John Elliott

unread,
Oct 27, 2009, 5:16:59 PM10/27/09
to
Volker Pohlers <vpoh...@arcor.de> wrote:
: Hi,

: does anyone knows a little information program that shows CPM version,
: TPA size, usable drive letters, I/O-stat, ... ?

Here's a spur-of-the-moment program that shows:

* Processor type
* CP/M version
* Top of the TPA
* Address of the BIOS

plus, on CP/M 3:

* Address of the BDOS
* Start of common memory
* List of valid drives

<http://www.seasip.demon.co.uk/Cpm/software/sysinfo.zip>

Source is included, if you want to extend it further.

--
John Elliott

Thinks: This is what a nice clean life leads to. Hmm, why did I ever lead one?
-- Bluebottle, in the Goon Show

Mr Emmanuel Roche, France

unread,
Oct 27, 2009, 5:41:47 PM10/27/09
to
Re-Hello, Volker!

> Does anyone knows a little information program that shows...

...the "Page Zero" of CP/M Plus? I made one, a long time ago, for the
Amstrad PCW-8256, when it was a best-seller (8 millions sold!) in
Europe.

Searching for it, I could find "BASEPAGE.BAS", published the 7th of
March 2003, under the title "Base Page of CP/M-86 Plus", but
impossible to find the 8-bit version. It was published, on paper, 20+
years ago, but I could not find it online. So, since I did not
republish it online as an article, I decided to show you only the
output of the program. If there is a demand from a PCW owner, I could
write a "Base Page of CP/M Plus" containing a small introduction, the
output and the source code.

CP/M Plus is just a refinement of CP/M 2.2. Most of the fields of the
"Page Zero" are similar. Have a look below, and see if this kind of
output could interest you. The BASIC program is very simple. I saw
that you wrote several messages about "Delphi": you could rewrite it
in Turbo Pascal (The German Werner Cirsovius is a fan of Turbo Pascal,
and could help you.)

A>mallard pagezero

Mallard-80 BASIC with Jetsam Version 1.29
(c) Copyright 1984 Locomotive Software Ltd
All rights reserved

30061 free bytes


PAGEZERO> Do you want a hardcopy (Y/N) : ? n

Page Zero Areas
---------------

Page Zero is the region of memory located from 0000H to 00FFH.
This region contains several segments of code and data that
are used by transient programs while running under CP/M Plus.

0000H: C3 03 FE ( JMP 0FE03H )

Contains a jump instruction to the BIOS warm start entry point at BIOS-
base + 3.
The address at location 0001H can also be used to make direct BIOS
calls
to the BIOS console status, console input, console output, and list
output
primitive functions.

0003H: 95H

(Reserved)

0004H: 00H

CCP Default User: 0 CCP Default Drive: A

0005H: C3 06 F0 ( JMP 0F006H )

Contains a jump instruction to the BDOS, the LOADER, or to the most
recently
added RSX, and serves two purposes: JMP 0005H provides the primary
entry point
to the BDOS, and LHLD 0006H places the address field of the jump
instruction
in the HL register pair. This value, minus one, is the highest address
of
memory available to the transient program.

0008H: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ................
0018H: ED ED 80 00 02 C9 00 00 ED ED 80 01 02 C9 00
00 ................
0028H: ED ED 80 02 02 C9 00 00 00 00 00 00 00 00 00
00 ................
0038H: 00 00 00 ...

Reserved interrupt locations for Restarts 1-7.

003BH: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ................
004BH: 00 00 00 00 00 .....

(Not currently used - reserved)

0050H: 01H

Identifies the drive from which the transient program was loaded.
A value of one to sixteen identifies drives A through P. (Here: A)

0051H: 0000H

Contains the address of the password field of the first command-tail
operand
in the default DMA buffer beginning at 0080H. The CCP sets this field
to zero
if no password for the first command-tail operand is specified.

0053H: 00H

Contains the length of the password field for the first command-tail
operand.
The CCP also sets this field to zero if no password for the first
command-tail
is specified.

0054H: 0000H

Contains the address of the password field of the second command-tail
operand
in the default DMA buffer beginning at 0080H. The CCP sets this field
to zero
if no password for the second command-tail operand is specified.

0056H: 00H

Contains the length of the password field for the second command-tail
operand.
The CCP also sets this field to zero if no password for the second
command-tail
is specified.

0057H: 00 00 00 00 00 .....

(Not currently used - reserved)

005CH: 00 20 20 20 20 20 20 20 20 20 20 20 00 00 00
00 . ....
006CH: 00 20 20 20 20 20 20 20 20 20 20 20 00 00 00
00 . ....

Default File Control Block, FCB, area 1 initialized by the CCP from
the first
command-tail operand of the command line, if it exists.

006CH: 00 20 20 20 20 20 20 20 20 20 20 20 00 00 00
00 . ....

Default File Control Block, FCB, area 2 initialized by the CCP from
the second
command-tail operand of the command line, if it exists.

Note: this area overlays the last 16 bytes of default FCB area 1. To
use the
information in this area, a transient program must copy it to another
location
before using FCB area 1.

007CH: 00H

Current record position of default FCB area 1. This field is used with
default
FCB area 1 in sequential record processing.

007DH: 00 00 00

Optional default random record position. This field is an extension of
default
FCB area 1 used in random record processing.

0080H: 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ...............
0090H: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ................
00A0H: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ................
00B0H: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ................
00C0H: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ................
00D0H: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ................
00E0H: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ................
00F0H: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ................

Default 128-byte disk buffer. This buffer is also filled with the
command-tail
when the CCP loads a transient program.

Ok
system

A>That's All, Folks!

Bob

unread,
Oct 27, 2009, 5:56:21 PM10/27/09
to
> : does anyone knows a little information program that shows CPM version,
> : TPA size, usable drive letters, I/O-stat, ... ?
>
>   Here's a spur-of-the-moment program that shows:

Nice one John, pretty much what the OP asked for. I certainly like
the DOS protection feature - one I'll probably employ when I start
writing programs for my N8VEM board.

Steve

Steven Hirsch

unread,
Oct 27, 2009, 6:11:34 PM10/27/09
to
Paul Martin wrote:

>> The memory address corresponding to FBASE varies from version to
>> version, and is described in the "Personal CP/M System Guide". As
>> seen from the preceding diagram, TBASE=0100H and BOOT=0000H, which is
>> the base of Random Access Memory (RAM).
>

> I don't think that all CP/M versions have a TBASE of 0x0100. In
> particular, I've got a niggling memory of a version adapted for the
> TRS-80 Model III which had everything relocated to work around the ROM
> and screen memory between 0x0000 and 0x3fff. I don't think it was a
> success.

The original Heath CP/M for H89 ORG'ed at 4300h, if memory serves. That's why
we bought the Magnolia Microsystems version - with a hardware update to bank
out the ROMs after bootstrap.

John Elliott

unread,
Oct 27, 2009, 6:46:46 PM10/27/09
to
Bob <ukp...@ic24.net> wrote:
: Nice one John, pretty much what the OP asked for. I certainly like

: the DOS protection feature - one I'll probably employ when I start
: writing programs for my N8VEM board.

Heh. If I'd had more time, I'd have made it actually give meaningful
information under DOS as well.

The idea is based on the utilities in Simeon Cran's MYZ80 emulator; the
DOS-protection header in those goes one better by not changing any Z80
registers. The magic sequence is EB 52 EB:

XCHG
MOV D,D
XCHG

but that means the DOS code ends up quite a way away from the start of the
program.

More fun can be had with self-extract PMArc archives. Start one with

defb 0EBh, 018h, '-pms-'

and it's treated as a valid archive by the PMA utilities, sends 8086
processors to 011Ah, and Z80 processors to 0130h.

David Knoll

unread,
Oct 28, 2009, 12:50:18 PM10/28/09
to
Volker Pohlers wrote:
> does anyone knows a little information program that shows CPM version,
> TPA size, usable drive letters, I/O-stat, ... ?

There's a program called SURVEY.COM in the disk images for SIMH
AltairZ80. I've also run it on my homebrew boards. It gives the
following output:

A>survey
*** System Survey (June 82) ***

Drive A: 738K bytes in 102 files with 254K bytes remaining

Memory map:
0 8 16 24 32 40 48 56 64
| | | | | | | | |
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTCCCBBBR
T=TPA C=CPM B=BIOS or unassigned R=ROM or bad
BIOS at F203 iobyte E5 drive 00 BDOS at E406

65279 Bytes RAM 256 Bytes ROM 58374 Bytes in TPA
0 Bytes Empty 65535 Total Active Bytes

Active I/O ports:
02 03 08 09 0A
10 11 12 13 14 15 16 17 18 19
28 29 2A 2B
32 33
FD FE FF
24 Ports active

A>

--
David Knoll
Anti-spam: Change 'news' to 'david' for my real address.

Volker Pohlers

unread,
Oct 28, 2009, 2:07:32 PM10/28/09
to
John Elliott schrieb:

> <http://www.seasip.demon.co.uk/Cpm/software/sysinfo.zip>
>

Thank you very very much! That is what I wanted!


Volker

Michael C Finn

unread,
Oct 28, 2009, 11:53:59 PM10/28/09
to

"David Knoll" <ne...@davidknoll.me.uk> wrote in message
news:hc9so6$e9m$1...@news.eternal-september.org...

> Volker Pohlers wrote:
>> does anyone knows a little information program that shows CPM version,
>> TPA size, usable drive letters, I/O-stat, ... ?
>
> There's a program called SURVEY.COM in the disk images for SIMH AltairZ80.
> I've also run it on my homebrew boards.

For those who do not use SIMH AltairZ80, you can find SURVEY4.LBR on the
CP/M CDROM. The library has the source .ASM file and the .COM file ready to
run.

X:/LAMBDA/SOUNDPOT/P/SURVEY4.LBR

On-line mirrors will have it for downloading.

0 new messages