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

.dataAlpha as last line consumes last character #31

Open
kommisar5150 opened this issue Jun 26, 2018 · 1 comment
Open

.dataAlpha as last line consumes last character #31

kommisar5150 opened this issue Jun 26, 2018 · 1 comment

Comments

@kommisar5150
Copy link
Contributor

kommisar5150 commented Jun 26, 2018

If we have a .dataAlpha field as the last line of a .casm file with no new line at the end, the assembler
consumes the last character and replaces it with null. Usually, the new line character would be consumed instead. This is a special case that would need separate handling. Either we enforce coders to add a new line at the end, or we change the .dataAlpha code field a little.

A simple fix could be like this:

            if operands[-1] == "\n":
                instruction += operands[1][:-1].encode("utf-8")
            else:
                instruction += operands[1].encode("utf-8")
@pg-cse
Copy link
Contributor

pg-cse commented Jun 26, 2018

Good catch! This bug was in the code since V1.0. Kudos for catching this!

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

2 participants