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

remove the strict mode flag (or revert its meaning) #67

Open
thomas374b opened this issue Jul 19, 2020 · 4 comments
Open

remove the strict mode flag (or revert its meaning) #67

thomas374b opened this issue Jul 19, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@thomas374b
Copy link
Contributor

Why should an obviously wrong statement be no error without the strict mode flag ?

Assembly language is difficult to learn and understand. Tools should help us and not hiding errors. Strict mode should be the default/always on. If legacy code would not assemble you probably have either a long forgotten bug inside or it was related to issue #64 where error codes from the first pass persisted.

This is a follow-up to issue #60. Imagine the value would be calculated from other symbols. You include some additional code, the value grows and will not fit into the desired space/register. The result would be definitely wrong code. Would you like to allow it ?

BTW: The deleted 'positive' testcases would fail also without strict mode flag. I recommend to include also commit a999a9d into the pull request.

@thomas374b
Copy link
Contributor Author

I commented a working testcase for both with and without -S flag commit c08bc1e

@msaarna
Copy link
Member

msaarna commented Jul 19, 2020

Why should an obviously wrong statement be no error without the strict mode flag ?

You're only considering the trivial case. If one is working on a target with a program size > 64k, regular label references will be larger than word size. Is it "obviously wrong" that one needs to wrap references to these labels in a (LABEL & 0xffff) construct? Is is serving the user base better to enforce the trivial case (which is obviously wrong) and to force them to use more cumbersome constructs? For me the answer is "no"

@thomas374b
Copy link
Contributor Author

thomas374b commented Jul 19, 2020 via email

@thomas374b
Copy link
Contributor Author

Why should an obviously wrong statement be no error without the strict mode flag ?

[..] Is it "obviously wrong" that one needs to wrap references to these labels in a (LABEL & 0xffff) construct?

No, it is not. With

.word NUMBER

you only tell the assembler "There are two bytes reserved for the next number to be put in"
you are NOT telling "If NUMBER evaluates to something bigger, it is allowed to wrap it".
The second statement is done with the AND mask and was done implicitly without StrictMode. And only you knew about, it's not written/reflected in the code.

I want to be alarmed if there is something that I've not foreseen.

Lets make StrictMode the default! ;-)

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

No branches or pull requests

3 participants