In my macros that allow any arbitrary machine instruction, I have separate
code for zero thru three operands like
AIF (N'&CODE EQ 1).CODE1
AIF (N'&CODE EQ 2).CODE2
AIF (N'&CODE EQ 3).CODE3
AIF (N'&CODE EQ 4).CODE4
where &CODE is a macro parameter that has the instruction.
Of course that is only valid for machine instructions, not any assembler
statement.
On Tue, 14 Nov 2023 18:25:20 -0300 João Reginato <[email protected]>
wrote:
:>same error with 2 variables:
:>
:> Loc Object Code Addr1 Addr2 Stmt Source Statement
:> HLASM R6.0 2023/11/14 18.23
:> 1 MACRO
:>
:> 2 &NAME ZERO &N
:>
:> 3 LCLC &INS1,&INS2
:>
:> 4 &INS1 SETC 'SR '
:>
:> 5 &INS2 SETC ' &N,&N'
:>
:> 6 &NAME &INS1.&INS2
:>
:> 7 MEND
:>
:>000000 00000 00000 8 XYZ CSECT
:>
:> 9 ABC ZERO 15
:>
:> 10+ABC SR 15,15
:> 01-00006
:>** ASMA057E Undefined operation code - 00006/SR 15,15
:>
:>** ASMA435I Record 6 in JOAO.QWASM.JOB09586.D0000101.? on volume:
:>
:>
:>
:>Em ter., 14 de nov. de 2023 às 18:20, Willy Jensen <
:>[email protected]> escreveu:
:>
:>> Would a sublisted SETC do, where P(1) is the instruction and P(2) is the
:>> register?
:>>
:>> -----Oprindelig meddelelse-----
:>> Fra: IBM Mainframe Assembler List <[email protected]> På
:>> vegne af João Reginato
:>> Sendt: 14. november 2023 22:16
:>> Til: [email protected]
:>> Emne: Re: ASMA057E Undefined operation code SR 15,15
:>>
:>> without the SETC it works but I need it to simplify the logic of a bigger
:>> macro.
:>> .
:>> João Reginato
:>> (61) 9911-55500
:>>
:>>
:>> Em ter., 14 de nov. de 2023 às 18:08, Paul Gilmartin <
:>> [email protected]> escreveu:
:>>
:>> > On 11/14/23 13:58:30, João Reginato wrote:
:>> > > Gil
:>> > >
:>> > > I know it works in the way you've proposed but I need to use the
:>> > > SETC in
:>> > a
:>> > > very bigger macro.
:>> > >.
:>> > Please post an example showing the failure without the SETC.
:>> >
:>> > Would it be better to have two separate MACROs, one of which calls the
:>> > other?
:>> >
:>> > >> Em ter., 14 de nov. de 2023 às 17:46, Paul Gilmartin escreve:>>>> .
:>> > >>> I believe the SETC is unnecessary. How a bout just:
:>> > >>> MACRO
:>> > >>> &REST ZERO &N
:>> > >>> &REST SR &N,&N
:>> > >>> MEND
:>> > >>>
:>> > >>> START
:>> > >>> L ZERO 15
:>> > >>> END
:>> >
:>> > --
:>> > gil
:>> >
:>>
--
Binyamin Dissen <[email protected]>
http://www.dissensoftware.com
Director, Dissen Software, Bar & Grill - Israel