The assembler does support the L' construct for literals, e.g.:
LA R0,=A(L'=C'Length of this literal')
(Folks, read the OT? Assembler "enhancements"? thread. That's where this MVC
discussion started.)
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On
Behalf Of Ray Mansell
Sent: Wednesday, May 16, 2012 3:11 PM
To: [email protected]
Subject: Re: MVC with 2nd operand length
Whilst John's example could certainly have been less flowery (though from the
way it's written, I'm assuming it may be a variant of some more general set of
such macros), your suggestion will fail if the source is coded as a literal. I
know, because I had the same reaction, and tried it...
Of course, if the assembler were to support the L' construct for literals, this
would not be a problem.
Ray...
Not (yet) a retired mainframer
On 5/16/2012 3:04 PM, retired mainframer wrote:
> :>: -----Original Message-----
> :>: From: IBM Mainframe Assembler List [mailto:ASSEMBLER-
> :>: [email protected]] On Behalf Of John Ehrman
> :>: Sent: Wednesday, May 16, 2012 9:48 AM
> :>: To: [email protected]
> :>: Subject: MVC with 2nd operand length
> :>:
> :>: This macro uses the length attribute of the second operand as the
> length
> :>: value in the MVC:
> :>: 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
> :>: MEnd
> :>:
> :>: Just write
> :>: MVC2 Target,=C'Whatever you like'
>
> I must be missing something obvious. Why not simply
>
> MACRO
> &Lab MVC2&Target,&Source
> &Lab MVC&Target(L'&Source-1),&Source
> MEND
>
> or avoid the macro completely with
>
> &Lab MVC Label1(L'Label2-1),Label2
>