CP/M-86 1.1 information

The following information was derived by disassembling CP/M-86. It does not hold for later versions such as DOSPLUS.

Disc devices and INT E6

INT E6 is called by CP/M-86 1.1 when an unknown disc drive is used. The following parameters are used:

AX   = function. 0 for SELDSK
                 1 for READ
                 2 for WRITE
                 3 for HOME
DX:BX = Parameter block address

The parameter block

+0	DB	drive_number	;0 for 1st unknown drive
				;1 for 2nd etc.
+1	DB	deblock_flag	;0 for normal write
				;1 for directory write
				;2 for write with no preread
+2	DW	track		;Set with SETTRK
+4	DW	sector		;Set with SETSEC
+6	DD	DMA_address	;DWORD address
+10	DB	verify_flag	;non-zero if writes should be verified

Values returned should be in AX.

In CP/M-86 1.1, the actual drive number (0 for A: 1 for B: etc) is at parameter-block - 1.

Since INT E6 conflicts with DOSEMU, I have written a patch to move this functionality to INT E7.


CP/M-86 1.1 BIOS jumpblock

All functions expect to be called with DS = CP/M-86 data segment. To ensure this is the case, call BIOS using the BDOS function 50 instead of using these directly.

In CP/M-86 1.x, this jumpblock will be at 2500h in the CP/M code segment (the segment of the INT E0h handler).

All jumps are short jumps. The jumpblock starts the same as CP/M-80 v2:

	JMP	BOOT
	JMP	WBOOT
	JMP	CONST
	JMP	CONIN
	JMP	CONOUT
	JMP	LIST
	JMP	PUNCH
        JMP     READER
	JMP	HOME
	JMP	SELDSK
	JMP	SETTRK
	JMP	SETSEC
	JMP	SETDMA
	JMP	READ
	JMP	WRITE
	JMP	LISTST
	JMP	SECTRAN
and then continues:
	JMP	SETDMAB ;Set DMA segment
	JMP	GETSEGB ;Get offset of memory region table
	JMP	GETIOB ;Get I/O byte
	JMP	SETIOB ;Set I/O byte
	DEFS	15     ;Five reserved entries

In the IBM PC implementation, there then follow a number of interesting offsets. These may not be present in other implementations of CP/M-86:

	DW	OFFSET FUNKEY ;Function key table
	DW	OFFSET BIOSDK ;BIOS disc parameters
	DW	OFFSET USART  ;USART parameters
	DW	OFFSET DEVICE ;Device data
	DW	OFFSET FIDDS  ;FIDD data
	DW	OFFSET SCREEN ;Screen data

SETDMAB

Set the segment of the DMA address used for disc transfers. Enter with CX = DMA segment.

GETSEGB

Returns the offset of the BIOS memory region table in BX. This contains the list of memory available to load programs. It is formed:

	DB	no_of_blocks
	DW	segment_1
	DW	length_1
	DW	segment_2
	DW	length_2
	...

Normally this contains just one block - the TPA. It can hold up to 8 blocks.

GETIOB

Read the I/O byte. In CP/M-86 1.1 for the PC, always returns 0.

SETIOB

Set the I/O byte. In CP/M-86 1.1 for the PC, does nothing.

FUNKEY

Offset of the function key table. This is a series of ASCIIZ strings, at 20-byte intervals. Each string is a character sequence generated by a particular function key. Set by FUNCTION.CMD.

BIOSDK

The offset of a BIOS disc data table. This is one byte before the parameter block for INT E6, and is therefore formed:

+0	DB	drive_number	;Current drive, 1=A: 2=B: etc.
+1      DB      fidd_drive	;0 for 1st unknown drive
                                ;1 for 2nd etc.
+2      DB      deblock_flag    ;0 for normal write
                                ;1 for directory write
                                ;2 for write with no preread
+3      DW      track           ;Set with SETTRK
+5      DW      sector          ;Set with SETSEC
+7      DD      DMA_address     ;DWORD address
+11     DB      verify_flag     ;non-zero if writes should be verified

USART

The offset of a table:

	DB	COM1_setup
	DB	COM2_setup

The format of the setup bytes is explained in the Interrupt List (INT 14h AH=0). They are set by CONFIG.CMD.

DEVICE

The offset of a table:

	DW	conin
	DW	conout
	DW	auxin
	DW	auxout
	DW	list

The values in here are bitmapped - so bit 0 is set if the first device is being used, bit 1 for the second etc. On the PC, device 1 is the keyboard and device 2 is the screen. Set by ASSIGN.CMD.

FIDDS

Points to a data area used for Field Installable Device Drivers:

	DW	Space available	(bytes?)
	DW	Segment reserved for FIDDs
	DW	Offset of DIRBUF - a 128-byte workspace area
	DB	Floppy disc parameters, pointed to by INT 1Eh

SCREEN

The offset of screen data:

	DB	screen mode
	DB	length of entries in data table below (normally 6 bytes)
;The following entries are generated from the mode table below when the 
;mode changes
	DB	screen width	
	DB	video mode to store in the BIOS equipment word (ie: 0, 10h,
		20h or 30h)
	DW	current cursor shape (low byte = bottom scanline, high byte =
		top scanline)
	DW	"cursor on" cursor shape
	DW	"cursor off" cursor shape
	DB	0 if status line off, 0FFh if it is on
	DB	0FFh if in text mode, 0 in graphics mode. This is used as a
		mask for the attribute byte when clearing the screen area 
		occupied by the status line
;8 mode entries, each of length given by the second byte in this area. Each
;entry is formed:
	DB	screen width
	DB	video mode for BIOS equipment word
	DW	"cursor on" cursor shape
	DB	0FFh if status line available, else 0
	DB	0FFh in text mode, 0 in graphics mode
	(extra data?)

Return to archive listing