標(biāo)題: 合泰單片機(jī)內(nèi)置的C移位函數(shù),是移動(dòng)一位嗎? [打印本頁(yè)]

作者: shifanghui    時(shí)間: 2016-8-26 20:09
標(biāo)題: 合泰單片機(jī)內(nèi)置的C移位函數(shù),是移動(dòng)一位嗎?
移位函數(shù)
C沒(méi)有循環(huán)移位函數(shù),CCompiler提供了
void _rr(int*);     //rotate 8 bits data right
void _rrc(int*);    //rotate 8 bits data right through carry
void _lrr(long*);   //rotate 16 bits data right
void _lrrc(long*);  //rotate 16 bits data right through carry
void _rl(int*);     //rotate 8 bits data left
void _rlc(int*);    //rotate 8 bits data left through carry
void _lrl(long*);   //rotate 16 bits data left
void _lrlc(long*);  //rotate 16 bits data left through carry
------------------------------------------------------------
合泰單片機(jī)內(nèi)置的C移位函數(shù),是移動(dòng)一位嗎?如
#include<HT45R17.h>//內(nèi)容省略
unsigned long   temp_AD=148;
_llrr(&temp_AD );    //移完是74嗎?這個(gè)“&”怎么理解??


作者: shifanghui    時(shí)間: 2016-8-27 21:31
右移一位,相當(dāng)于除以2。
作者: 黑白紀(jì)的黑    時(shí)間: 2016-8-27 22:37
左移一位,相當(dāng)于乘以2




歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1