Answered step by step
Verified Expert Solution
Link Copied!

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 x86 assembly
Introduction
The purpose of this assignment is to reinforce concepts around procedures, nested loops, and data validation (CLO 3,4). 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 [1...200]. The user enters a number, n, and the program verifies that 1n200. 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 every prime number 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 programmer's name and program title must appear in the output.
The counting loop (1 to n) 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, 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
Obtain user input
validate - Validate user input n is in specified bounds
o
display n 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 (0 or 1) indicating whether candidate value is prime (1) or not prime (0)
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 [1...200] an error message must be displayed and the user must be prompted to re-enter the
number of primes to be shown.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions