View previous topic :: View next topic
|
Author |
Message |
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
reading a listing will let You discover anything You want to know about an assembler program |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
any suggestion might be wrong unless You tell the base register allocation/use strategy |
|
Back to top |
|
|
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I must be having a brain-slow Friday. . .
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 |
|
|
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
can you put a DC AL4(*-csectname) at the end and see what it gets as a value in the listing? |
|
Back to top |
|
|
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
Pankaj Shrivastava Currently Banned New User
Joined: 24 Jul 2009 Posts: 51 Location: Pune
|
|
|
|
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 ..but not a perfect solution |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
...but not a perfect solution |
why blame others 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 |
|
|
|