A function can use the 256 bytes of memory at address F_ _TEMP as temporary scratch space in any manner it chooses. However, the memory is not saved between calls of the function. Symbols F_ _TEMP2, F_ _TEMP4, F_ _TEMP6, F_ _TEMP8, F_ _TEMP12, and F_ _TEMP32 are defined to be offsets into the initial part of the buffer.
A function may also allocate memory for its exclusive use by using the following macro:
DEFSPACE(fldname, bytes)
This should appear on a line by itself in the file, and causes TSM to create a symbol, "F_fldname" and provide the amount of space requested for it. If the size is a multiple of 4, the space will start on a 4-byte boundary. The space can be referenced within the subroutine as "F_fldname".
TSM automatically allocates one byte more than the number requested by the DEFSPACE macro. If the space is to be used to store a string, the additional byte is used for a NULL terminator. If the space is to be used to store an integer, you may conserve space by requesting one less byte of storage. This will also ensure that the address will always fall on an even address boundary. If you do not request one less byte of storage than that needed to store an integer and it does not begin with an even address boundary, you will receive an addressing warning message. This warning can be ignored since the system processor handles integers not starting on an even address boundary.
Since all symbols are global in TAS, the name chosen for space allocation should not conflict with other names used in the application.
The installed script (TAS based) does not recognize the DEFSPACE macro. In situations where an external function attempts to execute another external function which uses the DEFSPACE macro, the process will fail. It is therefore recommended that memory allocation for the external function to be executed be part of the script that is verified and installed before use.