After CATting a Microdrive, is the number of free kilobytes on the cartridge accessible to BASIC?
I.e. if I CAT a drive from BASIC, can this number be stored as a variable?
Microdrive: Number of free kilobytes stored after CAT
Re: Microdrive: Number of free kilobytes stored after CAT
Sure there is a better method (with machine code), but a dirty one can be to use the screen$ function to "capture" the number printed in screen.
Re: Microdrive: Number of free kilobytes stored after CAT
Check out page 41-42 of Ian Logan's Spectrum Microdrive Book. It should be a relatively simple task to add a counter to the program on page 41 to add up the '1's or '0's (instead of printing them) depending on whether you want to know 'free' or 'used' space. Note that each sector is 512 bytes, so you'll need to divide by two for a result in Kb.
https://spectrumcomputing.co.uk/entry/2 ... drive_Book
https://spectrumcomputing.co.uk/entry/2 ... drive_Book