Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!mef From: mef@aplcen.apl.jhu.edu (Marty Fraeman) Newsgroups: comp.lang.forth Subject: Re: ANS TC Magnet for LOOPS, EXIT, Term. Message-ID: <4805@aplcen.apl.jhu.edu> Date: 1 Mar 90 02:36:12 GMT References: <578.UUL1.3#5129@willett.UUCP> Reply-To: mef@aplcen (Marty Fraeman) Organization: Johns Hopkins University Lines: 33 In article <578.UUL1.3#5129@willett.UUCP> ForthNet@willett.UUCP (ForthNet articles from GEnie) writes: > > Date: 02-26-90 (08:19) Number: 2974 (Echo) > To: STEVE PALINCSAR Refer#: 2965 > From: IAN GREEN Read: NO > Subj: DO LOOPS IN FORTH Status: PUBLIC MESSAGE > > The reason for using FOR-NEXT is that I saw a comment comparing FOR > vs. DO in the RTX2001 data sheet. It said FOR runs several times faster > so I assumed that this was a standard word in Forth. > Nope. My impression is that the designers of the original Novix chip had a cute way of doing the FOR-NEXT loop with only a minimal amount of hardware. Rather than make the hardware more complicated (amazingly, the whole thing fit into a 4K gate array) they just invented a new loop construct. After all we are talking about Forth. -) While we were designing the Hopkins 32 bit Forth engine that later became the SC32, we also struggled with this issue. We finally came up with a way to implement Forth 83 style do-loops in 2 cycles. I believe the Novix (and hence the Harris RTX 2000) design can do the FOR-NEXT loop in just a single cycle. However in all but the most trivial loops this small difference is neglible. Marty Fraeman mef@aplcen.apl.jhu.edu 301-953-5000, x8360 Room 13-s587 Johns Hopkins University/Applied Physics Laboratory Johns Hopkins Road Laurel, Md. 20723