Question: Assignment # 5 : Prime numbers are pretty well distributed. Starting at 3 ( we will ignore 2 as it's the only even prime )
Assignment #:
Prime numbers are pretty well distributed. Starting at we will ignore as it's the only even
prime the distance between the first two primes and is the distance between the next two
primes and is also and the distance between the next and is the distance between
the next two primes and is again. So the question I want you to answer is what is the
maximum distance between two consecutive primes over a range, for instance between and
This would be a trivially easy program to write in or another high level language, but here you
have to capture all the logic in Intel assembly. C code should only be used to declare variables at
the beginning of the program and output the results at the end. Your output should be the two
consecutive primes found and the distance between them. For instance, from to the output
should be something like:
The maximum distance is found between and
Write the program in C first so you can see how it works. Then, convert your C code into Intel
assembly. Note: you might find it easier to write an isPrimelike function in your code but when
it comes to assembly, only have a main function do not write any other functions
Test your program on the range from to and you should get the results shown above. When
done, run your program on to to and to this run may take a couple of
minutes to execute Collect all three outputs and paste them at the bottom of your code.
Assignment #:
Implement the Bubble Sort in assembly code. Your program should declare all variables, including
initializing your array, in C enter assembly to perform the entire sort, and then after exiting the
assembly block, use a for loop to output the results. The Bubble Sort is given below in
pseudocode. Run your program on both lists of numbers below hardcode the numbers in your
program, do not use any input collect the outputs and paste them at the bottom of your code.
Array :
Array :
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
