Andes Workshop

It is currently Mon Oct 21, 2019 7:23 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Use variable in sag
PostPosted: Tue Dec 17, 2013 3:14 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
Example code in C

extern char __data_lmastart;
extern char __data_start;
extern char _edata;

size = &_edata - &__data_start;
MEMCPY(&__data_start, &__data_lmastart, size);

size = &_end - &__bss_start;
MEMSET(&__bss_start, 0, size);
---------------------------------------------------------------

In Sag:

USER_SECTIONS .vector
SDRAM 0x00000000 0x00800000 ; address base 0x00000000, max_size=8M
{
EXEC 0x00000000
{
VAR _ILM_BASE = 0x00600000 ; ILM base address
VAR _DLM_BASE = 0x00700000 ; DLM base address
VAR _ILM_SIZE = 0x00010000 ; 64Kb
VAR _DLM_SIZE = 0x00010000 ; 64Kb
* (+ISR,+RO)
LOADADDR __data_lmastart
ADDR __data_start

* (+RW)
ADDR _edata
ADDR _lmaend
ADDR __bss_start

* (+ZI)
ADDR _end
STACK = 0x00800000
}
}


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group