Re: LE C calling HLASM

2012-04-11 Thread Elardus Engelbrecht
Shmuel Metz (Seymour J.) wrote: http://publib.boulder.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.ikjb300%2Fpack.htm Yes. TSO/E also picked up up PCF. Thanks, Shmuel, for your kind confirmation. Much appreciated. Please keep up with your valuable educational posts. I learn

Re: LE C calling HLASM

2012-04-10 Thread Jan MOEYERSONS
On Fri, 6 Apr 2012 08:45:06 -0700, Phil Smith p...@voltage.com wrote: Darn it, no matter what I've tried, I CANNOT get PL/I to handle a plist [what I'd call] normally-marking the high bit on the last specified parameter. If I use OPTIONAL, I get all the parameters, with zeroes for the ones that

Re: LE C calling HLASM

2012-04-10 Thread Elardus Engelbrecht
Shmuel Metz (Seymour J.) wrote: The original TMP ran unauthorized, including the TMP in SVS and OS/VS2 (MVS); if you look at the COOKIE command, you will see that a nested TMP worked just fine. As I recall, it was the TSO Command Package[1] that added the parallel TMP structure that required

Re: LE C calling HLASM

2012-04-10 Thread Phil Smith
Jan MOEYERSONS quoted the doc, then asked: Is this not true then? I know this has been a protracted thread, so I'll summarize: If I use LIST, I can't use LINKAGE(SYSTEM), so it doesn't set the high bit. If I use OMITTED, it passes a zero for that parameter, so I can't tell whether the parameter

Re: LE C calling HLASM

2012-04-10 Thread Steve Comstock
On 4/10/2012 5:58 AM, Phil Smith wrote: Jan MOEYERSONS quoted the doc, then asked: Is this not true then? I know this has been a protracted thread, so I'll summarize: If I use LIST, I can't use LINKAGE(SYSTEM), so it doesn't set the high bit. If I use OMITTED, it passes a zero for that

Re: LE C calling HLASM

2012-04-10 Thread Phil Smith
Steve Comstock wrote: Ah, so that's what you want it for. But if the output buffer length is zero, doesn't that tell you to use the input buffer? And if an argument is omitted, it will appear as zero, right? I mean, why else would you pass a buffer length of zero? Because users make mistakes? I

Re: LE C calling HLASM

2012-04-10 Thread Steve Comstock
On 4/10/2012 7:00 AM, Phil Smith wrote: Steve Comstock wrote: Ah, so that's what you want it for. But if the output buffer length is zero, doesn't that tell you to use the input buffer? And if an argument is omitted, it will appear as zero, right? I mean, why else would you pass a buffer

Re: LE C calling HLASM

2012-04-10 Thread Shmuel Metz (Seymour J.)
In 0363431161795505.wa.elardus.engelbrechtsita.co...@bama.ua.edu, on 04/10/2012 at 05:39 AM, Elardus Engelbrecht elardus.engelbre...@sita.co.za said: http://publib.boulder.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.ikjb300%2Fpack.htm Yes. TSO/E also picked up up PCF. --

Re: LE C calling HLASM

2012-04-09 Thread Shmuel Metz (Seymour J.)
In 4f804f4a.3070...@valley.net, on 04/07/2012 at 10:29 AM, Gerhard Postpischil gerh...@valley.net said: I ran into an analog of this trying to determine whether a program is running under TSO - presence of TSO control blocks does not indicate that the immediate caller was the TMP. IBM, for

Re: LE C calling HLASM

2012-04-07 Thread Bernd Oppolzer
How do you do this at runtime in a fast way? I would first walk up the save area, get the entry point address of the caller and look if there is the LE signature at position 4 (X'01' followed by 'CEE'), so I know that is is a PL/1 or C compiler (maybe COBOL, too, I'm not sure about this). Then I

Re: LE C calling HLASM

2012-04-07 Thread Bernd Oppolzer
Maybe my misunderstanding is: I'm assuming that I am called dynamically and not linked to the caller (because at our site, we have ONLY dynamic calls). Kind regards Bernd Am 07.04.2012 09:40, schrieb Bernd Oppolzer: How do you do this at runtime in a fast way? I would first walk up the

Re: LE C calling HLASM

2012-04-07 Thread Gerhard Postpischil
On 4/6/2012 7:23 PM, Ken Brick wrote: many years ago I needed to know, in DOS/VS, whether an assembler routine was called from a PL/I or assembler module. I put in a test to see if in DOS terms the weak extrn PLIMAIN was not 0. Non zero meant a PL/I module was present. This works for special

Re: LE C calling HLASM

2012-04-06 Thread Phil Smith
Darn it, no matter what I've tried, I CANNOT get PL/I to handle a plist [what I'd call] normally-marking the high bit on the last specified parameter. If I use OPTIONAL, I get all the parameters, with zeroes for the ones that were omitted. That's not right, because I can't tell whether they

Re: LE C calling HLASM

2012-04-06 Thread Sam Siegel
On Fri, Apr 6, 2012 at 8:45 AM, Phil Smith p...@voltage.com wrote: Darn it, no matter what I've tried, I CANNOT get PL/I to handle a plist [what I'd call] normally-marking the high bit on the last specified parameter. If I use OPTIONAL, I get all the parameters, with zeroes for the ones that

Re: LE C calling HLASM

2012-04-06 Thread Steve Comstock
On 4/6/2012 9:53 AM, Sam Siegel wrote: On Fri, Apr 6, 2012 at 8:45 AM, Phil Smithp...@voltage.com wrote: Darn it, no matter what I've tried, I CANNOT get PL/I to handle a plist [what I'd call] normally-marking the high bit on the last specified parameter. If I use OPTIONAL, I get all the

Re: LE C calling HLASM

2012-04-06 Thread Sam Siegel
On Fri, Apr 6, 2012 at 9:02 AM, Steve Comstock st...@trainersfriend.comwrote: On 4/6/2012 9:53 AM, Sam Siegel wrote: On Fri, Apr 6, 2012 at 8:45 AM, Phil Smithp...@voltage.com wrote: Darn it, no matter what I've tried, I CANNOT get PL/I to handle a plist [what I'd call] normally-marking

Re: LE C calling HLASM

2012-04-06 Thread Phil Smith
Is there a reliable way to tell we were called by PL/I? If so, we could ignore zeroes for PL/I. And document it. ISTR there being a magic fullword in the savearea for PL/I? -- For IBM-MAIN subscribe / signoff / archive access

Re: LE C calling HLASM

2012-04-06 Thread Ken Brick
many years ago I needed to know, in DOS/VS, whether an assembler routine was called from a PL/I or assembler module. I put in a test to see if in DOS terms the weak extrn PLIMAIN was not 0. Non zero meant a PL/I module was present. Ken On 7/04/2012 03:46 AM, Phil Smith wrote: Is there a

Re: LE C calling HLASM

2012-04-06 Thread Steve Comstock
On 4/6/2012 5:23 PM, Ken Brick wrote: many years ago I needed to know, in DOS/VS, whether an assembler routine was called from a PL/I or assembler module. I put in a test to see if in DOS terms the weak extrn PLIMAIN was not 0. Non zero meant a PL/I module was present. Ken On 7/04/2012 03:46

Re: LE C calling HLASM

2012-03-30 Thread Steve Comstock
On 3/28/2012 11:54 AM, Phil Smith wrote: Steve Comstock wrote: On 3/23/2012 2:57 PM, Phil Smith wrote: Now for the next question: this allows us to implement variable parameterlists in C, by declaring the functions thus: int SOMEFUNCTION(char *someparm, ...); Is there an equivalent way to do

Re: LE C calling HLASM

