Files
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

93 lines
2.0 KiB
Plaintext
Raw Permalink 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 II V2.0 Disk System Reset')
disk$reset:
do;
$include (copyrt.lit)
/*
Revised:
14 Sept 81 by Thomas Rolander
*/
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;
declare tbuff (1) byte external;
/**************************************
* *
* B D O S Externals *
* *
**************************************/
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;
/*
Main Program
*/
start:
do;
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;