Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Refreshed by a brief blackout, I got to my feet and went next door. -- Martin Amis, _Money_


computers / comp.os.vms / BASIC and AST routines

SubjectAuthor
* BASIC and AST routinesJohn Doppke
+- Re: BASIC and AST routinesJonathan
+* Re: BASIC and AST routinesDave Froble
|`* Re: BASIC and AST routinesJohn Doppke
| `* Re: BASIC and AST routinesSimon Clubley
|  `- Re: BASIC and AST routinesDave Froble
+- Re: BASIC and AST routinesVAXman-
+- Re: BASIC and AST routinesCraig A. Berry
`* Re: BASIC and AST routinesBob Gezelter
 `* Re: BASIC and AST routinesChris Townley
  `* Re: BASIC and AST routinesBob Gezelter
   `* Re: BASIC and AST routinesDave Froble
    +* Re: BASIC and AST routinesBob Gezelter
    |+* Re: BASIC and AST routinesDave Froble
    ||`- Re: BASIC and AST routinesSimon Clubley
    |`* Re: BASIC and AST routinesVAXman-
    | `- Re: BASIC and AST routinesNeil Rieck
    +* Re: BASIC and AST routinesStephen Hoffman
    |`- Re: BASIC and AST routinesDave Froble
    `* Re: BASIC and AST routinesSimon Clubley
     `* Re: BASIC and AST routinesVAXman-
      +* Re: BASIC and AST routinesSimon Clubley
      |+* Re: BASIC and AST routinesArne Vajhøj
      ||+* Re: BASIC and AST routinesSimon Clubley
      |||+* Re: BASIC and AST routinesArne Vajhøj
      ||||+* Re: BASIC and AST routinesDave Froble
      |||||`- Re: BASIC and AST routinesArne Vajhøj
      ||||`* Re: BASIC and AST routinesSimon Clubley
      |||| `* Re: BASIC and AST routinesArne Vajhøj
      ||||  +* Re: BASIC and AST routinesSimon Clubley
      ||||  |`* Re: BASIC and AST routinesArne Vajhøj
      ||||  | `* Re: BASIC and AST routinesSimon Clubley
      ||||  |  `* Re: BASIC and AST routinesArne Vajhøj
      ||||  |   `* Re: BASIC and AST routinesSimon Clubley
      ||||  |    +* Re: BASIC and AST routinesArne Vajhøj
      ||||  |    |+- Re: BASIC and AST routinesBill Gunshannon
      ||||  |    |`* Re: BASIC and AST routinesChris Scheers
      ||||  |    | `* Re: BASIC and AST routinesAndrew Commons
      ||||  |    |  +- Re: BASIC and AST routinesAndrew Commons
      ||||  |    |  `* Re: BASIC and AST routinesCraig A. Berry
      ||||  |    |   `- Re: BASIC and AST routinesAndrew Commons
      ||||  |    +* Re: BASIC and AST routinesHunter Goatley
      ||||  |    |`- Re: BASIC and AST routinesChris Townley
      ||||  |    +- Re: BASIC and AST routinesVAXman-
      ||||  |    `* Re: BASIC and AST routinesSimon Clubley
      ||||  |     `- Re: BASIC and AST routinesVAXman-
      ||||  `- Re: BASIC and AST routinesVAXman-
      |||`- Re: BASIC and AST routinesVAXman-
      ||`- Re: BASIC and AST routinesDave Froble
      |+- Re: BASIC and AST routinesVAXman-
      |`* Re: BASIC and AST routinesDave Froble
      | `- Re: BASIC and AST routinesArne Vajhøj
      `* Re: BASIC and AST routinesVAXman-
       +* Re: BASIC and AST routinesSimon Clubley
       |+* Re: BASIC and AST routinesArne Vajhøj
       ||+* Re: BASIC and AST routinesSimon Clubley
       |||`- Re: BASIC and AST routinesArne Vajhøj
       ||`* Re: BASIC and AST routinesVAXman-
       || +- Re: BASIC and AST routinesSimon Clubley
       || `- Re: BASIC and AST routinesVAXman-
       |`* Re: BASIC and AST routinesDave Froble
       | `* Re: BASIC and AST routinesSimon Clubley
       |  `* Re: BASIC and AST routinesArne Vajhøj
       |   `* Re: BASIC and AST routinesBob Gezelter
       |    +- Re: BASIC and AST routinesArne Vajhøj
       |    `* Re: BASIC and AST routinesDave Froble
       |     `* Re: BASIC and AST routinesJohnny Billquist
       |      `- Re: BASIC and AST routinesDave Froble
       `* Re: BASIC and AST routinesVAXman-
        +* Re: BASIC and AST routinesSimon Clubley
        |`- Re: BASIC and AST routinesDave Froble
        `- Re: BASIC and AST routinesVAXman-

Pages:123
BASIC and AST routines

<d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18768&group=comp.os.vms#18768

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ad4:5bc4:: with SMTP id t4mr59535132qvt.3.1637190869075;
Wed, 17 Nov 2021 15:14:29 -0800 (PST)
X-Received: by 2002:ac8:5b87:: with SMTP id a7mr21212617qta.196.1637190868925;
Wed, 17 Nov 2021 15:14:28 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 17 Nov 2021 15:14:28 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=68.32.212.191; posting-account=WnLuRwoAAACJLvF6yOLCgCkvK5ataUzs
NNTP-Posting-Host: 68.32.212.191
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
Subject: BASIC and AST routines
From: jdop...@gmail.com (John Doppke)
Injection-Date: Wed, 17 Nov 2021 23:14:29 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: John Doppke - Wed, 17 Nov 2021 23:14 UTC

So I've been playing with writing AST routines (stubbornly) in BASIC. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters are, but doing anything with them is usually a bad idea. I communicate with my main program using common or event flags.

Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST call with my AST works ok).

Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.

-John

Re: BASIC and AST routines

<58ad8b34-c8da-4f3e-97b9-34f78a094d4cn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18770&group=comp.os.vms#18770

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:622a:1aa5:: with SMTP id s37mr21325559qtc.377.1637198241254;
Wed, 17 Nov 2021 17:17:21 -0800 (PST)
X-Received: by 2002:a05:622a:13c6:: with SMTP id p6mr21865139qtk.2.1637198241094;
Wed, 17 Nov 2021 17:17:21 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Wed, 17 Nov 2021 17:17:20 -0800 (PST)
In-Reply-To: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=72.93.100.146; posting-account=bDGL_AkAAABmVCa-x2ZuiVOQLJqcCw2X
NNTP-Posting-Host: 72.93.100.146
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <58ad8b34-c8da-4f3e-97b9-34f78a094d4cn@googlegroups.com>
Subject: Re: BASIC and AST routines
From: jtc...@gmail.com (Jonathan)
Injection-Date: Thu, 18 Nov 2021 01:17:21 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jonathan - Thu, 18 Nov 2021 01:17 UTC

On Wednesday, November 17, 2021 at 6:14:30 PM UTC-5, John Doppke wrote:
> So I've been playing with writing AST routines (stubbornly) in BASIC. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters are, but doing anything with them is usually a bad idea. I communicate with my main program using common or event flags.
>
> Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST call with my AST works ok).
>
> Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.

function long astRoutine by value(long pasteboard, astArgument, r0, r1, pc, psl)

should work, though how the first two args are passed is hard to determine; experiment with by ref. As you say, messing with the final four args is prone to problems...

Re: BASIC and AST routines

<sn49li$1dp$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18771&group=comp.os.vms#18771

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Wed, 17 Nov 2021 20:18:57 -0500
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <sn49li$1dp$1@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 18 Nov 2021 01:18:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="76bcc53f923cf8990ccba3224376c99e";
logging-data="1465"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19mv7/7IQ3tD+MXpjPoUevLGmg4Nxw6QZw="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:C6UNGisq87GGKfXzMyCCLOr5A6A=
In-Reply-To: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
 by: Dave Froble - Thu, 18 Nov 2021 01:18 UTC

On 11/17/2021 6:14 PM, John Doppke wrote:
> So I've been playing with writing AST routines (stubbornly) in BASIC. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters are, but doing anything with them is usually a bad idea. I communicate with my main program using common or event flags.
>
> Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST call with my AST works ok).
>
> Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.
>
> -John
>

From the 7.3 docs:

Table 8–3 AST Arguments for VAX Systems and Alpha Systems
VAX System Arguments Alpha System Arguments
AST parameter AST parameter
R0 R0
R1 R1
PC PC
PSL PS
Registers R0 and R1, the program counter (PC), and the processor status
longword (PSL) on VAX systems, or processor status (PS) on Alpha systems were
saved when the process was interrupted by delivery of the AST.
The AST parameter is an argument passed to the AST service routine so that
it can identify the event that caused the AST. When you call a system service
requesting an AST, or when you call the SYS$DCLAST system service, you
can supply a value for the AST parameter. If you do not specify a value, the
parameter defaults to 0.

Not formatted so well, but the important data is there.

You get to pass a longword to the AST routine. The other 4 parameters appear to
be set by the OS, or whatever. Not by you! I don't know what you'd do with R0,
R1, PC, and PLS/PS.

Other communications would be via global data, a COMMON block, a PSECT, and
whatever.

As an example, something I've done, set a timer on some I/O. When the AST
fires, you want to do something because of the timeout. I pass the channel #
for the I/O and have the AST cancel the I/O on that channel and return. That
causes I/O completion in the code that set the timer.

I've not used SMG, so I'm not much help in what you're doing. But I'd guess the
"SMG$ENABLE_UNSOLICITED_INPUT" would be an external value, and the use of an
INCLUDE statement would make it available, or, in global data shared with the
calling code.

Apologies if I've not understood your question.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: BASIC and AST routines

<8a20fd9a-2ec1-449c-9bc2-07586ba7d47en@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18775&group=comp.os.vms#18775

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ae9:e502:: with SMTP id w2mr21210767qkf.315.1637244455818;
Thu, 18 Nov 2021 06:07:35 -0800 (PST)
X-Received: by 2002:a05:622a:28b:: with SMTP id z11mr26169060qtw.242.1637244455607;
Thu, 18 Nov 2021 06:07:35 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 18 Nov 2021 06:07:35 -0800 (PST)
In-Reply-To: <sn49li$1dp$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=68.32.212.191; posting-account=WnLuRwoAAACJLvF6yOLCgCkvK5ataUzs
NNTP-Posting-Host: 68.32.212.191
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com> <sn49li$1dp$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8a20fd9a-2ec1-449c-9bc2-07586ba7d47en@googlegroups.com>
Subject: Re: BASIC and AST routines
From: jdop...@gmail.com (John Doppke)
Injection-Date: Thu, 18 Nov 2021 14:07:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 80
 by: John Doppke - Thu, 18 Nov 2021 14:07 UTC

On Wednesday, November 17, 2021 at 8:18:45 PM UTC-5, Dave Froble wrote:
> On 11/17/2021 6:14 PM, John Doppke wrote:
> > So I've been playing with writing AST routines (stubbornly) in BASIC. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters are, but doing anything with them is usually a bad idea. I communicate with my main program using common or event flags.
> >
> > Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST call with my AST works ok).
> >
> > Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.
> >
> > -John
> >
> From the 7.3 docs:
>
> Table 8–3 AST Arguments for VAX Systems and Alpha Systems
> VAX System Arguments Alpha System Arguments
> AST parameter AST parameter
> R0 R0
> R1 R1
> PC PC
> PSL PS
> Registers R0 and R1, the program counter (PC), and the processor status
> longword (PSL) on VAX systems, or processor status (PS) on Alpha systems were
> saved when the process was interrupted by delivery of the AST.
> The AST parameter is an argument passed to the AST service routine so that
> it can identify the event that caused the AST. When you call a system service
> requesting an AST, or when you call the SYS$DCLAST system service, you
> can supply a value for the AST parameter. If you do not specify a value, the
> parameter defaults to 0.
>
> Not formatted so well, but the important data is there.
>
> You get to pass a longword to the AST routine. The other 4 parameters appear to
> be set by the OS, or whatever. Not by you! I don't know what you'd do with R0,
> R1, PC, and PLS/PS.
>
> Other communications would be via global data, a COMMON block, a PSECT, and
> whatever.
>
> As an example, something I've done, set a timer on some I/O. When the AST
> fires, you want to do something because of the timeout. I pass the channel #
> for the I/O and have the AST cancel the I/O on that channel and return. That
> causes I/O completion in the code that set the timer.
>
> I've not used SMG, so I'm not much help in what you're doing. But I'd guess the
> "SMG$ENABLE_UNSOLICITED_INPUT" would be an external value, and the use of an
> INCLUDE statement would make it available, or, in global data shared with the
> calling code.
>
> Apologies if I've not understood your question.
>
> --
> David Froble Tel: 724-529-0450
> Dave Froble Enterprises, Inc. E-Mail: da...@tsoft-inc.com
> DFE Ultralights, Inc.
> 170 Grimplin Road
> Vanderbilt, PA 15486

Thanks. It also helps if you don't have a typo referring to your function. BASIC will happily compile and link and not say a word.

Re: BASIC and AST routines

<sn674s$rcr$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18779&group=comp.os.vms#18779

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Thu, 18 Nov 2021 18:47:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <sn674s$rcr$3@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com> <sn49li$1dp$1@dont-email.me> <8a20fd9a-2ec1-449c-9bc2-07586ba7d47en@googlegroups.com>
Injection-Date: Thu, 18 Nov 2021 18:47:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="1d64f20fc39c34d6437cd506f1c7e558";
logging-data="28059"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+M8n6FVONqve3ZPQNYcEvz86BvS2czII="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:8X7X/WvPohFHM+ZgaUGLy86qKr8=
 by: Simon Clubley - Thu, 18 Nov 2021 18:47 UTC

On 2021-11-18, John Doppke <jdoppke@gmail.com> wrote:
>
> Thanks. It also helps if you don't have a typo referring to your function. BASIC will happily compile and link and not say a word.

Huh ? Why don't you get an undefined function error ?

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: BASIC and AST routines

<sn6a96$r44$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18780&group=comp.os.vms#18780

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Thu, 18 Nov 2021 14:41:41 -0500
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <sn6a96$r44$1@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
<sn49li$1dp$1@dont-email.me>
<8a20fd9a-2ec1-449c-9bc2-07586ba7d47en@googlegroups.com>
<sn674s$rcr$3@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 18 Nov 2021 19:41:27 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="76bcc53f923cf8990ccba3224376c99e";
logging-data="27780"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181srJr+5m5S/SGM7Nr+EWI21cGRp04el4="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:hKKhjzFNNcrJGGegT5kkGU7ixWI=
In-Reply-To: <sn674s$rcr$3@dont-email.me>
 by: Dave Froble - Thu, 18 Nov 2021 19:41 UTC

On 11/18/2021 1:47 PM, Simon Clubley wrote:
> On 2021-11-18, John Doppke <jdoppke@gmail.com> wrote:
>>
>> Thanks. It also helps if you don't have a typo referring to your function. BASIC will happily compile and link and not say a word.
>
> Huh ? Why don't you get an undefined function error ?
>
> Simon.
>

Because the compiler is smart enough to rub your nose in your mistakes ??

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: BASIC and AST routines

<00B6C019.747CBCE9@SendSpamHere.ORG>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18782&group=comp.os.vms#18782

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!pr9o9uw/KLhPSFYv2ok3sg.user.46.165.242.75.POSTED!not-for-mail
From: VAXm...@SendSpamHere.ORG
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Thu, 18 Nov 2021 20:28:52 GMT
Organization: c.2021 Brian Schenkenberger. Prior employers of copyright holder and their agents must first obtain written permission to copy this posting.
Message-ID: <00B6C019.747CBCE9@SendSpamHere.ORG>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
Reply-To: VAXman- @SendSpamHere.ORG
Injection-Info: gioia.aioe.org; logging-data="4728"; posting-host="pr9o9uw/KLhPSFYv2ok3sg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: VAXm...@SendSpamHere.ORG - Thu, 18 Nov 2021 20:28 UTC

In article <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>, John Doppke <jdoppke@gmail.com> writes:
>So I've been playing with writing AST routines (stubbornly) in BASIC. They=
> work ok, but I've found I have to declare the routine as having 5 'standar=
>d' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sur=
>e what the 5 parameters are, but doing anything with them is usually a bad =
>idea. I communicate with my main program using common or event flags.
>
>Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLIC=
>ITED_INPUT. I've tried adding a parameter in my usual list in different wa=
>ys but I can't get it to work. Every time it's called I get a reserved opc=
>ode exception. (A DCLAST call with my AST works ok).
>
>Can anyone shed some light on what the parameters are that BASIC is getting=
>? I'll probably end up writing this one in MACRO, but I want to understand=
> what is happening.

AST parameter, R0, R1, PC, PSL/PS

--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.

Re: BASIC and AST routines

<sn6kua$8iu$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18785&group=comp.os.vms#18785

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: craigbe...@nospam.mac.com (Craig A. Berry)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Thu, 18 Nov 2021 16:43:21 -0600
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <sn6kua$8iu$1@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 18 Nov 2021 22:43:23 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="197d5aca8e55022bcf7c8b40d8e42d62";
logging-data="8798"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Co8BWduAFNTIF75YfJ7pdxqLu1Wu6kj0="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.3.0
Cancel-Lock: sha1:OJ+aTW3g63Ml6tk3QNZArcq6fqM=
In-Reply-To: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
Content-Language: en-US
 by: Craig A. Berry - Thu, 18 Nov 2021 22:43 UTC

On 11/17/21 5:14 PM, John Doppke wrote:
> So I've been playing with writing AST routines (stubbornly) in BASIC.
> They work ok, but I've found I have to declare the routine as having
> 5 'standard' parameters - "function long AST long (p1, p2, p3, p4,
> p5)". I'm not sure what the 5 parameters are, but doing anything
> with them is usually a bad idea. I communicate with my main program
> using common or event flags.
>
> Now I need an AST for a call that requires a parameter -
> SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my
> usual list in different ways but I can't get it to work. Every time
> it's called I get a reserved opcode exception. (A DCLAST call with
> my AST works ok).
>
> Can anyone shed some light on what the parameters are that BASIC is
> getting? I'll probably end up writing this one in MACRO, but I want
> to understand what is happening.

There is an example in the docs here:

<https://docs.vmssoftware.com/vsi-openvms-rtl-screen-management-smg-manual/#_5935disable_broadcast_trapping>

of calling SMG$ENABLE_UNSOLICITED_INPUT. The example does not work
as-is on post-Alpha architectures -- you have to declare the AST
routines as FUNCTION INTEGER and not SUB. But as far as parameter
passing, if memory serves, what it does works.

Re: BASIC and AST routines

<d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18789&group=comp.os.vms#18789

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:16b9:: with SMTP id s25mr24415287qkj.409.1637278296367;
Thu, 18 Nov 2021 15:31:36 -0800 (PST)
X-Received: by 2002:a37:491:: with SMTP id 139mr24561669qke.418.1637278296245;
Thu, 18 Nov 2021 15:31:36 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 18 Nov 2021 15:31:36 -0800 (PST)
In-Reply-To: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=100.2.113.217; posting-account=r2_qcwoAAACbIdit5Eka3ivGvrYZz7UQ
NNTP-Posting-Host: 100.2.113.217
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com>
Subject: Re: BASIC and AST routines
From: gezel...@rlgsc.com (Bob Gezelter)
Injection-Date: Thu, 18 Nov 2021 23:31:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 57
 by: Bob Gezelter - Thu, 18 Nov 2021 23:31 UTC

On Wednesday, November 17, 2021 at 6:14:30 PM UTC-5, John Doppke wrote:
> So I've been playing with writing AST routines (stubbornly) in BASIC. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters are, but doing anything with them is usually a bad idea. I communicate with my main program using common or event flags.
>
> Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST call with my AST works ok).
>
> Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.
>
> -John
John,

Been there, done that (for a client whose entire codebase was written in BASIC).

As VAXman and Dave Froble noted, the five parameters are passed are, and I quote from David's posting:

"From the 7.3 docs:

Table 8–3 AST Arguments for VAX Systems and Alpha Systems
VAX System Arguments Alpha System Arguments
AST parameter AST parameter
R0 R0
R1 R1
PC PC
PSL PS "

One will notice that the correct number of parameters restriction does not appear in all languages. C , FORTRAN, and others have looser restrictions on parameter lists, as well as variable-sized parameter lists. BASIC does not. BASIC requires that the parameter lists match in size and type AND enforces that restriction at the called routine interface. In the OpenVMS DOC set, I have seen examples which presume that the parameter count restriction is not enforced. They are a bit misleading in the case of BASIC.

Many library routines can be called from both normal thread and AST contexts, but since many of the library routines are not- re-entrant, one cannot generally call library routines from both AST and process threads. However, most OpenVMS general library routines and system services are reentrant, and can be invoked without excessive difficulty from BASIC. While many define their own prototypes I highly recommending the include files from the BASIC text library in SYS$LIBRARY. If those are out of date, write your own versions with correct parameter list definitions, correctly implemented definitions save a lot of fighting with debugging.

As to what is the AST parameter, my general practice is to use a data structure for each file, and pass a pointer to that file as the AST parameter. That allows storage of useful information beyond the file number/handle.

- Bob Gezelter, http://wwww.rlgsc.com

Re: BASIC and AST routines

<sn6tes$s80$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18790&group=comp.os.vms#18790

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: new...@cct-net.co.uk (Chris Townley)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Fri, 19 Nov 2021 01:08:44 +0000
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <sn6tes$s80$1@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
<d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 19 Nov 2021 01:08:44 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a512ecada1cf3af7a0ad15f5c190e8a9";
logging-data="28928"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lqYqfixN2kmMejMp8Ei24aiwXuDBcCvA="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.3.1
Cancel-Lock: sha1:RMVxJ7IQF1Am/oBBKy/lwLFnkJI=
In-Reply-To: <d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com>
Content-Language: en-GB
 by: Chris Townley - Fri, 19 Nov 2021 01:08 UTC

On 18/11/2021 23:31, Bob Gezelter wrote:
> On Wednesday, November 17, 2021 at 6:14:30 PM UTC-5, John Doppke wrote:
>> So I've been playing with writing AST routines (stubbornly) in BASIC. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters are, but doing anything with them is usually a bad idea. I communicate with my main program using common or event flags.
>>
>> Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST call with my AST works ok).
>>
>> Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.
>>
>> -John
> John,
>
> Been there, done that (for a client whose entire codebase was written in BASIC).
>
> As VAXman and Dave Froble noted, the five parameters are passed are, and I quote from David's posting:
>
> "From the 7.3 docs:
>
> Table 8–3 AST Arguments for VAX Systems and Alpha Systems
> VAX System Arguments Alpha System Arguments
> AST parameter AST parameter
> R0 R0
> R1 R1
> PC PC
> PSL PS "
>
> One will notice that the correct number of parameters restriction does not appear in all languages. C , FORTRAN, and others have looser restrictions on parameter lists, as well as variable-sized parameter lists. BASIC does not. BASIC requires that the parameter lists match in size and type AND enforces that restriction at the called routine interface. In the OpenVMS DOC set, I have seen examples which presume that the parameter count restriction is not enforced. They are a bit misleading in the case of BASIC.
>
> Many library routines can be called from both normal thread and AST contexts, but since many of the library routines are not- re-entrant, one cannot generally call library routines from both AST and process threads. However, most OpenVMS general library routines and system services are reentrant, and can be invoked without excessive difficulty from BASIC. While many define their own prototypes I highly recommending the include files from the BASIC text library in SYS$LIBRARY. If those are out of date, write your own versions with correct parameter list definitions, correctly implemented definitions save a lot of fighting with debugging.
>
> As to what is the AST parameter, my general practice is to use a data structure for each file, and pass a pointer to that file as the AST parameter. That allows storage of useful information beyond the file number/handle.
>
> - Bob Gezelter, http://wwww.rlgsc.com
>

IIRC Basic can handle variable number of parameters when calling a
sub/function, but you cannot write them in Basic

--
Chris

Re: BASIC and AST routines

<08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18791&group=comp.os.vms#18791

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ae9:e88e:: with SMTP id a136mr25519113qkg.76.1637293754334;
Thu, 18 Nov 2021 19:49:14 -0800 (PST)
X-Received: by 2002:a05:620a:2589:: with SMTP id x9mr25955349qko.454.1637293754123;
Thu, 18 Nov 2021 19:49:14 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 18 Nov 2021 19:49:13 -0800 (PST)
In-Reply-To: <sn6tes$s80$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=100.2.113.217; posting-account=r2_qcwoAAACbIdit5Eka3ivGvrYZz7UQ
NNTP-Posting-Host: 100.2.113.217
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
<d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com> <sn6tes$s80$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com>
Subject: Re: BASIC and AST routines
From: gezel...@rlgsc.com (Bob Gezelter)
Injection-Date: Fri, 19 Nov 2021 03:49:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 81
 by: Bob Gezelter - Fri, 19 Nov 2021 03:49 UTC

On Thursday, November 18, 2021 at 8:08:47 PM UTC-5, Chris Townley wrote:
> On 18/11/2021 23:31, Bob Gezelter wrote:
> > On Wednesday, November 17, 2021 at 6:14:30 PM UTC-5, John Doppke wrote:
> >> So I've been playing with writing AST routines (stubbornly) in BASIC. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters are, but doing anything with them is usually a bad idea. I communicate with my main program using common or event flags.
> >>
> >> Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST call with my AST works ok).
> >>
> >> Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.
> >>
> >> -John
> > John,
> >
> > Been there, done that (for a client whose entire codebase was written in BASIC).
> >
> > As VAXman and Dave Froble noted, the five parameters are passed are, and I quote from David's posting:
> >
> > "From the 7.3 docs:
> >
> > Table 8–3 AST Arguments for VAX Systems and Alpha Systems
> > VAX System Arguments Alpha System Arguments
> > AST parameter AST parameter
> > R0 R0
> > R1 R1
> > PC PC
> > PSL PS "
> >
> > One will notice that the correct number of parameters restriction does not appear in all languages. C , FORTRAN, and others have looser restrictions on parameter lists, as well as variable-sized parameter lists. BASIC does not. BASIC requires that the parameter lists match in size and type AND enforces that restriction at the called routine interface. In the OpenVMS DOC set, I have seen examples which presume that the parameter count restriction is not enforced. They are a bit misleading in the case of BASIC.
> >
> > Many library routines can be called from both normal thread and AST contexts, but since many of the library routines are not- re-entrant, one cannot generally call library routines from both AST and process threads. However, most OpenVMS general library routines and system services are reentrant, and can be invoked without excessive difficulty from BASIC. While many define their own prototypes I highly recommending the include files from the BASIC text library in SYS$LIBRARY. If those are out of date, write your own versions with correct parameter list definitions, correctly implemented definitions save a lot of fighting with debugging.
> >
> > As to what is the AST parameter, my general practice is to use a data structure for each file, and pass a pointer to that file as the AST parameter. That allows storage of useful information beyond the file number/handle.
> >
> > - Bob Gezelter, http://wwww.rlgsc.com
> >
> IIRC Basic can handle variable number of parameters when calling a
> sub/function, but you cannot write them in Basic
>
>
> --
> Chris
Chris,

Not relevant. I the case referenced, the AST, written in BASIC, is the CALLED routine. As to what can be called from BASIC, I suggest reading the reference manual. As I recall, the original header files had no parameter definitions, so it was possible to easily fall into the trap. Later versions allowed more precision, but the older form was preserved for backward compatibility.

Of course, more than a few people did not pick up the change and continued the earlier approach, which leads to problems.

- Bob Gezelter, http://www.rlgsc.com

Re: BASIC and AST routines

<sn7d2p$82q$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18792&group=comp.os.vms#18792

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Fri, 19 Nov 2021 00:35:20 -0500
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <sn7d2p$82q$1@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
<d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com>
<sn6tes$s80$1@dont-email.me>
<08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 19 Nov 2021 05:35:21 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a843314db70df0e8c46dbb129eac0fa1";
logging-data="8282"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/h18n70YPch8BK5xZQiZtjsgub39D+CPg="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:jh2SqIlCyAxfiXvCdRbkjX0ivEQ=
In-Reply-To: <08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com>
 by: Dave Froble - Fri, 19 Nov 2021 05:35 UTC

On 11/18/2021 10:49 PM, Bob Gezelter wrote:
> On Thursday, November 18, 2021 at 8:08:47 PM UTC-5, Chris Townley wrote:
>> On 18/11/2021 23:31, Bob Gezelter wrote:
>>> On Wednesday, November 17, 2021 at 6:14:30 PM UTC-5, John Doppke wrote:
>>>> So I've been playing with writing AST routines (stubbornly) in BASIC. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters are, but doing anything with them is usually a bad idea. I communicate with my main program using common or event flags.
>>>>
>>>> Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST call with my AST works ok).
>>>>
>>>> Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.
>>>>
>>>> -John
>>> John,
>>>
>>> Been there, done that (for a client whose entire codebase was written in BASIC).
>>>
>>> As VAXman and Dave Froble noted, the five parameters are passed are, and I quote from David's posting:
>>>
>>> "From the 7.3 docs:
>>>
>>> Table 8–3 AST Arguments for VAX Systems and Alpha Systems
>>> VAX System Arguments Alpha System Arguments
>>> AST parameter AST parameter
>>> R0 R0
>>> R1 R1
>>> PC PC
>>> PSL PS "
>>>
>>> One will notice that the correct number of parameters restriction does not appear in all languages. C , FORTRAN, and others have looser restrictions on parameter lists, as well as variable-sized parameter lists. BASIC does not. BASIC requires that the parameter lists match in size and type AND enforces that restriction at the called routine interface. In the OpenVMS DOC set, I have seen examples which presume that the parameter count restriction is not enforced. They are a bit misleading in the case of BASIC.
>>>
>>> Many library routines can be called from both normal thread and AST contexts, but since many of the library routines are not- re-entrant, one cannot generally call library routines from both AST and process threads. However, most OpenVMS general library routines and system services are reentrant, and can be invoked without excessive difficulty from BASIC. While many define their own prototypes I highly recommending the include files from the BASIC text library in SYS$LIBRARY. If those are out of date, write your own versions with correct parameter list definitions, correctly implemented definitions save a lot of fighting with debugging.
>>>
>>> As to what is the AST parameter, my general practice is to use a data structure for each file, and pass a pointer to that file as the AST parameter. That allows storage of useful information beyond the file number/handle.
>>>
>>> - Bob Gezelter, http://wwww.rlgsc.com
>>>
>> IIRC Basic can handle variable number of parameters when calling a
>> sub/function, but you cannot write them in Basic
>>
>>
>> --
>> Chris
> Chris,
>
> Not relevant. I the case referenced, the AST, written in BASIC, is the CALLED routine. As to what can be called from BASIC, I suggest reading the reference manual. As I recall, the original header files had no parameter definitions, so it was possible to easily fall into the trap. Later versions allowed more precision, but the older form was preserved for backward compatibility.
>
> Of course, more than a few people did not pick up the change and continued the earlier approach, which leads to problems.
>
> - Bob Gezelter, http://www.rlgsc.com
>

I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an AST
routine?

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: BASIC and AST routines

<c64469ea-9b2e-48e8-9b50-f188e2446bb6n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18795&group=comp.os.vms#18795

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:6214:411e:: with SMTP id kc30mr73875217qvb.38.1637322195933;
Fri, 19 Nov 2021 03:43:15 -0800 (PST)
X-Received: by 2002:a05:620a:21c2:: with SMTP id h2mr27440771qka.387.1637322195792;
Fri, 19 Nov 2021 03:43:15 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Fri, 19 Nov 2021 03:43:15 -0800 (PST)
In-Reply-To: <sn7d2p$82q$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=100.2.113.217; posting-account=r2_qcwoAAACbIdit5Eka3ivGvrYZz7UQ
NNTP-Posting-Host: 100.2.113.217
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
<d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com> <sn6tes$s80$1@dont-email.me>
<08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com> <sn7d2p$82q$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c64469ea-9b2e-48e8-9b50-f188e2446bb6n@googlegroups.com>
Subject: Re: BASIC and AST routines
From: gezel...@rlgsc.com (Bob Gezelter)
Injection-Date: Fri, 19 Nov 2021 11:43:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 101
 by: Bob Gezelter - Fri, 19 Nov 2021 11:43 UTC

On Friday, November 19, 2021 at 12:35:24 AM UTC-5, Dave Froble wrote:
> On 11/18/2021 10:49 PM, Bob Gezelter wrote:
> > On Thursday, November 18, 2021 at 8:08:47 PM UTC-5, Chris Townley wrote:
> >> On 18/11/2021 23:31, Bob Gezelter wrote:
> >>> On Wednesday, November 17, 2021 at 6:14:30 PM UTC-5, John Doppke wrote:
> >>>> So I've been playing with writing AST routines (stubbornly) in BASIC.. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters are, but doing anything with them is usually a bad idea. I communicate with my main program using common or event flags.
> >>>>
> >>>> Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST call with my AST works ok).
> >>>>
> >>>> Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.
> >>>>
> >>>> -John
> >>> John,
> >>>
> >>> Been there, done that (for a client whose entire codebase was written in BASIC).
> >>>
> >>> As VAXman and Dave Froble noted, the five parameters are passed are, and I quote from David's posting:
> >>>
> >>> "From the 7.3 docs:
> >>>
> >>> Table 8–3 AST Arguments for VAX Systems and Alpha Systems
> >>> VAX System Arguments Alpha System Arguments
> >>> AST parameter AST parameter
> >>> R0 R0
> >>> R1 R1
> >>> PC PC
> >>> PSL PS "
> >>>
> >>> One will notice that the correct number of parameters restriction does not appear in all languages. C , FORTRAN, and others have looser restrictions on parameter lists, as well as variable-sized parameter lists. BASIC does not. BASIC requires that the parameter lists match in size and type AND enforces that restriction at the called routine interface. In the OpenVMS DOC set, I have seen examples which presume that the parameter count restriction is not enforced. They are a bit misleading in the case of BASIC.
> >>>
> >>> Many library routines can be called from both normal thread and AST contexts, but since many of the library routines are not- re-entrant, one cannot generally call library routines from both AST and process threads. However, most OpenVMS general library routines and system services are reentrant, and can be invoked without excessive difficulty from BASIC. While many define their own prototypes I highly recommending the include files from the BASIC text library in SYS$LIBRARY. If those are out of date, write your own versions with correct parameter list definitions, correctly implemented definitions save a lot of fighting with debugging.
> >>>
> >>> As to what is the AST parameter, my general practice is to use a data structure for each file, and pass a pointer to that file as the AST parameter. That allows storage of useful information beyond the file number/handle.
> >>>
> >>> - Bob Gezelter, http://wwww.rlgsc.com
> >>>
> >> IIRC Basic can handle variable number of parameters when calling a
> >> sub/function, but you cannot write them in Basic
> >>
> >>
> >> --
> >> Chris
> > Chris,
> >
> > Not relevant. I the case referenced, the AST, written in BASIC, is the CALLED routine. As to what can be called from BASIC, I suggest reading the reference manual. As I recall, the original header files had no parameter definitions, so it was possible to easily fall into the trap. Later versions allowed more precision, but the older form was preserved for backward compatibility.
> >
> > Of course, more than a few people did not pick up the change and continued the earlier approach, which leads to problems.
> >
> > - Bob Gezelter, http://www.rlgsc.com
> >
> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an AST
> routine?
> --
> David Froble Tel: 724-529-0450
> Dave Froble Enterprises, Inc. E-Mail: da...@tsoft-inc.com
> DFE Ultralights, Inc.
> 170 Grimplin Road
> Vanderbilt, PA 15486
David,

Am rather busy this morning, but the IDSM has a full description of the dispatching process for an AST.

- Bob Gezelter, http://www.rlgsc.com

Re: BASIC and AST routines

<sn8g92$mic$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18804&group=comp.os.vms#18804

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: seaoh...@hoffmanlabs.invalid (Stephen Hoffman)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Fri, 19 Nov 2021 10:36:02 -0500
Organization: HoffmanLabs LLC
Lines: 51
Message-ID: <sn8g92$mic$1@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com> <d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com> <sn6tes$s80$1@dont-email.me> <08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com> <sn7d2p$82q$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="ef949d1fb28cb2e930d5f781ff371d24";
logging-data="23116"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Nw5Cdp6wf527fUwu1YAApxl21xWiGJH8="
User-Agent: Unison/2.2
Cancel-Lock: sha1:pkUImUrEVJkxep0I3nNAPSgBP+w=
 by: Stephen Hoffman - Fri, 19 Nov 2021 15:36 UTC

On 2021-11-19 05:35:20 +0000, Dave Froble said:

> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed
> to an AST routine?

Technically, because VAX.

VAX never saved R0 and R1 across CALLS/CALLG calls as those registers
were the return value path, and PC and PS/PSL are the rest of restoring
the context around the AST. If those registers didn't get preserved
(somewhere) across the AST, then the AST delivery would corrupt the
mainline.

Pragmatically, because the programming languages that the OpenVMS devs
largely utilized (then and now) could ignore those arguments, and "the
right thing" would happen. (There's a side-discussion in argument
mismatching to be had here, too.)

In aggregate, it's a dumb-arsed API design that exposes the hardware,
and one that will probably only change as part of overhauling BASIC for
64-bit and for more modern expectations. And possibly of overhauling
the OpenVMS APIs.

Minimally, better BASIC doc would be nice, as the AST API has
eventually bitten most BASIC developers, this stuff is ~not documented.
Searching for "asynchronous" in the current BASIC user and reference
manuals gets nada, and searching for "AST" in the user guide has
nothing useful for writing an AST routine in BASIC and nothing in the
reference manual. This would be where a discussion of AST and thread
reentrancy would likely be placed, too.

Smallest and most isolated VSI code change would be an added AST
function keyword that would allow those arguments to be preserved by
the BASIC run-time, but suppressed in the BASIC app source code.
Syntactic sugar in the BASIC compiler.

Moderate to larger changes would involve moving OpenVMS and BASIC to
object support, and with a hypothetical object AST routine would get an
object containing everything, and the app source code would never need
to reference those bits of hardware data. Or as ASTs are a predecessor
to threading, replace ASTs for KP threading or GCD/libdispatch-style
threading save for preserving the existing old-style-API AST source
code. But last I checked, BASIC was AST-safe and not thread-safe, so
this threading overhaul and object-overhaul would be a
comparatively large investment in the future of BASIC.

--
Pure Personal Opinion | HoffmanLabs LLC

Re: BASIC and AST routines

<sn8nrg$g7b$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18806&group=comp.os.vms#18806

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Fri, 19 Nov 2021 12:45:18 -0500
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <sn8nrg$g7b$1@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
<d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com>
<sn6tes$s80$1@dont-email.me>
<08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com>
<sn7d2p$82q$1@dont-email.me>
<c64469ea-9b2e-48e8-9b50-f188e2446bb6n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 19 Nov 2021 17:45:20 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a843314db70df0e8c46dbb129eac0fa1";
logging-data="16619"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DySgOS39HyZQ9+de1uywEnNSMEjMbYMw="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:trHaFeQIb3yMtoaZo6TfZ3V8s1k=
In-Reply-To: <c64469ea-9b2e-48e8-9b50-f188e2446bb6n@googlegroups.com>
 by: Dave Froble - Fri, 19 Nov 2021 17:45 UTC

On 11/19/2021 6:43 AM, Bob Gezelter wrote:
> On Friday, November 19, 2021 at 12:35:24 AM UTC-5, Dave Froble wrote:
>> On 11/18/2021 10:49 PM, Bob Gezelter wrote:
>>> On Thursday, November 18, 2021 at 8:08:47 PM UTC-5, Chris Townley wrote:
>>>> On 18/11/2021 23:31, Bob Gezelter wrote:
>>>>> On Wednesday, November 17, 2021 at 6:14:30 PM UTC-5, John Doppke wrote:
>>>>>> So I've been playing with writing AST routines (stubbornly) in BASIC. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters are, but doing anything with them is usually a bad idea. I communicate with my main program using common or event flags.
>>>>>>
>>>>>> Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST call with my AST works ok).
>>>>>>
>>>>>> Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.
>>>>>>
>>>>>> -John
>>>>> John,
>>>>>
>>>>> Been there, done that (for a client whose entire codebase was written in BASIC).
>>>>>
>>>>> As VAXman and Dave Froble noted, the five parameters are passed are, and I quote from David's posting:
>>>>>
>>>>> "From the 7.3 docs:
>>>>>
>>>>> Table 8–3 AST Arguments for VAX Systems and Alpha Systems
>>>>> VAX System Arguments Alpha System Arguments
>>>>> AST parameter AST parameter
>>>>> R0 R0
>>>>> R1 R1
>>>>> PC PC
>>>>> PSL PS "
>>>>>
>>>>> One will notice that the correct number of parameters restriction does not appear in all languages. C , FORTRAN, and others have looser restrictions on parameter lists, as well as variable-sized parameter lists. BASIC does not. BASIC requires that the parameter lists match in size and type AND enforces that restriction at the called routine interface. In the OpenVMS DOC set, I have seen examples which presume that the parameter count restriction is not enforced. They are a bit misleading in the case of BASIC.
>>>>>
>>>>> Many library routines can be called from both normal thread and AST contexts, but since many of the library routines are not- re-entrant, one cannot generally call library routines from both AST and process threads. However, most OpenVMS general library routines and system services are reentrant, and can be invoked without excessive difficulty from BASIC. While many define their own prototypes I highly recommending the include files from the BASIC text library in SYS$LIBRARY. If those are out of date, write your own versions with correct parameter list definitions, correctly implemented definitions save a lot of fighting with debugging.
>>>>>
>>>>> As to what is the AST parameter, my general practice is to use a data structure for each file, and pass a pointer to that file as the AST parameter. That allows storage of useful information beyond the file number/handle.
>>>>>
>>>>> - Bob Gezelter, http://wwww.rlgsc.com
>>>>>
>>>> IIRC Basic can handle variable number of parameters when calling a
>>>> sub/function, but you cannot write them in Basic
>>>>
>>>>
>>>> --
>>>> Chris
>>> Chris,
>>>
>>> Not relevant. I the case referenced, the AST, written in BASIC, is the CALLED routine. As to what can be called from BASIC, I suggest reading the reference manual. As I recall, the original header files had no parameter definitions, so it was possible to easily fall into the trap. Later versions allowed more precision, but the older form was preserved for backward compatibility.
>>>
>>> Of course, more than a few people did not pick up the change and continued the earlier approach, which leads to problems.
>>>
>>> - Bob Gezelter, http://www.rlgsc.com
>>>
>> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an AST
>> routine?
>> --
>> David Froble Tel: 724-529-0450
>> Dave Froble Enterprises, Inc. E-Mail: da...@tsoft-inc.com
>> DFE Ultralights, Inc.
>> 170 Grimplin Road
>> Vanderbilt, PA 15486
> David,
>
> Am rather busy this morning, but the IDSM has a full description of the dispatching process for an AST.
>
> - Bob Gezelter, http://www.rlgsc.com
>

