Shop OBEX P1 Docs P2 Docs Learn Events
DAT declaration — Parallax Forums

DAT declaration

DarrenYDarrenY Posts: 61
edited 2007-09-17 17:29 in Propeller 1
I have a simple problem that's driving me mad as I can't get it to work!

In my main module I (want to) declare a DAT block of bytes, that I get the address of via F8

I then use this address within a 'MemoryMap.spin' file:

CON BaseAddr = $54 ' Base Memory location - should be address of DataBlock in main module

CON
   Var1      = 0                
   Var2      = 4                   
   Var3      = 8                        
   Var4      = 12      
   ...
   LastVar = 192          




I then include the MemoryMap.spin object in all the spin files that need to access the memory block.
The main files memory block can then be read/written from any module using the following:

  readvar1 := long[noparse][[/noparse]constant(memmap#BaseAddr + memmap#Var1)]
  long[noparse][[/noparse]memmap#BaseAddr + memmap#Var2] := writevar2




(where memmap is OBJ memmap : "MemoryMap")


Trouble is, I am having trouble getting the main module to declare an array of bytes in the DAT block:

DAT
   DataBlock byte memmap#LastVar ' this is the last (i.e. size of) var in the global memory map




Is this the correct syntax?


Cheers all.

Comments

Sign In or Register to comment.