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

PUTBASIC mangles hexadecimal values that contain BASIC keywords, e.g. &3DEF #101

Open
markmoxon opened this issue Jun 30, 2024 · 0 comments

Comments

@markmoxon
Copy link

markmoxon commented Jun 30, 2024

Hexadecimal values that contain BASIC keywords get mangled by PUTBASIC, as it converts them to BASIC tokens. For example, &3DEF gets converted to &3<token for DEF>, which obviously breaks things (though the listings still look correct, which makes it really difficult to spot!).

test.zip

Attached in the zip are two example .bas files (test1.bas and test2.bas) that demonstrate the problem, one in BASIC and the other in assembler. You can build these into the test.ssd disc image using test.asm, like this:

beebasm -i test.asm -do test.ssd

The zip contains test.asm and test.ssd. To see the problem, load test.ssd and try CHAINing the test1 and test2 programs. The BASIC example in test1 gives up with an error, while the assembly example in test2 assembles, but the value of &3DEF is incorrectly put into memory as &3. The listings look OK, but that's because BASIC is showing the DEF token as "DEF", which is indistinguishable from the letters "D", "E" and "F". If you re-enter the offending lines within BASIC, the problem goes away.

mungre added a commit that referenced this issue Aug 23, 2024
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