Shop OBEX P1 Docs P2 Docs Learn Events
Propeller EEPROM/MEMORY organization — Parallax Forums

Propeller EEPROM/MEMORY organization

Jasper_MJasper_M Posts: 222
edited 2007-04-05 21:27 in Propeller 1
If a project has multiple objects, are all DAT/SPIN sections still grouped together at the beginning of EEPROM, and space for VAR/STACK after them?
ie. is the layout like the following:

CODE FROM OBJ 0
CODE FROM OBJ 1
VAR FROM OBJ 0
VAR FROM OBJ 1
STACK SPACE

and not like the following:

CODE FROM OBJ 0
VAR FROM OBJ 0
CODE FROM OBJ 1
VAR FROM OBJ 1
STACK SPACE

I'm asking this because I want to store data in EEPROM in the first 32KB area.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-05 20:50
    Your first layout is the one used. If you want to play it safe, allocate EEPROM storage from the top ($7FFF) down. The code and DAT sections are loaded beginning at location $10, after a 16 byte descriptor area. The VAR sections follow that (and are cleared to zero when the program is loaded from the Propeller Tool into RAM). The stack space is last.

    If you write to the EEPROM locations corresponding to variables in your program (if XXX is a variable, you write to EEPROM location @XXX), the variables will be initialized to the saved values on a reboot since the saved values replace the default zero value in the EEPROM and the whole EEPROM is copied to RAM on a reboot.
  • Jasper_MJasper_M Posts: 222
    edited 2007-04-05 21:27
    Ah, thank you Mike ^_^. Actually, I'm working on a filesystem for EEPROM. All ASM is done, now I'm working on a nice SPIN interface, creating filesystems etc.
Sign In or Register to comment.