Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!a.gp.cs.cmu.edu!koopman From: koopman@a.gp.cs.cmu.edu (Philip Koopman) Newsgroups: comp.lang.forth Subject: Re: Forth in C Summary: But, how much faster did it go? Message-ID: <7026@pt.cs.cmu.edu> Date: 18 Nov 89 12:03:04 GMT References: <8911142050.AA16286@jade.berkeley.edu> <717@noe.UUCP> Organization: Carnegie-Mellon University, CS/RI Lines: 17 In article <717@noe.UUCP>, marc@noe.UUCP (Marc de Groot) writes: > Here's a third way to do it that I just tried. Thanks to Bob Kelley > (sequent!rjk) who gave me the idea. > > I use the asm("..."); pseudo-op to assemble an indirect branch instruction. > This turns into some very efficient code, even with my awful pcc-derived > 80286 C compiler. This, of course, is "non-portable" in that it is > implementation-dependent. On the other hand, the actual amount of effort > necessary to port this to another environment is minimal. It's tantalizing... How much faster did it go? The PCC compilers I've seen tend to use an indirect jump table to implement case statements, which isn't that far away from what you're doing. Did you measure enough speed improvement to be worthwhile? Does your C compiler us jump tables? -- Phil