Shop OBEX P1 Docs P2 Docs Learn Events
Spin2 - Page 18 — Parallax Forums

Spin2

1121314151618»

Comments

  • RaymanRayman Posts: 14,350
    edited 2020-02-16 16:23
    Roy Eltham wrote: »
    Eric's compiler produces PASM to be run in hubexec. It's a whole different animal compared to how Chip's compiler works.

    Actually, I suppose Spin2 would have to produce PASM meant to run in hubexec in a dat section with assembly instructions following an "ORGH", right?

    Since that is something new, maybe there's room for a middle ground? Maybe this kind of code could resolve absolute addresses, same way in Spin2 and FastSpin?

  • @Rayman

    Chip's SPIN2 is interpreted bytecode, while Fastspin is compiled.
    Have you read Chip's code for the interpreter? It's not particularly long.
    The interpreter is split between cog and hub.

  • RaymanRayman Posts: 14,350
    AJL, Spin2 can also launch assembly cogs using "coginit".
    Those cogs can presumable call hubexec assembly code....
  • Rayman wrote: »
    AJL, Spin2 can also launch assembly cogs using "coginit".
    Those cogs can presumable call hubexec assembly code....

    Perhaps I misunderstood your original comment, or I'm nit-picking.

    While PNut is the current tool to produce SPIN2 code, Chip's aim is for SPIN2 to be self-hosted; PNut produces PASM code for execution, SPIN2 currently does not.

    Given SPIN2 is interpreted, then any assembly cogs would have their code produced by some other tool, e.g. PNut, or a self-hosted PASM2 Assembler.


  • cgraceycgracey Posts: 14,134
    I am going to work tomorrow on the documentation. That will clear the air quite a bit.
  • Rayman wrote: »
    Sorry, one more thing... Is there a list of the Spin2 operators somewhere?

    I thought that "=>" was going to change to ">=", like C++, but I think Fastspin didn't make this change, so I wonder about Spin2...

    Also, I'm getting an error on this:
    value := ||(value+x)
    

    So, I think absolute value operator has changed...

    I found the 2018 proposed operators here: https://forums.parallax.com/discussion/166416/spin2-operator-syntax/p17
    Seems || is now ABS...

    @cgracey
    I have been looking for the spin2 command list in the forums. Complete list as is complete at this time. Can you point me in that direction please.
    Thanks
    Martin
  • cgraceycgracey Posts: 14,134
    Martin, this is the latest documentation which lists all Spin2 commands:

    https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/edit?usp=sharing

    There are some DEBUG-displays-related things that are not documented, yet. I am working on a simplified syntax for the DEBUG displays. When that is done, which may be tomorrow, I will post a new zip file and bring the documentation up to date.
  • @cgracey
    Thanks for the assist.
  • @cgracey
    Perfect again thanks.
Sign In or Register to comment.