Wikipedia

Zero page (CP/M)

The Zero Page (or Base Page) is a data structure used in CP/M systems for programs to communicate with the operating system. In 8-bit CP/M versions it is located in the first 256 bytes of memory, hence its name.

The equivalent structure in DOS is the Program Segment Prefix (PSP), a 256-byte structure, which, however, is by default located at offset 0 in the program's load segment (rather than in segment 0) immediately preceding a loaded program.

In 8-bit CP/M, it has the following structure:

Offset Size Contents
00-02 Code Exit program (jumps to the BIOS, and is also used to find BIOS entry points).
03 Byte I/O byte, an optional feature allowing device reassignment in CP/M 2.
04 Byte Current command processor drive (low 4 bits) and user number (high 4 bits).
05-07 Code Jump to CP/M BDOS entry - main system call entry point. This is also the address of the first byte of memory not usable by the program.
08-3A Code 8080 restart/interrupt vectors.
3B-4F Bytes Reserved
50 Byte The drive from which the program was loaded (CP/M 3)
51-52 Word Address of the password for the first FCB (CP/M 3)
53 Byte Length of the password for the first FCB (CP/M 3)
54-55 Word Address of the password for the second FCB (CP/M 3)
56 Byte Length of the password for the second FCB (CP/M 3)
57-5B Bytes Reserved
5C-6B Default FCB 1
6C-7F Default FCB 2 (overwritten if FCB 1 is opened)
80 Byte Number of characters in command tail.
81-FF Bytes Command tail (everything after the program name).

In CP/M-86, the structure is:

Offset Size Contents
00-02 Bytes Length of code group in bytes
03-04 Word Segment address of code group
05 Byte 8080 model flag - set if program only has one segment
06-08 Bytes Length of data group in bytes
09-0A Word Segment address of data group
0B Byte Reserved
0C-11 Descriptor for extra group - same format as for data
12-17 Descriptor for stack group
18-1D Descriptor for X1 group
1E-23 Descriptor for X2 group
24-29 Descriptor for X3 group
2A-2F Descriptor for X4 group
30-4F Bytes Reserved
50 Byte The drive from which the program was loaded (CP/M 3)
51-52 Word Address of the password for the first FCB (CP/M 3)
53 Byte Length of the password for the first FCB (CP/M 3)
54-55 Word Address of the password for the second FCB (CP/M 3)
56 Byte Length of the password for the second FCB (CP/M 3)
57-5B Bytes Reserved
5C-6B Default FCB 1
6C-7F Default FCB 2 (overwritten if FCB 1 is opened)
80 Byte Number of characters in command tail.
81-FF Bytes Command tail (everything after the program name).

See also

  • Zero page (processor property)
  • Page boundary relocation

References

  • "Tim Olmstead Memorial CP/M library". Archived from the original on 2017-08-20. Retrieved 2017-08-20. - in particular:

External links

This article is copied from an article on Wikipedia® - the free encyclopedia created and edited by its online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of Wikipedia® encyclopedia articles provide accurate and timely information, please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.

Copyright © 2003-2025 Farlex, Inc Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.