Search code examples
programming-languagesinstallationstacknsiscpu-registers

NSIS instructions - some lexicon matter


I am reading doc to write NSIS installer. I tumbled on these lines:

the instructions that NSIS uses for scripting are sort of a cross between PHP and assembly. There are no real high level language constructs, but the instructions themselves are (for the most part) high level, and you have handy string capability (i.e. you don't have to worry about concatenating strings, etc). You essentially have 25 registers (20 general purpose, 5 special purpose), and a stack.

What does it mean that a language has got 25 registers and a stack? These are data structures. IMO these are related to memory management, not language syntax or structure. How do this relate to language structure/syntax ?

Thanks


Solution

  • The documentation refers to the registers

    • $0 .. $9
    • $R0 .. $R9
    • $CMDLINE
    • $INSTDIR
    • $OUTDIR
    • $EXEDIR
    • $LANGUAGE

    You can call them variables as well, they are just pre-existing builtin global variables. The first 20 are general usage variables and the last ones have a dedicated usage in a nsis script.

    Regarding the stack, you can actually pushing and poping arbitrary values during the execution of an installer (or uninstaller), but it is in some way a high level stack as you can push not just numerical registers but also strings. And you can play with the stack by swapping values as with Forth or the RPL language of HP calculators.