Syscall 10 (Exit) is supposed to always exit with code 0 (at least that's what it says in the documentation in RARS) however instead of this, if you have used Syscall 93 (Exit2, the one that lets you choose what code you exit with) since you opened the program, it uses the most recent exit code for that instead.
Repro:
- Open Rars
- Create a new file
- Make the contents of that file
addi a7, zero, 93
addi a0, zero, 1
ecall
- Assemble and run the file
- Change the file contents to
- Assemble and run again
Expected: Should exit with code 0
Actual: Exits with code 1