Difference between revisions of "CSC231 Homework 10 Solution 2010"
(Created page with '--~~~~ ---- <onlydft> <code><pre> ; findPrime.asm ; D. Thiebaut ; ; This program counts the number of primes number less than 1,000,000. ; ; This is the optimized version. ; ---…') |
|||
Line 7: | Line 7: | ||
; D. Thiebaut | ; D. Thiebaut | ||
; | ; | ||
− | ; | + | ; this program counts the number of primes number less than 1,000,000. |
; | ; | ||
− | |||
− | |||
; to assemble and run: | ; to assemble and run: | ||
; | ; | ||
Line 87: | Line 85: | ||
ja .endFor | ja .endFor | ||
− | .if: | + | .if: xor edx,edx ; divide n by i |
mov eax, ip_n | mov eax, ip_n | ||
Line 95: | Line 93: | ||
.ret0: | .ret0: | ||
− | |||
jmp .endIsPrime | jmp .endIsPrime | ||
Line 117: | Line 114: | ||
ret | ret | ||
+ | |||