IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Free space in program .


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Fri Aug 14, 2009 6:05 pm
Reply with quote

Hi ,

Is it possibel to determine the free space in the ASM program by looking at listing . I want to know know how much space is still left with the base registers .

Thanks

Reason for the BAN: Respect our Moderators.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Aug 14, 2009 6:13 pm
Reply with quote

reading a listing will let You discover anything You want to know about an assembler program
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Aug 14, 2009 6:15 pm
Reply with quote

Are you referring to CSECT Base-Registers? What does your CSECT USING statement specify?

What is the LENGTH of the program after Assembly?

Is this CICS/Assembler or Batch?

Actually, the question should refer to register "addressability" and not "space".

Bill
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Fri Aug 14, 2009 6:31 pm
Reply with quote

I am using this calculation for free space :

(Number of base register * 4096 - 1) - ( current location counter - start of pgm LC)

But this is taking some time to find all the parametrs . The PGm is batch.
Is it possible ..does soemthing in listing can tell me directly without going thru the above cal.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Aug 14, 2009 6:38 pm
Reply with quote

any suggestion might be wrong unless You tell the base register allocation/use strategy
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Fri Aug 14, 2009 6:53 pm
Reply with quote

For example , I am declaring the base registers as :

PGM START 0
LM R3,R5,ADD
USING PGM,R3,R4,R5

.......
ADD DC A(PGM),A(PGM+4095),A(PGM+8191)

But this code being know to me , is easy to figure out the free space . My task gets time consuming when i analyze some complex modules having multiple csect . Is there any trick some listing data ..which can solve the purpose without doing manual calculation .
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 14, 2009 8:35 pm
Reply with quote

Hello,

I must be having a brain-slow Friday. . . icon_confused.gif

I'm confused on exactly what the goal is.

Does each new csect not "start over" using a new set of registers?

How will the "answer" be used?
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Fri Aug 14, 2009 10:06 pm
Reply with quote

doing this whole thing on the real code(listing) is taking some time to figure out ,going in each csect and finding the number of registers used in base addressing , task becomes bit more time consuming when the program is having a number of USING declarative to establish desct addresiblity also , if the base addres registers is declared at two diff location in the same csect , it again consumes time to find the Total number of base registers used in csect .
Is this the only way to do this .can something be done to estimate this without going thu the trouble of this much analysis , is any tool available ?

Thanks
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 14, 2009 10:10 pm
Reply with quote

Hello,

Yes, this will surely take an inordinate amount of time. . .

Quote:
Is this the only way to do this .can something be done to estimate this without going thu the trouble of this much analysis
Why do you have the "requirement" to do this in the first place?

What should "the answer" provide? Why is it worth the time to even do this?
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Fri Aug 14, 2009 10:20 pm
Reply with quote

I am developing a tool for debugging pgm in my application , wherien It will implant WTO macros in pgm to trace the trajectory of a record in pgm . I have to calculate the free space in pgm to decide how many WTO my tool can implant in the pgm .
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Sat Aug 15, 2009 6:08 am
Reply with quote

can you put a DC AL4(*-csectname) at the end and see what it gets as a value in the listing?
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Sat Aug 15, 2009 9:23 am
Reply with quote

Babu ,

I don't have system with me now so cant experiment with this code , But i believe DC AL4(*-csectname) wont solve the problem , as it will just give the length/size of CSECT.For free space anyhow the base registers should be identified .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Aug 15, 2009 6:23 pm
Reply with quote

Quote:
as it will just give the length/size of CSECT
Since the CSECT is 4096 bytes at most, won't you be able to subtract the length/size from 4096 and find out exactly how many bytes are free? Without knowing the base register, even?
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Sat Aug 15, 2009 6:51 pm
Reply with quote

Please could you cross check this statement again , I guess may be some confusion is here or may be you are saying this in context to some specific situation .

Quote:


Since the CSECT is 4096 bytes at most



CSECT size may go way beyond 4096 bytes depending upon the number of base registers declared .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Aug 15, 2009 7:26 pm
Reply with quote

And you're not able to figure out how to generalize the formula?

You might want to rethink your approach and come up with a solution that you can understand and implement -- or if you cannot, perhaps you're not ready to develop such a tool yet.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Aug 15, 2009 8:11 pm
Reply with quote

Quote:
CSECT size may go way beyond 4096 bytes depending upon the number of base registers declared .


plain wrong...

a csect size will be what it will be
Code:

...
         l somereg,=a(thingy)
...
         ltorg
...
sample   csect
thingy   ds 247560cl1
         csect


the csect size does not depend on the addressability scheme used
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Aug 15, 2009 8:22 pm
Reply with quote

With the advent of baseless assembler programming, it'll be interesting to see how you handle this the first time you come across it. Without a base register, how are you going to proceed?
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Sat Aug 15, 2009 9:06 pm
Reply with quote

Quote:
CSECT size may go way beyond 4096 bytes depending upon the number of base registers declared .

That is correct. The control section size and the addressability of a single base register are unrelated. One base register may not address the whole CSECT but that is why you can have multiple base registers. As Robert points out, it is not necessary to have base registers any more since you can use jump instead of branch, and use of immediate instructions for referencing short static data, and put everything you can't get from immediate instructions into a static CSECT which uses a non-dedicated base register and a DSECT for just the data, but somehow that seems impractical to me, probably because I've never tried to do it.[/quote]
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Aug 15, 2009 9:20 pm
Reply with quote

the statement as stated is just plain wrong
csect size and number of base registers are UNRELATED
all depends on the techniques being used

for a beginner it might be easier to use as many registers as needed ( csect_size / 4096 )
for a more experienced programmer not true
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Sun Aug 16, 2009 11:28 am
Reply with quote

because the original question was related to addressability, I took "CSECT size" to mean "addressability within a CSECT", but strictly speaking, Enrico, you are correct that the way it is written states that the total length of the csect, not addresability within it, depends on the number of base registers and that statement, as written, is definitely wrong. I read too much into it.

It is not uncommon to have data areas at the end of a nonreentrant CSECT that are not addressable by the base registers which access the code but are addressed by index registers or temporary 'base' registers (pointers). An even more common case is a data only CSECT which has no base registers at all because it has no code.
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Sun Aug 16, 2009 9:22 pm
Reply with quote

I guess discussion is moving in to CSECT size , and what i said is in context to my problem , wherein I need to find the frees space spared by the base registers.

CSECT size - Area(bytes) my base registers are capable to address. It can go way beyond 4096 if I use more than 1 BR.
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Mon Aug 17, 2009 1:21 pm
Reply with quote

I am trying to read the listing of a compiled program in order to find an alternative of knowing the base registers . The program is having one CSECT only . In the following USING map , Registers 3,4,9,12 are for DSECT addressability and Registers 10 and 11 are the base registers declared for the CSECT .

So this CSECT is capable of addr 8192 bytes . Please correct me as I am just guessing and dont know how to decipher the USING map.
Code:

            Using Map                                               
                                                  HLASM R5.0  2009/08
--------Using----------------- Reg Max     Last Label and Using Text
      Value    Range     Id        Disp    Stmt                     
    00000000 00001000 FFFFFFFD   3 00036   8121 CURORDER,R03         
    00000000 00001000 FFFFFFFC   4 004C2   7854 BJ2DSHEZ,R04         
    00000000 00001000 FFFFFFFF   9 00C7E   7956 COMMAREA,R09         
    00000FFF 00001000 FFFFFFFF  12 00F3E   8080 COMMAREA+4095,R12   
    00000000 00001000 00000001  15 00014   5751 *,R15               
                                15              R15                 
    000                           Using Map              R10         
    000                                                  4095,R11   
       Action ----------------Using----------------- Reg             
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Tue Aug 18, 2009 9:41 am
Reply with quote

This has been explained already, but a CSECT is just a block of memory that contains code and data. It does not address anything and the number of base registers used in the program has nothing to do with the total size of a CSECT. If you want the size of a CSECT, the USING MAP will not give you anything useful. I think you need to get the terminology correct because now it seems no one can figure out what you are asking.
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Tue Aug 18, 2009 11:04 am
Reply with quote

icon_neutral.gif sorry i asked this question , but still cant understand what was so confusing in the question , Did no body ever find such a situation where a need to find the free space arose . I agree that there are special techniques as pointed by Enrico to address without base registers , But i have been asking right from the begining that my requirement is,given a set of base registers to establish the addresibilty ..is there any convinient way to find the free space .
Anyways thanks all for giving time in the discussion...this surely has given some valauble info icon_smile.gif ..but not a perfect solution icon_sad.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Aug 18, 2009 2:12 pm
Reply with quote

Quote:
...but not a perfect solution


why blame others icon_evil.gif for Your unwillingness to ...
- listen and understand what is being told
- amend Your understanding of addressability and csect size
- learn the proper terminology , nothing as free space in a csect
- learn the basics, for donkey programming the number of base registers needed is csectsize/4096

since the beginning you were told that your question did not make sense.
no reason at all to complain
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top