DCB and APF Authorized



High Level Assembler(HLASM) for MVS & VM & VSE

Re: DCB and APF Authorized

Postby sensuixel » Tue Feb 12, 2013 2:37 pm

The structure of my program looks like this

0) Standard prologue
1) Obtain storage for WORK31 and ...
2) Initialize it with a MVCL

3) Obtain storage for WORK24 and ...
4) Initialize it with a MVCL

5) I open the file using a dedicated CSECT called by BAKR - PR
6) I check the JCL parm using a dedicated CSECT called by BAKR - PR
7) I read the SYSIN ...
8) and i check it using a dedicated CSECT called by BAKR - PR
9) I perform the main task (still using a dedicated CSECT)
10) I close my file using a dedicated CSECT called by BAKR - PR
11) I release the storage and quit the program

I used this much of CSECT to avoid lack of registers.
sensuixel
 
Posts: 58
Joined: Mon Feb 21, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DCB and APF Authorized

Postby enrico-sorichetti » Tue Feb 12, 2013 3:51 pm

and Yes, I am very picky when it comes to assembler programmingm ;) at least for the programs I write.
to avoid surprises I prefer to fill up myself the proper addresses in the <copied> DCBs/DCBEs

for a plain DCB for example
here is my standard <open> sequence

000098 ...
000099 LA <DCBREG>,<DCBADDR>
000100 USING IHADCB,<DCBREG>
000101 MVC DCBDDNAM,<DDNAME>
000102 LA R15,<DCBEOFADDR>
000103 STCM R15,B'0111',DCBEODA
000104 OPEN ((<DCBREG>),(INPUT)),MF=(E,OPENLST)
000105 TM DCBOFLGS,DCBOFOPN
000106 BO <PROCESS>
000107 ...


just chatting about it, probably You already took care of that

{Replaced with correct snippet}
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: DCB and APF Authorized

Postby steve-myers » Tue Feb 12, 2013 5:23 pm

sensuixel wrote:I didn't know that using the linkage stack was slower than regular linkage.
I used a BAKR to build the linkage stack and then PR to exit (as taught by our instructor recently, but he didn't mentionned the performance issue).

I think your analysis on the DCBE is right, the DCBE must be somehow invalid or ignore.

By the way, my program is reenterable.
  • Back in the 90s I carefully measured it, and I was quite surprised. Think about it. In z/Architecture BAKR saves 16 64-bit registers, and 16 32-bit access registers. In ESA/390, BAKR saves 16 32-bit registers and 16 32-bit access registers Conventional linkage saves 15 32-bit registers, and you may need fewer. In your OPEN_FIC and CLOSE_FIC, depending on the details, you might just need to save and restore reg 14.
  • As for Mr. Sorichetti's comment about too many CSECTs. I thought about that issue, too, though in a different context. I wondered why you defined WORK24 as RMODE ANY. Then I realized you moved it to 24-bit storage, and then I realized you did not have any 24-bit address constants in it, so there was no issue about the RMODE ANY. Then I realized you had the reentrancy problem with the DCBE.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: DCB and APF Authorized

Postby sensuixel » Tue Feb 12, 2013 7:43 pm

enrico-sorichetti wrote:and Yes, I am very picky when it comes to assembler programmingm ;) at least for the programs I write.
to avoid surprises I prefer to fill up myself the proper addresses in the <copied> DCBs/DCBEs

for a plain DCB for example
here is my standard <open> sequence

000098 ...
000099 LA <DCBREG>,<DCBADDR>
000100 USING IHADCB,<DCBREG>
000101 MVC DCBDDNAM,<DDNAME>
000102 LA R15,<DCBEOFADDR>
000103 STCM R15,B'0111',DCBEODA
000104 OPEN ((<DCBREG>),(INPUT)),MF=(E,OPENLST)
000105 TM DCBOFLGS,DCBOFOPN
000106 BO <PROCESS>
000107 ...


just chatting about it, probably You already took care of that


Your code is more legible than mine.

i'm currently "rebuilding" my code, I'll get rid of BAKR - PR to improve efficiency. :)
sensuixel
 
Posts: 58
Joined: Mon Feb 21, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DCB and APF Authorized

Postby steve-myers » Wed Feb 13, 2013 12:26 am

sensuixel wrote:... I'll get rid of BAKR - PR to improve efficiency. :)
In practice, for this case, you won't notice any difference. You would need hundreds or thousands of calls to notice a difference.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: DCB and APF Authorized

Postby sensuixel » Wed Feb 13, 2013 12:40 am

I know it, but as a matter of principles i try, whenever i can, to use what seems to be the best practices ;)
sensuixel
 
Posts: 58
Joined: Mon Feb 21, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DCB and APF Authorized

Postby steve-myers » Wed Feb 13, 2013 11:09 am

sensuixel wrote:You're right, I have modified the RMODE of WORK24 , i've replaced my RSECT by CSECT and removed the RENT option and
it works now ...

But i don't know if the problem comes from the APF or from the RENT (maybe both of it) , i'll go check that in the manuals.
Both, as I sort of explained earlier. With the DCBE pointer corrected, it should be reenterable.

You do not want to change the RMODE of your WORK24 CSECT/RSECT. That will have the effect of making the load module RMODE 24. I think the comment from someone else was because they thought the storage in WORK24 was going to be used in place, not moved below the line and the below the line copy would be used.

In another post, you talked about trying to use "best practices." I do not believe what you are doing falls under "best practices." I know it took me quite a while before I fully understood what you were trying to do. Once I did I thought, "Clever, but confusing," not because it is "wrong," but because it is not done the way many people do similar things. I won't go into details, but the way I have done dynamic allocation in most programs for 30 years falls into this category.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: DCB and APF Authorized

Postby steve-myers » Wed Feb 13, 2013 11:29 am

enrico-sorichetti wrote:and Yes, I am very picky when it comes to assembler programmingm ;) at least for the programs I write.
to avoid surprises I prefer to fill up myself the proper addresses in the <copied> DCBs/DCBEs

for a plain DCB for example
here is my standard <open> sequence

 000098          ...
 000099          LA    <DCBREG>,<DCBADDR>           
 000100          USING IHADCB,<DCBREG>
 000101          MVC   DCBDDNAM,<DDNAME>
 000102          LA    R15,<DCBEOFADDR>
 000103          ST    R15,DCBEODAD
 000104          OPEN  ((<DCBREG>),(INPUT)),MF=(E,OPENLST)
 000105          TM    DCBOFLGS,DCBOFOPN
 000106          BO    <PROCESS>
 000107          ...   


just chatting about it, probably You already took care of that
Actually, the code to populate DCBEODAD is incorrect. The address is in 3 bytes, actually at DCBEODAD+1 or DCBEODA. The first byte of DCBEODAD is DCBBFTEK/DCBHIARC/DCBBFALN, depending on the bits that are used. DCBHIARC, of course, has been obsolete for nearly 40 years, but the other two elements, especially DCBBFTEK, are still valid.

{corrected above: if there is one piece of invalid code amongst many, that will be the code chosen as an example...}
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: DCB and APF Authorized

Postby enrico-sorichetti » Wed Feb 13, 2013 12:30 pm

:oops:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: DCB and APF Authorized

Postby BillyBoyo » Wed Feb 13, 2013 5:11 pm

For clarity I have edited the above posts with a different example provided by enrico.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

PreviousNext

Return to Assembler