Shop OBEX P1 Docs P2 Docs Learn Events
is DAT storage consecutive — Parallax Forums

is DAT storage consecutive

bdickensbdickens Posts: 110
edited 2010-09-08 12:26 in Propeller 1
This probably sounds incredibly dumb, but if I put two (or in my case 8) variables into DAT storage consecutively, I presume they are stored consecutively ?

most of the programs read the data as 8 different variables, but one method would be faster if it could just read them as an array. Just making sure the compiler isn't doing any odd manipulations with storage. So if VAR1 is defined, then VAR2, they will exist in memory that way ?

Thanks

Comments

  • jmspaggijmspaggi Posts: 629
    edited 2010-09-08 12:16
    Hi,

    Yes, they are stored consecutively.

    You can take a look at the TV driver to see how it's working. It's passing the 1st variables, and calculating the other addresses based on this one.

    JM
  • Mike GreenMike Green Posts: 23,101
    edited 2010-09-08 12:17
    DAT storage is consecutive. If you put two statements following each other in a DAT section, they will be allocated storage in the order you put them. Note that items will be aligned to the appropriate boundaries (word, long), but definitely in the order written. This is not true for the VAR section where longs are allocated first, then words, then bytes.
  • bdickensbdickens Posts: 110
    edited 2010-09-08 12:23
    "Note that items will be aligned to the appropriate boundaries (word, long), but definitely in the order written"

    That was a key improvement. I would have run into that one the way I had it working.
  • jmspaggijmspaggi Posts: 629
    edited 2010-09-08 12:26
    Mike Green wrote: »
    This is not true for the VAR section where longs are allocated first, then words, then bytes.



    Hahaha!

    Thanks Mike!

    You just solved one of my issues! I was not aware of that and wondering why I had to put all my variables in LONG to be able to access them in the right order!

    JM
Sign In or Register to comment.