• Please review our updated Terms and Rules here

Leaving data behind post-execution.

cj7hawk

Veteran Member
Joined
Jan 25, 2022
Messages
1,120
Location
Perth, Western Australia.
Hi All,

I was just wondering if there was a convention within CP/M for leaving data behind for the next program to use?

For example, if a program exits, but wants to leave data for the next program to use ( if it uses the data ) is there a common place to store vectors for such information if the location of the data itself isn't fixed?

Kind of like how the command line is stored at 0080, but for a terminating program, rather than the user input.

The intended application is that after I exit my assembler, to have a debug routine that can be run post assembly. It could read out a vector from somewhere pointing to my data tables start location, then it would print them out or perform other similar tasks. The key question is where to store such a vector?

I could choose a random location like the final bytes before the CCP, or the memory around location 0040 to 005B in the zero page, and both approaches would be suitable, though I'm not sure if any later versions of CP/M used the memory from 0040 to 005B. I only need a few bytes for vectors, and ideally a signature to indicate the data *might* be valid and was wondering if there are any common conventions around how other programs have approached this issue?

Thanks,
David
 
Data was typically passed to other programs in files or by using program overlays. Exiting to CCP is a bit haphazard, as the TPA is free to be trashed during warm boot and by the CCP. Using overlays was accomplished by selecting an overlay area and then loading the new code/program into that area. But the address(es) and range(s) were something chosen by the programmer, using some sort of (simple or complex) organization to ensure data is preserved (as well as some base of code - including the overlay loader). In the case of overlays, no warm boot is involved so there is nothing to disturb the TPA. CP/M 3 provided a CHAIN function, and coupled with the LOADER RSX was capable of helping with overlays or chaining programs (although I think CHAIN still trashed the TPA).
 
Back
Top