Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Zero page (CP/M)

From Wikipedia, the free encyclopedia

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

The equivalent structure inDOS is theProgram Segment Prefix (PSP), a 256-byte (page-sized) structure, which is by default located exactly before offset 0 of the program's load segment, rather than in segment 0. A segment register is initialised to 0x10 less than the code segment, in order to address it.

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

OffsetSizeContents
00–02CodeExit program (jumps to theBIOS, and is also used to find BIOS entry points).[1]
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.[1]
08–3ACode8080 restart/interrupt vectors.
3B–3FBytesReserved
40–4FBytesReserved for use by the BIOS[2]
50ByteThe drive from which the program was loaded (CP/M 3)
51–52WordAddress of the password for the firstFCB (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–5BBytesReserved
5C–6BDefault FCB 1
6C–7FDefault FCB 2 (overwritten if FCB 1 is opened)
80ByteNumber of characters in command tail.
81–FFBytesCommand tail (everything after the program name).

InCP/M-86, the structure is:

OffsetSizeContents
00–02BytesLength of code group in bytes
03–04WordSegment address of code group
05Byte8080 model flag - set if program only has one segment
06–08BytesLength of data group in bytes
09–0AWordSegment address of data group
0BByteReserved
0C–11Descriptor for extra group - same format as for data
12–17Descriptor for stack group
18–1DDescriptor for X1 group
1E–23Descriptor for X2 group
24–29Descriptor for X3 group
2A–2FDescriptor for X4 group
30–4FBytesReserved
50ByteThe 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–5BBytesReserved
5C–6BDefault FCB 1
6C–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

[edit]

References

[edit]
  1. ^abTaylor, Roger; Lemmons, Phil (June 1982)."Upward migration - Part 1: Translators - Using translation programs to move CP/M-86 programs to CP/M and MS-DOS" [Using translation programs to move CP/M programs to CP/M-86 and MS-DOS](PDF).BYTE. Vol. 7, no. 6.BYTE Publications Inc. pp. 321–322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344 [342, 344].ISSN 0360-5280.CODEN BYTEDJ.Archived(PDF) from the original on 2020-01-16. Retrieved2020-01-15.[…] Gaining Access toCP/M-86 […] Gaining access to CP/M-86 requires placing the function code in the CL register, placing the byte parameter in the DL register or placing the word parameter in the DX register, placing the data segment in the DS register (the data segment is usually not changed for a converted program), and executing a software interrupt,INT #224. The result is returned in the AL register if it is a byte value; if the result is a word value, it is returned in both the AX and BX registers. Double-word values are returned with the offset in the BX registers and the segment in the ES register. Conversion of programs fromCP/M-80 to CP/M-86, then, requires replacing the call to location 5 with the software interrupt INT #224. Another necessary change involves thewarm boot. Under CP/M-80, the warm boot may be accessed by a system call with a function code of 0 for a jump to location 0. CP/M-86, however, does not support the jump to location 0. As a result, you must change this program exit in the translated program if the program is to run correctly. Provided that the call to location 5 is replaced with INT #224, that the warm boot change is made, and that the registers are mapped correctly, there should be little problem in getting the translated program to access the CP/M-86 system functions. […] Gaining Access toMS-DOS […] Although MS-DOS has a "preferred" mechanism through a soft-ware interrupt,INT #33, for accessing the system, an additional mechanism is provided for "preexisting" programs that is compatible with CP/M-80 calling conventions, at least for functions in the range of 0-36. As far as system calls within the allowed function range are concerned, the programmer doesn't have to do anything to translated programs to get them to run under MS-DOS other than to correctly map the registers. MS-DOS also supports the warm boot function of CP/M-80. A jump to location 0 under MS-DOS executes a software interrupt,INT #32, which is functionally a program end and the normal way to exit from a program. […][1][2][3][4][5][6][7][8][9][10][11][12][13][14] (13 pages)
  2. ^CP/M 2.0 Alteration Guide(PDF). Digital Research. 1979. p. 23.

Further reading

[edit]


People
Products
Programming
languages
Software,
technology
Operating systems
Related
Retrieved from "https://en.wikipedia.org/w/index.php?title=Zero_page_(CP/M)&oldid=1264564563"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp