-
Notifications
You must be signed in to change notification settings - Fork 0
/
PUTBIOS.PAS
executable file
·91 lines (74 loc) · 1.91 KB
/
PUTBIOS.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
80
81
82
83
84
85
86
87
88
89
90
91
program PutBios;
(* Modifikation af TRACK0 910223/ Thorbjørn *)
const
BiosSize=78;
FilNavn='B:C.COM';
Skipsectors= 5;
var
check, x: integer;
trans: array[1..26] of byte;
buffer: array[1..BiosSize,1..128] of byte; (* 128 sektorer l{ses *)
indfil: file;
compare,teststr:
array[8..$D] OF CHAR;
PROCEDURE WriteSector( track, sector, dmaindex: BYTE);
begin
write('*');
bios(11,addr(buffer[dmaindex])); (* Set DMA *)
bios(9,track); (* Read track0 *)
bios(10,sector);
if biosb(13)<>0 then
begin
mem[$da37]:=8;
write('WRITE ERROR ON SECTOR ',SECTOR,1/0)
end;
end;
begin
WriteLn('Dette program l{gger en Rc700 bios ned p} system sporet p}');
WriteLn('drev A. Da dette er en testversion skal filen hedde ',FilNavn);
WriteLn;
IF Port(.20.) AND $80<> 0 THEN
BEGIN
WriteLn('Denne version KUN for 8" disketter');
HALT;
END;
for x:=0 to 25 do
trans[(x*6) mod 26+1+x div 13]:=x; (* Beregn SKEW faktor *)
Fill(Buffer, Size(buffer), '+');
assign(indfil, filnavn);
reset(indfil);
Write('L{ser bios fil...');
BlockRead(indfil, buffer, BiosSize, x);
IF NOT Eof(indfil) THEN
BEGIN
WriteLn('Bios for lang');
Close(Indfil);
halt;
END;
Close(indfil);
Move(Buffer[1,$9], teststr, 6);
compare:= ' RC702';
IF TestStr<>compare THEN
BEGIN
WriteLn('Not for Rc702 ');
Halt;
END;
WriteLn('Ok');
WriteLn;
FOR x:=1+skipsectors to BiosSize DO Write('.');
Write(^M);
buffer[($383 div 128)-1,($383 mod 128)+1]:=0; (* Ny base adresse *)
mem[$da37]:=0; (* Set SS *)
bios(8,0); (* Sel dsk a: *)
for x:= 1+ skipsectors to 26 do
writesector(0,trans[x],x); (* Skip configuration sektors *)
mem[$da37]:=24; (* Set SD/DD *)
bios(8,0);
for x:=52 to 103 do writesector(0,x,x-25);
mem[$da37]:=8;
bios(8,0);
writeln;
write('Bios lagt ned. Resetter CP/M...');
Bdos(13);
writeln('F{rdig.');
end.