Professional Documents
Culture Documents
Micro
Micro
include irvine32.inc
.data?
tmp DWORD ?
.data
msg1 byte "The First Prime Number is:
",0
.code
main PROC
mov ecx, 1500
mov eax, 1500
L1 :
mov esi, 0
mov tmp, eax
mov ebx, 1
mov EDI, ecx
mov ecx, eax
L2 :
mov eax, tmp
mov edx, 0
div EBX
.IF EDX == 0
add esi, 1
.EndIF
inc EBX
Loop L2
CMP ESI, 2
JE L3
L4:
mov eax, tmp
inc eax
mov ecx, EDI
Loop L1
L3 :
mov edx, OFFSET msg1
call writeString
mov eax, tmp
call writeDec
exit
main endp
end main
Flow Chart