Andes Workshop http://forum.andestech.com/ |
|
用gdb寫暫存器的語法 http://forum.andestech.com/viewtopic.php?f=16&t=118 |
Page 1 of 1 |
Author: | cindy [ Tue Aug 02, 2011 10:34 am ] |
Post subject: | 用gdb寫暫存器的語法 |
有幾種方式可以寫暫存器。 (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"); |
Page 1 of 1 | All times are UTC + 8 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |