Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi. Can someone help me write the the code for this assignment. There are 4 functions in the program, but only two of them need

Hi. Can someone help me write the the code for this assignment. There are 4 functions in the program, but only two of them need to be completed. I will list the instructions and then the .asm file that is used.

Instructions:

image text in transcribedimage text in transcribed

.asm file:

image text in transcribedimage text in transcribed

Assignment 2 The file ass asm holds a partial program. The purpose of the program is to read in a list of 10 integers and then print them out. There are 4 functions in the program, 2 of which you are to complete Main: This function will call getdata and print. Main is complete and should not be changed. Getdata: This function reads 10 integers and stores them into memory. There is one parameter ($a0) which holds the address of where the list of numbers is to be stored. Getdata calls the function printstr to print the prompt. Getdata is complete and should not be changed. Printstr: This function is to print a string. There is one parameter (Sa0 which holds the address of the string to print. You are to complete this function so it performs as required. This function is call from the getdata function and the print function. Print: This function is to print the list of integers. The integers must all be on the same line of output and be separated by a comma and space (already in the data segment). See the example input and output below. This function must call the printstr function to print the comma string. Remember that as this function calls another, it must save and restore the $ra. Specifics Use only the instructions covered to date. Do not use pseudo-instructions. See the information under MARS for preventing the use of pseudo-instructions Make sure that your print function calls the printstr function correctly and that the stack is used correctly. Documentation: Comment the beginning of your programs with your name, plass, and assignment number. Comment every instruction. Assignment submittal: Upload your assembly language program (asm file) using this link on Blackboard Hints on getting started: Load the assi asm file into the MARS simulator Write the code for printstr and make sure that it works correctly. Write the code for print

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions