Re: catch and throw, was Is multi-level function return possible?

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Thu, 27 Mar 2014 19:21:34 +0000 (UTC)

          From comp.compilers

Related articles
Is multi-level function return possible? noitalmost@cox.net (noitalmost) (2014-03-10)
Re: Is multi-level function return possible? gneuner2@comcast.net (George Neuner) (2014-03-11)
Re: Is multi-level function return possible? federation2005@netzero.com (2014-03-26)
Re: catch and throw, was Is multi-level function return possible? rpw3@rpw3.org (2014-03-27)
Re: catch and throw, was Is multi-level function return possible? kaz@kylheku.com (Kaz Kylheku) (2014-03-27)
Re: catch and throw, was Is multi-level function return possible? usenet@bitblocks.com (Bakul Shah) (2014-03-26)
Re: catch and throw, was Is multi-level function return possible? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-03-27)
Re: catch and throw, was Is multi-level function return possible? gneuner2@comcast.net (George Neuner) (2014-03-28)
Re: catch and throw, was Is multi-level function return possible? acolvin@efunct.com (mac) (2014-03-28)
Re: catch and throw, was Is multi-level function return possible? ivan@ootbcomp.com (Ivan Godard) (2014-03-28)
Re: catch and throw, was Is multi-level function return possible? kaz@kylheku.com (Kaz Kylheku) (2014-03-29)
Re: catch and throw, was Is multi-level function return possible? kaz@kylheku.com (Kaz Kylheku) (2014-03-29)
Re: catch and throw, was Is multi-level function return possible? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-03-29)
[2 later articles]
| List of all articles for this month |
From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Thu, 27 Mar 2014 19:21:34 +0000 (UTC)
Organization: Aioe.org NNTP Server
References: 14-03-020 14-03-023 14-03-065 14-03-068 14-03-070
Keywords: PL/I, errors, history
Posted-Date: 27 Mar 2014 15:25:45 EDT

Bakul Shah <usenet@bitblocks.com> wrote:


(snip


> PL/I had ON and SIGNAL statements. SIGNAL would signal an exception.
> ON would catch it. REVERT to cancel the effect of ON. Web search
> indicates it was defined in 1964 but implemented later. May be the
> PL/I designered borrowed it from an earlier language/facility?


As mentioned earlier, some features of PL/I were implementations of
features of OS/360.


OS/360 has SPIE, Specify Program Interrupt Exit, where what they call
exit is what others would call an interrupt routine. If a program
interrupt occurs (fixed or floating point overflow, zerodivide,
illegal instruction, and such) it will call the routine at the
specified address. When that routine returns, it goes back to the
original program, possibly with registers or memory modified.


There is, then, the corresponding ON unit such as FIXEDOVERFLOW or
ZERODIVIDE. Other exception conditions such as end of file, of even
end of page when the system counts lines on a page, can also have ON
units.


ON units stay in effect on entering different blocks, either a new
procedure or a BEGIN block. On exit from a block, any ON units on from
that block are unstacked. REVERT goes back to the one on entering the
current block.


It seems that when multitasking is used, ON units can also be
inherited by subtasks. I am not sure at all what happens when you do
that, but I expect that it complicates the implementation.


-- glen


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.