Skip to content

Instantly share code, notes, and snippets.

View argoc's full-sized avatar

Amelia Read argoc

  • Colorado School of Mines
  • Golden, CO
View GitHub Profile
@argoc
argoc / helloworld.s
Last active January 26, 2023 03:14
Hello World in RISC-V
.data # declare and initialize variables
hello: .asciz "Hello world!" # string with null terminator
.text # code starts here
main: # label marking the entry point of the program
la a0, hello # load the address of hello into $a0 (1st argument)
addi a7, zero, 4 # code to print the string at the address a0
ecall # make the system call
addi a7, zero, 10 # code to exit