How does storing data in registers work in assembly on MIPS?

0 Dol Lod · April 6, 2015
I am currently working on homework and I realized that I still don't understand how this works entirely with intermediates where intermediates are specific numbers that do not need to be stored in variables. In particular, I don't understand when it is fine to store the full 32 bits and when only 16 bits can be used for the register. 

I also don't understand how you would access a dynamically calculated offset for an array. I computed the offset and stored it in a temporary integer, but I don't know how to apply the offset. Is it simple addition after multiplying the offset by 4 because it is made of integers.

Post a Reply

Replies

Oldest  Newest  Rating
0 Tatrasiel R · April 8, 2015
The most I have done with MIPS was in C and that was a long time ago.

I think however that this would be like any architecture. If the processor / Architecture can support 32 bits then you can store in any of the many registers that MIPS has except, for the NULL register.

I think you should make something in C and open up GDB and traverse it and watch it work.

Here is my answer for compiling C on MIPS

http://stackoverflow.com/questions/17006843/compile-c-for-mips-architecture/18117016#18117016
  • 1

Other Programming Languages

107,282 followers
About

I think it is pretty obvious what this section is for.

Links
Moderators
Bucky Roberts Administrator