DOS_SET_1346

Rebuild the sector cache and RAM disk
Function AddressDescription
DOS_SET_1346 013FRebuild the sector cache and RAM disk

Synopsys

Rebuild the sector cache and RAM disk.

This routine is used to make some store available to the user, or to return store to DOS. Note that if the RAM disk is moved, or its size is changed, then all files thereon are erased.

Pages 1, 3, 4, 6 are considered as an array of 128 sector buffers (numbered 0...127), each of 512 bytes. The cache and RAMdisk occupy two separate (contiguous) areas of this array.

The location and size of the cache and RAMdisk can be specified separately; any remaining buffers are unused by DOS and are available to the caller.

Note that the sizes actually used may be smaller than those specified as in practice, there is a maximum cache size and a minimum size of RAMdisk (4 sectors).

A cache size of 0 will still work but will seriously impair the floppy disk performance.

This routine will fail if there are any files open on drive M:

Entry Parameters

Register Content
D First buffer for cache
E Number of cache sector buffers
H First buffer for RAM disk
L Number of RAM disk sector buffers
Note: E + L <= 128

Exit Parameters

If OK
Carry true
A corrupt
Otherwise:
Carry false
A = Error code
Always:
BC DE HL IX corrupt, all other registers preserved.
Last modified November 24, 2021: DOS attributes, fix blb class (8c71b69)