On 10/2/2022 12:53 AM, Binyamin Dissen wrote:
:>In my experience, HLASM's features tend to be best leveraged when code
:>follows data definitions.
Such as?
Do you subscribe to ASSEMBLER-LIST? The assembler's look-ahead
limitations are often discussed there. This discussion belongs there as
well...
Here is an example of a macro that wants to iterate internally based
upon the number of entries in a table. (I've replaced the typical
looping macro code with a simple MNOTE that displays the number of
entries in the table passed as a parameter.) As expected, it works only
if the table has already been defined.
MACRO ,
TC &TC
&Count SETA &TC
MNOTE 0,'Table Count is &Count'
MEND ,
**
** This one will fail
**
TC TabCount
Table DC F'1'
DC F'2'
DC F'3'
TabCount EQU (*-Table)/L'Table
**
** This one will work
**
TC TabCount
END ,
Here are the results of the first macro call, issued before the table is
defined:
** ASMA154E Operand must be absolute, predefined symbols; set to zero -
00003/PPARM00001
** ASMA254I *** MNOTE *** 13+ 0,Table Count is 0
Here are the results of the second macro call, issued after the table is
defined:
** ASMA254I *** MNOTE *** 22+ 0,Table Count is 3
--
Phoenix Software International
Edward E. Jaffe
831 Parkview Drive North
El Segundo, CA 90245
https://www.phoenixsoftware.com/
--------------------------------------------------------------------------------
This e-mail message, including any attachments, appended messages and the
information contained therein, is for the sole use of the intended
recipient(s). If you are not an intended recipient or have otherwise
received this email message in error, any use, dissemination, distribution,
review, storage or copying of this e-mail message and the information
contained therein is strictly prohibited. If you are not an intended
recipient, please contact the sender by reply e-mail and destroy all copies
of this email message and do not otherwise utilize or retain this email
message or any or all of the information contained therein. Although this
email message and any attachments or appended messages are believed to be
free of any virus or other defect that might affect any computer system into
which it is received and opened, it is the responsibility of the recipient
to ensure that it is virus free and no responsibility is accepted by the
sender for any loss or damage arising in any way from its opening or use.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN