📄 idigitdiv.c
字号:
/* idigitdiv.c - inline assembler code for MSVC++6.0 on Intel586 *//* TPf, Sep 1999 */#include <iint.h>#include <idigit.h>#if !defined(USE_C_DIGITDIV)DigitType DigitDiv(quot, h, l, d) DigitType *quot, h, l, d; /* Suppose: d>0 and h<d quot=QUOT; return REM; where QUOT, REM are defined by: h*2^BitsPerDigit + l == d*QUOT + REM, 2^BitsPerDigit > REM >= 0 */{__asm {/* .text .align 4 .globl USCORE(DigitDiv)USCORE(DigitDiv):*/ ; push ebx mov ebx, quot ; DWORD PTR 8[esp] mov edx, h ; DWORD PTR 12[esp] mov ecx, d ; DWORD PTR 20[esp] cmp ecx, edx ; compute edx-ecx = h-d jbe L2 ; jump if carry or zero flag is set ; i.e. if h <= d mov eax, l ; DWORD PTR 16[esp] div ecx mov DWORD PTR [ebx], eax mov eax, edx jmp L3 ; pop ebx ; retL2: mov eax, edx xor edx, edx div ecx mov eax, DWORD PTR 16[esp] div ecx mov DWORD PTR [ebx], eax mov eax, edx ; pop ebx ; retL3: }}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -