On 5/16/2012 1:10 PM, Ray Mansell wrote:
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.

Wow! Now there's a really ugly thought! DON'T DO IT!



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




--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-355-2752
http://www.trainersfriend.com

* To get a good Return on your Investment, first make an investment!
  + Training your people is an excellent investment

* Try our tool for calculating your Return On Investment
    for training dollars at
  http://www.trainersfriend.com/ROI/roi.html

Reply via email to