中科因仑“3+1”工程特种兵精英论坛
标题:
PIC编译器C30内部函数如何理解?
[打印本页]
作者:
123321
时间:
2015-3-13 11:37
标题:
PIC编译器C30内部函数如何理解?
void SpeedControl(void) {
SFRAC16 *CPtr = Ce;
SFRAC16 *Pr = Ps;
SFRAC16 x_p;
SFRAC16 y_p;
register int reg_a asm("A");
register int reg_b asm("B");
reg_a = __builtin_lac(Rd,0);
reg_b = __builtin_lac(Md,0);
reg_a = __builtin_subab();
*CPtr = __builtin_sac(reg_a,0);
reg_a = __builtin_movsac(&CPtr, &x_p, 2,&Pr, &y_p, 2, 0);
reg_a = __builtin_lac(ControlOutput, 0);
reg_a = __builtin_mac(x_p,y_p,&CPtr, &x_p, 2,&Pr, &y_p, 2, 0);
reg_a = __builtin_mac(x_p,y_p,&CPtr, &x_p, 2,&Pr, &y_p, 2, 0);
reg_a = __builtin_mac(x_p,y_p,&CPtr, &x_p, 2,&Pr, &y_p, 2, 0);
ControlOutput = __builtin_sac(reg_a, 0);
return;
}
上面这段代码是什么意思望大家帮忙解释一下,说明一下reg_a、reg_b、__builtin_subab()、__builtin_lac()、 __builtin_mac()是什么意思。
欢迎光临 中科因仑“3+1”工程特种兵精英论坛 (http://bbs.enlern.com/)
Powered by Discuz! X3.4