Problem I ( Assembler )
Provide the assembly implementation of the C - code below . Sub 10 is a function that subtract 10 from a given input x.
Assumption :
MyArray base address is store in register $S1.
Feel free to use instruction li or si.
li load an immediate value into a register . For instance, li $S4 5 will copy value 5 into register $S4.
C code
for ( i = 0,1 < 10="" ,="" i="" ++="">
{
MyArray [ i ] = MyArray [ i - 1 ] + MyArray [ i + 1 ] ;
Sub10 ( MyArray [ i ];
}
Sub10 ( x )
Return ( x - 10 ) ;
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here