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

Access different address when debugging many times

I am debugging my code with Keil v5, but I found that there was a reentrant function. Every time when I the break point went to a specific variable, the address of the variable was always different. For example, if this time is MOV WR6, @DPTR+#0x06, the next time will be MOV WR6, @DPTR+#0x08, and then it will be MOV WR6, @DPTR+#0x0A. This situation will cause an error when compling the code, but if I change the reentrant function into unreentrant function, it will correct the compling error.

Could anyone tell me that why this could happen and what would be the root cause? And how could I fix the error?

Thanks in advance!