> -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On > Behalf Of Patrick O'Keefe > Sent: Monday, November 06, 2006 2:01 PM > To: [email protected] > Subject: Re: Assembler question > > On Mon, 6 Nov 2006 13:37:50 +0100, Chris Mason <[EMAIL PROTECTED]> > wrote: > > >... > >I was commenting on the following instruction: > > > > MVC M1CC-1(L'M1CC+1),=X'402120202020' MOVE IN EDIT MASK > >... > >The task is to move a 6-character string into a storage area. There needs > to > >be some symbolic reference to the storage area so the M1CC variable is > used. > >... > > I'm afraid I don't understand what the issue is. Seems to be a matter of > style. I see the task as moving a edit mask into a field that starts one > byte prior to M1CC and extends to the end of M1CC. I have to build the > mask so have to know that the length is 6 but M1CC-1(L'M1CC+1)explains > why it is 6. Is that bad? > > Actually, if I had to do that more than once or twice I'd probably write > a macro that builds both the MVC and the mask, and would (hopefully) > comment it well enough that a neophyte would understand. > > Pat O'Keefe
The main issue for me is that the literal has a hard-coded length, while the other operand uses a symbolic reference for the length. If the symbol changes, there is no warning that the literal is now the wrong length. In situations like this, I usually add an assertion that insists on equality between the symbol and the literal length, but that is still vulnerable to maintenance errors. A EQU L'M1CC+1 B EQU 6 MVC M1CC-1(A),=XL(B)'402120202020' MOVE IN EDIT MASK DS ((A-B)*(B-A))X If A is unequal to B, this causes an assembly-time error. I use an ASSERT macro to hide the DC details, which makes the source code easier to read. Jeffrey D. Smith Principal Product Architect Farsight Systems Corporation 700 KEN PRATT BLVD. #204-159 LONGMONT, CO 80501-6452 303-774-9381 direct 303-484-6170 FAX http://www.farsight-systems.com/ comments are invited on my encryption project ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

