MIPS project 2
Look at the file I’ve attached for the question.
CS2400 Fall 2020
1
Programming Project 02- (35 Points) Extended due date Sep 25th 2020
Objective: To understand Developing and executing programs in the simulator environment
Do basic logical operation and to understand memory instructions and data segment.
P1. Write a MIPS program using MARS IDE that (16 points)
a) Will assign the last 6 digits of your #900 number in hex format in a variable N
(2points)
b) Declare a hex number in variable M to mask bits from 2nd to 12th from value
stored in N.
(2points)
c) Shift the masked number so that 2nd bit is the 0th (Least significant bit) bit.
(2points)
d) Store the value in variable P.
(2points)
• Example if your 900 number is 0x900123456
• Last six digits – 123456 in decimal convert that to hex and store in a variable N
• Then the 32-bit (0 to 31) variable will be storing as binary equivalent
00000000000000011110001001000000
• Mask bits 2 to 12 – 00000000000000011110001001000000
• After masking all bits other than the shaded ones will be 0
• Which is 00000000000000000000001001000000
• Decide the logical operation with a masking number to get the result as above.
• Shift 2 time to right so you get
00000000000000000000000010010000
• Store that in variable P.
CS2400 Fall 2020
2
e) Compute (only compute you do not have to print the expression) the result of
expression Q= (N – P) * 2, without using multiplication instruction and display the
result. Display only the result in Q. (3 Points)
f) Compute (only compute you do not have to print the expression) the result of
expression Q= (N + P) / 2, without using division instruction and display the
result. Display only the result in Q. (3 Points)
P2. Write a MIPS program using MARS IDE that will ask the user to enter the users Full name
(First Name, Middle Name and Last Name) with space in between and all in small letters.
Write instructions to change the first letters of First Name, Middle Name and Last Name to
Upper case and display. (15 points)
C1: List the errors you got while doing the program as comments for every program. (If
nothing write “No Error”) (1Point)
C2: Comment in every program if the topic covered in class helped you in doing this or did
you refer any resources outside or a peer help? (1Point)
C3: Comment your name, your #900 number, date of completion of the program and the
time taken to do the program. (1Point)
For every P section you need all C sections
What to submit in Canvas.
Submit two separate assembly (.asm) files for the 2 programs.
• Use Input – Your Own name
• Example- ranjidha nmn rajan (all in small letters)
• Objective is to understand data segment so no loops required, manually see the
positions of First middle and the last name and change the first letters of each to
Capital Letter
• Output shout be Ranjidha Nmn Rajan