Like John Gilmore, I (strongly) dislike hard-coded 3's and 4's, especially
when a macro generates several instructions that must be ORG'ed into and
around.  Labels are our friends.  If I were writing this macro and found
that the user-supplied label was optional, I would probably write code to
generate my own label and ORG to that.  In fact, I'd probably also define a
label that follows the generated instruction and ORG back to that.  But, I
would hazard a guess that these are techniques that most of us are already
aware of.

- mb

IBM Mainframe Assembler List <[email protected]> wrote on
12/21/2013 01:20:48 PM:

> From: John Gilmore <[email protected]>
> To: [email protected],
> Date: 12/21/2013 01:23 PM
> Subject: Re: macros to implement opcodes
> Sent by: IBM Mainframe Assembler List <[email protected]>
>
> Steve Comstock wrote:
>
> <begin extract>
> Neither version is bullet proof, but Ed's works in both cases of a
> label supplied or not (neither of which is an error, so 'bullet
> proofing' for a missing  label is really irrelevant).
> </end extract>
>
> and this---Let me quote him---is
>
> Nonsense!
>
> When someone writes a macro definition he or she is free to make the
> omission of or a putatively inappropriate value of any symbolic
> parameter an error, as I did with the skeletal sample lines that
> tested for the presence or absence of a label in the DIAG macro
> instruction.   In general the omission of a label may be innocuous in
> one context and a severe error in another, in the judgment of the
> writer of a particular macro instruction.
>
> Bullet proofing is never irrelevant.  It is tedious, certainly; but
> the only appropriate stance for the writer of a production macro
> definition is that those who write macro instructions that use it will
> be ignorant, malicious or perhaps both.
>
> Ed Jaffe's point is more substantial; but, as he well knows, there are
> simple ways to guard against the difficulty he raised.  Indeed, there
> are alternative ways to induce the assembler to do the necessary
> arithmetic without resort to the magic numbers 3 and 4,  which still
> seem to me to be ugly.
>
> I do not at all mind being ganged up upon.  Let's do it again sometime
soon.
>
>
> John Gilmore, Ashland, MA 01721 - USA
>

Reply via email to