When I first had a look at some more complex scripts with lots of separate functions to call I noticed these "orgies" of
at the beginning of each function and at the end the same the other way round
I propose to add two new commands like 'PreservePreDefVars' and 'RestorePreDefVars' which simply saves the values of the predefined variables ($0 - $9, $R0 - $R9) and restore them when called.
The advantage is that one could use any of these variables within a function without running into trouble because of using a variable and forgot to push it to the stack before.
Another possibility would be to add the optional possibility to add the variables name as parameter like
PreservePreDefVars $0 $1 $8 $9 $R5
In an ideal world the RestorePreDefVars command automatically knows which variables were preserved before and restores only those.
Log in to post a comment.