I have several macros that use AREAD to read the following nicely
formated source lines and then generate the correct DCs. Following is
one of the simple ones:
KEYWORD_TABLE DS 0D
PTABLE PREFIX=PK_,LENGTH_ID=KT_E_LENGTH << macro call
DUMMY CHAR
SUPPORT_EMAIL_ADDR CHAR
V3_DJDE_FORMS V3_FLAG
MESSAGE_OPTION MESSAGE
NORUN CHAR
FFFFFF
Which generates:
-DUMMY CHAR
+ DC CL20'DUMMY ',A(PK_CHAR)
+ DC A(DUMMY),A(L'DUMMY)
-SUPPORT_EMAIL_ADDR CHAR
+ DC CL20'SUPPORT_EMAIL_ADDR ',A(PK_CHAR)
+ DC A(SUPPORT_EMAIL_ADDR),A(L'SUPPORT_EMAIL_ADDR)
Tony Thigpen
-----Original Message -----
From: Paul Gilmartin
Sent: 06/04/2011 01:22 PM
On Jun 3, 2011, at 16:19, Edward Jaffe wrote:
On 6/3/2011 2:08 PM, Robert A. Rosenberg wrote:
Here is a simple solution. Create a $DC macro to use in lieu of the
DC. That will allow you to format your DC as you want (ie: Macro
continuation format). Inside the macro you can generate each parm as
a separate DC (to avoid the need to emit end of line characters).
Or just emit one long DC and let the assembler automatically generate the
continuation characters and additional lines.
This intrigued me sufficiently that I tried a test:
LONGDC CSECT
GBLA&A
&A SETA 0
GBLC&C,&D
&C SETC ''
*
PUSH PRINT
.LOOP ANOP
&A SETA&A+1
&D SETC 'C''This is string&A'''
&C SETC '&C.&D,'
PRINT OFF
AIF (&A LT 40 ).LOOP
POP PRINT
*
CONST DC&C.0C'end'
END
Worked pretty much as you'd expect.
o It failed on an implementation limit at a count of 50.
But the only behavior I'd significantly prefer is if the
string size were limited only by available REGION.
o Your statement "let the assembler automatically generate
the continuation characters and additional lines," puzzled
me. But the listing shows it does exactly that! So it
takes the generated instruction apart into 72-character
pieces only to put them right back together. Even more
complicated if the source line itself were continued. (Or
does it separate the string only for display in the listing?)
o It's particularly irritating that PRINT OFF was printed 40
times in the listing. Grrrr. When I say PRINT OFF, I mean
don't print anything until I POP PRINT.
o I suspect the HLASM parsing is context-sensitive and
enormously complicated. Can/must I use BIFs such as
DOUBLE() alike in SETC, DC, and macro calls? What
chapter states all these rules?
-- gil