Question: I need help writing a program in x86 assembly language. For reference, here are the instructions but I will post what I have so far
I need help writing a program in x86 assembly language. For reference, here are the instructions but I will post what I have so far at the end:
Instructions:
Write a program to calculate prime numbers. First, the user is instructed to enter the number of primes to be displayed, and is prompted to enter an integer in the range [1 ... 200]. The user enters a number, n, and the program verifies that 1 n 200. If n is out of range, the user is re-prompted until they enter a value in the specified range. The program then calculates and displays the all of the prime numbers up to and including the nth prime. The results must be displayed 10 prime numbers per line, in ascending order, with at least 3 spaces between the numbers. The final row may contain fewer than 10 values.
Program Requirements
- The programmers name and program title must appear in the output.
- The counting loop (1 to n) must be implemented using the LOOP instruction.
- The main procedure must consist of only procedure calls (with any necessary framing). It should be a readable "list" of what the program will do.
- Each procedure will implement a section of the program logic, i.e., each procedure will specify how the logic of its section is implemented. The program must be modularized into at least the following procedures and sub-procedures:
- introduction
- getUserData
- validate
- showPrimes
- isPrime
- farewell
- The upper and lower bounds of user input must be defined as constants.
Here is what I have so far:
I have everything but the nested loop to test and display the primes numbers up until n. What would be the best way to do this nested loop?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
