System information

A responsibility of the SELDSK subroutine is to return the base address of the DPH for the
selected drive. The following sequence of operations returns the table address, with a 0000H
returned if the selected drive does not exist.
NDISKS EQU 4 ;NUMBER OF DISK DRIVES
.......
SELDSK: ;SELECT DISK GIYEN BY BC
LXI H,0000H ;ERROR CODE
MOV A,C ;DRIVE OK?
CPI NDISKS ;CY IF SO
RNC ;RET IF ERROR
;NO ERROR, CONTINUE
MOV L,C ;LOW(DISK)
MOV H,B ;HIGH(DISK)
DAD H
DAD H ;*4
DAD H ;*8
DAD H ;*16
LXI D,DPBASE ;FIRST DP
DAD D ;DPH(DISK)
RET
The translation vectors, XLT00 through XLTn-1, are located elsewhere in the BIOS, and simply
correspond one-for-one with the logical sector numbers zero through the sector count 1. The Disk
Parameter Block (DPB) for each drive is more complex. As shown in Figure 6-4, particular DPB,
that is addressed by one or more DPHS, takes the general form:
+----+----+------+-----+-----+------+----+----+-----+----+
|SPT|BSH|BLM|EXM|DSM|DRM|AL0|AL1|CKS|OFF|
+----+----+------+-----+-----+------+----+----+-----+----+
16B 8B 8B 8B 16B 16B 8B 8B 16B 16B
Figure 6-4. Disk Parameter Block Format
where each is a byte or word value, as shown by the 8b or 16b indicator below the field.
6.10 Disk Parameter Tables CP/M Operating System Manual
6-30