Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# Starter code for threeTimes.asm # Put in comments your name and date please. You will be # revising this code. # # Dianne Foreback

image text in transcribedimage text in transcribedimage text in transcribed

# Starter code for threeTimes.asm # Put in comments your name and date please. You will be # revising this code. # # Dianne Foreback # # # This code displays the authors name (you must change # outpAuth to display YourFirstName and YourLastName". # # The code then prompts the user for 3 integer values. # The code outputs the summation of these 3 values multiplied by 3. # # In MARS, make certain in "Settings" to check # "popup dialog for input syscalls 5,6,7,8,12" # .data # data segment .align 2 # align the next string on a word boundary outpAuth: .asciiz "This is YourFirstName YourLastName presenting threeTimes. " outpPrompt: .asciiz "Please enter an integer: " .align 2 #align next prompt on a word boundary outpStr: .asciiz "The sum of your numbers multiplied by 3 is: " .align 2 # align users input on a word boundary # # main begins .text # code section begins .globl main main: ############################################################### # system call to display the author of this code la $a0,outpAuth # system call 4 for print string needs address of string in $a0 li $v0,4 # system call 4 for print string needs 4 in $v0 syscall # # system call to prompt user for input la $a0,outpPrompt # system call 4 for print string needs address of string in $a0 li $v0,4 # system call 4 for print string needs 4 in $v0 syscall ############################################################### # write a system call to read the user's integer value # We have not studied looping, so you will need to repeat the prompt for input # and do the calculation as you see fit # # system call to display "The sum of your numbers multiplied by 3 is: " la $a0,outpStr # system call 4 for print string needs address of string in $a0 li $v0,4 # system call 4 for print string needs 4 in $v0 syscall ################################################################ # write a system call to display the calculation # # Exit gracefully li $v0, 10 # system call for exit syscall # close file ############################################################### 
Project Description This project will help you to familiarize yourself with MIPS assembly language and encoding of MIPS instructions to machine language. Write an assembly program threeTimes.asm that: 1. 2. 3. 4. Prompts the user to enter 3 integers Displays the 3 integers Prints the sum of these three multiplied by the number 3 Use the starter code file, threeTimes.asm, and make the necessary modifications for this project. Remember, to place YOUR name at the top of the code. An example dialog follows: This is Dianne Foreback presenting threeTimes. Please enter an integer: 5 Please enter an integer: -3 Please enter an integer: 12 The sum of your numbers multiplied by 3 is: 42 Aside: Notice 42 (5 + (-3) + 12) * 3 Project Description This project will help you to familiarize yourself with MIPS assembly language and encoding of MIPS instructions to machine language. Write an assembly program threeTimes.asm that: 1. 2. 3. 4. Prompts the user to enter 3 integers Displays the 3 integers Prints the sum of these three multiplied by the number 3 Use the starter code file, threeTimes.asm, and make the necessary modifications for this project. Remember, to place YOUR name at the top of the code. An example dialog follows: This is Dianne Foreback presenting threeTimes. Please enter an integer: 5 Please enter an integer: -3 Please enter an integer: 12 The sum of your numbers multiplied by 3 is: 42 Aside: Notice 42 (5 + (-3) + 12) * 3

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