On 29 October 2015 at 19:26, Paul Gilmartin
<[email protected]> wrote:
>On 2015-10-29 15:23, David Cole wrote:
>> Yeah Paul, Tony has it right. "&STCKEVAL.(8)" is what you want to do.
>>
>> The dot separates the "(8)" from the symbol.
>>
>> Without the dot, HLASM expects &STCKEVAL is an array and that you want the 
>> 8th element.

Which is silently null for a macro parameter with an omitted
subargument, as documented in the HLASM book.

> Is this preferable to my accidental discovery:
>     &STCKEVAL+0(8)

Yes. As Bernd points out, it is the standard, and works in all such
contexts. Other people will understand it at a glance.

And your +0 won't work correctly with some reasonable values of your
macro argument. What if you have e.g.

         CONV 0(R4)

You'll generate  UNPK  YYYY(15),0(R4)+(8)  Perhaps better to generate
something that will "fail correctly", which the dot syntax will do for
this case. Well better to check the operand type at macro time.
[...]
> (Is there a better way to translate a string to hex?  I don't
> feel I need a loop, or to learn TRL or TRG.)

TROT? Though the table may be too big for your taste, and without the
ETF2-enhancement facility installed, it fails 1/256 of the time.

Tony H.

Reply via email to