IAR: long longMul(long lX, long lY) { __asm(" smull r0, r1, r0, r1
" " lsrs r0, r0, #16
" " orr r0, r0, r1, lsl #16
" " bx lr");
return(0); /* 不会跑到这里,用于防止编译警告!*/ }
GCC: static long __attribute__((naked)) longMul(long lX, long lY) { __asm(" smull r0, r1, r0, r1
" " lsrs r0, r0, #16
" " orr r0, r0, r1, lsl #16
" " bx lr");
return(0); /* 不会跑到这里,用于防止编译警告!*/ }
Keil: __asm long longMul(long lX, long lY) { smull r0, r1, r0, r1; lsrs r0, r0, #16; orr r0, r0, r1, lsl #16; bx lr; }
(zlgarm_zsg)
|