How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Matt Smith Your Own Question
Matt Smith
Matt Smith, Computer Software Engineer
Category: Programming
Satisfied Customers: 9
Experience:  Software Developer at Autodesk, Inc (6+ years)
13181439
Type Your Programming Question Here...
Matt Smith is online now
A new question is answered every 9 seconds

how to convert machine language to MIPS assembly

Customer Question

10101101001010100000000000000000

Submitted: 7 years ago.
Category: Programming
Expert:  Danny B replied 7 years ago.

Sorry didn't read this correctly - opting out.

 

Danny



Edited by Danny B on 2/23/2010 at 7:06 PM EST
Expert:  Matt Smith replied 7 years ago.

First, let me point you to some helpful links:

http://www.scribd.com/doc/3577342/MIPS-Assembly-Language-Programming

 

Go to Appendix C: "Integer Instruction Set". Also, for determining which register name corresponds to a given number, see Figure 1.2.

 

Also check this link:

http://www.d.umn.edu/~gshute/spimsal/talref.html

 

--------------------------------------------

 

Now, specifically for the instruction you gave:

10101101001010100000000000000000

 

This can be split up as follows:

101011|01001|01010|0000000000000000

 

 

The first 6 digits specify the opcode: 101011 refers to the "Store Word" instruction or sw. So we're looking at something like:

sw rt offset(rs)

 

where the register rs is specified by the 5 bits after the opcode:

01001

This binary number corresponds to 9 in decimal. Looking at Figure 1.2, the register's name for 9 is $t1

 

and the register rt is specified by the 5 bits after that:

01010

This binary number corresponds to 10 in decimal. Looking at Figure 1.2, the register's name for 10 is $t2

 

The remaining 16 bits are the "immediate" or offset.

 

Thus, the assembly for this machine instruction would be

sw $t2, 0($t1)

 

Register File (Figure 1.2):

graphic

 

Please let me know if you'd like additional clarification or if you have any questions.

Thanks,

- Matt

Matt Smith, Computer Software Engineer
Category: Programming
Satisfied Customers: 9
Experience: Software Developer at Autodesk, Inc (6+ years)
Matt Smith and other Programming Specialists are ready to help you

Related Programming Questions