Changing the value of the two adjacent addresses/elements by moving one

By moving one, i would first check if our current address is within the last arrayaddress.
if it is so, then I would check if the value stored at our current address ($a0) is zero or not.
– code removed–
so now I get the value store in my current address if it is right.

then I would check whether this value is zero or not.

it it is not zero then I just jump to the next address with
– code removed – (and do the previous steps above)

if it is equal zero, then I would exchange this value with the value in the next address with a subfunction “swap”?

– code removed —

Please someone tell me what’s the problem here? Tried to figure it out, but it did not work…
Thanks in advance…

Hey,

please do not post solution code in the forum.

Besides, helping you in this case just using the snippets you have posted is not really possible. One would have to look at your entire code in order to see what you attempted to do and where it goes wrong.

The next office hour is today at 2pm, or next monday.

Hope this helps,
Johannes

1 Like