Ooops, the 'Macro' statement somehow got dropped, sorry. Here is the updated 
version....  

As someone else mentioned you can program your way around it. Here is a macro 
ASPLIT I just put together for the fun of it. Not pretty but seems to do the 
job.
So in your macro you should be able to do

&instr1  setc  'la,r15,fw'  
.*   then sometimes later   
         ASplit &instr1     


Asplit macro:

          Macro                                                    
.*-                                                                   
.*                                                                    
.*  ASPLIT - split a string into opcode and 0-3 parameters            
.*  Syntax                                                            
.*   [label] ASPLIT 'string'[,'dlm']                                  
.*   label   Any valid label or none                                  
.*   string  Quoted instruction and parameters seperated by the 'dlm' 
.*           value. i.e. 'lr,2,4'. Note that one delimiter may come   
.*           between each operand, so even though a blank is a valid  
.*           delimiter, there can be only one.                        
.*   dlm     Quoted delimiter value, default is a comma.              
.*  Samples                                                           
.*       ASPLIT 'SR,1,2'                                              
.*       ASPLIT 'icm-r1-8-fw','-'                                     
.*                                                                    
.*-                                                                   
&mlbl    ASPLIT                                                 
         lclc  &p(10)                                                 
         lcla  &sp,&sl,&pn                                            
&s       setc  dequote('&syslist(1)')  string                         
&dlm     setc  dequote('&syslist(2)')  delimiter                      
&dlm     setc  '&dlm.,'(1,1)           set default                    
&sk      seta  k'&s                                                   
&sp      seta  1                       start                          
.*  main part                                                         
.a       anop                                                         
&sl      seta  &sl+1                                                  
         aif   (&sl gt &sk).p          end of string                  
         aif   ('&s'(&sl,1) eq '&dlm').p end of parm                  
         ago   .a                                                     
.* endparm / enddata                                                  
.p       anop                                                         
&sl      seta  &sl-&sp                 parm length                    
&pn      seta  &pn+1                                                  
&p(&pn)  setc  '&s'(&sp,&sl)                                          
&sl      seta  &sp+&sl                 update ptr                     
&sp      seta  &sl+1                   past dlm                       
         aif   (&sl lt &sk).a          beware end of string           
.* end of string                                                      
.e       anop                                                         
         aif   (&pn eq 1).p1                                          
         aif   (&pn eq 2).p2                                          
         aif   (&pn eq 3).p3                                          
         aif   (&pn eq 4).p4                                          
         mnote 8,'**exessive number of operands'                      
         mexit                                                        
.p1      anop                                                         
&mlbl    &p(1)                                                        
         mexit                                                        
.p2      anop                       
&mlbl    &p(1)   &p(2)              
         mexit                      
.p3      anop                       
&mlbl    &p(1)   &p(2),&p(3)        
         mexit                      
.p4      anop                       
&mlbl    &p(1)   &p(2),&p(3),&p(4)  
         mexit                      
.x       Mend                       


-----Oprindelig meddelelse-----
Fra: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU> På vegne af 
Bill Hitefield
Sendt: 15. november 2023 16:27
Til: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Emne: Re: ASMA057E Undefined operation code SR 15,15

Peter,

I got the impression the OP desired to have a single LCLC variable containing 
both the opcode and the operands. When the examples with multiple LCLC 
variables were offered, they did not fit what was seen as the initial 
requirement. The OP may have thought "Yes, that works, but I need to have only 
the one LCLC variable" - not realizing until later a single variable would not 
work.

Bill Hitefield

> -----Original Message-----
> From: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU> 
> On Behalf Of Peter Relson
> Sent: Wednesday, November 15, 2023 8:40 AM
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Re: ASMA057E Undefined operation code SR 15,15
> 
> This was a very lengthy thread in which the OP multiple times ignored 
> those who correctly provided what was needed. I don't know why the OP 
> would not simply take the advice and proceed.
> 
> The error has nothing to do with "label", although the lack of allowing 
> "label"
> is not typically good. The operand was not specified in column 1.
> 
> As was mentioned, the single macro variable was treated as "the opcode".
> There is no "opcode" of "SR 15,15". That is the way assembler macro 
> substitution works. Should it? Maybe not, but history and 
> compatibility demand that it not be changed.
> 
> All of the approaches demonstrated in the macro below work:
>          MACRO
>          ZERO  &N
>          SR    &N,&N
> &OPCODE  SETC  'SR'
> &OPERAND SETC  '&N'
>          SR    &OPERAND,&OPERAND
>          &OPCODE &OPERAND,&OPERAND
> &OPERANDS SETC  '&N,&N'
>          &OPCODE &OPERANDS
>          MEND
> 
> And then add support for a label for better usability.
> 
> (I think older releases of the assembler used to require &LCLC for 
> each SETC symbol, but apparently that is no longer required.)
> 
> I saw no mention that "SR" is at best the 4th best choice for zeroing a 
> register.
> I'll leave the other 3 (and perhaps more) as an exercise for the 
> reader, for a while.
> 
> Peter Relson
> z/OS Core Technology Design

Reply via email to