Description
For context, see #341 and #315.
Our current commodore
targets clobber BASIC ZP. This does seem a reasonable default behavior for a C program: it's like BASIC, but unlike the KERNAL, so it should clobber BASIC but preserve the KERNAL. The commodore
targets used to exit by returning to a possibly broken BASIC, but #341 changes them to infinitely loop instead.
It may still be desirable to be able to return to BASIC. This would either require not using the BASIC area, or saving and restoring the BASIC ZP to a buffer. The latter seems more appropriate for a C program. Accordingly, we should see if there's a way to create a library, includable with -lsave-basic
, that can save and restore ZP before and after main
, across the various commodore
targets.