Files
Digital-Research-Source-Code/MPM OPERATING SYSTEMS/MPM-86/MPM-86 2.0 SOURCES/07/DSKRST.PLM
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

125 lines
2.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$title ('MP/M-86 2.0 Disk System Reset')
disk$reset:
do;
$include (copyrt.lit)
$include (vaxcmd.lit)
/*
Revised:
19 Jan 80 by Thomas Rolander
02 Sep 81 by Danny Horovitz
*/
declare mpmproduct literally '11h';
declare cpmversion literally '30h';
declare plmstart label public;
/* declare start label;
declare jmp$to$start structure (
jmp$instr byte,
jmp$location address ) data (
0C3H,
.start-3); */
mon1:
procedure (func,info) external;
declare func byte;
declare info address;
end mon1;
mon3:
procedure (func,info) address external;
declare func byte, info address;
end mon3;
declare tbuff (1) byte external;
/**************************************
* *
* B D O S Externals *
* *
**************************************/
print$con$buffer:
procedure (sadr);
declare sadr address;
call mon1(9,sadr);
end print$con$buffer;
version:
procedure address;
return mon3(12,0);
end version;
reset$drives:
procedure (drive$vector);
declare drive$vector address;
call mon1 (37,drive$vector);
end reset$drives;
/**************************************
* *
* X D O S Externals *
* *
**************************************/
terminate:
procedure;
call mon1 (143,0);
end terminate;
declare mask (16) address data (
0000000000000001b,
0000000000000010b,
0000000000000100b,
0000000000001000b,
0000000000010000b,
0000000000100000b,
0000000001000000b,
0000000010000000b,
0000000100000000b,
0000001000000000b,
0000010000000000b,
0000100000000000b,
0001000000000000b,
0010000000000000b,
0100000000000000b,
1000000000000000b );
declare drive$mask address initial (0);
declare i byte;
declare vers address initial(0);
/*
Main Program
*/
plmstart:
do;
vers = version;
if high(vers) <> mpmproduct or low(vers) <> cpmversion then
do;
call print$con$buffer(.(0dh,0ah,'Requires MP/M-86 2.0$'));
call mon1(0,0);
end;
i = 0;
if tbuff(0) = 0 then
do;
drive$mask = 0ffffh;
end;
else
do while (i:=i+1) <= tbuff(0);
if (tbuff(i) >= 'A') and (tbuff(i) <= 'P') then
do;
drive$mask = drive$mask or mask(tbuff(i)-'A');
end;
end;
call reset$drives (drive$mask);
call terminate;
end;
end disk$reset;