sushu.asm

来自「用C编写的求素数和时间的程序,希望能对大家都有点用处」· 汇编 代码 · 共 55 行

ASM
55 行
字号
include irvine32.inc

.data
A byte "this is a sushu.",0
B byte "this is not a sushu.",0
D byte "please input a number:",0

.code
main proc

l3:
mov edx,offset D
call writestring
call crlf
call readint 
mov ecx,eax
cmp eax,2
je l1
cmp eax,-1
je l2
mov edx,0
mov bx,2

l4:
idiv bx
cmp dx,0
je l5

inc bx
mov ax,bx
cwd
mov ebx,eax
mov eax,ecx
cmp ebx,eax
jb l4
jge l1


l5:
mov edx,offset B
call writestring
mov edx,0
call crlf
jmp l3

l1:
 mov edx,offset A
call writestring

l2:
exit

main endp
end main

⌨️ 快捷键说明

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