MIPS assembly: big and little endian confusion

Posted by Barney on Stack Overflow See other posts from Stack Overflow or by Barney
Published on 2010-04-12T19:15:32Z Indexed on 2010/04/12 19:23 UTC
Read the original article Hit count: 497

Filed under:
|

I've run the following code snippet on the MIPS MARS simulator. That simulator is little endian. So the results are as follows:

lui    $t0,0x1DE             # $t0 = 0x01DE0000
ori    $t0,$t0,0xCADE        # $t0 = 0x01DECADE 
lui    $t1,0x1001            # $t1 = 0x10010000
sw     $t0,200($t1)          # $t1 + 200 bytes = 0x01DECADE 
lw     $t2,200($t1)          # $t2 = 0x01DECADE 

So on a little endian MIPS simulator, the value of $t2 at the end of the program is 0x01DECADE. If this simulator was big endian, what would the value be? Would it be 0xDECADE01 or would it still be 0x01DECADE?

© Stack Overflow or respective owner

Related posts about mips

Related posts about assembly