On Tue, 14 Nov 2023 18:27:16 -0300, João Reginato <[email protected]> wrote:
 >** ASMA057E Undefined operation code - 00006/SR  15,15

The message shows you exactly what is the problem. There is no opcode "SR 
15,15". The assembler thinks " 15,15" is part of the instruction. Assembler 
tokenization and macro tokenization can be confusing. "tokenization" is the 
process of splitting / parsing.

Assembler tokenization parsing:    label   opcode   arguments    comments  

>                                       3 &REST    SETC  'SR    &N,&N'
>                                       4          &REST

Use of a variable is 1 assembler token 'SR  &N,&N'  which is not a valid opcode 
thus giving you the error message including regs.

>                                      6 &NAME    &INS(1).&INS(2)

The period between &INS(1) and &INS(2)  incorrectly caused SR to be 
concatenated with 15,15, again causing them to be the opcode instead of opcode 
and arguments.. 

>                                      4 &INS(1)  SETC  'SR '

The extra blank included after the SR makes the opcode "SR   ".  If you had not 
included the period, the error message would be very confusing because we 
wouldn't see the blank in the error message.

You should also be aware about the tokenization quirks of the "arguments".  For 
real instructions, a single variable can be used to contain all the arguments. 
For macro calls, you must use separate variables separated by comma because the 
macro tokenization of "15,15" is a single &SYSLIST(#) variable instead of 2 
separate &SYSLIST( ) variables.

Reply via email to