Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write code in masm x 8 6 assembly Introduction The purpose of this assignment is to reinforce concepts around procedures, nested loops, and data validation
Write code in masm x assembly
Introduction
The purpose of this assignment is to reinforce concepts around procedures, nested loops, and data validation CLO Please be
sure to thoroughly check the rubric there are some specific requirements with point penalties if they are not satisfied.
Designing and implementing procedures
Designing and implementing loops
Writing nested loops
Understanding data validation
What you must do
Program Description
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 The user enters a number, and the program verifies that If is out of range, the user is
reprompted until they enter a value in the specified range. The program then calculates and displays every prime number up to and including
the prime. The results must be displayed prime numbers per line, in ascending order, with at least spaces between the numbers. The
final row may contain fewer than values.
Program Requirements
The programmer's name and program title must appear in the output.
The counting loop to must be implemented using the Loop instruction.
The 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, ie each procedure will specify how the logic of its section is implemented.
The program must be modularized into at least the following procedures and subprocedures:
introduction
Obtain user input
validate Validate user input is in specified bounds
o
display prime numbers; utilize counting loop and the Loop instruction to keep track of the number of primes displayed;
candidate primes are generated within counting loop and are passed to isprime for evaluation
receive candidate value, return boolean or indicating whether candidate value is prime or not prime
The upper and lower bounds of user input must be defined as constants.
The
directive is not allowed on this project.
If the user enters a number outside the range an error message must be displayed and the user must be prompted to reenter the
number of primes to be shown.
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