Thanks to everyone contributions
I borrowed some code from the GETMAIN macro using &LV or &LA

Paul D'Angelo

---------- Original Message ----------
From: Bernd Oppolzer <bernd.oppol...@t-online.de>
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Some Help with Conditional Assembly
Date: Sun, 3 Nov 2013 14:18:26 +0100

In my opinion, this is the most valuable suggestion.

Because: the two cases (1: the macro gets a length directly or
2: the address of a fullword, where it can find the length) are completely
different things. So I would suggest that there are two different
mutual exclusive parameters, for example L= and LADR=

You could then specify:

L=200
L=equate_symbol
L=(5)  register contains length

LADR=fullword_address
LADR=(5)   register contains fullword address

The responsibility for the correct usage of the macro is up
to the caller. Keep it simple ...

Kind regards

Bernd



Am Samstag, 2. November 2013 20:00 schrieben Sie:
> You should consider how IBM macros such as STORAGE handle this
> situation.  It requires an absolute value for LENGTH, and if you want to
> generate it dynamically, or get it from a memory location, then the user
> will just have to get the value into a register himself.  The two
> options are an absolute value, or a register (indicated by parentheses).
>
> If you must provide both options, either use a different operand (say,
> ALENGTH=), or a cryptic option (such as LENGTH=(*,address); or just
> parentheses if register notation isn't needed). Generally, though,
> having such flexibility is not worth saving the user 1 instruction.
>
> Ultimately, there is no completely valid way for a macro to determine
> whether a symbol is intended to be the value or the address of the
> value. In fact, there's not any solid reason why a bare number couldn't
> be a valid address.
>
> sas
>
> On 11/2/2013 11:39, esst...@juno.com wrote:
> > I have a simple macro
> >
> >          AMOVE  &L=LENGTH,&S=SOURCE,&T=Target
> >          L     R15,&L              .Length Of Move
> >      ...
> >      ...
> >          MVCL  Ra,Rb
> >          MEXIT
> >          MEND
> >
> > In a Macro I wish to generate 3 different instructions depending on the
> > value supplied for &L.
> >
> > If I specify AMOVE L=LENGTH
> > I want the macro to generate a LOAD Of a Full Word
> >         L Rz,LENGTH
> >
> > LENGTH DS F
> >
> > If I Specify AMOVE L=32767
> > I want the macro to generate a Load Addres
> >         LA  Rz,32767
> >
> > If I specify AMOVE  L=EQUATE
> > I want the macro to generate a Load Address of
> >         LA  Rz,EQUATE
> >
> > EQUATE EQI (*-BEGIN)
> >
> >
> > Could someone please provide an example as to how to test for
> > the conditions above in a Macro.
> >
> > Paul D'Angelo
> > *******************************

Reply via email to