Programming Assignment #1 Solution

$29.99 $18.99

Objectives: Introduction to MASM assembly language Defining variables (integer and string) Using library procedures for I/O Integer arithmetic Display your name and program title on the output screen. Display instructions for the user. Prompt the user to enter two numbers. Calculate the sum, difference, product, (integer) quotient and remainder of the numbers. Display a terminating…

You’ll get a: . zip file solution

 

 

Description

Rate this product

Objectives:

  1. Introduction to MASM assembly language

  2. Defining variables (integer and string)

  3. Using library procedures for I/O

  4. Integer arithmetic

  1. Display your name and program title on the output screen.

  1. Display instructions for the user.

  2. Prompt the user to enter two numbers.

  3. Calculate the sum, difference, product, (integer) quotient and remainder of the numbers.

  4. Display a terminating message.

  1. The main procedure must be divided into sections: introduction

get the data

calculate the required values display the results

say goodbye

  1. The results of calculations must be stored in named variables before being displayed.

  2. The program must be fully documented. This includes a complete header block for identification, description, etc., and a comment outline to explain each section of code.

  3. Submit your text code file (.asm) to Canvas by the due date.

  1. A program shell (template) is available on the course website.

  1. You are not required to handle negative input or negative results.

  2. You may submit only one of your programs up to 48 hours late without penalty. Try not to use this on the first program. A second late submission will not be accepted.

  3. To create, assemble, run, debug, and modify your program, follow the instructions at http://www.kipirvine.com/asm/gettingStartedVS2015/index.htm.

(Or other version for different version of Visual Studio)

  1. Find the assembly language instruction syntax in the textbook.

  2. Find help on using Irvine library procedures in in the textbook.

Example execution (user input is in italics):

Elementary Arithmetic by Wile E. Coyote

Enter 2 numbers, and I’ll show you the sum, difference, product, quotient, and remainder.

First number: 37

Second number: 5

37+5=42

37-5=32

37 x 5 = 185

37 ÷ 5 = 7 remainder 2

Impressed? Bye!

Extra-credit options (original definition must be fulfilled):

  1. Repeat until the user chooses to quit.

  2. Validate the second number to be less than the first.

  3. Calculate and display the quotient as a floating-point number, rounded to the nearest .001.

To ensure you receive credit for any extra credit options you did, you must add one print statement to your program output PER EXTRA CREDIT which describes the extra credit you chose to work on. You will not receive extra credit points unless you do this. The statement must be formatted as follows…

–Program Intro–

**EC: DESCRIPTION

–Program prompts, etc—

For example, for extra credit option #2:

Elementary Arithmetic by Wile E. Coyote

**EC: Program verifies second number less than first.

Enter 2 numbers, and I’ll show you the sum, difference, product, quotient, and remainder.

First number: 7

Second number: 9

The second number must be less than the first!

Impressed? Bye!