Variables in {$DATA} area

with xMegas

Marco
Benutzer
Avatar
Gender: n/a
Location: Italy
Posts: 270
Registered: 10 / 2004
Subject:

Variables in {$DATA} area

 · 
Posted: 20.12.2012 - 21:23  ·  #1
Hello,

I have defined a byte variable in {$DATA} area and an INC(var) instruction in the main.
It compile without error, but at runtimes the inc() instruction seems ignored...
Only a direct assignment var:=1; seems work...

Moving the var declaration into {$IDATA} solved the problem.

Is it still available in xMegas some {$DATA} memory space ?

Regards,
Marco
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Variables in {$DATA} area

 · 
Posted: 21.12.2012 - 00:01  ·  #2
Hello Marco,

while $DATA (Registerspace) is in the linear address room for all AVRs
the Registerspace of the XMegas is completely separate.
For example the registers can be reached with LDS and STS with AVRs
this is not possible with XMegas. So some standard operations will not
work with XMegas. Here $DATA should be avoided, except ASM is used.

rolf
Marco
Benutzer
Avatar
Gender: n/a
Location: Italy
Posts: 270
Registered: 10 / 2004
Subject:

Re: Variables in {$DATA} area

 · 
Posted: 23.12.2012 - 13:07  ·  #3
Ok, I suspected something like this, but not sure because I expected an error or warning at compile time...

Happy Christmas !

Marco
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Variables in {$DATA} area

 · 
Posted: 23.12.2012 - 16:00  ·  #4
Hello Marco,

INC and DEC of DATA vars should work now in next update.

rolf
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   81   95 · Page-Gen-Time: 0.0243s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI