This general macro assigns a storage block from the specified working
storage list to the ECB level by placing its address in the auto-storage block
reference word (CE1AUT). Only one auto-storage block can be attached to
an ECB on each program nesting level.
Format
Notes:
- type1
- label
- A symbolic name can be assigned to the macro statement.
Either the positional or the keyword parameter may be used.
- size
- A storage size may be specified symbolically as parameter one. The
size specified as the number of bytes, is rounded up to a full double word
value (maximum of 4079).
- type1
- A storage list type may be specified symbolically as parameter one.
The ALASC macro will convert this symbol to a size value. Valid list
references are:
- L0
- 128 byte block - user size = 120
- L1
- 381 byte block - user size = 376
- L2
- 1055 byte block - user size = 1048
- L4
- 4095 byte block - user size = 4079
- TYPE
- The argument for this keyword parameter is identical to that required for
the type1 positional parameter.
Entry Requirements
- R9 must contain the address of the ECB being processed.
- The ECB auto storage block reference word must not be holding a storage
block for this entry at the current program nesting level in the entry
block.
Return Conditions
- Control is returned to the next sequential instruction.
- The contents of R14 and R15 are unknown. The contents of all other
registers are preserved across this macro call except for R7.
- The assigned storage block consists of a header area and a user area, and
is initialized as follows:
- Any earlier auto storage block is chained to this block by placing the
contents of CE1AUT in header field CU1ACH.
- The address of the current ECB program nesting level is placed in header
field CU1PNL.
- The caller's R7 is placed in the first word of user area
CU1USR.
- The remainder of the block is initialized with a unique value determined
by the ALASC service routine.
- The address of the assigned block is placed in the auto storage block
reference word CE1AUT.
- R7 contains the address of user area CU1USR in the assigned block.
Programming Considerations
- This macro can run from any I-stream.
- Storage blocks held by an operational program will be released when the
nesting level drops below the level at which the block was obtained.
That is, BACKC, ENTDC, ENTNC, or EXITC will adjust the auto storage levels
accordingly.
When using these macros, when returning to the program that calls the ALASC
macro, general register 7 addresses the user area in the assigned block of the
current program level. The contents of register 7 at the time of the
ENTxC/BACKC macro are saved in the first fullword of the user area (CU1USR) in
the assigned block.
- Only one auto storage block can be assigned for each program nesting level
used by the entry. If a block is already held, a system error dump is
taken and the entry is exited.
- Auto storage block labels (CU1ACH,..PNL,..USR)
are defined in DSECT CZ4CP.
- ALASC generates a label of the form xxxxyy where xxxx is the name of the
calling segment and yy is the version of the calling segment. This
label is required by SABRETALK and labels like this must not be coded by users
to avoid duplicate label errors.
- ALASC cannot be called from an ISO-C segment (coded with BEGIN
TPFISOC=YES).
Examples
The following example shows the use of ALASC:
- Prior to ALASC call-
ECB
CE1AUT- 0022A008 (current auto-storage block)
CE1CPNL- 00207A68 (current nesting level)
Register R7 - y......y
Auto Storage Block (at 0022A008)
CU1ACH- 00000000 (no prior block)
CU1PNL- 002052D0 (nesting level at attach time)
CU1USR- x......x (caller's R7 at attach time)
CU1USR+4- 8080..... (initialization value)
- Macro call-
XYZ ALASC 200 Get a 200 byte auto storage block
- After ALASC call-
ECB
CE1AUT- 00235008 (current auto-storage block)
CE1CPNL- 00207A68 (current nesting level)
Register R7 - 00235010 (CU1USR field)
Auto Storage Block (at 00235008)
CU1ACH- 0022A008 (prior block address)
CU1PNL- 00207A68 (nesting level at attach time)
CU1USR- y......y (caller's R7 at attach time)
CU1USR+4- A0A0..... (initialization value)