-
Notifications
You must be signed in to change notification settings - Fork 26
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
Bug: Bad assembly code generated for bytes marked as 'Text' #65
Comments
whew. nice find! I will have a look. language bugs... phew. |
reminder to self, check out: #73 |
for this issue, potentially the simplest implementation to make this play nice with Asar would be to modify IsPrintableCharacter() to exclude any non-ASCII-printable chars from strings. while doing that might produce assembly output that Asar doesn't choke on, it might result in strings that could have been more human-readable if we were doing localized/unicode text better in the disassembly output. |
2023 update too is that in #73 are commits that exclude newlines, linefeeds, and nulls already (by breaking up strings and including them as individual data bytes). I haven't tested it on non-english text though so it might still be handling the case you mentioned here. if you get a sec feel free to test out latest version see what it generates |
I just tested with Diz v2.3.1.2. Things are much better! But not yet perfect because I stumbled on one last issue. In my test sample, I have this piece of text data: This export looks fine. However, when asar runs it generates the following error for this line: In order to fix this issue, I had to insert a \ before the "!" inside the quoted string. The exclamation mark seems to mean something special for asar that it tries to process. With this line: Anyway many thanks for your support, and keep up the good work on diz (I am patiently waiting version 3) |
Diztinguish allows me to mark any bytes as 'Text' in a project. However, if non-printable characters are marked as text, Diztinguish generates an asm output that asar cannot process.
Example: in a ROM where there is a C-like string containing a single underscore, I marked the two bytes as being 'Text' (the underscore itself, and the following 00 byte marking the end of the string).
The asm file generated by Diztinguish contains this: db "_ " (Here I wrote a space after the underscore but there is actually a 00 byte in the asm file which asar cannot process, causing the following error message:
test.asm:725: error: (E5029): Mismatched quotes. [ db "_]
If I only mark the underscore character as 'Text' and I use '8-Bit Data' for the 00 byte, then the asm file is fine and assembles correctly.
Yet it does not seem logical not to mark the 00 as text as it is part of the string.
The same issue occurs with any other non-printable characters like line feed, or most Japanese text data.
I think Diztinguish should only output quoted characters for byte values corresponding to ASCII printable characters. For any other byte value, it should output hex bytes so that asar will understand the asm file.
The text was updated successfully, but these errors were encountered: