home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky vmsnet.internals:1231 vmsnet.misc:768
- Newsgroups: vmsnet.internals,vmsnet.misc
- Path: sparky!uunet!eco.twg.com!eco.twg.com!reece
- From: reece@eco.twg.com (Reece R. Pollack)
- Subject: Re: Exit handlers in VAX-C
- Message-ID: <1992Aug31.182542.4983@eco.twg.com>
- Lines: 35
- Sender: reece@flash.eco.twg.com (Reece R. Pollack)
- Nntp-Posting-Host: eco.twg.com
- Reply-To: reece@eco.twg.com (Reece R. Pollack)
- Organization: The Wollongong Group (East Coast Operations)
- References: <la4fgtINNhs6@news.bbn.com>
- Distribution: na
- Date: Mon, 31 Aug 92 18:25:42 GMT
- Lines: 35
-
-
- In article <la4fgtINNhs6@news.bbn.com>, mjensen@BBN.COM (Martin Jensen) writes:
- |> Thank you O Gods of VMS for a prompt and satisfying response to my
- |> earlier query!! Now for the next question :-)
- |>
- |> I'm trying to write an exit handler for a VMS program written in
- |> VAX-C. The various VMS manuals have left me a little confused as to
- |> the calling conventions for exit handlers.
- |>
- |> The Programming Resources Guide indicates that the exit handler
- |> should be written as a subroutine - implying (in my mind anyway) that
- |> the handler is called with a JSB and should return with a RSB. Other
- |> documents seem to indicate that the handler is called as a normal
- |> procedure - implying (again, in my mind) that the handler is called
- |> with a CALL(S,G) and should return with a RET instruction.
- |>
- |> As you can't write subroutines in C, this leaves me stuck with MACRO
- |> if the first case is true. If the second case is true, I can code it
- |> in C and stick it in a shared library (which for various reasons is
- |> the preferable way to go!).
- |>
- |> Any of you VMS gurus care to comment on the correct convention?
-
- Exit handlers are called via the CALLG mechanism, specifying the 3rd
- longword of the exit handler block (offset 8) as the start of the
- argument list.
-
- Make sure the argument block is not allocated on the stack or reused
- before the exit handler is tripped, since it is the block you pass
- to the $DCLEXH service which is used when calling the exit handler.
-
- --
- Reece R. Pollack
- Senior Software Engineer
- The Wollongong Group, Inc.
-