Unformatted text preview: immediate field of an instruction), and “big” is a constant that is 32 bits (i.e. too long for the immediate field). If you need to access a portion of the constant, you can do that. For example, to implement “li $t2, big”, you would write: lui $at, big[31:16] # $at’s top 16 bits set properly ori $t2, $at, big[15:0] # $t2’s bottom 16 bits also set 2.) (C to MIPS) Exercise 2.19.1 for code segment (b). Assume a is in $a0, b in $a1, n in $a2, and the result should go into $v0. You may change the values in any of these registers. Note that to implement the subroutine call by simply jumping to the top of your code, but with the arguments updated appropriately. To end your program, call “jr $ra” to return to the subroutine caller. Shorter and faster programs will be given more credit....
View Full Document
- Spring '10
- Assembly Language, Central processing unit, MIPS architecture, real MIPS instructions