Advertisement
squelch

storeword prototype

May 27th, 2020
963
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.80 KB | None | 0 0
  1. int storeword(int address, int value) {                                        
  2.     asm volatile(R"(                                                            
  3.            li a1, %[value]                                                    
  4.            la t0, %[address]                                                  
  5.            sw a1, 0(t0)                                                        
  6.            )"   // store at 0+t0, which is the supplied address                
  7.             : // no outputs                                                    
  8.             : [address] "i" (address), [value] "i" (value)                      
  9.             : "a1", "t0"                            // Clobber                  
  10.             );                                                                  
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement