llvm-mos / llvm-mos-sdk

SDK for developing with the llvm-mos compiler
https://www.llvm-mos.org
Other
255 stars 52 forks source link

[Breaking] Make commodore family targets infinitely loop on exit #342

Closed mysterymath closed 1 week ago

mysterymath commented 1 week ago

We currently take advantage of the BASIC ZP area, but commodore family targets can only load programs from a BASIC environment. This makes it intrinsically unsafe to exit by return, since it always returns to a possibly-clobbered environment.

Instead, exiting by looping still allows a screen's worth of output to be viewed, without possibly returning to a broken BASIC interpreter. This is arguably a bugfix, but it's also a very significant change in behavior, so I'm considering it a breaking change.

We should also have an optional library that saves and restores BASIC ZP on entry-exit and exits via returning, but that shouldn't block this change.

mysterymath commented 1 week ago

See #341