a Program completely in PASM.

Hello,

Is it possible to write a program completely in PASM, all code, variables, data, directives in the DAT section, nothing in CON, PUB, or PRIZ?

Or, Is some spin required.

Thank you

Comments

  • yetiyeti Posts: 485
    edited 2019-02-09 - 16:44:29
    Is it possible to write a program completely in PASM
    No.
    The bytecode interpreter in the P1's ROM gets started and expects a Spin program' bytecode. This may consist of only starting a PASM cog, but at least this action has to be done in Spin.
    ◁ FastSpin ▷ ◁ DK-E ▷ ◁ :-D ▷ ◁ Stay OmmmmmmPtimistic! ▷ ◁ No Source – No Go! ▷ ◁ Help Spin at RosettaCode.org ▷ ◁ Why Asimov's Laws of Robotics Don't Work ▷ ◁ DNA is a four letter word. ▷
  • JonnyMacJonnyMac Posts: 6,156
    edited 2019-02-09 - 16:55:31
    I've not done this, but you should be able to get away with a single-line pub method that overwrites cog 0 with your PASM code.
    pub main
    
      coginit(0, @entry, 0)
    
    This assumes that you only need one cog hence are not passing a "mailbox" address in the third parameter. If that doesn't work you could always try:
    pub main
    
      cognew(@entry, 0)
      cogstop(0)
    

    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.
  • bteddy wrote: »
    Hello,

    Is it possible to write a program completely in PASM, all code, variables, data, directives in the DAT section, nothing in CON, PUB, or PRIZ?

    Or, Is some spin required.

    Thank you

    I think you need a little spin progam to initialization variables for each PASM cog but after that you can have all eight cogs running PASM code. Use the coginit method to start each cog and remember to start cog 0 last or the code you're running to start the cogs will be clobbered. I have tested this technique and it works.

    Sandy



    Infantryman's Axiom; Always cheat, always win.
  • You need one line of Spin to execute a COGINIT or COGNEW to start a PASM cog. The Spin cog will shut down if there is no other code, and the PASM cog can start other cogs as desired. This is apparently how the Turbulence demo worked.
Sign In or Register to comment.