mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-23 00:14:25 +00:00
51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
$compact
|
||
$title ('SDIR 8086 - Get Disk Parameters')
|
||
dpb86:
|
||
do;
|
||
/* the purpose of this module is to allow independence */
|
||
/* of processor, i.e., 8080 or 8086 */
|
||
|
||
$include (comlit.lit)
|
||
|
||
/* function call 32 in 2.0 or later BDOS, returns the address of the disk
|
||
parameter block for the currently selected disk, which consists of:
|
||
spt (2 bytes) number of sectors per track
|
||
blkshf (1 byte) block size = shl(double(128),blkshf)
|
||
blkmsk (1 byte) sector# and blkmsk = block number
|
||
extmsk (1 byte) logical/physical extents
|
||
blkmax (2 bytes) max alloc number
|
||
dirmax (2 bytes) size of directory-1
|
||
dirblk (2 bytes) reservation bits for directory
|
||
chksiz (2 bytes) size of checksum vector
|
||
offset (2 bytes) offset for operating system
|
||
*/
|
||
|
||
$include(dpb.lit)
|
||
|
||
declare k$per$block byte public;
|
||
declare dpb$base pointer;
|
||
declare dpb$array based dpb$base (15) byte;
|
||
|
||
mon4: procedure (f,a) pointer external;
|
||
dcl f byte, a address;
|
||
end mon4;
|
||
|
||
dcl get$dpb lit '31';
|
||
|
||
dpb$byte: procedure(param) byte public;
|
||
dcl param byte;
|
||
return(dpb$array(param));
|
||
end dpb$byte;
|
||
|
||
dpb$word: procedure(param) address public;
|
||
dcl param byte;
|
||
return(dpb$array(param) + shl(double(dpb$array(param+1)),8));
|
||
end dpb$word;
|
||
|
||
base$dpb: procedure public;
|
||
dpb$base = mon4(get$dpb,0);
|
||
k$per$block = shr(dpb$byte(blkmsk$b)+1 ,3);
|
||
end base$dpb;
|
||
|
||
end dpb86;
|
||
|