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

📄 最小公倍数.asm

📁 最大公约数和最小公倍数
💻 ASM
字号:
INCLUDE Irvine32.inc
.data
a byte "please input x:",0
b byte "please input y:",0
d byte "the gongbeishu is:",0
y dword ?
z dword ?
.code
main proc
mov edx,offset a
call writestring
call readint
mov z,eax
mov ebx,eax
mov edx,offset b
call writestring
call readint
mov y,eax


.if eax>ebx

cdq
div ebx
cmp edx,0
jne l1
mov edx,offset d
call writestring
mov eax,y
call writeint


.elseif eax<ebx
xchg eax,ebx

cdq
div ebx
cmp edx,0
jne l1
mov edx,offset d
call writestring
mov eax,z
call writeint

.elseif eax==ebx
mov edx,offset d
call writestring
call writeint
.endif
exit

l1:
mov eax,ebx
mov ebx,edx
cdq
div ebx
cmp edx,0
jne l1
mov edx,offset d
call writestring
mov ecx,ebx
mov eax,z
mov ebx,y
imul ebx
cdq
mov ebx,ecx
idiv ebx  
call writeint


exit
main endp
end main



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -