maths.c
来自「使用picc开发的基于pic16f87x的与上位机进行串行通信的源程序」· C语言 代码 · 共 45 行
C
45 行
/*
KeyGhost
Designed by Shane Tolmie Apr 99.
Microprocessor: see mainkg.c
Compiled with: see mainkg.c
Overall goal: maths routines
*/
#include <pic.h>
#include "always.h"
#include "maths.h"
unsigned char maths_temp;
/*
unsigned char rotate_left(unsigned char bitrotate)
{
maths_temp=bitrotate; //change local to global variable
CARRY=0;
asm("RLF _maths_temp,f"); //rotate left through carry
if (maths_temp==0) asm("RLF _maths_temp,f"); //as it goes through carry it must be rotated twice if at end
return maths_temp;
}
*/
/*
unsigned char rotate_right(unsigned char bitrotate)
{
maths_temp=bitrotate; //change local to global variable
CARRY=0;
asm("RRF _maths_temp,f"); //rotate right through carry
if (maths_temp==0) asm("RRF _maths_temp,f"); //as it goes through carry it must be rotated twice if at end
return maths_temp;
}
*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?