Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

COMP 273

Basic MARS Programming

2022

INSTRUCTIONS

This assignment explores assembler programming. What is a low-level language and how does it run?      Keep in mind the properties of the CPU and RAM when programming. Try to imagine what the CPU must look like. Submit your answers in a single ASM text file called mini2.asm. The teaching assistants will        hold office hours the week of the 22nd .

You are expected to do all your work on your own. Plagiarism and cheating are a serious offence. You may ask classmates, the Tas, and the professor clarification questions.

QUESTION

You must write and execute the code for this question in the MARS MIPS Emulator provided to you on    our myCourses webpage under Content/Resources. Your TA will only grade your work from the provided emulator.

Write a MIPS program that asks the user for a string of 30 ASCII characters or less. If the user does not enter any characters, then the program terminates without doing anything. The program will then ask the user for an integer number greater than 0.  If the user enters a number less than or equal to zero, the program terminates without doing anything. If the number is greater than zero, the program then shifts the characters in the string by the number entered by the user in RAM. It then displays those      shifted characters to the user adding a square bracket before and after the output.

Make your program’s output display as shown here:

Input a string 30 characters or less: My name is Bob.

Input an integer greater than 0: 4

Shifted string = [ame is Bob.My ]

WHAT TO HAND IN

A single ASM text file named mini2.asm with the answers to the above question. Submit this to the assignment box mini 2” on myCourses.

HOW IT WILL BE GRADED

This assignment is worth 20 points.

Point Deductions:

-      For not following submission instructions: -3 points

-     Your program must execute to be graded (part marks will be given)

Points Awarded:

-      6 In memory shifting

-      1 Prompt for string

-      1 Reading string

-     4 Terminating for wrong string

-      1 Prompt for integer

-      1 Reading integer

-     4 Terminating for wrong integer

-      2 Shifted characters were outputted correctly

TA GRADING INSTRUCTIONS

-      Grade the student’s program only with the MARS emulator provided from myCourses.

-      20% off per day late, max 3 late days.

-      If the student submits a waiver, mark the assignment as 0 on myCourses but record the waiver event on the grading spreadsheet to average the students grades out of 5 assignments. If this  student has used the waiver multiple times, then the grade is 0 for the assignment and do not record the waiver event.

-      Remember to award grades proportionally to the students, this means if the student got a question half correct then they receive half of the points.

-     Award the score to the student by comparing their work with the solution sheet.