Memory allocation: Difference between revisions
Content added Content deleted
Line 37: | Line 37: | ||
* The STORAGE macro is used (PC call to the storage routine) instead of GETMAIN/FREEMAIN (SVC based. Stabilised (no new functions). |
* The STORAGE macro is used (PC call to the storage routine) instead of GETMAIN/FREEMAIN (SVC based. Stabilised (no new functions). |
||
* One of the many functions of STORAGE over GETMAIN/FREEMAIN is illustrated: EXECUTABLE=NO. The code below will execute successfully if EXECUTABLE=YES (or defaulted to), or if running on a pre z14 machine. If on a z14 or newer machine and EXECUTABLE=NO then the module will ABEND S0C4-4. |
* One of the many functions of STORAGE over GETMAIN/FREEMAIN is illustrated: EXECUTABLE=NO. The code below will execute successfully if EXECUTABLE=YES (or defaulted to), or if running on a pre z14 machine. If on a z14 or newer machine and EXECUTABLE=NO then the module will ABEND S0C4-4. |
||
* The code |
* The code shows the use of the system supplied linkage stack to save caller's registers (BAKR) and restore them on return (PR), as opposed to STM/LM of the caller's register contents. |
||
* Finally, the code is REENTRANT, meaning it could be loaded in a system module directory (LINKLIST, LPA), and exeuted simultanuously by multiple callers. Though not a requirement for this type of sample code it is a best practice in assembler coding. |
|||
<lang 360 Assembly> |
<lang 360 Assembly> |
||
STOREXNO CSECT , |
STOREXNO CSECT , |