home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / vmsnet / internal / 1231 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  2.1 KB

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