Homework 3

Computer Architecture I ShanghaiTech University

Quick Sort


In this task you will be writing a quick sort using RISC-V. We have written some code for you, but you have to finish the most important part all by yourself. You can download the src here.

Quick sort can be "partitioned" into two parts:

Source for the code above: Wikipedia

If you are not familiar with these two process, here are some help.

The code we wrote follows these two procedures too. Mind that you must fill two functions and you MUST NOT combine them or we WILL NOT grade your homework. We enforce this for a reason. One, it's good to get things separated and keep your mind cool; besides, you also need to practice save(and load) from(to) memory before calling a function.

Consider Learning Before You Start

What you should do

Heads Ups


You should NOT change the structure of the code above line 70. And also, we will check registers validation. Besides, your code should no longer than 450 lines. Additional, make sure your code has at least 50% commits. Save your code into a file, then submit the file in autolab, the name of the file doesn't matter, but recommended hw3.asm.
Last Modified: Mar. 15th, 2019 by Wang Ruoyu(wangry@shanghaitech.edu.cn)