Andes Workshop

It is currently Tue Aug 21, 2018 10:29 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How to use global variable in inline assembly
PostPosted: Fri Apr 20, 2018 11:19 am 
Offline

Joined: Fri May 04, 2012 6:49 am
Posts: 17
Sometime programmer need inline assembly programming, 《Andes Programming Guild》 gets an chapter to illustrate how to do inline assembly programming and shows several examples. It shows how to use global variable which is defined in C code:
Code:
char arr[4] = {0,1,2,3};
int main (void)
{
   printf("hello world");
   asm("movi $r1, #10");
   asm(".extern arr[4]");
   asm ("la $r0, arr");
   return 0;
}


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 1 guest


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