On Sat, Apr 12, 2008 at 08:26:34PM -0700, Bob Rogers wrote: > The ops in src/ops/stack.ops are holdovers from the bad old days of > limited registers. In modern times, it is more versatile (and probably > faster) to create an array and use it as an explicit stack via push and > pop operations.
I've conducted a review of the codebase to see where stack ops are being used. For reference, the deprecated stack opcodes are entrytype, depth, lookback, save, savec, restore, and rotate_up. (The "saveall" and "restoreall" opcodes are being handled by another ticket.) Other than t/op/stacks.t (which will go away when this issue is resolved), the following files or subsystems seem to use one or more of the deprecated opcodes: languages/BASIC languages/befunge examples/pasm/stack.pasm examples/pasm/nanoforth.pasm examples/pasm/xml_parser.pasm examples/benchmarks/primes2.pasm examples/benchmarks/primes2_i.pasm Here's my vote for the disposition of each of these: 1. languages/BASIC has the save/restore opcodes in it, but it also seems to have some opcodes such as pushp and popp that have been gone for over two years. That said, the various *.bas sample files all seem to compile and not use any of save/restore/pushp/popp, so I'm thinking we can leave BASIC alone even after removing the stack ops. 2. languages/befunge uses save/restore in a few macros in its *.pasm files. It looks like it might be a good candidate for converting things into PIR functions... but if we want to leave it as PASM then there will be a fair bit of macro conversion to be done. 3. examples/pasm/stack.pasm should simply disappear, since we will no longer have any stack ops to demonstrate. :-) 4. The remaining examples/* files are all in PASM, and somewhat ancient PASM at that. (I guess all PASM source is pretty old, though.) Do we really need to keep these examples around-- are they likely to be useful to anyone? If no, I say we should just get rid of them. If we still need the PASM examples, then it's probably better to just rewrite these entirely than to try to fix up what is already there. Comments welcomed. Pm