Oh, you mean that big book on the bookshelf gathering dust?

Got to now consider how curious I really am.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: BASIC and AST routines

<sn8o6u$l72$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18807&group=comp.os.vms#18807

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Fri, 19 Nov 2021 12:51:24 -0500
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <sn8o6u$l72$1@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
<d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com>
<sn6tes$s80$1@dont-email.me>
<08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com>
<sn7d2p$82q$1@dont-email.me> <sn8g92$mic$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 19 Nov 2021 17:51:26 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a843314db70df0e8c46dbb129eac0fa1";
logging-data="21730"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HzdqF+4sZxSumgPuu82ybvOWGmfjnmgE="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:3tjsZyhgGMsxqpnIKvln7VSpXc8=
In-Reply-To: <sn8g92$mic$1@dont-email.me>
 by: Dave Froble - Fri, 19 Nov 2021 17:51 UTC

On 11/19/2021 10:36 AM, Stephen Hoffman wrote:
> On 2021-11-19 05:35:20 +0000, Dave Froble said:
>
>> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an
>> AST routine?
>
> Technically, because VAX.
>
> VAX never saved R0 and R1 across CALLS/CALLG calls as those registers were the
> return value path, and PC and PS/PSL are the rest of restoring the context
> around the AST. If those registers didn't get preserved (somewhere) across the
> AST, then the AST delivery would corrupt the mainline.
>
> Pragmatically, because the programming languages that the OpenVMS devs largely
> utilized (then and now) could ignore those arguments, and "the right thing"
> would happen. (There's a side-discussion in argument mismatching to be had here,
> too.)
>
> In aggregate, it's a dumb-arsed API design that exposes the hardware, and one
> that will probably only change as part of overhauling BASIC for 64-bit and for
> more modern expectations. And possibly of overhauling the OpenVMS APIs.
>
> Minimally, better BASIC doc would be nice, as the AST API has eventually bitten
> most BASIC developers, this stuff is ~not documented. Searching for
> "asynchronous" in the current BASIC user and reference manuals gets nada, and
> searching for "AST" in the user guide has nothing useful for writing an AST
> routine in BASIC and nothing in the reference manual. This would be where a
> discussion of AST and thread reentrancy would likely be placed, too.
>
> Smallest and most isolated VSI code change would be an added AST function
> keyword that would allow those arguments to be preserved by the BASIC run-time,
> but suppressed in the BASIC app source code. Syntactic sugar in the BASIC compiler.
>
> Moderate to larger changes would involve moving OpenVMS and BASIC to object
> support, and with a hypothetical object AST routine would get an object
> containing everything, and the app source code would never need to reference
> those bits of hardware data. Or as ASTs are a predecessor to threading, replace
> ASTs for KP threading or GCD/libdispatch-style threading save for preserving the
> existing old-style-API AST source code. But last I checked, BASIC was AST-safe
> and not thread-safe, so this threading overhaul and object-overhaul would be a
> comparatively large investment in the future of BASIC.
>
>
>

All very interesting, and yes, I asked, so thanks for the info.

The real problem is John still doesn't have a Basic compiler for x86, which just
might be a bit more important than how ASTs work. I'll just be real happy when
he has an x86 Basic compiler. I'm not too hard to please.

:-)

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: BASIC and AST routines

<00B6C0F1.ECE903A3@SendSpamHere.ORG>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18810&group=comp.os.vms#18810

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!pr9o9uw/KLhPSFYv2ok3sg.user.46.165.242.75.POSTED!not-for-mail
From: VAXm...@SendSpamHere.ORG
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Fri, 19 Nov 2021 22:18:25 GMT
Organization: c.2021 Brian Schenkenberger. Prior employers of copyright holder and their agents must first obtain written permission to copy this posting.
Message-ID: <00B6C0F1.ECE903A3@SendSpamHere.ORG>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com> <d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com> <sn6tes$s80$1@dont-email.me> <08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com> <sn7d2p$82q$1@dont-email.me> <c64469ea-9b2e-48e8-9b50-f188e2446bb6n@googlegroups.com>
Reply-To: VAXman- @SendSpamHere.ORG
Injection-Info: gioia.aioe.org; logging-data="45657"; posting-host="pr9o9uw/KLhPSFYv2ok3sg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: VAXm...@SendSpamHere.ORG - Fri, 19 Nov 2021 22:18 UTC

In article <sn8nrg$g7b$1@dont-email.me>, Dave Froble <davef@tsoft-inc.com> writes:
>On 11/19/2021 6:43 AM, Bob Gezelter wrote:
>> On Friday, November 19, 2021 at 12:35:24 AM UTC-5, Dave Froble wrote:
>>> On 11/18/2021 10:49 PM, Bob Gezelter wrote:
>>>> On Thursday, November 18, 2021 at 8:08:47 PM UTC-5, Chris Townley wrote:
>>>>> On 18/11/2021 23:31, Bob Gezelter wrote:
>>>>>> On Wednesday, November 17, 2021 at 6:14:30 PM UTC-5, John Doppke wrote:
>>>>>>> So I've been playing with writing AST routines (stubbornly) in BASIC. They work ok, but I've found I have to declare the routine as having 5 'standard' parameters - "function long AST long (p1, p2, p3, p4, p5)". I'm not sure what the 5 parameters
>>>>>>>
>>>>>>> Now I need an AST for a call that requires a parameter - SMG$ENABLE_UNSOLICITED_INPUT. I've tried adding a parameter in my usual list in different ways but I can't get it to work. Every time it's called I get a reserved opcode exception. (A DCLAST
>>>>>>>
>>>>>>> Can anyone shed some light on what the parameters are that BASIC is getting? I'll probably end up writing this one in MACRO, but I want to understand what is happening.
>>>>>>>
>>>>>>> -John
>>>>>> John,
>>>>>>
>>>>>> Been there, done that (for a client whose entire codebase was written in BASIC).
>>>>>>
>>>>>> As VAXman and Dave Froble noted, the five parameters are passed are, and I quote from David's posting:
>>>>>>
>>>>>> "From the 7.3 docs:
>>>>>>
>>>>>> Table 8–3 AST Arguments for VAX Systems and Alpha Systems
>>>>>> VAX System Arguments Alpha System Arguments
>>>>>> AST parameter AST parameter
>>>>>> R0 R0
>>>>>> R1 R1
>>>>>> PC PC
>>>>>> PSL PS "
>>>>>>
>>>>>> One will notice that the correct number of parameters restriction does not appear in all languages. C , FORTRAN, and others have looser restrictions on parameter lists, as well as variable-sized parameter lists. BASIC does not. BASIC requires that
>>>>>>
>>>>>> Many library routines can be called from both normal thread and AST contexts, but since many of the library routines are not- re-entrant, one cannot generally call library routines from both AST and process threads. However, most OpenVMS general li
>>>>>>
>>>>>> As to what is the AST parameter, my general practice is to use a data structure for each file, and pass a pointer to that file as the AST parameter. That allows storage of useful information beyond the file number/handle.
>>>>>>
>>>>>> - Bob Gezelter, http://wwww.rlgsc.com
>>>>>>
>>>>> IIRC Basic can handle variable number of parameters when calling a
>>>>> sub/function, but you cannot write them in Basic
>>>>>
>>>>>
>>>>> --
>>>>> Chris
>>>> Chris,
>>>>
>>>> Not relevant. I the case referenced, the AST, written in BASIC, is the CALLED routine. As to what can be called from BASIC, I suggest reading the reference manual. As I recall, the original header files had no parameter definitions, so it was possibl
>>>>
>>>> Of course, more than a few people did not pick up the change and continued the earlier approach, which leads to problems.
>>>>
>>>> - Bob Gezelter, http://www.rlgsc.com
>>>>
>>> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an AST
>>> routine?
>>> --
>>> David Froble Tel: 724-529-0450
>>> Dave Froble Enterprises, Inc. E-Mail: da...@tsoft-inc.com
>>> DFE Ultralights, Inc.
>>> 170 Grimplin Road
>>> Vanderbilt, PA 15486
>> David,
>>
>> Am rather busy this morning, but the IDSM has a full description of the dispatching process for an AST.
>>
>> - Bob Gezelter, http://www.rlgsc.com
>>
>
>Oh, you mean that big book on the bookshelf gathering dust?
>
>Got to now consider how curious I really am.

RTFM!

--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.

Re: BASIC and AST routines

<915ab91a-d25e-46e6-9516-171ff7eff791n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18815&group=comp.os.vms#18815

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:1294:: with SMTP id w20mr37263000qki.197.1637415842990;
Sat, 20 Nov 2021 05:44:02 -0800 (PST)
X-Received: by 2002:a05:6214:509a:: with SMTP id kk26mr83390733qvb.43.1637415842867;
Sat, 20 Nov 2021 05:44:02 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sat, 20 Nov 2021 05:44:02 -0800 (PST)
In-Reply-To: <00B6C0F1.ECE903A3@SendSpamHere.ORG>
Injection-Info: google-groups.googlegroups.com; posting-host=70.31.99.225; posting-account=QqCTBgkAAACie99dBE6oFauYH8hE6sk0
NNTP-Posting-Host: 70.31.99.225
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
<d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com> <sn6tes$s80$1@dont-email.me>
<08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com> <sn7d2p$82q$1@dont-email.me>
<c64469ea-9b2e-48e8-9b50-f188e2446bb6n@googlegroups.com> <00B6C0F1.ECE903A3@SendSpamHere.ORG>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <915ab91a-d25e-46e6-9516-171ff7eff791n@googlegroups.com>
Subject: Re: BASIC and AST routines
From: n.ri...@bell.net (Neil Rieck)
Injection-Date: Sat, 20 Nov 2021 13:44:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 20
 by: Neil Rieck - Sat, 20 Nov 2021 13:44 UTC

John etc al,

Back in the day, I was under the impression that I could do almost anything I wanted in DEC-BASIC (given enough time). You mentioned the 5 standard parameters. I recall being here as well when I was first attempting to write my own code to call SYS$QIO and SYS$QIOW. It was around that time that I discovered errors in the official VMS documentation that did not agree with how things were done in the STARLET library. Anyway, here are three links: the first one is for doing $QIO from BASIC (one of the QIO examples includes an AST). The second is a "dog's breakfast menu" of my mostly DEC-BASIC demo code. The third is a menu of VMS notes where one entry shows you how to open any system library so you can see how things need to be declared for the language in question. Enjoy!

http://neilrieck.net/demo_vms_html/qio_demo_bas.html
http://neilrieck.net/demo_vms_html/openvms_demo_index.html
http://neilrieck.net/links/openvms_resources.html#openvms-notes

Neil Rieck
Waterloo, Ontario, Canada

Re: BASIC and AST routines

<sngp1p$aud$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18838&group=comp.os.vms#18838

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Mon, 22 Nov 2021 18:54:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <sngp1p$aud$2@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com> <d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com> <sn6tes$s80$1@dont-email.me> <08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com> <sn7d2p$82q$1@dont-email.me>
Injection-Date: Mon, 22 Nov 2021 18:54:49 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="542b83290251363799ce2f51ac764cb9";
logging-data="11213"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18B8vlfkzE5hdTbRO6l8bYB3FgwEXARizM="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:27T4GGJKp+YGBtIgeOI5HGkNxJw=
 by: Simon Clubley - Mon, 22 Nov 2021 18:54 UTC

On 2021-11-19, Dave Froble <davef@tsoft-inc.com> wrote:
>
> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an AST
> routine?
>

Because it's another example of VMS functionality being implemented
at way too low an abstraction level because of the need to support
Macro-32 as an application programming language.

In a modern version of VMS, that would be hidden from the application
programmer as an implementation detail and the most you would have to
do would be to tag the AST routine with a pragma or some type of __ast__
attribute that the compiler understood and then automatically generated
the right code for you.

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: BASIC and AST routines

<sngp4j$aud$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18839&group=comp.os.vms#18839

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Mon, 22 Nov 2021 18:56:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <sngp4j$aud$3@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com> <d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com> <sn6tes$s80$1@dont-email.me> <08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com> <sn7d2p$82q$1@dont-email.me> <c64469ea-9b2e-48e8-9b50-f188e2446bb6n@googlegroups.com> <sn8nrg$g7b$1@dont-email.me>
Injection-Date: Mon, 22 Nov 2021 18:56:20 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="542b83290251363799ce2f51ac764cb9";
logging-data="11213"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18z2cUqZKiRdv+grMtFjy0XiAEkoLy7QxI="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:jAlr4urrAwIQ6Y+SKWNsWahQI3Y=
 by: Simon Clubley - Mon, 22 Nov 2021 18:56 UTC

On 2021-11-19, Dave Froble <davef@tsoft-inc.com> wrote:
> On 11/19/2021 6:43 AM, Bob Gezelter wrote:
>> David,
>>
>> Am rather busy this morning, but the IDSM has a full description of the dispatching process for an AST.
>>
>> - Bob Gezelter, http://www.rlgsc.com
>>
>
> Oh, you mean that big book on the bookshelf gathering dust?
>
> Got to now consider how curious I really am.
>

That "big book" has lots of interesting stuff in it. Try reading
it sometime. :-)

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: BASIC and AST routines

<00B6C348.F74CDC7B@SendSpamHere.ORG>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18850&group=comp.os.vms#18850

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!pr9o9uw/KLhPSFYv2ok3sg.user.46.165.242.75.POSTED!not-for-mail
From: VAXm...@SendSpamHere.ORG
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Mon, 22 Nov 2021 21:46:31 GMT
Organization: c.2021 Brian Schenkenberger. Prior employers of copyright holder and their agents must first obtain written permission to copy this posting.
Message-ID: <00B6C348.F74CDC7B@SendSpamHere.ORG>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com> <d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com> <sn6tes$s80$1@dont-email.me> <08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com> <sn7d2p$82q$1@dont-email.me> <sngp1p$aud$2@dont-email.me>
Reply-To: VAXman- @SendSpamHere.ORG
Injection-Info: gioia.aioe.org; logging-data="27274"; posting-host="pr9o9uw/KLhPSFYv2ok3sg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: VAXm...@SendSpamHere.ORG - Mon, 22 Nov 2021 21:46 UTC

In article <sngp1p$aud$2@dont-email.me>, Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> writes:
>On 2021-11-19, Dave Froble <davef@tsoft-inc.com> wrote:
>>
>> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an AST
>> routine?
>>
>
>Because it's another example of VMS functionality being implemented
>at way too low an abstraction level because of the need to support
>Macro-32 as an application programming language.

BULLSHIT! If you believe that's true, please provide an illustrating example.
I'll be waiting...

>In a modern version of VMS, that would be hidden from the application
>programmer as an implementation detail and the most you would have to
>do would be to tag the AST routine with a pragma or some type of __ast__
>attribute that the compiler understood and then automatically generated
>the right code for you.

Most will NEVER need to access those parameter and attempts to change them will
do nothing. ASTPRM is first and that's all you may need. Consider the others
gratuitous FYI.

--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.

Re: BASIC and AST routines

<snjcd1$9hn$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18868&group=comp.os.vms#18868

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Tue, 23 Nov 2021 18:37:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <snjcd1$9hn$2@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com> <d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com> <sn6tes$s80$1@dont-email.me> <08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com> <sn7d2p$82q$1@dont-email.me> <sngp1p$aud$2@dont-email.me> <00B6C348.F74CDC7B@SendSpamHere.ORG>
Injection-Date: Tue, 23 Nov 2021 18:37:21 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3abc66a69efd5025592d62074193bda5";
logging-data="9783"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19p11piDS8ovWeLe12S99fdfrCS2qa56ps="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:tm500GNUJ/+VQGD0yIbFBuW8zwY=
 by: Simon Clubley - Tue, 23 Nov 2021 18:37 UTC

On 2021-11-22, VAXman- @SendSpamHere.ORG <VAXman-@SendSpamHere.ORG> wrote:
> In article <sngp1p$aud$2@dont-email.me>, Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> writes:
>>On 2021-11-19, Dave Froble <davef@tsoft-inc.com> wrote:
>>>
>>> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an AST
>>> routine?
>>>
>>
>>Because it's another example of VMS functionality being implemented
>>at way too low an abstraction level because of the need to support
>>Macro-32 as an application programming language.
>
> BULLSHIT! If you believe that's true, please provide an illustrating example.
> I'll be waiting...
>

That VMS API passes in a stack pointer, a PC and what were originally
two architecture-specific registers.

That kind of information simply would not be exposed at application
code level in a modern version of that API as it would (rightly) be
treated as an implementation specific detail that would be handled
by the compiler.

