This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

IDATA LOOP

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

Parents
  • 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.

Reply
  • 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.

Children
No data