Shop OBEX P1 Docs P2 Docs Learn Events
spin from asm — Parallax Forums

spin from asm

danielstrittdanielstritt Posts: 43
edited 2011-12-28 18:40 in Propeller 1
i know spin is an object oriented language, and asm is generally considered not to be, but is it at all possible to use spin based objects calling them from asm based code?

Comments

  • Heater.Heater. Posts: 21,230
    edited 2011-12-28 18:40
    Spin is not really an object oriented language, it has "objects" but lacks many features people would expect of an OOP.
    ASM is, well, an assembly language.

    No, you cannot call the methods of Spin objects from PASM.
    Neither can you call PASM procedures from Spin.

    The only way for PASM and Spin to interact is through shared variables in HUB RAM through which they can pass commands/data/results etc.

    One normally does this by having Spin start some PASM in a COG and passing an address of a HUB RAM area as a parameter to COGNEW/INIT. The running PASM in the new COG gets that address in its PAR register and now it can communicate with any other Spin (or PASM) that uses that area.

    There are examples in the manual and in the many objects in OBEX.
Sign In or Register to comment.