Question: Please - If you do not know assembly coding in at&t syntax, pass this question on to an expert who does with access to a
Please If you do not know assembly coding in at&t syntax, pass this question on to an expert who does with access to a bit Linux system nonmac The code must compile and run on Debian xGNULinuxusing gcc nopie filename.c o filename. Here is the prompt:
find prime numbers less than using the Sieve of Eratosthenes algorithm. The
algorithm marks off numbers that are not prime by marking off the multiples of an integer. Since multiples of any integer are not prime numbers, marking them off will eliminate them from being considered prime.
You should use bits to correspond to the integers under test. You should initially turn all bits off onand when a number is found that is not prime, you should turn the corresponding bit on off
Completion of the program requires going through all bits and printing the decimal numbers corresponding to those bits that remain off on
You should investigate some efficiency steps to improve the performance of the program. For example, consider how you might make use of the fact that all even numbers after two will not be prime or how to reduce the number of comparisons and assignments when marking off multiples of higher primes.
Task List:
Write a program in assembler that initializes the primes array and marks off multiples of two. You should also write a function to print the prime numbers. The print function should print or more prime numbers on each line and should print the prime numbers out as decimal base numbers
Input: Ask the user to enter the upper limit of the prime numbers to check. This is helpful for testing.
As you develop your program, you should test your program on a much smaller set to save time and put off possible challenges you may face with a larger set of numbers.
Output:
Initially print up to prime numbers before any primes are identified ieevery number should appear as a prime except possibly number
Mark off the multiples of two
Mark off all nonprime numbers less than
Print the first primes
Add additional output:
Print a count of all prime numbers less than that are found.
Consider efficiencies that you might be able to incorporate into your program.
Submit your completed program.
Notes:
The program should be written as efficiently as possible.
You should print numbers on a line to reduce the of lines and pages that are necessary to print the prime numbers.
You should call printf with a decimal format dto print a number. If you use a format of the form das an example, it will print the number in a field width of seven. That is very convenient for printing the numbers in columns.
Be sure to review your output to make sure it is correct and matches what you intended. You can look up the number of primes on the Internet to verify that you have found the correct number of primes. Again, solve the problem in assembly language only please, and in at&t syntax not Intel
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
