Apple III COBOL: Using CALL and CANCEL with subprograms

Apple III COBOL: Using CALL and CANCEL with subprograms

When a linkage section is used between a calling and a called program and there
is I/O (disk read/write, etc.) in the called program, the file I/O
instructions are not successfully executed by the called program. Also, the
"Cancel" verb does not seem to always free up the entire amount of memory
allocated to subprograms.
 
Page 85 of the COBOL Manual states," If you are not careful in Call/Cancel
sequences, you can fragment memory, leaving no room for a new Call, even though
the total amount of free memory might be enough." Page 86 says," There is one
more complication to consider: any program can be segmented. When you Call a
segemented program, The Run-Time System allocates for it enough memory to hold
the root segment and the largest overlay."  What this all means is that all
memory is returned with Cancel but fragmentation could be the problem. A Called
module requires contigous memory to be loaded.

Back