You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please forgive my non-knowledge of Java. In class I am using this simulator to teach RISC-V. Students input a value using system call 51 (InputDialogInt) at the start of an assembly program and then watch the simulator run the program with that input.
It is my understanding that this system call inputs a decimal number. For many test cases, students would appreciate the opportunity to instead input a hexadecimal number. Here's my understanding of what is happening:
Integer.parseInt takes two arguments; the second is the base and is if not specified 10
If the first two characters of input are 0x, could they be removed and then result in a call like return SystemIO.readInteger(input[2:].trim(), 16)? Again, sorry, I don't know Java.
The text was updated successfully, but these errors were encountered:
Please forgive my non-knowledge of Java. In class I am using this simulator to teach RISC-V. Students input a value using system call 51 (
InputDialogInt
) at the start of an assembly program and then watch the simulator run the program with that input.It is my understanding that this system call inputs a decimal number. For many test cases, students would appreciate the opportunity to instead input a hexadecimal number. Here's my understanding of what is happening:
rars/src/rars/riscv/syscalls/SyscallReadInt.java
:SyscallReadInt
callsSystemIO.readInteger
rars/src/rars/util/SystemIO.java
:SystemIO.readInteger
callsreturn Integer.parseInt(input.trim())
Integer.parseInt
takes two arguments; the second is the base and is if not specified 10If the first two characters of
input
are0x
, could they be removed and then result in a call likereturn SystemIO.readInteger(input[2:].trim(), 16)
? Again, sorry, I don't know Java.The text was updated successfully, but these errors were encountered: