The title pretty much sums this up. I am writing a program in 32-bit MIPS Assembly Language (using the MARS emulator) for a school project and I'm having zero luck reading in int values > 2,147,483,647.
I spent a decent amount of time hunting around the internet and in my book to no avail. This is not central to the assignment (which, if you happen to know it is impossible, you probably already realized) but curiosity is killing this cat. Now that I've hit this brick wall, I must know for sure.
Notes:
The standard code for grabbing an int with syscall:
li $v0, 5
syscall
move $t0, $v0
The error that occurs when 2 500 000 000 is passed at prompt for integer:
Error in C:\DEV\....... line 57: Runtime exception at
0x004000034: invalid integer input (syscall 5)
Help me Obi-Wan, you're my only hope!
You'll need to use a different system call -- MARS is throwing the exception, not anything "inside" the MIPS CPU. Try, for instance, syscalls 8 or 12 (read string and read character). Note that, as a result, you'll have to implement a lot more of the parsing yourself to make these work.
Alternatively, you might try reading a double (syscall 7) and converting it to an integer...
There's a full list of MARS syscalls online at:
http://courses.missouristate.edu/KenVollmar/MARS/Help/SyscallHelp.html