keil C51中的本征函數(shù)庫及使用說明
來實現(xiàn)(無需堆棧操作?),可大大提高函數(shù)的訪問效率.
本文引用地址:http://www.ex-cimer.com/article/201611/315687.htm
函數(shù)原型
extern void _nop_ (void);
extern bit _testbit_ (bit);
extern unsigned char _cror_ (unsigned char, unsigned char);
extern unsigned int _iror_ (unsigned int, unsigned char);
extern unsigned long _lror_ (unsigned long, unsigned char);
extern unsigned char _crol_ (unsigned char, unsigned char);
extern unsigned int _irol_ (unsigned int, unsigned char);
extern unsigned long _lrol_ (unsigned long, unsigned char);
extern unsigned char _chkfloat_(float);
頭文件
#include
說明
extern void _nop_ (void);
產生一個nop指令
extern bit_testbit_ (bit);
產生一個JBC指令,若該位置位,返回1,否則為0;只能作用于直接尋址的位變量,不能用于表達式
之中
extern unsigned char _cror_ (unsigned char val, unsigned char n);
(unsigned char)val右移n位
extern unsigned int _iror_ (unsigned int val, unsigned char n));
(unsigned int)val右移n位
extern unsigned long _lror_ (unsigned long val, unsigned char n));
(unsigned long)val右移n位
extern unsigned char _crol_ (unsigned char val, unsigned char n));
(unsigned char)val左移n位
extern unsigned int _irol_ (unsigned int val, unsigned char n));
(unsigned int)val左移n位
extern unsigned long _lrol_ (unsigned long val, unsigned char n));
(unsigned long)val左移n位
extern unsigned char _chkfloat_(float);
測試并返回float的狀態(tài)
一下摘自keil C51的幫助文檔
0 Standard floating-point numbers 標準浮點數(shù)
1 Floating-point value 0 浮點數(shù)0
2 +INF (positive overflow) 正溢出
3 -INF (negative overflow) 負溢出
4 NaN (Not a Number) error status出錯
參考文獻
李軍等編著.51系列單片機高級實例開發(fā)指南.北京-北京航空航天大學出版社 2004
keil software,inc. C51 users guide
評論