H include stdlibh int fibint n int z if

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Write a MIPS Code segment that implements the following C code segment: int i, sum, A[10], j; for(sum=0, i=0;i<10;i++) { if( A[i] > 10 ) continue; if( A[i] < 0 ) break; sum += A[i]; } j++; Assume i is in register $1, sum is in register $2, array A is allocated starting from address $1000, and j is in register $10. You need to follow the comment in the following table. Add labels as needed. Label Instruction comment ADD $1, $0, $0 # initialize i 0 ADD $2, $0, $0 # init sum to 0 Loop: SLTI $3, $1, 40 # testing termination condition BNE $3, $0, Exit # e...
View Full Document

This note was uploaded on 07/20/2013 for the course ECE 2035 taught by Professor Willis during the Spring '13 term at Georgia Institute of Technology.

Ask a homework question - tutors are online