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
 

 

CALL MACRO EXECUTE FORM - Setting the 'VL' attribute

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

New User


Joined: 10 Jul 2012
Posts: 24
Location: USA

PostPosted: Tue Feb 09, 2016 10:32 pm    Post subject: CALL MACRO EXECUTE FORM - Setting the 'VL' attribute
Reply with quote

Hi All,

When I use CALL MACRO for non re entrant code, I do not have to use the EXECUTE form, so my code looks more like this:

Code:

CALL  ABCD,(P1,P2,P3),VL


In this case, I get the last parm address with the higher order byte set. This is all good.

But for RE-ENTRANT code , when using the Execute form of the CALL macro where should the VL attribute be specified.

This is the code:
Code:

 CALL  ABCD,MF=(E,PARMADDR)   
 
 PARMADDR CALL ,(P1,P2,P3),MF=L


I tried putting the VL right after the PARMADDR and it actually changes the address to actual data it references to. Then VL anywhere else gives S0C1. I would please like to understand where should the VL attribute go in the execute form for the last parm address to be set with higher order byte on.

Your help would be really appreciated. Thanks!


Thanks,
Sudarshan
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 09, 2016 10:34 pm    Post subject: Reply to: CALL MACRO EXECUTE FORM - SETTING THE VL ATTRIBUTE
Reply with quote

just run a few tests looking at the macro expansions
and find where the VL bit is set
Back to top
View user's profile Send private message
Willy Jensen

New User


Joined: 01 Sep 2015
Posts: 96
Location: Switzerland

PostPosted: Wed Feb 10, 2016 1:12 am    Post subject:
Reply with quote

Hi,
the VL must go on the CALL statement, i.e:
Call mymod,(p1,p2,p3),mf=(E,plist),VL

And if your program really is reentrant, then the plist field better be getmained.
I suggest reading up on the the 'mf' option.
Back to top
View user's profile Send private message
sudarshan.srivathsav

New User


Joined: 10 Jul 2012
Posts: 24
Location: USA

PostPosted: Wed Feb 10, 2016 1:50 am    Post subject:
Reply with quote

Willy,

Thanks a ton, it works this way.

But one of my other requirement, I also need a way to use VL with 64 bit Program, but when i try to use the VL parameter it says:

12,*** IHB280 VL INVALID WITH 8_BYTE_ENTRY_PLIST

I mean would by any chance know a way to use CALL or some other macro which sets the higher order byte of a 64 bit register.

Thanks,
Sudarshan
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7912
Location: Bellevue, IA

PostPosted: Wed Feb 10, 2016 3:04 am    Post subject:
Reply with quote

From the Assembler Services Guide manual:
Quote:
Lengths and formats of parameters are defined by the called service. For an AMODE 24 or AMODE 31 program, the parameter list consists of 4-byte wide address slots; for an AMODE 64 program, the parameter list consists of 8-byte wide address slots. For an AMODE 24 or AMODE 31 program, the high order bit of the last address slot is used to indicate the end of the list. For an AMODE 64 program, that convention is not used. Instead, a separate parameter would be provided if the target program needs to be able to determine how many parameters were passed. That separate parameter could be within the parameter list (for example, the first parameter list slot) or could be in register 0.
Back to top
View user's profile Send private message
sudarshan.srivathsav

New User


Joined: 10 Jul 2012
Posts: 24
Location: USA

PostPosted: Wed Feb 10, 2016 3:10 am    Post subject:
Reply with quote

Robert, Thank you so much and appreciate everyone who participated in this thread to help me with this problem. I have got all the information which is required.


Thanks again all!
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Wed Feb 10, 2016 5:58 am    Post subject:
Reply with quote

Code:
         CALL  TEST2,(A,B),VL,MF=(E,PARMLIST)
         CALL  TEST3,(,B,C),VL,MF=(E,PARMLIST)

PARMLIST CALL  ,(*-*,*-*,*-*),VL,MF=L
expands to
Code:
                                     18          CALL  TEST2,(A,B),VL,MF=(E,PARMLIST)
00001E 0700                          20+         CNOP  0,4
000020 47F0 C028            00028    21+         B     *+8
000024 00000000                      22+IHB0007B DC    V(TEST2)
000028 4110 C068            00068    27+         LA    1,PARMLIST
00002C 41E0 C074            00074    28+         LA    14,A
000030 41F0 C080            00080    29+         LA    15,B
000034 90EF 1000            00000    30+         STM   14,15,0(1)
000038 9680 1004      00004          31+         OI    4(1),X'80'
00003C 58F0 C024            00024    32+         L     15,IHB0007B
000040 05EF                          33+         BALR  14,15
                                     34          CALL  TEST3,(,B,C),VL,MF=(E,PARMLIST)
000042 0700                          36+         CNOP  0,4
000044 47F0 C04C            0004C    37+         B     *+8
000048 00000000                      38+IHB0013B DC    V(TEST3)
00004C 4110 C068            00068    43+         LA    1,PARMLIST
000050 41E0 C080            00080    44+         LA    14,B
000054 41F0 C08C            0008C    45+         LA    15,C
000058 90EF 1004            00004    46+         STM   14,15,4(1)
00005C 9680 1008      00008          47+         OI    8(1),X'80'
000060 58F0 C048            00048    48+         L     15,IHB0013B
000064 05EF                          49+         BALR  14,15
The OI instruction is setting the high order bit of the last argument as defined in the parameter list as specified the CALL macro.

Not all the macros that provide for MF=E / MF=L expansions behave this way. For example -
Code:
         OPEN  (DCB1,OUTPUT,DCB2,OUTPUT),MF=(E,OPARM)
         ...
OPARM    OPEN  (*-*,,*-*),MF=L
will not alter the high order bit, though it will carefully preserve any of the remaining bits in the high order byte of the last word in the prototype parameter list.

<War story on>I, my self, was caught up in this years ago. I had noticed this behavior in OPEN and CLOSE. Quite suddenly, OPEN and CLOSE were changed to set the high order bit. "Yipee," I said to my self, "They're behaving correctly!" After the next PTF cycle, OPEN and CLOSE reverted to their previous behavior. After some thought I realized the issue: the new behavior broke programs that used MF=E to alter some, though not all of a prototype parameter list; the new behavior cut off the parameter list.<War story off>

My war story makes a point. In theory, you should regard the macro expansion as a black box, but not a black box to be fully trusted, especially when using MF=E to fill in a prototype parameter list built by MF=L. In other words, check the expansion.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Wed Feb 10, 2016 6:41 am    Post subject:
Reply with quote

sudarshan.srivathsav wrote:
... But one of my other requirement, I also need a way to use VL with 64 bit Program, but when i try to use the VL parameter it says:

12,*** IHB280 VL INVALID WITH 8_BYTE_ENTRY_PLIST

I mean would by any chance know a way to use CALL or some other macro which sets the higher order byte of a 64 bit register. ...
It's AMODE 64, not AMODE 63. The macro is telling you it won't alter a bit that can be used to address storage.
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 Cobol EZASOKET call to SETSOCKOPT fails Andi1982 COBOL Programming 6 Thu Oct 06, 2016 7:12 pm
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts execute APP if they are not ADDRESS T... italo_pm CLIST & REXX 3 Fri Aug 12, 2016 2:15 am
No new posts XFACILIT class setting for Fault Anal... egrove IBM Tools 2 Thu Aug 11, 2016 8:02 pm


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