uchar MSB_LSB(uchar wrd) { #asm movwf fsr0l rlcf fsr0l rrcf fsr1l rlcf fsr0l rrcf fsr1l rlcf fsr0l rrcf fsr1l rlcf fsr0l rrcf fsr1l rlcf fsr0l rrcf fsr1l rlcf fsr0l rrcf fsr1l rlcf fsr0l rrcf fsr1l rlcf fsr0l rrcf fsr1l
movf fsr1l,w #endasm return (wrd);
}
这个函数实现一个字节高位到低位的交换,不想用fsr寄存器,如果btemp,或声明个一个局部变量val,用_val在汇编里引用,或?a_MSB_LSB+0汇编里引用,最编译时总出上面那上变量没有定义的错,看了picc英文手册,好像也没错,是不是那个地方要设置一下,或要包括什么头文件啊,急需解决! |