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

Dangerous automatic CLR within LOAD #24

Open
FeralChild64 opened this issue Jun 12, 2019 · 0 comments
Open

Dangerous automatic CLR within LOAD #24

FeralChild64 opened this issue Jun 12, 2019 · 0 comments

Comments

@FeralChild64
Copy link
Collaborator

The 'cmd_load.s' contains:

;; XXX - C64 BASIC apparently doesn't clear variables after a LOAD in the
;; middle of a program. For safety, we do.
jsr basic_do_clr

This can break BASIC programs utilizing LOAD to fetch sprite data, machine code, and other binary data, like this code:

100 DN = 8: REM <- set device number
110 LOAD "SPRITE DATA 1", DN, 1
120 LOAD "SPRITE DATA 2", DN, 1: REM <- this will try to load from device #0 

IMHO this CLR is only safe if data is loaded to memory starting from TXTTAB ($2B-$2C, by default pointing to $0801) - if not, you can be sure this is some programming trick as in the snipped above.

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

No branches or pull requests

1 participant