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

Tweak to SETDBR to fix issues with PRINT and PUTS #18

Merged
merged 2 commits into from
Jul 18, 2023
Merged

Conversation

pweingar
Copy link
Collaborator

There was an error in the SETDBR macro that cause it to fail if the data bank was not 0. The macro expanded to:

PEA #(`foo*256)+`foo
PBR
PBR

But, the bank operator has a low precedence, and so the PEA was calculating the wrong value... like so:

PEA #(`(foo*256))+`foo

This fix protects multiplication by wrapping the parameter in parentheses.

Tweaked the altered SETDBR macro.
Figured out what the error was in SETDBR... the bank# operator (`) in the parameter was grabbing the multiplication in the macro... basically macros aren't hygenic.
@pweingar pweingar merged commit 3c2798d into master Jul 18, 2023
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

Successfully merging this pull request may close these issues.

1 participant