hw-02 - CSE 341 Fall 2011 Homework #2 1. Must a MIPS...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 341 Fall 2011 Homework #2 1. Must a MIPS program always conform to the software convention outlined in class in order for it to work on a MIPS processor? Justify your answer. 2. The MIPS processor designers are considering making a change to the ISA. The change involves replacing the LUI instruction with subtract immediate ( subi )? Is this a good change to make? Why or why not? 3. List at least three (3) native MIPS assembly instructions which could be eliminated from the ISA without limiting the functionality of the architecture. Describe how other instructions can be used to replace each instruction you list. 4. Is LB $a2, 0x10010032 a native MIPS assembly instruction? Why or why not? 5. The subroutine eval shown in the MIPS assembly language code below returns 3 * a0 + (a1) 2 – 17 in v0 for integers greater than 2 that are passed in a0 and a1. When eval is called, the routine never returns to the calling routine as it should. Why? eval: addi $sp, $sp, -4 sw $a1, ($sp) addi $a1, $0, 3 jal multiply or $0, $0, $0 add $s0, $0, $v0 lw $a1, 0($sp) addi $sp, $sp, 4 add $a0, $a1, $0 jal multiply or $0, $0, $0 add $v0, $s0, $v0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/03/2011 for the course CSE 341 at SUNY Buffalo.

Page1 / 3

hw-02 - CSE 341 Fall 2011 Homework #2 1. Must a MIPS...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online