mrmuldv.cpp
来自「关于大数运算的加 减 乘 除 模 等运算 运用了libtommath库的算法」· C++ 代码 · 共 62 行
CPP
62 行
/*
* Borland C++ 32-bit compiler (BCC32). Use with mirdef.h32
* Uses inline assembly feature. Suitable for Win32 Apps
* Also compatible with Microsoft Visual C++ 32-bit compiler
*/
#include "inner_support.h"
int muldiv(int a, int b,int c,int m,int *rp)
{
__asm{
mov eax,DWORD PTR a
mul DWORD PTR b
add eax,DWORD PTR c
adc edx,0h
div DWORD PTR m
mov ebx,DWORD PTR rp
mov [ebx],edx
}
}
int muldvm(int a,int c,int m,int *rp)
{
__asm{
mov edx,DWORD PTR a
mov eax,DWORD PTR c
div DWORD PTR m
mov ebx,DWORD PTR rp
mov [ebx],edx
}
}
int muldvd(int a,int b,int c,int *rp)
{
__asm{
mov eax,DWORD PTR a
mul DWORD PTR b
add eax,DWORD PTR c
adc edx,0h
mov ebx,DWORD PTR rp
mov [ebx],eax
mov eax,edx
}
}
void muldvd2(int a, int b,int *c,int *rp)
{
__asm{
mov eax,DWORD PTR a
mul DWORD PTR b
mov ebx,DWORD PTR c
add eax,[ebx]
adc edx,0h
mov esi,DWORD PTR rp
add eax,[esi]
adc edx,0h
mov [esi],eax
mov [ebx],edx
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?