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

Reply via email to