2012-03-30 Thread Phil Smith
Steve Comstock made some helpful suggestions; my big problem was having a comma before the LIST keyword. Making progress but not there yet. So now I have: Declare MYFUNC External('MYFUNC') Entry( Char(*) byaddr, Char(*) byaddr, Fixed Bin(31) byaddr

Re: LE C calling HLASM

2012-03-30 Thread Steve Comstock
On 3/30/2012 2:01 PM, Phil Smith wrote: Steve Comstock made some helpful suggestions; my big problem was having a comma before the LIST keyword. Making progress but not there yet. So now I have: Declare MYFUNC External('MYFUNC') Entry( Char(*) byaddr, Char(*)

Re: LE C calling HLASM

2012-03-30 Thread Phil Smith
Steve Comstock wrote: Well, Phil, one way is to use the built in functions I mentioned in one of my posts: snip Sure, but this is a general API, not PL/I-specific, so I can't use . Seems hard to believe PL/I can't be teased into making this work. Tinkering with OPTIONAL option now... --

Re: LE C calling HLASM

2012-03-28 Thread Phil Smith
Steve Comstock wrote: On 3/23/2012 2:57 PM, Phil Smith wrote: Now for the next question: this allows us to implement variable parameter lists in C, by declaring the functions thus: int SOMEFUNCTION(char *someparm, ...); Is there an equivalent way to do this in PL/I? In the declare of the

Re: LE C calling HLASM

2012-03-25 Thread Shmuel Metz (Seymour J.)
In capd5f5puedvzqroqc2r8l5pwcuouh51qzbktvyn6tc2uuia...@mail.gmail.com, on 03/23/2012 at 04:55 PM, John Gilmore johnwgilmore0...@gmail.com said: o to invoke the HLASM from PL/I using PL/I descriptors, I did that with F and optimizing, but don't know where to find mapping macros for file

Re: LE C calling HLASM

2012-03-23 Thread Don Poitras
#pragma linkage(identifier, OS) In article b870629719727b4ba82a6c06a31c291232410ae...@hqmailsvr01.voltage.com you wrote: When writing an LC C program that calls an HLASM function, the last element of the parameter list does not have the high-order bit set. Is there an option to force it to

Re: LE C calling HLASM

2012-03-23 Thread McKown, John
Not really. As best as I can tell, the C calling sequence is __horrible__. Too much is call by value. Variable length argument lists are accessed via the va_args functions. Try reading here: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ccrug130/3.67 Have you looked at Metal C?

Re: LE C calling HLASM

2012-03-23 Thread Sam Siegel
Look at #pragma linkage. Use linkage OS. You will get a list of addresses w/HO bit set on the last address Sent from my Verizon Wireless BlackBerry -Original Message- From: Phil Smith p...@voltage.com Sender: IBM Mainframe Discussion List IBM-MAIN@bama.ua.edu Date: Fri, 23 Mar

Re: LE C calling HLASM

2012-03-23 Thread Steve Comstock
On 3/23/2012 1:16 PM, Phil Smith wrote: When writing an LC C program that calls an HLASM function, the last element of the parameter list does not have the high-order bit set. Is there an option to force it to do so? We can't seem to find one?! -- ...phsiii Phil Smith III

Re: LE C calling HLASM

2012-03-23 Thread Phil Smith
Thanks. The #pragma was the answer. We had tried that but thought it wasn't working for some reason. Now for the next question: this allows us to implement variable parameter lists in C, by declaring the functions thus: int SOMEFUNCTION(char *someparm, ...); Is there an equivalent way to do

Re: LE C calling HLASM

2012-03-23 Thread Steve Comstock
On 3/23/2012 2:57 PM, Phil Smith wrote: Thanks. The #pragma was the answer. We had tried that but thought it wasn't working for some reason. Now for the next question: this allows us to implement variable parameter lists in C, by declaring the functions thus: int SOMEFUNCTION(char *someparm,

Re: LE C calling HLASM

2012-03-23 Thread John Gilmore
There are several ways to do what you want to do in PL/I, among them the ways Steve Comstock suggests. I personally prefer o to invoke the HLASM from PL/I using PL/I descriptors, which are easy to work with in assembly language, and o to invoke PL/I from the HLASM using the PL/I descriptors