TPA -- Display/Change TPA size March 9, 1988 TPA reports the amount of memory available in your TPA (Transient Program Area). The Transient Program Area is that portion of a CP/M system that holds programs which are loaded from disk by the CCP and the memory required by the programs (buffers, working storage areas, etc.). The program also allows you to temporarily lower the size of the TPA. This is useful for testing new programs to see if and how they function at a lower TPA size. The size of the TPA is reset to the maximum available to the system with a warm boot. To lower the TPA size specify the decimal two digit number on the command line after the program name as follows: "TPA 56". This will lower your TPA to approximately 56K. The new TPA size will be displayed. If, for some reason, the size cannot change the size (the parameter is not a valid number, etc) the program will display the current size and exit. CP/M has three functional modules. They are the CCP (Console Command Processor), the BDOS (Basic Disk Operating system), and the BIOS (Basic Input/Output System). In addition to this, CP/M reserves the first 256 bytes of memory (Page 0) for system storage area. When the system is cold booted, the CCP, BDOS, and BIOS are loaded at the top of memory of your system. The exact location depends on how much real memory your system has and the size of the BIOS for your system. For a CP/M 2.2 system, the size of the CCP is 2K, the size of the BDOS is 3.5K. The size of the Kaypro II BIOS is 1.5K. So, this means that the CP/M operating system uses 7K. The Kaypro II has 64K of memory, so we have available 57K (minus the 256 bytes of Page 0) to load programs. The CCP is reloaded into storage from disk every time the system is warm booted. The function of the CCP is to communicate with the user and to interpret commands entered at the keyboard. Transient programs don't use the CCP, so, if the program terminates with a cold boot, the program may overlay the CCP, and therefore has another 2k to play with. Many programs, however, do not exit with a cold boot, but rather return directly to the CCP, and therefore may not overlay the CCP. In addition to the CP/M operating system, many systems have installed extensions to the operating system that usually remain resident whenever the system is powered on. Some uses are to install Hard disk or RAM disk drivers, print spoolers, keyboard function key translates, etc. These Resident System Extensions (RSX) are loaded into storage just below the CCP. The size of the RSXs you have installed, take away that much more from the transient program area. Because you have to install them directly below the CCP, you immediately drop the TPA by the size of the CCP -- 2K. On an unmodified CP/M system (no Resident Extensions), the size of the TPA is easy to calculate. At location 5 in memory, CP/M maintains a jump to the BDOS. By taking the address of the jump and subtracting the 256 bytes of low memory, we have the amount of memory available for our transient programs if they terminate with a warm boot. If they return directly to the CCP, we have to subtract another 2K from the size. If a Resident Extension is installed, it is the responsibility for that RSX to modify the BDOS jump address at location 6 to the lowest location in the RSX and then it must jump to the BDOS. To see if an RSX is installed, we can look at location 0 of the system, which contains a jump to the warm boot routine in the BIOS. This jump is defined to be three bytes into the BIOS. By subtracting the start of the BDOS from the start of the BIOS, we should get an answer of 3.5K. If the answer is larger, an extension is installed. Then, the space left for the TPA is the difference of the address of BDOS jump minus 256 bytes either if the program returns to the CCP or if it exits with a warm boot. TPA will calculate the space for transient programs and display the results. Enter "TPA" at the CP/M "A>" prompt.