n 6/17/2012 8:18 AM, Hardee, Chuck wrote:
Hello Listers!

I am in the process of writing a macro and would like to control whether or not 
some MNOTEs are generated.

What I am looking for is whether or not I can check the current status of GEN 
versus NOGEN.

If the macro is assembled and PRINT GEN is specified, I don't want to issue my 
MNOTEs but if the assembly is performed with PRINT NOGEN, then I want to 
execute the MNOTEs.

Has anyone ever done anything like this?
If so, how does one test for the GEN/NOGEN status?


You might choose to define your own PUSH, POP and PRINT macros and use OPSYN to
make them active. Those three macros would then internally manage the binary
on/off value for producing the MNOTEs as needed. Here is a quick 'proof of
concept' PRINT macro:

Stmt  Source Statement
   1          MACRO ,
   2          XPMAC &A,&B
   3          GBLB  &Mnotes
   4          AIF   ('&A' EQ 'GEN').L1
   5          AIF   ('&A' EQ 'NOGEN').L2
   6          AGO   .L3
   7 .L1      ANOP  ,
   8 &Mnotes  SETB  0
   9          MNOTE 'Debugging: Mnotes will be suppressed'
  10          AGO   .L3
  11 .L2      ANOP  ,
  12 &Mnotes  SETB  1
  13          MNOTE 'Debugging: Mnotes will be produced'
  14 .L3      ANOP  ,
  15          XPRINT &A,&B
  16          MEND  ,
  17 XPRINT   OPSYN PRINT
  18 PRINT    OPSYN XPMAC
  19 TEST     RSECT ,
  20          PRINT GEN
  21+Debugging: Mnotes will be suppressed
  22+         XPRINT GEN,
  23          PRINT NOGEN
  24+Debugging: Mnotes will be produced
  25+         XPRINT NOGEN,
  26          PRINT ON
  27+         XPRINT ON,
  28          PRINT OFF
  29+         XPRINT OFF,
  38          PRINT OFF,NOPRINT

This last statement illustrates a drawback to this approach. The 'NOPRINT'
keyword is not honored for your OPSYNed PRINT statement.

--
Edward E Jaffe
Phoenix Software International, Inc
831 Parkview Drive North
El Segundo, CA 90245
310-338-0400 x318
[email protected]
http://www.phoenixsoftware.com/

Reply via email to