-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Support Multiple Charmaps/Disable Charmap #256
Comments
How would you do this? |
One way to do this would be a
Then you could make macros such as
|
What about the "default charmap" that exists before you use
Another thing to consider is the state that a new charmap starts off with. Does it inherit the current charmap's mapping or start with some predefined initial mapping (e.g. ASCII)? |
I would agree with hardcoding the default charmap to I think creating a new charmap should inherit from the current one, that way if you want to base it off the default mappings you simply do |
That sounds good to me. Another thought I just had is that we might want to distinguish between creating a new charmap and switching to an existing one. The benefit is that it might help catch errors where someone thinks they're creating a charmap but they're switching to an existing one or vice versa. The downside is that there would be more directives to remember. Specifically, |
Also, I don't think my suggestion of "default" is the best idea. It could be confusing because it sounds like it would be the charmap that the assembler begins with, without any changes. "main" would be a better name for it. |
Well, that charmap is the one the assembler begins with, isn't it? The problem with requiring a It does mean that you can keep defining a charmap as you go, which isn't very clean, but that's already what happens with the current system. Lastly, you can decide to break backwards compatibility in that regard (hopefully in a mild manner), and keep this feature for 0.4.0. |
Yes, but to me, "default" sounds like it's what the assembler begins with, without any modifications by the user. I was thinking that you would start with the "main" charmap already in existence and be able to use |
The thing I'm slightly worried about is, to maintain backwards compatibility, the |
Under the risk of making suggestions to an issue that already has a pull that closes it, how about this?
Note that the assembler's default charmap would still be modifiable via This proposal eliminates accidental charmap definitions, as definitions and usage look nothing alike. It still has the problem of state, though. EDIT: one way of eliminating the state issue would be to introduce yet another block that creates a charmap scope:
This would only really work for occasional usage of alternate charmaps, though. It also introduces yet another overload for |
I think the charmap definition block could be good. It looks odd that you have to repeat |
Either the charmap could inherit from the current one ( |
When I tried putting
Is it worth using a new keyword to avoid that? |
Using a new keyword would make more sense (so as not to overload the I'm starting to doubt the practicality of introducing a new variant of this construct, actually. |
Right now it looks like
charmap
overrides any previous mapping including ASCII. This means you can't have more than one mapping, or use ASCII and a custom map in the same ROM (eg for debug output form emulators). Would be great to have a way to specify which mapping to use for a given string or group of strings.The text was updated successfully, but these errors were encountered: