Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/06/01 06:47
Read: times


 
#9775 - RE: 8052 subroutines
Hi,

I think I see a problem in your code. If you don't change the default stack pointer value (07H) the first routine's return address is stored in 08H and 09H. Then you push the Accu on address 0AH. Your delay routine's return address is pushed on 0BH and 0CH. Finally the Accu is saved again in 0DH in your delay routine. But I see you use 0AH and 0BH as delay counter in your delay routine. THIS IS PART OF YOUR STACK!!!!

Solution to this problem: Initialize your stack pointer to a different portion of RAM (preferably above 7FH on a 8052 with 256 bytes of RAM). Or use an other RAM address as a counter.

Good luck.

List of 7 messages in thread
TopicAuthorDate
8052 subroutines            01/01/70 00:00      
RE: 8052 subroutines            01/01/70 00:00      
RE: 8052 subroutines            01/01/70 00:00      
RE: 8052 subroutines            01/01/70 00:00      
RE: 8052 subroutines            01/01/70 00:00      
RE: 8052 subroutines            01/01/70 00:00      
RE: 8052 subroutines            01/01/70 00:00      

Back to Subject List