This part of the code in a program Im translating is giving me problems and I dont really know how to solve it. Could some one help?? does anyon know how to do it?
void max(int int list1[], int list2[], int list3[], int n)
{
int j;
for (j = 0; j < n; j++)
if (list1[j] > list2[j])
list3[j] = list1[j];
else
list3[j3] = list2[j];
}
this is what I have so far:
list5: .equate 8
n5: .equate 6
temp2: .equate 4
temp: .equate 2
j5: .equate 0
reverse: subsp 4, i
ldx 0, i
stx j, s
lda n, s
asra
sta temp, s
for5: cpx temp, sxf
brge endFor5
aslx
ldx list5, x
stx temp2, s
lda list5, x
ldx j, s
aslx
sta list5, x
subx n, s
subx 1,i
subx j, s
stx j, s
ldx j, s
aslx
lda temp2,s
sta list5,x
br endFor5
endFor5:addsp 4, i
ret2