-1

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?

Dhruv Ghulati
  • 2,976
  • 3
  • 35
  • 51

1 Answers1

1

You made an error in your translation: 0x2B translate to 0010 1011 (so indeed opcode 10 1011), not 0010 1010.

lucvoo
  • 501
  • 4
  • 15