CP/M 2.2 Bios Functions
- 1 BOOT (function 0)
- 2 WBOOT (function 1)
- 3 CONST (function 2)
- 4 CONIN (function 3)
- 5 CONOUT (function 4)
- 6 LIST (function 5)
- 7 PUNCH / AUXOUT (function 6)
- 8 READER (function 7)
- 9 HOME (function 8)
- 10 SELDSK (function 9)
- 11 SETTRK (function 10)
- 12 SETSEC (function 11)
- 13 SETDMA (function 12)
- 14 READ (function 13)
- 15 WRITE (function 14)
- 16 LISTST (function 15)
- 17 SECTRAN (function 16)
BOOT (function 0)
This function is completely implementation-dependent and should never be called from user code.
WBOOT (function 1)
Reloads the command processor and (on some systems) the BDOS as well. How it does this is implementation-dependent; it may use the reserved tracks of a floppy disc or extra memory.
CONST (function 2)
Returns its status in A; 0 if no character is ready, 0FFh if one is.
CONIN (function 3)
Wait until the keyboard is ready to provide a character, and return it in A.
CONOUT (function 4)
Write the character in C to the screen.
LIST (function 5)
Write the character in C to the printer. If the printer isn't ready, wait until it is.
PUNCH / AUXOUT (function 6)
Write the character in C to the "paper tape punch" - or whatever the current auxiliary device is. If the device isn't ready, wait until it is.
This function is called PUNCH in CP/M 2.x, AUXOUT in CP/M 3.
READER (function 7)
Read a character from the "paper tape reader" - or whatever the current auxiliary device is. If the device isn't ready, wait until it is. The character will be returned in A. If this device isn't implemented, return character 26 (^Z).
This function is called READER in CP/M 2.x, AUXIN in CP/M 3.
HOME (function 8)
Move the current drive to track 0.
SELDSK (function 9)
Select the disc drive in register C (0=A:, 1=B: ...). Called with E=0 or 0FFFFh.
If bit 0 of E is 0, then the disc is logged in as if new; if the format has to be determined from the boot sector, for example, this will be done.
If bit 0 if E is 1, then the disc has been logged in before. The disc is not accessed; the DPH address (or zero) is returned immediately.
SELDSK returns the address of a Disc Parameter Header in HL. The exact format of a DPH varies between CP/M versions; note that under CP/M 3, the DPH is in memory bank 0 and probably not visible to programs. If the disc could not be selected it returns HL=0.
SETTRK (function 10)
Set the track in BC - 0 based.
SETSEC (function 11)
Set the sector in BC. Under CP/M 1 and 2 a sector is 128 bytes. Under CP/M 3 the sector size is given in the Disk Parameter Block.
There has been discussion in comp.os.cpm about whether the parameter to this function is a byte or a word. The conclusion (based on examining the BDOS source) was that it is a word.
SETDMA (function 12)
The next disc operation will read its data from (or write its data to) the address given in BC.
READ (function 13)
Read the currently set track and sector at the current DMA address. Returns A=0 for OK, 1 for unrecoverable error, 0FFh if media changed.
WRITE (function 14)
Write the currently set track and sector. C contains a deblocking code:
C=0 - Write can be deferred C=1 - Write must be immediate C=2 - Write can be deferred, no pre-read is necessary. Returns A=0 for OK, 1 for unrecoverable error, 2 if disc is readonly, 0FFh if media changed.
LISTST (function 15)
Return status of current printer device.
Returns A=0 (not ready) or A=0FFh (ready).
SECTRAN (function 16)
Translate sector numbers to take account of skewing.
On entry, BC=logical sector number (zero based) and DE=address of translation table. On exit, HL contains physical sector number. On a system with hardware skewing, this would normally ignore DE and return either BC or BC+1.