ROSUNCR.DOC vers 1.0 11jan88 by W. Brimhall Z-Node 52 (602)996-8739 ROSUNCR.LBR contains the files used to add uncrunch support to my ROS 3.4 CP/M 80 system. It was put together in a quick effort to share the information with others that do not want to wait for a more refined future release. The main obstacle in uncrunching a file under ROS is the need for a 24k free memory buffer. The only solution I could come up with was to chain to a separate Turbo pascal .CHN file to perform the uncrunch then chain back to the main ROS program. For this scheme to work it is necessary to save the present state of ROS on the heap during the chain. I was disappointed to find that Turbo Pascal does not normally preserve the heap when chaining. A wasted 15 min call to Borland technical support verified that the heap gets destroyed and provided no help in solving the problem. After several hours hours of debugging and disassembly I came up with the solution which is detailed in the TPHEAP.DOC file. The actual UNCREL.Z80 uncrunch subroutine was provided by Steven Greenberg. I made many unsuccessful attempts using ZAS vers 3.0 to assemble this into the UNCREL.INC format for use with Turbo Pascal. I finally discovered that ZAS had a bug with the Turbo include mode which prevented it from assembling correctly. I was able to patch the assembler to fix the problem and I notified Al Hawley who has removed the bug in ZAS vers 3.05. For the Pascal uncrunch program to work it must have 24k of free memory between the end of its program code and the start of the ROS heap. Even on my TurboDOS system with 63k of tpa there was not enough free memory. To increase the free memory size it was necessary to reduce the heap size of ROS. This was accomplished by modifying ROS to read the SECTION.BB# file data directly from disk as it is needed instead of storing it in the heap at initialization. (The additional access time is hardly noticeable.) Free memory space is still a big problem for small tpa systems. You must have at least 58k of tpa to run this version of ROS. Hopefully some future optimization will reduce this figure. Several of the ROS modules had to be modified to implement the uncrunch scheme. The modifications are all documented within the than I expected and overall I'm quite pleased with it. Next I'm planning to further reduce the tpa requirements and add support for .ARC files to allow logging into them just like libraries. A couple of the .INC files in the ROSUNCR library have also been modified for use with TurboDOS. You will most likely want to undo these modifications if you are running under CP/M. (These modifications are also documented within the files.) Good luck and give me a call if you have any questions.