Skip to content

Lab03 - Introduction to RISC-V Assembly Programming

Code due Tue Sep 9th by 11:59pm in your Lab03 GitHub repo

Tests: https://github.com/USF-CS315-F25/tests

Autograder: https://github.com/phpeterson-usf/autograder

Requirements

  1. You will develop RISC-V assembly language implementations of the following arithmetic problems. You will be given the C implementations, you need to write the RISC-V implementations.
  2. Your executable must be compiled with a Makefile
  3. Before you add files to your repo, do a $ make clean so you don't add/commit build products like executables or .o files
  4. We will test the labs using autograder

quadratic: Runs the quadratic equation (ax^2 + bx + c) on the 32-bit integers x, a, b, c and returns the result. Example:

$ ./quadratic 4 3 2 1
C: 57
Asm: 57

min: Calculates the smaller of two 32-bit integers and returns its value. Example:

$ ./min 2 3
C: 2
Asm: 2

sum_array Sums the integer values in an array.

$ ./sumarr 1 2 3 4 5
C: 15
Asm: 15

find_max finds the largest value in an array

$ ./find_max 1 2 99 3 4
C: 99
Asm: 99

Given

The Lab03 GitHub repo will contain starter code including a Makefile, the C versions of the functions above, and empty .s files for you to fill in.

Rubric

  1. Your lab will receive the score indicated by the autograder
  2. To get the test cases, git pull in the tests repo