⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 idigitdiv.c

📁 Arithmetic for integers of almost unlimited size for C and C++. Developed and copyrighted by Ra
💻 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 + -