|
|
#1 |
|
Junior Member
Join Date: Dec 2008
Posts: 2
|
Greetings from a newbie!
I am writing my first ever function in NSIS and for the life of me I can't figure out from reading the manual whether I should ALWAYS push (in the beginning of the function) ALL registers used inside the function - and pop them at the end of the function? If NSIS automatically saves all $0..$9 and $R0..$R9 variables on entering a function then restores them on returning, then I don't have to do that as a programmer. But does NSIS really do that? Thanks -- Phil |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Yes, you have to manually push and pop the registers. Only push and pop the minimum you need, because it saves typing out all of them. Example:
code: If you have returned a value from your function, you pop it off the stack so that you can use it in the rest of your script (if you want to). Hope this helps, Jason Ross aka JasonFriday13. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Dec 2008
Posts: 2
|
Thank you Jason.
So if I understand correctly, there is a bug in the following code, right? PHP Code:
|
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Dec 2005
Location: Glow
Posts: 285
|
Quote:
ps. All variables in NSIS are global, even if defined in a function. PaR |
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|