sam11 wrote
in this case my understanding is that *@n is some arbitrary memory address used to store the counter of loop iterations. what happens if math is such that this *@n memory location getting overwritten due to it being in within @R1 address range from @R0 base address.
eg. R0 is 200 and R1 is 10. and n is picked to be 205, so RAM[205] will be overwritten at some point. what ensures n is a safe place to store counter variable on which the assembly program depends.
The only thing that ensures that your code behaves correctly is you writing code that behaves correctly.
At this level of programming, you have complete control over what happens -- which means you also have complete responsibility for doing it right. There's no guard rails or safety nets.