Date : Thu, 28 Jan 1993 20:51:00 GMT
From : pbricker@rdth2.rdth.luc.edu (Preston Bricker)
Subject: BDOS calls
I cannot find who requested it, but here are CP/M BDOS functions
as best as I can read Sol Libes' pocket guide.
Func # Value Passed Value Returned
in C reg in DE or E reg in A or HL reg
Peripheral I/O
0 00 system reset -- --
1 01 console read -- char
2 02 console write E=char --
3 03 reader read -- char
4 04 punch write E=char --
5 05 list write E=char --
6 06 direct con IO (V2.x) E=FFh (input) char
E=char (output) 0=not ready
7 07 get IOBYTE -- IOBYTE
8 08 set IOBYTE E=IOBYTE
9 09 print string string addr --
10 0A read console buffer addr of data buffer --
11 0B get console status -- 00h=not ready
FFh=ready
Disk I/O
12 0C lift head (V1.x) -- --
get version (V2.x) -- HL=vers no.
13 0D reset disk** E=drive no. --
14 0E select disk E=drive no. --
15 0F open file - --
16 10 close file |-FCB addr
17 11 search for file - -dir
18 12 search for next | -- -| 00h valid, FFh not found
19 13 delete file | -*
20 14 read next record |-FCB addr
21 15 write next record |
22 16 create file - dir; FFh=disk full
23 17 rename file old file FCB addr dir; FFh=disk full
24 18 get login vector -- (V1.4) HL=drive code
25 19 get disk number -- A=cdn
26 1A set DMS addr. DMA addr --
27 1B get alloc. vector -- HL=alloc vector
V2.x only
28 1C write protect -- --
29 1D get R/O vector -- HL=R/O vector
30 1E set file attrib. FCB addr dir code
31 1F get addr. disk parms. -- HL=disk parm blk addr
32 20 get/set user code E=FFh (get) current code
E=user code (set) --
33 21 read random error code***
34 22 write random -|FCB addr error code***
35 23 compute file size -|r0,r1,r2 fmt random record field set
36 24 set random record random record field set
V2.2 & later
37 25 reset drive drive vector 0
40 28 write random zero fill FCB addr return code
not used
38 26
39 27
* V1.4 none
** V1.4 initializes system and selects A drive
*** error codes 01 - reading unwritten data
03 - cannot close current extent
04 - seek to unwritten extent
05 - directory overflow (write only)
06 - seek past physical end of disk
char=character
addr=address
dir =directory code
cdn =current drive number (A=0)
dpba=disk parameter block address
pbricker@rdth2.rdth.luc.edu