Question
80x86 Assembly language - write a program that stores the primes in an array of doublewords primeArray -------------------- prime[1] := 2; {first prime number} prime[2]
80x86 Assembly language - write a program that stores the primes in an array of doublewords primeArray
--------------------
prime[1] := 2; {first prime number}
prime[2] := 3; {second prime number}
primeCount := 2;
candidate := 5; {first candidate for a new prime}
while primeCount < 100 loop
index := 1;
while (index <= primeCount)
and [prime[index] does not evenly divide canditate] loop
add 1 to index;
end while
if (index > primeCount)
then {no existing prime evenly divides the canditate, so its a new prime)
add 1 to primeCount;
prime(primeCount) := candidate;
end if;
add 2 to candidate;
end while;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started