Shop OBEX P1 Docs P2 Docs Learn Events
PASM Interpreter — Parallax Forums

PASM Interpreter

hippyhippy Posts: 1,981
edited 2008-07-29 04:52 in Propeller 1
Before re-inventing the wheel; has anyone already written a PASM interpreter in PASM ideally or Spin ?

This would be an interpreter which could execute PASM as is, supporting self modifying code, arbitrary access to all 512 registers / cog locations, standard PASM call / return handling. I'd expect the PASM to be interpreted to be held in 496 longs of hub memory.

This is similar to but quite an extension of LMM interpretation. It would consequently be a lot slower but its advantage is that PASM doesn't need to be changed to LMM-style code to work.

Ultimately the PASM interpreter would be coded as LMM and interpreted, but as real PASM running an LMM Interpreter running a PASM interpreter, potentially running a Spin interpreter become such a 'mind-blow' it's probably best not to think about any of that smile.gif

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2008-07-29 04:52
    @Hippy, the debugger I posted yesterday is a little way towards doing just that. It's crude, but take a look. The asm code debugger looks like it resides in a cog but it doesnt. However, the labels need to be different (<<2) which will impact but that could be gotten (hate that word) around by a compiler preprocessor. I have just used hub ram $7000 onwards, but this could have been declared as a variable and so allocated properly.

    I think we are now missing someone to write a spin complier so we can put all the pieces together. If someone targets Basic and C, etc to the spin interpreter, I think we could have a great system, given the other work being done on SD drivers, etc.

    Mindblowing smile.gif

    Postedited: I already have a short, fast, variable length·overlay loader which hits the sweet spot (16 clocks).

    Post Edited (Cluso99) : 7/29/2008 4:58:07 AM GMT
Sign In or Register to comment.