Shop OBEX P1 Docs P2 Docs Learn Events
memory organization — Parallax Forums

memory organization

MazziniMazzini Posts: 58
edited 2011-08-09 12:00 in Propeller 1
Hi ,

I searched on forum about my doubts but there so many thread I'm lost..

Because the first locations are reserved for bootloader and SPIN interpreter inizialization , my application start at 0x010

Why Does the programs start with ORG 0 ?

Because the latest locations are reserved for variable and stack space ,
Which is the last add for user's program or how many locations are reserved for stack and variable ?

Thank

Comments

  • Dave HeinDave Hein Posts: 6,347
    edited 2011-08-08 11:41
    The first 16 locations in a Spin binary are used to set up the clock circuitry and initialize the start addresses for the top object, VAR variable space and the stack. The 16-byte header also provides the initial stack pointer value and program starting address. This is why the application code starts at 0x010.

    PASM programs always start running from location 0 in the cog. This is why they use an ORG 0 at the beginning. This is independent of actual location of the PASM image in hub RAM, which can be located anywhere in hub RAM.

    The VAR section is located after the end of the program space. The stack is located after the VAR section.

    The VAR section contains space for every instance of an object. The number of instaces is determined by the number of times an object is referenced by another object. The top object has only one instance. The stack space for the top object can extend all the way to the end of hub RAM.
  • MazziniMazzini Posts: 58
    edited 2011-08-09 12:00
    Thanks :smile:
Sign In or Register to comment.