I have the following code already written and everything should be good. It suppose to find biggest and smallest values in array of size 4 using loop.
I got the loops setup and everything except my output is not correct. I have a bug in line 46 that when load the array the value into register X11 I get big weird number and causes the whole calculations to be wrong.
Please see if you can suggests a fix in this code.
//X0 Array, X17 number of runs, X11 Biggest, X12 Smallest
ADR X0,v
LDR X17,=4
LDR X11,[X0],#3
MOV X12,X11
loop:
**LDR X11,[X0],#3 //Line 46**
//LSL X11,X0,#3
CMP X12,X11
BLT loop1
SUB X17,X17,#1
CMP X17,#1
BEQ exit
BGT loop
loop1:
MOV X12,X11
SUB X17,X17,#1
CMP X17,#1
BEQ exit
BGT loop
I'm using the DS-5 IDE, in case that matters.