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.

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

OffsetSizeContents00–02CodeExit program (jumps to the BIOS, and is also used to find BIOS entry points).03ByteI/O byte, an optional feature allowing device reassignment in CP/M 2.04ByteCurrent command processor drive (low 4 bits) and user number (high 4 bits).05–07CodeJump 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–3ACode8080 restart/interrupt vectors.3B–3FBytesReserved40–4FBytesReserved for use by the BIOS50ByteThe drive from which the program was loaded (CP/M 3)51–52WordAddress of the password for the first FCB (CP/M 3)53ByteLength of the password for the first FCB (CP/M 3)54–55WordAddress of the password for the second FCB (CP/M 3)56ByteLength of the password for the second FCB (CP/M 3)57–5BBytesReserved5C–6BDefault FCB 16C–7FDefault FCB 2 (overwritten if FCB 1 is opened)80ByteNumber of characters in command tail.81–FFBytesCommand tail (everything after the program name).

In CP/M-86, the structure is:

OffsetSizeContents00–02BytesLength of code group in bytes03–04WordSegment address of code group05Byte8080 model flag - set if program only has one segment06–08BytesLength of data group in bytes09–0AWordSegment address of data group0BByteReserved0C–11Descriptor for extra group - same format as for data12–17Descriptor for stack group18–1DDescriptor for X1 group1E–23Descriptor for X2 group24–29Descriptor for X3 group2A–2FDescriptor for X4 group30–4FBytesReserved50ByteThe drive from which the program was loaded (CP/M 3)51–52WordAddress of the password for the first FCB (CP/M 3)53ByteLength of the password for the first FCB (CP/M 3)54–55WordAddress of the password for the second FCB (CP/M 3)56ByteLength of the password for the second FCB (CP/M 3)57–5BBytesReserved5C–6BDefault FCB 16C–7FDefault FCB 2 (overwritten if FCB 1 is opened)80ByteNumber of characters in command tail.81–FFBytesCommand tail (everything after the program name).

See also Zero page (processor property) Page boundary relocation

References (13 pages)

Further reading - in particular: