本征函数(intrinsicroutines)是指编译时直接将固定代码刺进当前行,而不必ACALL和LCALL
来完成(无需仓库操作?),可大大提高函数的拜访功率.
函数原型
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的状况
一下摘自keil C51的协助文档
0 Standard floating-point numbers 规范浮点数
1 Floating-point value 0 浮点数0
2 +INF (positive overflow) 正溢出
3 -INF (negative overflow) 负溢出
4 NaN (Not a Number) error status犯错
参考文献
李军等编著.51系列单片机高档实例开发攻略.北京-北京航空航天大学出版社 2004
keil software,inc. C51 users guide