CS 2734
Computer Organization II
int b[] = {10, -1, 7, 4, 3};
int sumit(int a[])
{
int c[5];
int i;
for (i = 0; i < 5; i++) {
c[i] = a[i+1] - i + b[i];
a[i] = 2*i + c[i];
}
return 0;
}
Assume the address of a is in register i0. Allocate c on the stack and b as a static initialized variable.
You may use an array which is an automatic variable of size 10 in the main program.
Revision Date: 2/12/97 1:30 p.m.