-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2891 from o1-labs/dw/add-addi-test
o1vm/riscv32im: add example and test for addi
- Loading branch information
Showing
3 changed files
with
36 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,20 @@ | ||
.section .text | ||
.globl _start | ||
|
||
_start: | ||
# Initialize register | ||
li t0, 10 # Load immediate value 10 into t0 | ||
|
||
# Perform addition | ||
addi t0, t0, 5 # Add 5 to the value in t0 and store the result back in t0 | ||
|
||
# Custom exit syscall | ||
li a0, 0 # Set a0 to 0 | ||
li a1, 0 # Set a1 to 0 | ||
li a2, 0 # Set a2 to 0 | ||
li a3, 0 # Set a3 to 0 | ||
li a4, 0 # Set a4 to 0 | ||
li a5, 0 # Set a5 to 0 | ||
li a6, 0 # Set a6 to 0 | ||
li a7, 42 # Set a7 to 42 (custom ecall number) | ||
ecall |
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