1#include "io.h" 2 3int main(void) 4{ 5 long long rd, rs, rt, result, dspreg, dspresult; 6 rs = 0x123456789ABCDEF0; 7 rt = 0x3456123498DEF390; 8 result = 0x468A68ACFFFFFFFF; 9 dspresult = 0x01; 10 11 __asm 12 ("addu_s.ob %0, %2, %3\n\t" 13 "rddsp %1\n\t" 14 : "=r"(rd), "=r"(dspreg) 15 : "r"(rs), "r"(rt) 16 ); 17 18 dspreg = ((dspreg >> 20) & 0x01); 19 20 if ((rd != result) || (dspreg != dspresult)) { 21 printf("addu_s.ob error\n\t"); 22 23 return -1; 24 } 25 26 return 0; 27} 28