         MACRO
&N       SWITST  &OPCODE,&A
.* Macro to ease Conversion from NOP/B-switches to proper flags
.*   expected coding:
.*  1-  NAME    NOP  LABEL   (can also be a B to LABEL)
.*  2-  an OI/NI against NAME+1 is also expected
.*  3-  in the very first lines of the code a
.*      CODE LOCTR  is expected -
.*      the location of the DEFS LOCTR can be anywhere later (at end)
&N       CLI     &N._S,1
         JE      &A
         AIF     ('&OPCODE' EQ 'NOP').NOP
         AIF     ('&OPCODE' EQ 'B').B
         MNOTE   12,'SWITCH IS NEITHER NOP NOR B'
         MEXIT
.NOP     ANOP
DEFS     LOCTR
&N._S    DC      X'00'
CODE     LOCTR
         MEXIT
.B       ANOP
DEFS     LOCTR
&N._S    DC      X'01'
CODE     LOCTR
         MEND
         MACRO
&N       SWISET  &A,&B  should be a 1 or a 0
.*   This is the counterpart to SWITST
.*   adapt it to your likes because...
.*    might even consider a SWISET and SWIREST
&N       MVI     &A._S,&B
         MEND

