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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/19/04 15:54
Read: times


 
#62893 - RE: To Dan Henry - stack question
Responding to: ???'s previous message
"Realise that as soon as you call a function, the stack pointer has changed (as the return address has been pushed onto the stack) therefore the test that you have will fail."

As a side note, the return address may not be the only thing pushed onto the stack. If you are using "c" (your code examples indicate such), you should understand that the compiler may be obliged to push some other stuff onto the stack. Keil "c" compiler for example, supports #pragmas that affect what gets pushed. #pragma disable and #pragma NOAREGS will both cause PSW to get pushed. Interrupt service routines will push ACC, probably DPH and DPL and sometimes B, as well as PSW (depending on the declared register bank usage). This behavior is all spelled out in the compielr manuals and should be understood whenever programmer/ developer stack manipulation or testing is needed.
Regards,
Steve C.

List of 11 messages in thread
TopicAuthorDate
Keil software - stack question            01/01/70 00:00      
   RE: Keil software - stack question            01/01/70 00:00      
      RE: Keil software - stack question            01/01/70 00:00      
         RE: Keil software - stack question            01/01/70 00:00      
         RE: Keil software - stack question            01/01/70 00:00      
            RE: stack pertubation            01/01/70 00:00      
   RE: To Dan Henry - stack question            01/01/70 00:00      
      RE: To Dan Henry - stack question            01/01/70 00:00      
         RE: To Dan Henry - stack question            01/01/70 00:00      
      RE: To Dan Henry - stack question            01/01/70 00:00      
   RE: Keil software - stack question            01/01/70 00:00      

Back to Subject List