3. There are many ways to determine prime numbers. Here is a design for one way...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3. There are many ways to determine prime numbers. Here is a design for one way to find the first 100 primes. Implement this design in 80x86 assembly language. Using the console32 or console64 frame- work, write a program that stores the primes in an array of doublewords primeArray, and examine the contents of primeArray using the debugger. 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 s primeCount) and (prime[index] does not evenly divide candidate) loop add 1 to index; end while; if (index > primeCount) then {no existing prime evenly divides the candidate, so it is a new prime} add 1 to primeCount; prime[primeCount]:= candidate; end if; add 2 to candidate; end while; 3. There are many ways to determine prime numbers. Here is a design for one way to find the first 100 primes. Implement this design in 80x86 assembly language. Using the console32 or console64 frame- work, write a program that stores the primes in an array of doublewords primeArray, and examine the contents of primeArray using the debugger. 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 s primeCount) and (prime[index] does not evenly divide candidate) loop add 1 to index; end while; if (index > primeCount) then {no existing prime evenly divides the candidate, so it is a new prime} add 1 to primeCount; prime[primeCount]:= candidate; end if; add 2 to candidate; end while;
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Reid Corporation's balance sheet at January 1, 20X9 reflected the following balances: Cash & Receivables $ 30,000 Inventory $ 75,000 Land $125,00 Building & Equipment (net) $850,000 Common Stock...
-
What two alternative tests are applied to a business in order to judge whether it is an "employer" and therefore subject to the FUTA tax?
-
Trace the effect on bank reserves of a change in the amount of cash held by the public.
-
Match the measures of worth in the first column with the appropriate unit of measure that results from the analysis. Measure of Worth (a) Annual Worth (b) External Rate of Return (c) Future Worth (d)...
-
The comparative balance sheets for Alvin Arts, Inc., for December 31, 2011 and 2009 appear on the opposite page. Additional information about Alvin Art's operations during 2010 is as follows: (a) Net...
-
When switch S is thrown to the left in figure, the plates of capacitor 1 acquire a potential differenceVo. Capacitors 2 and 3 are initially uncharged. The switch is now thrown to the right What are...
-
1. Assuming that Pete plans to sell 750 dog houses, 335 bird cages, and 640 cat castles (60% through distributors), prepare a contribution margin income statement based on these sales volumes....
-
With injunctions for torts, courts won't enforce an injunction requiring an act of great taste, skill or judgment because taste, skill or judgment are too subjective and hard to enforce. Please give...
-
On May 2, 2022, a first draft of U.S. Supreme Court Justice Alito's majority opinion in Dobbs v. Jackson Women's Health Organization was leaked to Politico which published the draft opinion. Do the...
-
Discuss how you will implement Responsiveness to children within a high-quality early childhood education and care setting ( tips: Identification, examples, and analysis using literature to support...
-
A salad can be made using at most four oranges, at most one pears, any even number of apples and bananas in groups of five. Using generating functions, find the number of ways can we make a salad...
-
Write a feature article that analyses how one target from either SDG 6 (Clean Water and Sanitation) or SDG 17 (Partnerships for the Goals) accounts for human dignity and the common good (based on...
-
Write an essay on Zhang Yimous Contribution to Film Industry its about Chinese film director, a special period of the film history, or a group of filmmakers who share a common theme or cinematic...
-
Suppose you need to answer any four of seven essay questions on a history test and you can answer them in any order. a. How many different question combinations are possible? b. What is the...
-
Consider the number of product choices available in the U.S. consumer market. In virtually every product category, consumers have many options to fulfill their needs. Are all of these options really...
-
This case gives students an opportunity to learn about branding from a company that is a shining example of an organization that successfully embraces the branding mantra. Throughout its 60 years of...
-
What are some of the potential difficulties in approaching strategic planning from a balanced perspective? Isnt financial performance still the most important perspective to take in planning? Explain.
-
Which firms look best for someone wishing to buy stocks on margin?
-
Which firm looks best for someone planning to pay cash to buy 100 shares?
-
Examine all of the views available in the drop-down box menu (Snapshot, Performance, Portfolio, and Nuts and Bolts) to answer the following questions: a. Which fund has the best expense ratio? b....
Study smarter with the SolutionInn App