Hai all,
Some times in my program I get infinite Loop..Even though I am not using infinite while loop.The program gets struck in the following loop..
IF IDATALEN <> 0 MOV R0,#IDATALEN - 1 CLR A IDATALOOP: MOV @R0,A DJNZ R0,IDATALOOP ENDIF
Is that compiler(keil micro vision2) problem?...Kindly clarify me.....
with thanks, G.karthik Ragunath
haven't you brought this on yourself?
Several things need clarifying:
1. the code you've shown is assembly; so it must be assembled by an assembler - not compiled by a compiler;
2. uVision is an IDE - not a compiler (nor an assembler);
3. How have you defined IDATALEN?
Is that compiler(keil micro vision2) problem?
No. It's a bug in your code. I won't deprive you of the experience of finding it out yourself, though, so I'll just drop a hint: this can be an endless loop, but only if you run it with the register bank unequal to zero.
Oh, and you don't want to have IDATALEN=1, either.
I strongly suggest you step through this in the simulator to see what happens.