Why the instruction
divhas only 2 registers, unlike
mul? where is the result stored?
Since a week, I failed the daily test
Prog2.tests.daily.CodeGenTests::testExpression. I’ve written tests to check if the my implementation fails but it seems to work perfectly in my local tests. Is there any hints to solve this?
Since division is a complex instruction and you can’t really divide without computing the modulo simultaneously,
division stores its result in the special
lo registers (as does
lo = s/t,
hi = s % t.
Question moved to
Here is a detailed MIPS reference with all the detail you would need to build a mips emulator.