s390guy / SATK

Toolkit for creating baremetal programs targeting mainframe compatible systems
GNU General Public License v3.0
42 stars 6 forks source link

Macro invocation with continuation lines results in alternate lines being discarded. #27

Open srorso opened 2 years ago

srorso commented 2 years ago

If a macro is invoked with keyword parameters, one per line, with a continuation character on each line, the even numbered lines are dropped, e.g., second, fourth. etc. This operand skipping does not occur when positional operands are used.

So:

LABEL   MACINV KEY1=YES,KEY2=NO,    \
              KEY3=MAYBE,           \
              KEY4=DEFINITELY

KEY3=MAYBE will not be processed at all. Changing the snippet to:

LABEL   MACINV KEY1=YES,KEY2=NO,    \
              KEY3=MAYBE,           \
              KEY3=MAYBE,           \
              KEY4=DEFINITELY

causes KEY4 to be dropped, and the duplication of KEY3 is not reported.

I have attached a .zip containing a sample program and listing with two macro definitions and two invocations of each macro. The first macro uses keyword operands, and the second uses positional. The first invocation illustrates the issue and the second illustrates the work-around of duplicating all lines after the first. The macro just issues MNOTE instructions to echo the keyword operands provided.

ztest-999.zip

Fish-Git commented 5 months ago

FWIW, I personally do not use such non-standard(?) continuation lines. I always use the standard assembler non-blank column 72 continuation style:

LABEL   MACINV KEY1=YES,KEY2=NO,                                       x
              KEY3=MAYBE,                                              x
              KEY4=DEFINITELY

which seems to work reliably.