If I modify the example a bit and write it as:
Mov A,#00h
Mov R0,#05h
here: Inc a
DJNZ R0,here
end
Then after executing the above program the value at A=05.
So,
Initially R0=5,A=0
1: A=1. then R0=4. As 4!=0, it goes to here.
2: A=2. R0=3. As 3!=0, it goes to here
3:A=3. R0=2. As 2!=0,ite goes to here
4:A=4.R0=1. As1!=0, it goes to here
5.A=5. R0=0. 0=0. And it terminates.
LOOP means having a common start and end points. RIGHT?? In the 5th case, it doesn't jumps. AGREED. But, The looping takes place 5 times.Because A=5.
Is this logic of mine right?