In one of the posts, it was mentioned that the LA causes the assembler
to do a look-ahead if &Target has not been found yet.
I don't know why the CLC.

Tony Thigpen

-----Original Message -----
 From: David Bond
 Sent: 05/23/2012 12:07 PM
What is the purpose of using CLC with a null first operand and then
replacing the first part with LA?  Isn't it better to use:
&Lab MVC&Target.(0),&Source
and then replace the length?

My biggest problem with the version below is that it does no RENT checking.
Neither CLC nor LA will flag&Target if it is within a RSECT or if the RENT
option is set. Also the XREF will not show&Target as modified.

On Tue, 22 May 2012 11:46:24 -0700, John Ehrman wrote:
This version issues an MNOTE if the source operand is longer than the
target.  The message severity can be modified to suit your preferences.

        Macro
&Lab    MVC2&Target,&Source
&Lab    CLC   0(0,0),&Source    X'D500 0000',S(&Source)
        Org   *-6               Back up to first byte of instruction
        LA    0,&Target.(0)     X'4100',S(&Target),S(&Source)
        Org   *-4               Back up to first byte of instruction
        DC    AL1(X'D2',L'&Source-1)  First 2 bytes of instruction
        Org   *+4               Step to next instruction
        AIF   (L'&Target ge L'&Source).Done
        MNote *,'MVC2: Length of ''&Source'' greater than length of ''&*
              Target''.'
.Done   MEnd

Thanks for the comments and suggestions.


Reply via email to