Last active
January 26, 2023 03:14
-
-
Save argoc/77ffe85738c12d4bf178ccdb935d1aae to your computer and use it in GitHub Desktop.
Hello World in RISC-V
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
.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 | |
ecall # make the system call |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment