-
Notifications
You must be signed in to change notification settings - Fork 0
/
BIOSDISK.PAS
79 lines (68 loc) · 1.71 KB
/
BIOSDISK.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{ Interrupt 13h Floppy fonctions }
{ By FreddyV }
UNIT BIOSDisk;
{$A+,Q-,R-,S-}
INTERFACE
TYPE Byte9k=Array[1..9216] of Byte;
VAR
Floppy_error : Byte;
Function BIOS_InitFloppy(FId:Byte) : Byte;
Function BIOS_FloppyReadSector(FId:Byte;Head:Byte;Track:Byte;Sector:Byte;SectorNb:Byte;Buffer:Byte9k):Byte;
IMPLEMENTATION
{bit(s) Description
15-14 Number of parallel devices.
13 Reserved.
12 Game port installed.
11-9 Number of serial devices.
8 Reserved.
7-6 Number of floppy disk drives (minus 1):
00 single floppy disk;
01 two floppy disks;
10 three floppy disks;
11 four floppy disks.
5-4 Initial video mode:
00 EGA,VGA,PGA, or other with on-board video BIOS;
01 40x25 CGA color.
10 80x25 CGA color (emulator default).
11 80x25 mono text.
3 Reserved.
2 PS/2 mouse is installed.
1 Math coprocessor installed.
0 Set when booted from floppy. }
Function BIOS_FloppyNb : Byte; Assembler;
ASM
INT 11h
TEST AL,00000001b
JZ @NoFloppy { Bit 0=0 }
MOV CL,6
SHR AL,CL
AND AL,00000011b
INC AL
JMP @FNEnd
@NoFloppy:
XOR AX,AX
@FNEnd:
End; {BIOS_FloppyNb}
Function BIOS_InitFloppy(FId:Byte) : Byte; Assembler;
ASM
XOR AH,AH
MOV DL,FId
INT 13h
MOV AL,AH
MOV Floppy_Error,AL
End; {BIOS_InitFloppy}
Function BIOS_FloppyReadSector(FId:Byte;Head:Byte;Track:Byte;Sector:Byte;SectorNb:Byte;Buffer:Byte9k):Byte; Assembler;
ASM
MOV AH,02h
MOV AL,SectorNb
MOV CH,Track
MOV CL,Sector
MOV DH,Head
MOV DL,FId
AND DL,1 { Be sure we send 0 or 1 Only as Floppy ID}
LES BX,Buffer
INT 13h
MOV AL,AH
MOV Floppy_Error,AL { Copy the Error code }
End; {BIOS_FloppyNb}
END. { Unit End }