Shop OBEX P1 Docs P2 Docs Learn Events
ORG — Parallax Forums

ORG

peterzpeterz Posts: 59
edited 2007-01-21 20:45 in Propeller 1
Can I do the following ?

cognew(@MyCode2)

DAT

ORG

MyCode
....
MyCode2
....


Or do I need to put the starting code just after the ORG sentence ?


·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-21 20:45
    You really need to put an ORG before each section. The Spin assembler keeps 2 different location counters. One, which is referenced from the Spin code, has the actual hub memory location where the code is stored before being loaded into a cog. The other, which is referenced from the assembly code, has the address where the code will reside in the cog memory. This second one is the one set by the ORG. Since COGNEW loads the code whose address it's given starting at cog location zero, the code better be assembled for that. That's why you need the ORG before MyCode2. If you're doing a COGNEW on MyCode also, you'll need an ORG in front of that as well.
Sign In or Register to comment.