-
Notifications
You must be signed in to change notification settings - Fork 19
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
Invalid Intel HEX output #35
Comments
Hello, thanks for your report.
please try whether this works for you. kio ! |
Thank you for suggesting the use of the #code directive instead of org.
But while this approach does produce the desired result, using such a specific directive in existing code causes compatibility issues with other assemblers that already support the standard The standard It would be great to get a working Intel HEX output using the standard org directive. Is that possible? Thanks |
I understand your point and support it. As said, i will work on it next time i work on zasm. But it is not an easy fix at the point where the hex file is created because at that point i already lack the required information. I need to change the way zasm keeps track of the locations with generated code. |
The assembler produces invalid Intel HEX output containing many unwanted zeros, which can overwrite important data on the target device without any request.
For example here is
test-ihex.asm
file:You can compile it with old-school z80 assembler zmac with command
zmac -h -o build/test-ihex.hex -x build/test-ihex.lst test-ihex.asm
and get the following result:This is expected Intel HEX result and works ok.
You can also try more modern modifications of zmac, like this one.
Now, try to compile the same test-ihex.asm file with
zasm
and you will get this:test-ihex.hex output from zasm
This is incorrect Intel HEX output and contains incorrect addresses and a lot of unwanted zeros.
It appears that ZASM simply ignores the Intel HEX format's ability to specify addresses and uses it as a continuous binary file, filling all gaps with zeros. However, these gaps may contain important data or code on the target platform, and these zeros will overwrite them without justification.
Please fix it.
The text was updated successfully, but these errors were encountered: