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=(5) register contains length
LADR=(5) register contains fullword address
The responsibility for the correct usage of the macro is up to the caller.
Keep it simple ...
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.
> On 11/2/2013 11:39, E.J. 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.
> > P.A.
> > *******************************