Author Topic: Resetting HC08 stack pointer when exiting sub  (Read 1090 times)

0 Members and 1 Guest are viewing this topic.

Offline CirclotronTopic starter

  • Super Contributor
  • ***
  • Posts: 3568
  • Country: au
Resetting HC08 stack pointer when exiting sub
« on: December 04, 2018, 06:19:17 am »
I just read that doing a RSP on a HC08 only resets the lower 8 bits of the stack pointer. I have sometimes used the expedient of RSP after exiting a subroutine rather than completing the sub then RTS. So... the red-faced question is, is it okay to do this provided the stack is less than 255 deep? I don't know how deep my stacks would be but probably not more than 10 or 20. I only write in assembly, and not super complicated stuff.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->