That information is only needed because the lowest supported application
language on VMS is Macro-32 and not C (or another comparable low-level
language).

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: BASIC and AST routines

<619d35db$0$706$14726298@news.sunsite.dk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18870&group=comp.os.vms#18870

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Tue, 23 Nov 2021 13:41:30 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.3.2
Subject: Re: BASIC and AST routines
Content-Language: en-US
Newsgroups: comp.os.vms
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
<d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com>
<sn6tes$s80$1@dont-email.me>
<08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com>
<sn7d2p$82q$1@dont-email.me> <sngp1p$aud$2@dont-email.me>
<00B6C348.F74CDC7B@SendSpamHere.ORG> <snjcd1$9hn$2@dont-email.me>
From: arn...@vajhoej.dk (Arne Vajhøj)
In-Reply-To: <snjcd1$9hn$2@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 35
Message-ID: <619d35db$0$706$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: 38938705.news.sunsite.dk
X-Trace: 1637692891 news.sunsite.dk 706 arne@vajhoej.dk/68.9.63.232:62519
X-Complaints-To: staff@sunsite.dk
 by: Arne Vajhøj - Tue, 23 Nov 2021 18:41 UTC

On 11/23/2021 1:37 PM, Simon Clubley wrote:
> On 2021-11-22, VAXman- @SendSpamHere.ORG <VAXman-@SendSpamHere.ORG> wrote:
>> In article <sngp1p$aud$2@dont-email.me>, Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> writes:
>>> On 2021-11-19, Dave Froble <davef@tsoft-inc.com> wrote:
>>>>
>>>> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an AST
>>>> routine?
>>>>
>>>
>>> Because it's another example of VMS functionality being implemented
>>> at way too low an abstraction level because of the need to support
>>> Macro-32 as an application programming language.
>>
>> BULLSHIT! If you believe that's true, please provide an illustrating example.
>> I'll be waiting...
>
> That VMS API passes in a stack pointer, a PC and what were originally
> two architecture-specific registers.
>
> That kind of information simply would not be exposed at application
> code level in a modern version of that API as it would (rightly) be
> treated as an implementation specific detail that would be handled
> by the compiler.
>
> That information is only needed because the lowest supported application
> language on VMS is Macro-32 and not C (or another comparable low-level
> language).

What does the Macro-32 application developers need those
arguments for that the C application developers does not need
them for?

Arne

Re: BASIC and AST routines

<snje3g$9hn$4@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18873&group=comp.os.vms#18873

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: BASIC and AST routines
Date: Tue, 23 Nov 2021 19:06:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <snje3g$9hn$4@dont-email.me>
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com> <d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com> <sn6tes$s80$1@dont-email.me> <08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com> <sn7d2p$82q$1@dont-email.me> <sngp1p$aud$2@dont-email.me> <00B6C348.F74CDC7B@SendSpamHere.ORG> <snjcd1$9hn$2@dont-email.me> <619d35db$0$706$14726298@news.sunsite.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Nov 2021 19:06:25 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3abc66a69efd5025592d62074193bda5";
logging-data="9783"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18cTWmBz1spPMY+6zt1VMRPDuKJyySxoeI="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:1eUfLdg1ZwOZtnvEs+PGwfLaEpA=
 by: Simon Clubley - Tue, 23 Nov 2021 19:06 UTC

On 2021-11-23, Arne Vajhøj <arne@vajhoej.dk> wrote:
> On 11/23/2021 1:37 PM, Simon Clubley wrote:
>> On 2021-11-22, VAXman- @SendSpamHere.ORG <VAXman-@SendSpamHere.ORG> wrote:
>>> In article <sngp1p$aud$2@dont-email.me>, Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> writes:
>>>> On 2021-11-19, Dave Froble <davef@tsoft-inc.com> wrote:
>>>>>
>>>>> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an AST
>>>>> routine?
>>>>>
>>>>
>>>> Because it's another example of VMS functionality being implemented
>>>> at way too low an abstraction level because of the need to support
>>>> Macro-32 as an application programming language.
>>>
>>> BULLSHIT! If you believe that's true, please provide an illustrating example.
>>> I'll be waiting...
>>
>> That VMS API passes in a stack pointer, a PC and what were originally
>> two architecture-specific registers.
>>
>> That kind of information simply would not be exposed at application
>> code level in a modern version of that API as it would (rightly) be
>> treated as an implementation specific detail that would be handled
>> by the compiler.
>>
>> That information is only needed because the lowest supported application
>> language on VMS is Macro-32 and not C (or another comparable low-level
>> language).
>
> What does the Macro-32 application developers need those
> arguments for that the C application developers does not need
> them for?
>

You miss the point Arne.

If C was the lowest level supported language then the compiler would
simply have a pragma or function attribute that marked it as an AST
routine so that the compiler would generate the required code (or not
generate troublesome code sequences) as required.

This happens all the time with C language interrupt handlers in some
embedded environments for example.

The SP/PC/R0/R1 parameters are implementation details that the person
writing the AST routine should never see or have to deal with.

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: BASIC and AST routines

<619d417a$0$699$14726298@news.sunsite.dk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=18879&group=comp.os.vms#18879

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Tue, 23 Nov 2021 14:31:00 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.3.2
Subject: Re: BASIC and AST routines
Content-Language: en-US
Newsgroups: comp.os.vms
References: <d77053df-ac45-42f9-9b01-fac40a04095en@googlegroups.com>
<d98f13aa-4da0-482a-aaa5-6f6a629c3f25n@googlegroups.com>
<sn6tes$s80$1@dont-email.me>
<08af58ca-be1f-49ad-9134-a2b55576b21an@googlegroups.com>
<sn7d2p$82q$1@dont-email.me> <sngp1p$aud$2@dont-email.me>
<00B6C348.F74CDC7B@SendSpamHere.ORG> <snjcd1$9hn$2@dont-email.me>
<619d35db$0$706$14726298@news.sunsite.dk> <snje3g$9hn$4@dont-email.me>
From: arn...@vajhoej.dk (Arne Vajhøj)
In-Reply-To: <snje3g$9hn$4@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 66
Message-ID: <619d417a$0$699$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: 806c2c8a.news.sunsite.dk
X-Trace: 1637695866 news.sunsite.dk 699 arne@vajhoej.dk/68.9.63.232:64523
X-Complaints-To: staff@sunsite.dk
 by: Arne Vajhøj - Tue, 23 Nov 2021 19:31 UTC

On 11/23/2021 2:06 PM, Simon Clubley wrote:
> On 2021-11-23, Arne Vajhøj <arne@vajhoej.dk> wrote:
>> On 11/23/2021 1:37 PM, Simon Clubley wrote:
>>> On 2021-11-22, VAXman- @SendSpamHere.ORG <VAXman-@SendSpamHere.ORG> wrote:
>>>> In article <sngp1p$aud$2@dont-email.me>, Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> writes:
>>>>> On 2021-11-19, Dave Froble <davef@tsoft-inc.com> wrote:
>>>>>> I'm going to confess to curiosity. Why are R0, R1, SP, and PC passed to an AST
>>>>>> routine?
>>>>>
>>>>> Because it's another example of VMS functionality being implemented
>>>>> at way too low an abstraction level because of the need to support
>>>>> Macro-32 as an application programming language.
>>>>
>>>> BULLSHIT! If you believe that's true, please provide an illustrating example.
>>>> I'll be waiting...
>>>
>>> That VMS API passes in a stack pointer, a PC and what were originally
>>> two architecture-specific registers.
>>>
>>> That kind of information simply would not be exposed at application
>>> code level in a modern version of that API as it would (rightly) be
>>> treated as an implementation specific detail that would be handled
>>> by the compiler.
>>>
>>> That information is only needed because the lowest supported application
>>> language on VMS is Macro-32 and not C (or another comparable low-level
>>> language).
>>
>> What does the Macro-32 application developers need those
>> arguments for that the C application developers does not need
>> them for?
>
> You miss the point Arne.
>
> If C was the lowest level supported language then the compiler would
> simply have a pragma or function attribute that marked it as an AST
> routine so that the compiler would generate the required code (or not
> generate troublesome code sequences) as required.
>
> This happens all the time with C language interrupt handlers in some
> embedded environments for example.
>
> The SP/PC/R0/R1 parameters are implementation details that the person
> writing the AST routine should never see or have to deal with.

????

There are two questions here.

1) How to deal with side effects from those arguments.

Basic apparently has a problem. It could be fixed like you describe
for C. John Reagan already confirmed that.

Neither C nor Macro-32 has the need for such a fix. They just
don't access the argument and they are good.

2) Why are those arguments there?

It is not obvious to me why Macro-32 code would want to use them
any more than C or Basic code.

Arne

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor