Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Blank /Space out big memory area in Assembly

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Manu Dhawan

New User


Joined: 01 Jun 2009
Posts: 9
Location: India

PostPosted: Wed Oct 06, 2010 11:45 am    Post subject: Blank /Space out big memory area in Assembly
Reply with quote

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
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Oct 06, 2010 3:58 pm    Post subject: Reply to: Blank /Space out big memory area in Assembly
Reply with quote

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.

Code:

         L     R1,=A(L'BIGAREA)

MVCL will clear up to 16MB-1. For areas that exceed 16MB-1, review MVCLE.

Bill
Back to top
View user's profile Send private message
Manu Dhawan

New User


Joined: 01 Jun 2009
Posts: 9
Location: India

PostPosted: Wed Oct 06, 2010 4:21 pm    Post subject: Reply to: Blank /Space out big memory area in Assembly
Reply with quote

Thanks Bill.....Great Explanation

I had coded the same way with little modifications like instead of LHI I used LA i.e.

Code:
LA   R1,L'BIGAREA


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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Oct 06, 2010 4:29 pm    Post subject: Reply to: Blank /Space out big memory area in Assembly
Reply with quote

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
View user's profile Send private message
Manu Dhawan

New User


Joined: 01 Jun 2009
Posts: 9
Location: India

PostPosted: Wed Oct 06, 2010 4:43 pm    Post subject: Reply to: Blank /Space out big memory area in Assembly
Reply with quote

Thanks again Bill.

Yeah that was a mistake for ICM.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Oct 06, 2010 5:07 pm    Post subject: Reply to: Blank /Space out big memory area in Assembly
Reply with quote

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.... icon_wink.gif

Bill
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts Not enough virtual memory is availabl... Vinay Pushpala IBM Tools 16 Tue Sep 13, 2016 4:37 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us