22-Mar-2012 17:49:31-PDT,2761;000000000000 Return-Path: <mrc@Lingling.Panda.COM> Received: from hsinghsing.panda.com ([206.124.149.116]) by Lingling.Panda.COM with TCP/SMTP; Thu, 22 Mar 2012 17:48:49 -0700 (PDT) X-Return-Path: <tops20@alderson.users.panix.com> X-Received: from mailbackend.panix.com ([166.84.1.89]) by Lingling.Panda.COM with TCP/SMTP; Thu, 22 Mar 2012 17:16:58 -0700 (PDT) X-Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id 7B8FD345EA for <tops-20@lingling.panda.com>; Thu, 22 Mar 2012 20:16:51 -0400 (EDT) X-Received: by panix5.panix.com (Postfix, from userid 17662) id 6F77424256; Thu, 22 Mar 2012 20:16:51 -0400 (EDT) From: Rich Alderson <tops20@alderson.users.panix.com> To: tops-20@lingling.panda.com Subject: Macro-20/Fortran calling convention Message-Id: <20120323001651.6F77424256@panix5.panix.com> Date: Thu, 22 Mar 2012 20:16:51 -0400 (EDT) ReSent-Date: Thu, 22 Mar 2012 17:48:40 -0700 (PDT) ReSent-From: TOPS-20 List Moderator <mrc@Lingling.Panda.COM> ReSent-To: TOPS-20 Distribution: ; ReSent-Subject: Macro-20/Fortran calling convention ReSent-Message-ID: <alpine.OSX.2.00.1203221748400.74057@hsinghsing.panda.com> ReSent-User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) This is embarassing. In 35 years of programming on the DEC-20, it has never been necessary for me to call a Macro-20 routine from a Fortran main program. Until now. I can still, to this day, remember the calling sequence for OS/360 programs. (Fortran and Assembler use the same calling sequence; PL/I is a little more complex, but only just.) Even if I couldn't, I know where to look for that information in the 360/370/... documentation. So I went off to the Fortran Language Reference--three editions: v5, v10, and v11--and found all I wanted to know about calling Fortran subroutines from Macro. I went to Ralph's book, and similarly found what I needed to know to call the Fortran SIN function from my Macro-20 program. I suppose that I could add a routine to FORLIB/FOROTS, using the FORPRM magic macros, and get the result I want/need, but suppose I weren't a wheel on a system with the Fortran compiler sources? What then? So far, I've been able to compile a little Fortran program, and an even smaller Macro program, and LINK is happy to shove all the relevant bits into memory, but I end up with the program's entry point being the entry to the Macro routine, and the Fortran code is never executed. Clearly, there's an incantation upon which I have not yet stumbled. So, can anyone tell me where I might be going wrong? Thanks, Rich 22-Mar-2012 19:39:42-PDT,2620;000000000000 Return-Path: <mrc@Lingling.Panda.COM> Received: from hsinghsing.panda.com ([206.124.149.116]) by Lingling.Panda.COM with TCP/SMTP; Thu, 22 Mar 2012 19:39:20 -0700 (PDT) X-Return-Path: <pfarrell@pfarrell.com> X-Received: from www.pfarrell.com ([184.180.159.167]) by Lingling.Panda.COM with TCP/SMTP; Thu, 22 Mar 2012 18:18:24 -0700 (PDT) X-Received: by www.pfarrell.com (Postfix, from userid 1009) id CF3B231C4117; Thu, 22 Mar 2012 21:18:17 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on www.pfarrell.com X-Spam-Level: X-Spam-Status: No, score=-4.4 required=6.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=no version=3.2.5 X-Received: from way.pfarrell.com (way.local [172.16.4.67]) by www.pfarrell.com (Postfix) with ESMTP id 2D57D31C40A2; Thu, 22 Mar 2012 21:18:17 -0400 (EDT) Message-ID: <4F6BCF58.9050101@pfarrell.com> Date: Thu, 22 Mar 2012 21:18:16 -0400 From: Pat Farrell <pfarrell@pfarrell.com> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Rich Alderson <tops20@alderson.users.panix.com> CC: tops-20@lingling.panda.com Subject: Re: Macro-20/Fortran calling convention References: <20120323001651.6F77424256@panix5.panix.com> In-Reply-To: <20120323001651.6F77424256@panix5.panix.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ReSent-Date: Thu, 22 Mar 2012 19:39:08 -0700 (PDT) ReSent-From: TOPS-20 List Moderator <mrc@Lingling.Panda.COM> ReSent-To: TOPS-20 Distribution: ; ReSent-Subject: Re: Macro-20/Fortran calling convention ReSent-Message-ID: <alpine.OSX.2.00.1203221939080.74057@hsinghsing.panda.com> ReSent-User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) AC 16 points to the argument block. Fortran, Cobol and perhaps other languages do the same. Argument block is zero based and contains address of value for int and float argument block points to a two word block that had character length in the first word and a standard byte pointer in the second. Or, perhaps I've got this rotated. The KL extend instructions were reversed, whatever they take, as in length byte pointer the Fortran and Cobol argument block are reversed, as in byte pointer length I always wondered why the KL instructions didn't use the same format as the languages, which predated the KL by many years. that would have let you do a DMOVE to load both length and byte pointer To use the Extend instructions you had to do to MOVE, since the order was inverted -- Pat Farrell http://www.pfarrell.com/ 22-Mar-2012 19:39:53-PDT,2604;000000000000 Return-Path: <mrc@Lingling.Panda.COM> Received: from hsinghsing.panda.com ([206.124.149.116]) by Lingling.Panda.COM with TCP/SMTP; Thu, 22 Mar 2012 19:39:51 -0700 (PDT) X-Return-Path: <pfarrell@pfarrell.com> X-Received: from www.pfarrell.com ([184.180.159.167]) by Lingling.Panda.COM with TCP/SMTP; Thu, 22 Mar 2012 19:05:53 -0700 (PDT) X-Received: by www.pfarrell.com (Postfix, from userid 1009) id CD09F31C40E1; Thu, 22 Mar 2012 22:05:46 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on www.pfarrell.com X-Spam-Level: X-Spam-Status: No, score=-4.4 required=6.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=no version=3.2.5 X-Received: from way.pfarrell.com (way.local [172.16.4.67]) by www.pfarrell.com (Postfix) with ESMTP id 1D0FC31C40CF; Thu, 22 Mar 2012 22:05:45 -0400 (EDT) Message-ID: <4F6BDA79.3080903@pfarrell.com> Date: Thu, 22 Mar 2012 22:05:45 -0400 From: Pat Farrell <pfarrell@pfarrell.com> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Rich Alderson <tops20@alderson.users.panix.com> CC: tops-20@lingling.panda.com Subject: Re: Macro-20/Fortran calling convention References: <20120323001651.6F77424256@panix5.panix.com> In-Reply-To: <20120323001651.6F77424256@panix5.panix.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ReSent-Date: Thu, 22 Mar 2012 19:39:36 -0700 (PDT) ReSent-From: TOPS-20 List Moderator <mrc@Lingling.Panda.COM> ReSent-To: TOPS-20 Distribution: ; ReSent-Subject: Re: Macro-20/Fortran calling convention ReSent-Message-ID: <alpine.OSX.2.00.1203221939360.74057@hsinghsing.panda.com> ReSent-User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) On 3/22/12 8:16 PM, Rich Alderson wrote: > So far, I've been able to compile a little Fortran program, and an even > smaller Macro program, and LINK is happy to shove all the relevant bits into > memory, but I end up with the program's entry point being the entry to the > Macro routine, and the Fortran code is never executed. Clearly, there's an > incantation upon which I have not yet stumbled. Opps, I misread your question, jumping in from the subject line. Your macro code can't have the usual program startup stuff. It simply had a global symbol that Link will use, calling on 17 with arguments in 16. Its not a Macro program (like we all know and love). You want to make sure that the EXE has the same startup prologue (which calls FOROTS) as a pure Fortran program. -- Pat Farrell http://www.pfarrell.com/ 23-Mar-2012 09:08:34-PDT,3695;000000000000 Return-Path: <mrc@Lingling.Panda.COM> Received: from hsinghsing.panda.com ([206.124.149.116]) by Lingling.Panda.COM with TCP/SMTP; Fri, 23 Mar 2012 09:08:09 -0700 (PDT) X-Return-Path: <fw@fwright.net> X-Received: from a.mail.sonic.net ([64.142.16.245]) by Lingling.Panda.COM with TCP/SMTP; Fri, 23 Mar 2012 08:49:49 -0700 (PDT) X-Received: from newshell.sonic.net (bolt.sonic.net [208.201.242.19]) by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id q2N7rtnf030846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Mar 2012 00:53:55 -0700 X-Received: from bolt.sonic.net (IDENT:TnyxKX9RgpkJKhX7Xn5vZRpyZYJMQUmx@localhost.localdomain [127.0.0.1]) by newshell.sonic.net (8.13.6/8.12.1) with ESMTP id q2N7rt4Y008926; Fri, 23 Mar 2012 00:53:55 -0700 X-Received: from localhost (fw@localhost) by bolt.sonic.net (8.13.6/8.12.1/Submit) with ESMTP id q2N7rs1c008918; Fri, 23 Mar 2012 00:53:55 -0700 X-Authentication-Warning: bolt.sonic.net: fw owned process doing -bs Date: Fri, 23 Mar 2012 00:53:54 -0700 (PDT) From: Fred Wright <fw@fwright.net> X-X-Sender: fw@bolt.sonic.net To: Rich Alderson <tops20@alderson.users.panix.com> cc: tops-20@Lingling.Panda.COM Subject: Re: Macro-20/Fortran calling convention In-Reply-To: <20120323001651.6F77424256@panix5.panix.com> Message-ID: <Pine.LNX.4.58L1X.1203230051150.1572@bolt.sonic.net> References: <20120323001651.6F77424256@panix5.panix.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII ReSent-Date: Fri, 23 Mar 2012 09:08:00 -0700 (PDT) ReSent-From: TOPS-20 List Moderator <mrc@Lingling.Panda.COM> ReSent-To: TOPS-20 Distribution: ; ReSent-Subject: Re: Macro-20/Fortran calling convention ReSent-Message-ID: <alpine.OSX.2.00.1203230908000.74057@hsinghsing.panda.com> ReSent-User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) On Thu, 22 Mar 2012, Rich Alderson wrote: > This is embarassing. In 35 years of programming on the DEC-20, it has never > been necessary for me to call a Macro-20 routine from a Fortran main program. > > Until now. > > I can still, to this day, remember the calling sequence for OS/360 programs. > (Fortran and Assembler use the same calling sequence; PL/I is a little more > complex, but only just.) Even if I couldn't, I know where to look for that > information in the 360/370/... documentation. > > So I went off to the Fortran Language Reference--three editions: v5, v10, > and v11--and found all I wanted to know about calling Fortran subroutines > from Macro. I went to Ralph's book, and similarly found what I needed to > know to call the Fortran SIN function from my Macro-20 program. > > I suppose that I could add a routine to FORLIB/FOROTS, using the FORPRM magic > macros, and get the result I want/need, but suppose I weren't a wheel on a > system with the Fortran compiler sources? What then? > > So far, I've been able to compile a little Fortran program, and an even > smaller Macro program, and LINK is happy to shove all the relevant bits into > memory, but I end up with the program's entry point being the entry to the > Macro routine, and the Fortran code is never executed. Clearly, there's an > incantation upon which I have not yet stumbled. It sounds like you supplied an argument to the END statement in the MACRO program, which then sets the program's entry point. A non-"main" MACRO module should just say "END", not "END <address>". Fred Wright > So, can anyone tell me where I might be going wrong? > > Thanks, > Rich > > 23-Mar-2012 09:08:36-PDT,2688;000000000000 Return-Path: <mrc@Lingling.Panda.COM> Received: from hsinghsing.panda.com ([206.124.149.116]) by Lingling.Panda.COM with TCP/SMTP; Fri, 23 Mar 2012 09:08:32 -0700 (PDT) X-Return-Path: <sra@hactrn.net> X-Received: from cyteen.hactrn.net ([66.92.66.68]) by Lingling.Panda.COM with TCP/SMTP; Fri, 23 Mar 2012 08:55:09 -0700 (PDT) X-Received: from minas-ithil.hactrn.net (ATuileries-151-1-25-212.w82-123.abo.wanadoo.fr [82.123.203.212]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "nargothrond.hactrn.net", Issuer "Grunchweather Associates" (verified OK)) by cyteen.hactrn.net (Postfix) with ESMTPS id 207A82846B; Fri, 23 Mar 2012 15:18:04 +0000 (UTC) X-Received: from minas-ithil.hactrn.net (localhost [127.0.0.1]) by minas-ithil.hactrn.net (Postfix) with ESMTP id 7D4D56DEB71; Fri, 23 Mar 2012 16:18:02 +0100 (CET) Date: Fri, 23 Mar 2012 16:18:02 +0100 From: Rob Austein <sra@hactrn.net> To: Rich Alderson <tops20@alderson.users.panix.com> Cc: tops-20@lingling.panda.com Subject: Re: Macro-20/Fortran calling convention In-Reply-To: <20120323001651.6F77424256@panix5.panix.com> References: <20120323001651.6F77424256@panix5.panix.com> User-Agent: Wanderlust/2.15.5 (Almost Unreal) Emacs/22.3 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Message-Id: <20120323151802.7D4D56DEB71@minas-ithil.hactrn.net> ReSent-Date: Fri, 23 Mar 2012 09:08:21 -0700 (PDT) ReSent-From: TOPS-20 List Moderator <mrc@Lingling.Panda.COM> ReSent-To: TOPS-20 Distribution: ; ReSent-Subject: Re: Macro-20/Fortran calling convention ReSent-Message-ID: <alpine.OSX.2.00.1203230908210.74057@hsinghsing.panda.com> ReSent-User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) 30 years since the last time I wrote MACRO code to be called by FORTRAN, the only thing I remember is a prohibition against the MACRO code using the stack for anything but PUSHJ/POPJ. In particular, one must not push data onto the stack, use pointers to stack frames, or anything like that, because FOROTS reserves the right to move the stack, at software interrupt level (presumably in response to pushdown overflow, but I don't think anything promised that FOROTS won't decide to move the stack just because it's tea time). As I vaguely recall, if one follows the manual for the calling sequence, there's no particular magic in running the program, it's just like running a FORTRAN program with subroutines in multiple files, one uses the EXEC's COMPILE and SAVE commands. Pat is correct that, from your description, you don't want a main program in your MACRO code, you just want a subroutine or function. 24-Mar-2012 10:46:33-PDT,3036;000000000000 Return-Path: <mrc@Lingling.Panda.COM> Received: from hsinghsing.panda.com ([206.124.149.116]) by Lingling.Panda.COM with TCP/SMTP; Sat, 24 Mar 2012 10:46:00 -0700 (PDT) X-Return-Path: <sfmc68@verizon.net> X-Received: from vms173003pub.verizon.net ([206.46.173.3]) by Lingling.Panda.COM with TCP/SMTP; Fri, 23 Mar 2012 20:18:18 -0700 (PDT) X-Received: from MacPro.local ([unknown] [96.231.203.19]) by vms173003.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0M1D007Q0ADJ81T1@vms173003.mailsrvcs.net> for TOPS-20@Lingling.Panda.COM; Fri, 23 Mar 2012 21:17:44 -0500 (CDT) Message-id: <4F6D2EC7.5020107@verizon.net> Date: Fri, 23 Mar 2012 22:17:43 -0400 From: bob smith <sfmc68@verizon.net> Reply-to: Bob Smith <sfmc68@verizon.net> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120312 Firefox/11.0 SeaMonkey/2.8 MIME-version: 1.0 To: TOPS-20 Hackers and Yackers <TOPS-20@Lingling.Panda.COM> Subject: just for fun, systat Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit ReSent-Date: Sat, 24 Mar 2012 10:45:51 -0700 (PDT) ReSent-From: TOPS-20 List Moderator <mrc@Lingling.Panda.COM> ReSent-To: TOPS-20 Distribution: ; ReSent-Subject: just for fun, systat ReSent-Message-ID: <alpine.OSX.2.00.1203241045510.74057@hsinghsing.panda.com> ReSent-User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) Escape character is '^]'. KLAXON KLH10 TOPS20, PANDA TOPS-20 Monitor 7.1(21733)-4 This system is for the use of authorized users only. Usage of this system may be monitored and recorded by system personnel. Anyone using this system expressly consents to such monitoring and is advised that if such monitoring reveals possible evidence of criminal activity, system personnel may provide the evidence from such monitoring to law enforcement officials. @login bob Job 15 on TTY51 (TCP) 23-Mar-2012 22:10:12 Last interactive login 21-Mar-2012 09:15:40 Last non-interactive login Never [Jobs 9, 10, 12, 13, 14 also logged in under BOB] You have mail from Mailer at 14-Nov-2011 10:47:31 @enable $term vt100 $systat Fri 23-Mar-2012 22:10:56 Up 3511:27:28!!! 6+9 Jobs Load av 0.00 0.01 0.01 No operator in attendance System is remedial Job Line Program User Origin 9 44 EXEC BOB l#Va(TCP) 10 45 EXEC BOB l#Va(TCP) 12 46 EXEC BOB 96.231.203.19(TCP) 13 47 EXEC BOB 96.231.203.19(TCP) 14 50 EXEC BOB l#Va(TCP) 15* 51 SYSTAT BOB 96.231.203.20(TCP) 1 13 OPR OPERATOR 2 DET SYSJB1 OPERATOR 3 14 RESOLV OPERATOR 4 15 NETSRV OPERATOR 5 16 SMTJFN OPERATOR 6 17 MMAILR OPERATOR 7 20 IMAPSV OPERATOR 8 21 FTS OPERATOR 11 5 EXEC OPERATOR $ -- We'll see said the zen master