最大公约数.asm
来自「最大公约数和最小公倍数」· 汇编 代码 · 共 68 行
ASM
68 行
INCLUDE Irvine32.inc
.data
a byte "please input x:",0
b byte "please input y:",0
d byte "the gongyueshu is:",0
.code
main proc
mov edx,offset a
call writestring
call readint
mov ebx,eax
mov edx,offset b
call writestring
call readint
.if eax>ebx
cdq
div ebx
cmp edx,0
jne l1
mov edx,offset d
call writestring
mov eax,ebx
call writeint
.elseif eax<ebx
xchg eax,ebx
cdq
div ebx
cmp edx,0
jne l1
mov edx,offset d
call writestring
mov eax,ebx
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 eax,ebx
call writeint
exit
main endp
end main
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?