Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Programming Project
Assignment
Learning Outcomes
After completion of this programming project you should be able to:
Read and write strings of arbitrary length.
Implement non-trivial algorithms that require conditional execution and iteration.
Design and code functions that implement the MIPS assembly register conventions.
Getting Started
Visit Piazza and download the file proj2.zip. Decompress the file and then open proj2.zip. Fill in the
following information at the top of proj2.asm:
1. your first and last name as they appear in Blackboard
2. your Net ID (e.g., jsmith)
3. your Stony Brook ID # (e.g., 111999999)
Having this information at the top of the file helps us locate your work. If you forget to include this information
but don’t remember until after the deadline has passed, don’t worry about it – we will track down your submission.
Inside proj2.asm you will find several function stubs that consist simply of jr $ra instructions. Your job
in this assignment is implement all the functions as specified below. Do not change the function names, as the
grading scripts will be looking for functions of the given names. However, you may implement additional helper
functions of your own, but they must be saved in proj2.asm. Helper functions will not be graded.
If you are having difficulty implementing these functions, write out pseudocode or implement the functions in a
higher-level language first. Once you understand the algorithm and what steps to perform, then translate the logic
to MIPS assembly code.
Be sure to initialize all of your values (e.g., registers) within your functions. Never assume registers or memory
will hold any particular values (e.g., zero). MARS initializes all of the registers and bytes of main memory to
zeroes. The grading scripts will fill the registers and/or main memory with random values before calling your
functions.
Finally, do not define a .data section in your proj2.asm file. A submission that contains a .data section
will probably receive a score of zero.
Important Information about CSE 220 Homework Assignments
Read the entire homework documents twice before starting. Questions posted on Piazza whose answers are
clearly stated in the documents will be given lowest priority by the course staff.
You must use the Stony Brook version of MARS posted on Piazza. Do not use the version of MARS
posted on the official MARS website. The Stony Brook version has a reduced instruction set, added tools,
and additional system calls you will need to complete the homework assignments.
When writing assembly code, try to stay consistent with your formatting and to comment as much as
possible. It is much easier for your TAs and the professor to help you if we can quickly figure out what your
code does.
You personally must implement homework assignments in MIPS Assembly language by yourself. You may
not write or use a code generator or other tools that write any MIPS code for you. You must manually write
all MIPS Assembly code you submit as part of the assignments.
Do not copy or share code. Your submissions will be checked against other submissions from this semester
and from previous semesters.