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, [email protected] 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