Jorge Loya

SP out of allowed range (?)

Discussion created by Jorge Loya on Mar 24, 2008
Latest reply on Mar 26, 2008 by Tom Thompson
I've initialized the Stack Pointer register using Freescale template:
 
_Startup:
            LDHX   #RAMEnd+1        ; initialize the stack pointer
            TXS
 
But when using PSHA instruction, True-Time Simulator generates this error:
 
Error: Attempt to push or pop with SP out of allowed range
I understand that in the Flexis QE128, the stack could be anywhere within RAM section, right? At the beginning SP register is loaded with $1800 (end of RAM section, wich runs from $0080 to $17FF). But when trying to push Accumulator, TT Simulator throws this message!
 
So, I tried to change manually SP register to $00FF and PSHA works nice.
 
Any help will be appreciated.
 
Jorge
 

Outcomes