Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
IMHO, when the length exceeds 768, then an MVCL should be used. In this example R0/R1 and R14/R15 are used. As a failsafe, you may want to save them beforehand, unless you're sure they're not being used.
BIGAREA DS XL4096
LA R0,BIGAREA RECEIVING-ADDRESS
LHI R1,L'BIGAREA RECEIVING-LGTH
XR R14,R14 SENDING-ADDRESS
LA R15,64 LOAD WITH X'00000040'
SLL R15,24 COMPLETE SENDING-LGTH
MVCL R0,R14 CLEAR TO SPACES
Instead of the two instructions against R15, some folks use -
LHI is an immediate instruction. If the length exceeds 32767, then you need to specify a fullword.
MVCL will clear up to 16MB-1. For areas that exceed 16MB-1, review MVCLE.