Re: Need help with PD source (again)
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Apr 05, 2005
- 418 views
Pete Lomax wrote: > > On Mon, 04 Apr 2005 10:25:10 -0700, Matt Lewis > <guest at RapidEuphoria.com> wrote: > > >Pete Lomax wrote: > >> > >> > > >> Matt Lewis wrote: > >> > So it's those ENDFOR_INT_UP1's and ENDFOR_GENERAL's that you need to > >> > reproduce. > >> > >> You would need additional goto's after them, to properly exit the > >> loop, should you be on the last iteration. I think you would be better > >> off jumping to the existing endfor/endwhile statement instead. > >> Branch straightening might tidy things up automatically, with luck. > > > >That seems wasteful (execution-wise) > Yes, an extra jump,... but, otoh, slightly less code ). > >and requires changing the back end, > Not sure why you think that. Please elaborate. Aha. Now that I see your code, I understand what you're saying. I was thinking that there's no simple GOTO opcode in the interpreter, but of course, there is, and it's called EXIT. You just have to backpatch the address. Very slick. > > Like I said, I have not tested it, it was just a simple suggestion I > thought would do the trick. Maybe the comparison will be useful > anyway. Definitely useful. Have to consider whether slightly larger code (about 5 opcodes per use of next/continue) vs the extra jump. Matt Lewis