I'm new to MIPS assembly and I'm trying to learn how to use arrays. I understand that arrays are declared in the .data segment and then you load the address of the array to the register. However, I'm confused on accessing elements of the the array and changing the values. Here is a simple program I wrote in C that I'm trying to convert into assembly. Any explanation/code is greatly appreciated!
void addArray (int arrA[], int arrB[], int i, int j) {
arrB[j] = arrA[i] + arrA[i + 1];
printf("%d", arrB[j]);
}
int main(void) {
int arrA [] = {1,2,3,4,5,6};
int arrB [] = {1,1,1,1,1,1};
int i = 2;
int j = 3;
addArray(arrA, arrB, i, j);
return 0;
}