Shop OBEX P1 Docs P2 Docs Learn Events
Assembly Code Divided by Org Statement — Parallax Forums

Assembly Code Divided by Org Statement

Bob DruryBob Drury Posts: 236
edited 2008-08-21 21:51 in Propeller 1
Hello On the other Side
When using assembly code· a symbol label to an Org Statement is used in the Dat section for loaiding
cognew. How does the compiler know that when multiple org statements apear in the Dat section
when to stop compiling for the individual cog? Maybe following is not allowed but it does seem to work.
eg
cognew(@toggle0,0)
cognew(@toggle1,0)
cognew(@toggle2,0)

Dat
············ Org 0
@toggle0· assembly statement
·········· ··· assembly statement
··········· Org 0
@toggle1· assembly statement
··········· ·· assembly statement
··········· Org 0
@toggle2· assembly statement
············· assembly statement
Thanks for help
Bob Drury

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-21 21:51
    Each cog gets loaded with 496 longs, regardless of how long a particular assembly routine actually is, beginning with the address given with the COGNEW. So your toggle0 cog also gets loaded with toggle1 and toggle2 after it. The ORG simply tells the assembler to restart its address counter at the address given. It has no bearing on where the code exists in hub memory or gets loaded into cog memory.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
Sign In or Register to comment.