View previous topic :: View next topic
|
Author |
Message |
Manu Dhawan
New User
Joined: 01 Jun 2009 Posts: 9 Location: India
|
|
|
|
Hi,
What is the best way to blank out i.e putting spaces (x'40') in a large memory area say 4K.
Should we use MVCL? if yes then how.
Regards,
Manu Dhawan |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 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.
EG:
Code: |
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 -
Code: |
ICM R15,B'1111',=X'40000000'
|
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.
Bill |
|
Back to top |
|
|
Manu Dhawan
New User
Joined: 01 Jun 2009 Posts: 9 Location: India
|
|
|
|
Thanks Bill.....Great Explanation
I had coded the same way with little modifications like instead of LHI I used LA i.e.
And yes I used ICM
Code: |
XR R15,R15
ICM R15,B'1000',X'40' |
Cause it is just one immediate character that you are inserting.
Also you said that when length exceeds 768 then we use MVCL. Did you mean 256 because I know that MVC is up to 256 and for more than that we use MVCL. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Remember, LA is limited to 4095. This is why LHI is preferred. The ICM to R15 was to ensure that the low-order three-bytes were X'000000' and the high-order is the pad-character.
I use 768 as a cutoff point because it's less cycles to use an MVI, followed by a 255-byte propagation MVC then two 256-byte MVC's.
But, this is just my opinion.
I certainly would not use MVCL for lengths less than 257.
BTW, your ICM requires the character as a literal (=X'40'), not an immediate.
Bill |
|
Back to top |
|
|
Manu Dhawan
New User
Joined: 01 Jun 2009 Posts: 9 Location: India
|
|
|
|
Thanks again Bill.
Yeah that was a mistake for ICM. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
One last thought. You could use XR R15,R15, followed by an OIHH R15,16384 (X'4000' - the pad-character X'40'), which is an immediate instruction and will "OR" a X'4000' into the high-hword of R15.
But, I'm not sure if the LA R15,64 combined with the SLL R15,24 causes more or less cycles. If there is a difference, it would probably be immeasurable.
Anyway, it's good to have options....
Bill |
|
Back to top |
|
|
|