Closed Kouzeru closed 2 years ago
I've given this some thought, and I've decided it's too application-specific. In practice very few people have written programs that need bank-switching, and there are already several techniques available. I'm not adding this feature at this time.
A new keyword ":offset NNNN" will subtract any new addresses and branches assigned after it by the specified NNNN until the compiler met another ":offset", hence one don't need to write separate program in order to do multiple banks of "program code".
For example, when program code located on some long address "0x2000", and one wish to execute it on "0x800", using keyword ":offset 0x1800" will subtract the new addresses by "0x1800":
The offset could be reset anytime by ":offset 0", as the offset is 0 by default on the start of compilation.
The ":offset" also may accept constant, or any variables defined by ":calc".
In case of some forward references, ":offset" only affects new resolved addresses.