Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MONITOR clobbers 'free' ZP locations #111

Closed
tomxp411 opened this issue May 16, 2023 · 1 comment · Fixed by #173
Closed

MONITOR clobbers 'free' ZP locations #111

tomxp411 opened this issue May 16, 2023 · 1 comment · Fixed by #173

Comments

@tomxp411
Copy link
Contributor

Forwarded from commanderx16/x16-rom#329

The machine code monitor clobbers a bunch of Zero page locations that are inside the "unused" area.
I would expect the monitor to not touch these. Or at least, backup on entry/ restore them on exit?
https://github.com/commanderx16/x16-rom/blob/master/monitor/monitor.s#L105

My thinking is to nudge these variables up to the top of the empty space in ZP, maybe even overlap some of the BASIC zero page locations if we can do so without harm. We're talking about 12 bytes, so there has to be a buffer or something unused in BASIC while MONITOR is being used.

@stefan-b-jakobsson
Copy link
Collaborator

I'm not sure you can find a 12 byte buffer in low RAM that can be used for this purpose with no side effects.

It might be easier to place the backup in RAM bank #0 instead.

The segment BVARSB0 is a good candidate: 192 bytes are reserved for this segment but only 13 are currently used as far as I can tell.

We could shrink BVARSB0 a bit to make room for a new segment to be used by the monitor. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants