Posts: 3,283
Threads: 104
Joined: Jul 2005
Marcel, hitting A is executed as XEQ A. Press and hold the key and you will see.
The behavior you noticed is intentional. If you want to keep the return stack, and with it the local registers, intact use R/S instead. The reasoning is that manually starting a subroutine with XEQ or a hotkey should establish the same execution context each time (except for the contents of the stack or global registers, of course). We decided to clear the subroutine stack when the user starts a routine to assure this.
As a result, a program of interactive nature that uses XEQ or hotkeys to accomplish user tasks can and should always resort to global registers to hold the context and data entered by the user. Local registers are meant for intermediate storage within a subroutine. If you need more then 100 permanent registers you're out of luck with our WP 34S.
Posts: 528
Threads: 40
Joined: Dec 2008
In addition to what Marcus said, another advantage is that it helps ensure that you don't accidentally build up a huge set of unused local registers. E.g., XEQ VTL, press the 'A' hotkey, go have lunch, XEQ VTL again, answer the phone, XEQ VTL, etc. You really want to clear the local registers each time somehow.
An alternative would have been to clear the local registers when you return control to the keyboard, but that would make debugging them impossible.
Dave