From: "John McKown" <[email protected]> Sent: Friday, October 16, 2015 12:14 AM
On Thu, Oct 15, 2015 at 7:30 AM, Robin Vowels <[email protected]> wrote:
From: "Jon Perryman" <[email protected]> Sent: Thursday, November 21, 2013 1:24 PM Rather than moving the data to the 8 byte work field, you could calculatethe length you want to move and then move it. LA R3,5 Counter for EX MOVE MVC WORKAREA(0),0(R9) Move instruction for execute EX R3,MOVE Move 5 bytesWell, actually, it moves 6 bytes.
I've sometimes thought that it would have been better if the length field in the MVC was actually the number of bytes to move. Which would make a length of zero essentially be a "no-op". But would be more intuitive. And make it easier to put the EX'd MVC "in line". It would also save code and a branch if the true length actually was zero. I'm sure that there was originally some hardware reason to move one more byte than the number in the MVC. Surely the ability to move [0..255] is not really significantly less useful than the ability to move [1..256]. The reason is that they wanted the ability to move up to 256 bytes. Had zero been a "no-op" as you suggest, then MVC could move up to only 255 bytes (1:255). I agree about the need to move exactly k bytes, where k is given in a register. IBM should have produced a special EXC instruction for characters, that did what EX does, but accepts k, the number of bytes to move (or compare, etc), tests for zero (and performs a no-op if it is), subtracts 1, and then executes MVC. --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com
