I was going through an old exam paper and was doing a question to convert sw $6, -4($7)
into machine code in hex.
I was used to the format where the opcode is 6 digits long and set. If you Google, the opcode for sw
is 101011. However, in this exam paper, it had a table of opcodes where the opcode was Ox2B
which for me translates as 0010 1010
. Now, if I was to see this exam question, how would I convert this 8 digit opcode into the 6 digit one I need? What is the rule system for this?