CS计算机代考程序代写 mips assembly Assignment 2

Assignment 2

COMP1003 – Lab 1

MIPS Assembly Programming 1 (6%)

Due 11:59pm, Saturday, 16 October 2021

1. Run what.s (downloadable from “Lab 1” on iSpace) in QtSPIM, examine
some of the registers etc in the QtSPIM windows, and look in the code of

what.s, and try to work out what it does. Check whether the program works

if the argument is changed to 6, 1, 0, 10, 20, etc? Answer what the program

does in one sentence, as a comment on top of your program for Part 2.

2. Modify what.s so that it takes two arguments. If the arguments are the same
then the answer should be the same as that of what.s that takes only one

argument. If they are different then you should figure out what your

program should do based on the above. Try to make as few changes as

possible. Give your new program a sensible name.

3. Enhance the program to allow it to receive the two arguments from the
keyboard and display the result in the console window of QtSPIM. If any of

the input arguments is a negative number (less than zero), your enhanced

program should display a zero in the console.

SUBMISSION:

You should store your enhanced program (only a SINGLE program for Parts 2 & 3)

in one SINGLE file called “X.s”, where “X” is your last name. At the top of the

program, use comments (starting with “#”) to write your name and also use

comments to answer Part 1. Your submitted program must be in plain text format

and must be runnable on QtSPIM.

Submit your program to the Lab 1 site in iSpace. Hardcopy or email submission will

NOT be accepted.

Late submissions will be penalized (1% deducted for each day delay and no

submissions accepted after 3-day delay).