Andes Workshop

It is currently Sun Dec 08, 2019 3:44 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: 用gdb寫暫存器的語法
PostPosted: Tue Aug 02, 2011 10:34 am 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
有幾種方式可以寫暫存器。

(1) 用gdb寫。例如,set $r1=0x300001
寫完之後,讀出來驗證,command為 p/x $r1
(2) 用inline assembly來寫。請參考programming guide的
18.9. Inline Assembly Programming
程式的語法類似這樣
__asm__ ("add\t%0, %1, %2\n\t"
"movi\t$r6, 123\n\t"
"add\t%0, %0, $r6"
: "=r" (ret)
: "r" (i), "r" (j)
: "$r6");


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