In MIPS, I wonder if there is a way to tell if an instruction, by just looking at the machine code, is an I-type or R-type instruction?
If you're looking for something quick and dirty, the op-code (6 most significant bits) of almost all R-type instructions is set to 0
.
Of course in a real CPU there would be a more complicated test that would deal with all the possible exceptions.
See this chart.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With