Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!mcnc!uvaarpa!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: Another way (How not to write a loop) Message-ID: <2156@bsu-cs.UUCP> Date: 19 Feb 88 20:49:46 GMT References: <1988Feb11.200149.25172@sq.uucp> <2550046@hpisod2.HP.COM> <2150@bsu-cs.UUCP> <7285@brl-smoke.ARPA> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 41 In article <7285@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: [re floating add versus integer decrement & test] >So, the Snobol implementor made a stupid decision, then. > >[On the] Gould PowerNode 9080, >which has a remarkably similar architecture...to the IBM 360's... >[a test showed that the] floating-point version burned 4.3 seconds of CPU >time while the integer counter version's overhead was only 0.5 seconds. I don't know what Dewar and Belcher, the authors of SPITBOL, would say to this. Here's what Griswold says in his book "The Macro Implementation of Snobol4" (Freeman & Co. 1972). "An amusing example of the difference between SNOBOL4 and SPITBOL is provided by the way &STLIMIT is implemented and statement numbers located....[In SNOBOL4] &STLIMIT (at a known location in UKYPBL) is checked by init1. If the statement limit has been exceeded, control is transferred to an error routine.... "SPITBOL, in its quest for efficiency, approaches these matters quite differently. At the beginning of each statement, the following instruction occurs. AUR SCNT,SINC This instruction increments a floating-point register reserved for statement counting. SCNT is set up so that when &STLIMIT is exceeded, a program interrupt occurs because of floating-point overflow. An interrupt handler detects this interrupt as excessive statement execution.... [some paragraphs later] "...In any event, SPITBOL is someone else's story to tell. It is a fascinating, well-designed, and cleverly implemented system which the serious student of software is well advised to study....SPITBOL, of course, is hardly machine-independent or portable. Heavy use is made of idiosyncracies of the 360 instruction set, and the coding is very tight." -- Rahul Dhesi UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!dhesi