Shop OBEX P1 Docs P2 Docs Learn Events
Spin interpreter binary code — Parallax Forums

Spin interpreter binary code

David BetzDavid Betz Posts: 14,516
edited 2007-05-30 03:12 in Propeller 1
It is my understanding that the Spin compiler compiles into bytecodes or some other form of binary code that gets interpreted at runtime by a Spin interpreter in the Propeller on-chip ROM. Where can I find a description of the Spin binary format? It seems as though it should be possible to target other languages (like C or Python or whatever) to the Spin virtual machine. Is that machine defined somewhere? I did a search of this forum but didn't find a description of it.

Thanks,
David Betz

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-29 14:22
    You couldn't find a description of it because it's not documented by Parallax. Cliff Biffle analyzed some programs to come up with this (www.cliff.biffle.org/software/propeller/spin-bytecode.html) and GEAR (http://forums.parallax.com/showthread.php?p=624986) will emulate Spin programs (and the native instruction set) and its source is available on SourceForge.
  • bambinobambino Posts: 789
    edited 2007-05-29 14:26
    David,

    This has already been done to some extent.
    (The loader anyway)

    http://forums.parallax.com/forums/default.aspx?f=25&p=1&m=150887
    I was trying to port it to visual basic, but my understanding of delphi is nill and figuring out the bit packing and checksums has me stumped at the moment.

    If you get any where let me know!
  • David BetzDavid Betz Posts: 14,516
    edited 2007-05-30 01:57
    Mike Green said...
    You couldn't find a description of it because it's not documented by Parallax.
    Is there any chance that will change in the future? It seems like making this available officially would encourage ports of other languages to the Propeller.

    On another note, are there any plans for a flash version of the Propeller chip? While Spin is nice, it might be nice to be able to use different virtual machines for different applications. Also, the trig tables and character set bitmaps might not be useful to every application and the space freed up could be used for other code/data.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-30 03:12
    There's been discussion of this including the issue of ports of other languages. I'm not a Parallax employee, but I don't see this as happening based on these discussions. I've brought up this issue myself and it just hasn't gotten anywhere. Cliff's analysis and GEAR's use of that and some other "fact findings" are the best that we have at this time.

    There have also been discussions of having flash on a version 2 Propeller. It's not going to happen, partly because the planned chip process won't support it and partly because of the markedly greater chip area required. It will be masked ROM. There will be a Spin interpreter included since that will be the primary interpreter (which needs to be there anyway). The trig tables and character set bitmaps were added as useful uses for the "extra" ROM space provided once the bootstrap loader and Spin interpreter were included. Keep in mind that the Stamps have trig functions, so that was a priority, and the character bitmaps are needed for many applications and are fairly large.
Sign In or Register to comment.