Correction to my "simple" code:
TM 0(R6),UEPPSB1
JO PSBFUNC
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On
Behalf Of Swarbrick, Frank
Sent: Tuesday, May 17, 2016 11:44 AM
To: [email protected]
Subject: Re: Structured Programming Macros
This is exactly true. That being said, I don't know how structured programming
macros can be used for 100% of your code if you want to also use the minimum
number of instructions possible. These two things appear to be in conflict.
For example, I did this simple code:
IF (TM,0(R6),UEPPSB1,O)
J PSBFUNC
ENDIF
Which generated this:
TM 0(R6),UEPPSB1
BRC 14,#@LB5
J PSBFUNC
+#@LB5 DC 0H
But without using the macros I'd simply do this:
TM 0(R6),UEPPSB1
JNO PSBFUNC
So it seems like there might be implied guidance to not use an IF macro if the
only conditional code is a branch. Or is there something I am missing? I know
there is DOEXIT, but that doesn't really fit in this case.
I should qualify that I know that I *could* do something like the following:
IF (TM,0(R6),UEPPSB1,O)
[lots of code here]
ELSE
[lots of code here]
ENDIF
I choose not to because I have a philosophy, for higher level languages anyway,
that if "conditional code" is more than a "few" lines it should be taken "out
of line" and invoked. For example, in COBOL, instead of
IF SOME-CONDITION
[50 lines of code goes here]
ELSE
[30 lines of code goes here]
ENDIF
I would do this:
IF SOME-CONDITION
PERFORM 50-LINES-OF-CODE
ELSE
PERFORM 30-LINES-OF-CODE
ENDIF
The compiler, of course, is free to bring the "performed" code inline. And, of
course, an assembler will not do that.
I have only been using the SP macros for a total of three days, so if I am
missing a possibility please let me know!
Frank
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On
Behalf Of Willy Jensen
Sent: Friday, May 13, 2016 10:21 AM
To: [email protected]
Subject: Re: Structured Programming Macros
Maybe for consistency ?
I've been using structured macro for a long time and I don't think that you'll
ever get rid of 'old style' code. But it still easier to read if as much as
possible is using IFs and DOs. At least I find it so.
The information contained in this electronic communication and any document
attached hereto or transmitted herewith is confidential and intended for the
exclusive use of the individual or entity named above. If the reader of this
message is not the intended recipient or the employee or agent responsible for
delivering it to the intended recipient, you are hereby notified that any
examination, use, dissemination, distribution or copying of this communication
or any part thereof is strictly prohibited. If you have received this
communication in error, please immediately notify the sender by reply e-mail
and destroy this communication. Thank you.
The information contained in this electronic communication and any document
attached hereto or transmitted herewith is confidential and intended for the
exclusive use of the individual or entity named above. If the reader of this
message is not the intended recipient or the employee or agent responsible for
delivering it to the intended recipient, you are hereby notified that any
examination, use, dissemination, distribution or copying of this communication
or any part thereof is strictly prohibited. If you have received this
communication in error, please immediately notify the sender by reply e-mail
and destroy this communication. Thank you.