8051-ELL库  beta 1.1.6
8051-ELL library API Document Center
STC8x_MDU16.h 文件参考
#include "ELL_CORE.h"
#include "STC8Ax_REG.h"
STC8x_MDU16.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define PER_LIB_MDU16_CTRL   1
 如果没有定义这个宏,默认为0。 If the mirco is undefined,select to "0" 更多...
 
#define MUL_16_BIT(mul1, mul2, pro)
 16位乘法宏函数。 更多...
 
#define DIV_16_BIT(mol, den, quo, rem)
 16位除法宏函数。 更多...
 
#define DIV_32_BIT(mol, den, quo, rem)
 32位除法宏函数。 更多...
 
#define MOVE_LEFT_SHIFT(mdata, digits, result)
 左移宏函数。 更多...
 
#define MOVE_RIGHT_SHIFT(mdata, digits, result)
 右移宏函数。 更多...
 

宏定义说明

◆ DIV_16_BIT

#define DIV_16_BIT (   mol,
  den,
  quo,
  rem 
)
值:
do{ \
EAXFR_ENABLE(); \
MD1U16 = mol; MD5U16 = den; \
ARCON = 0x06 << 5; OPCON = 1; \
while((OPCON & 0x01) != 0); \
quo = MD1U16; mol = MD5U16; \
EAXFR_DISABLE(); \
}while (0)
#define MD1U16
Definition: STC8Cx_REG.h:967
#define OPCON
Definition: STC8Cx_REG.h:978
#define MD5U16
Definition: STC8Cx_REG.h:968

16位除法宏函数。

16 bit division macro functions.

参数
[in]mol分子。molecule.
[in]den分母。denominator.
[out]quo商。quotient.
[out]rem余数。remainder.

◆ DIV_32_BIT

#define DIV_32_BIT (   mol,
  den,
  quo,
  rem 
)
值:
do{ \
EAXFR_ENABLE(); \
MD3U32 = mol; MD5U16 = den; \
ARCON = 0x06 << 5; OPCON = 1; \
while((OPCON & 0x01) != 0); \
quo = MD3U32; mod = MD5U16; \
EAXFR_DISABLE(); \
}while (0)
#define MD3U32
Definition: STC8Cx_REG.h:965

32位除法宏函数。

32 bit division macro functions.

参数
[in]mol分子。molecule.
[in]den分母。denominator.
[out]quo商。quotient.
[out]rem余数。remainder.

◆ MOVE_LEFT_SHIFT

#define MOVE_LEFT_SHIFT (   mdata,
  digits,
  result 
)
值:
do{ \
EAXFR_ENABLE(); \
ARCON = (0x02 << 5) + digits; \
MD3U32 = mdata; OPCON = 1; \
while((OPCON & 0x01) != 0); \
result = MD3U32; \
EAXFR_DISABLE(); \
}while (0)

左移宏函数。

Move data to the left functions.

参数
[in]mdata需要被左移的数据。Data that needs to be moved.
[in]digits被左移的位数。Number of digits moved.
[out]result左移完的结果。Data of result.

◆ MOVE_RIGHT_SHIFT

#define MOVE_RIGHT_SHIFT (   mdata,
  digits,
  result 
)
值:
do{ \
EAXFR_ENABLE(); \
ARCON = (0x01 << 5) + digits; \
MD3U32 = mdata; OPCON = 1; \
while((OPCON & 0x01) != 0); \
result = MD3U32; \
EAXFR_DISABLE(); \
}while (0)

右移宏函数。

Move data to the left functions.

参数
[in]mdata需要被右移的数据。Data that needs to be moved.
[in]digits被右移的位数。Number of digits moved.
[out]result右移完的结果。Data of result.

◆ MUL_16_BIT

#define MUL_16_BIT (   mul1,
  mul2,
  pro 
)
值:
do{ \
EAXFR_ENABLE(); \
MD1U16 = mul1; MD5U16 = mul2; \
ARCON = 0x04 << 5; OPCON = 1; \
while((OPCON & 0x01) != 0); \
pro = MD3U32; \
EAXFR_DISABLE(); \
}while(0)

16位乘法宏函数。

16 bit multiplier macro functions.

参数
[in]mul1乘数1。multiplier 1.
[in]mul2乘数2。multiplier 2.
[out]pro乘积。product.

◆ PER_LIB_MDU16_CTRL

#define PER_LIB_MDU16_CTRL   1

如果没有定义这个宏,默认为0。 If the mirco is undefined,select to "0"