Skip to content

Commit

Permalink
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
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
Binary file added lab0/lab0-numbers.pdf
Binary file not shown.
66 changes: 66 additions & 0 deletions lab0/lab0.md
@@ -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.

23 changes: 23 additions & 0 deletions lab0/lab0.s
@@ -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

0 comments on commit af667be

Please sign in to comment.