Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.misty.com!news.iecc.com!.POSTED!nerds-end From: "Robin Vowels" Newsgroups: comp.compilers Subject: Re: exception catching in PL/I Date: Fri, 28 Mar 2014 10:50:43 +1100 Organization: Compilers Central Lines: 30 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-073@comp.compilers> References: <14-03-020@comp.compilers> <14-03-023@comp.compilers> <14-03-065@comp.compilers> <14-03-068@comp.compilers> <14-03-070@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Trace: miucha.iecc.com 1395965817 19327 2001:470:1f07:1126:0:676f:7373:6970 (28 Mar 2014 00:16:57 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 28 Mar 2014 00:16:57 +0000 (UTC) Keywords: PL/I, history Posted-Date: 27 Mar 2014 20:16:57 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1195 From: "Bakul Shah" Sent: Thursday, March 27, 2014 5:20 PM > 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? PL/I provided the means to catch an exception, typically a hardware exception, but not limited to them. S/360 hardware exceptions included floating-point underflow, floating-point overflow, division by zero, fixed-point overflow, and invalid decimal arithmetic. A few of these exceptions could be turned on and off at the program level (e.g., float underflow). Others such as an invalid decimal data interrupt could not be turned off, and were taken by the operating system which in turn passed control to the program's error handler. Thus, the hardware exceptions implemented in PL/I were OVERFLOW, UNDERFLOW, FIXEDOVERFLOW, ZERODIVIDE, and invalid decimal data. Those implemented in software included CONVERSION, SUBSCRIPTRANGE, STRINGRANGE, ENDPAGE, ENDFILE. The user could introduce his own named conditions, and invoke them using a SIGNAL statement. ON statements established the action to be taken in the event of an exception. SIGNAL statements were provided for testing purposes (so that you could check out your exception-handler), and for invoking a user-defined condition. Certain exceptions can be turned on and off at procedure level and at statement level; hence the statement prefixes such as NOFIXEDOVERFLOW and FIXEDOVERFLOW. Other exceptions such as ENDPAGE cannot be turned off, but the exception handler can be a user-written null operation.