gtpg2m37General Macros

MALOC-Reserve a Storage Block

This general macro obtains a variable-sized, doubleword-aligned block from heap-resident storage.

Format




label
A symbolic name can be assigned to the macro statement.

SIZE=Rn
A general register (R0-R7, R14, R15) or a register equate containing the number of contiguous bytes of storage to be allocated.

When coded in the control program (CP), only R0-R6 can be used.

Entry Requirements

Return Conditions

Programming Considerations

Examples

This example shows the number of requested bytes that are being drawn from a DSECT and the address of the returned block that is being stored in an ECB location.

ITUUTL REG1=R14           CONNECT WITH TABLE UPDATE DSECT
LA    R14,ITULEN          GET THE LENGTH OF A BLOCK
MALOC SIZE=R14            GET A STORAGE BLOCK
ST    R14,EBX000          SAVE THE ADDRESS
LTR   R14,R14             LOOK FOR RETURN CODE