Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In MARS All parts are part of 1 question. e 02 507620- 162LaD02uT.par For this lab we are going to get started working in MARS

In MARS
image text in transcribed All parts are part of 1 question.
e 02 507620- 162LaD02uT.par For this lab we are going to get started working in MARS and will just be performing a simple ask. The main goal of the lab will be to gain an understanding of how to perform basic LO functions and how to end a program properly in addition to general usage. We must make use of calls to the system software to do any input or output operations and to end our program correctly. In order to do this, we will be making use of the syscall instruction, however, we must also set up specific registers properly in order make it function how we would like it. See the accompanying resources on Moodle for more information on the syscall command and its use. Part 1: Open MARS, create a new file, and call it "Lab1LastNameFirstName.asm Create the MIPS version of the function: f-g (h-) Use the following values for the variables: o g#20. h-14,i-6, and j#22 After getting the function itself working. lets print the result of the function. . Since we are working with, and will want to print, an integer value then we will need to place a value of 1 into the SvO register as found on the provided chart. . We will then place the integer we wish to print into the Sa0 register(f in this case ) Using the add instruction and the Szero register will let us move values between registers. Ex. destination-original + 0 o Finally, we are ready to use the syscall command to have our value printed to the screen. Part 2: . Next we will take in two values for use in the formula in part 1. We want to replace h with 10 and j with 1 take in an integer, we can see on the chart that we must place a 5 in the so register and then perform our syscall. We can then enter a value, with that value being stored in Sv0 after the syscall. Take in both values and then using the same method from part 1, print the result . Part 3: Once we have the result of our two operations printed, youll notice that there is no spacing of any kind between the first output and the first input, so let's fix that Before taking in the first number for part 2, insert a new line character using the same method as printing an integer, but in this case using the code for printing a character as found on the chart of syscall codes. In order to specify which character to print, we will provide the decimal number of that character as found on the ASCilI table, which one version of is also provided. This will alow separation between your two results p... M MARS MIPS simul.. EALab1JohnsonKee

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