llvm-mos-sdk icon indicating copy to clipboard operation
llvm-mos-sdk copied to clipboard

Mechanism to preserve ZP variables before they are overwritten

Open JPEWdev opened this issue 1 year ago • 0 comments

The OS and/or BASIC may put useful variables for a program into the Zero Page, and it would be convenient if there was a way to guarantee these variables were preserved, even if llvm-mos would have normally assigned a zero page variable to their address.

As an example, the C64 places the device number from a load in 0xBA, so by using this you can load data from the same device as the user specified, instead of hard coding etc. It would be nice if there was a way to either A) tell llvm-mos to not use this specific address for any other zero page variables, or B) run some code to preserve it before the zero page is overwritten.

JPEWdev avatar Mar 11 '25 02:03 JPEWdev