MIPS question

edited February 2004 in Internet & Media
i have to convert the pseudo instruction (load immediate) li $t5, big into the equivlent to what it would be in mips and i'm lost. I know I have to do something using $at but i don't know what. Big is a 32 bit number.

I'm also having trouble converting lw $t5, big(t3) into the mips way of doing it, big here also stands for a 32 bit number.

Comments

  • shwaipshwaip bluffin' with my muffin Icrontian
    edited February 2004
    big[n:m] = bits m-n of the binary number big

    li $t5,big:
    lui $t5, big[31:16]
    ori $t5, big[15:0]
    
    lw $t5, big($t3):
    lui $at, big[31:16]
    ori $at, big[15:0]
    add $at, $at, $t3
    lw $t5, 0($at)
    
    There may be a "quicker" way to do the latter, I'm a bit rusty.
Sign In or Register to comment.