-
Notifications
You must be signed in to change notification settings - Fork 103
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 #2894 from o1-labs/dw/test-addi-negative-values
o1vm/riscv32im: add tests for addi with negative values
- Loading branch information
Showing
3 changed files
with
40 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,22 @@ | ||
.section .text | ||
.globl _start | ||
|
||
_start: | ||
li t0, 100 # t0 = 100 | ||
|
||
# Subtract 50 using addi (addi with negative immediate) | ||
addi t1, t0, -50 # t1 = t0 + (-50) (Expected: t1 = 50) | ||
|
||
# Subtract 100 using addi (addi with negative immediate) | ||
addi t2, t1, -100 # t2 = t1 + (-100) (Expected: t2 = -50) | ||
|
||
# Custom exit syscall | ||
li a0, 0 | ||
li a1, 0 | ||
li a2, 0 | ||
li a3, 0 | ||
li a4, 0 | ||
li a5, 0 | ||
li a6, 0 | ||
li a7, 42 | ||
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