Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
lab0
- Loading branch information
Jerry Shi
committed
Jan 4, 2024
1 parent
1d7148f
commit af667be
Showing
3 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Getting prepared | ||
|
||
*Deadline:* Friday, 1/19/2024. | ||
|
||
We will keep the submission open until Friday, 2/2/2024 as students may enroll | ||
into the course late. | ||
|
||
*If you work on a lab computer or UConn AnyWare Desktop, save your files to | ||
cloud storage like OneDrive. Otherwise, you may lose your files.* | ||
|
||
Read the Deliverables carefully at the end of the page. | ||
|
||
Lab 0 is graded automatically. We do not adjust grades manually. Students | ||
should submit their work early to get feedback and improve their grades. | ||
|
||
## Learning Objectives | ||
|
||
* Run a RISC-V programs in RARS. | ||
|
||
* Submit code in Gradescope. | ||
|
||
* Conversion of non-negative numbers in one radix to another. | ||
|
||
* Take a quiz in HuskyCT. | ||
|
||
## Description | ||
|
||
### Task 1 | ||
|
||
Follow the instructions on [this | ||
page](https://github.com/zhijieshi/cse3666/blob/master/misc/rars.md) to install | ||
RARS and run RISC-V programs in RARS. | ||
|
||
Download `lab0.s`. The RARS instructions page mentioned in the previous | ||
paragraph has a section about "Download files from GitHub". The page also has a | ||
link to more [RISC-V | ||
examples.](https://github.com/zhijieshi/cse3666/tree/master/rv-examples). | ||
|
||
Modify the `msg` string in lab0.s so the program prints the following. There is | ||
a newline, but no space, after the ending dot. | ||
|
||
Hello, welcome to CSE 3666. Greetings from RISC-V. | ||
|
||
Submit revised `lab0.s` in Gradescope. There is a link in HuskyCT. The | ||
submitted filename must be `lab0.s`. It is case sensitive. The system does NOT | ||
accept names like `Lab0.s`. | ||
|
||
### Task 2 | ||
|
||
Study the slides in `lab0-numbers.pdf` to learn/review conversion of numbers in | ||
different radices. | ||
|
||
* Binary to decimal. | ||
* Decimal to binary. | ||
* Hexadecimal to decimal. | ||
* Decimal to hexadecimal. | ||
|
||
Practice on [this page](https://zhijieshi.github.io/cse3666/binarynumbers/). | ||
For now, you can click the Config button and uncheck "Bits are signed". | ||
|
||
## Deliverables | ||
|
||
Submit `lab0.s` in Gradescope and complete lab0-test in HuskyCT. | ||
|
||
The submission pages will be created before the semester starts. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# CSE 3666 Lab 0 | ||
|
||
# Anything after # is comments. | ||
|
||
# .data starts data segments | ||
.data | ||
# msg is a label in data segment | ||
# .asciz specifies an ASCII string ends with a NUL character | ||
# we can also use ".string", instead of ".asciz" | ||
msg: .asciz "Hello, welcome to CSE 3666.\n" | ||
|
||
# .text starts code segments | ||
.text | ||
|
||
# define a label, in code segment | ||
main: | ||
lui a0, 0x10010 # a0 = the address of msg. hard-coded | ||
addi a7, zero, 4 # a7 = 4, the system call number for printing a string | ||
ecall # system call | ||
|
||
# system call 10: exit with code 0 | ||
addi a7, zero, 10 # a7 = 10 | ||
ecall # system call |