Switch CLC operands works, but leaves the code messier.
CLC =C'OPEN ',COMMAND
CLC =C'CLOSE ',COMMAND
CLC =C'TERMINATE ',COMMAND
CLC =C'END ',COMMAND
vs:
CLC:2 COMMAND,=C'OPEN '
CLC:2 COMMAND,=C'CLOSE '
CLC:2 COMMAND,=C'TERMINATE '
CLC:2 COMMAND,=C'END '
Tony Thigpen
-----Original Message -----
From: Tuben, Gregg
Sent: 05/22/2012 11:06 PM
I don't object to MVC:2 although I don't need it and it seems almost everyone
has a solution already.
regarding CLC:2 if you know the second operand is shorter make it the first
operand - that problem is solved.
Gregg
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On
Behalf Of Tony Thigpen
Sent: Tuesday, May 22, 2012 9:45 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: MVC with 2nd operand length
After reading this over the last few days, I got to ask:
Why is everyone so concerned about validating the move to length when
nobody is concerned about the move from length?
Let's get real here. Almost everything we move is within a dsect along
with other fields both before and after it. This means that should we
move something too long, we just wipe out some of our other fields and
get strange errors. On the other hand, move a short field to a longer
field and we also get errors when we throw garbage into our data. For
example, how is:
MVC FLDA,FLDB (receiver too short)
any worse than
MVC FLDC,FLDD (sender too short)
FLDA DS CL10
FLDB DS CL20
FLDC DS CL20
FLDD DS CL10
Both are bugs that will have to be chased down.
So, if we are willing to put up with the first error because it's been
that way for 40 years, why all the 'horror' at
MVC:2 FLDA,FLDB
Be consistent.
Also, what ever is proposed for MVC needs to be also made available for
CLC and other instructions.
Tony Thigpen
-----Original Message -----
From: robin
Sent: 05/22/2012 09:21 PM
From: Gainsford, Allen
Sent: Tuesday, 22 May 2012 8:37 AM
Agreed. I'd suggest that an instruction tag (like the :ASM and :MAC tags
that HLASM already supports) might be a good syntax to allow this. For
example:
MVC DEST,SRCE USE DEST LENGTH
MVC:2 DEST,SRCE USE SRCE LENGTH
And MVC DEST,SRCS()
However, as I said before, better to use a defined constant
having a clear unequivocal length a la CLx.
To avoid errors, probably even better to use a macro that checks that
DEST is not shorter than SRCE.