Skip to content

rdmorel/test-prime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

test-prime

Finding prime numbers

Assignment: "Nested Loop and Leaf Procedures"

1: Write an assembly-language code to test if a positive integer number n is a prime number. Implement your code using a leaf procedure named testPrime(n), which will return 1 if n is prime and return 0 otherwise.

Also, follow the convention of saving the values of different registers, e.g., $t0, $s0, in the stack memory as usually done by the caller and callee of a procedure.

2: Using the testPrime(n) procedure, write an assembly-language code that prints the first 100 prime numbers. Apply the same convention of saving register values during the procedure call, as mentioned above.

About

Finding prime numbers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published