-
Notifications
You must be signed in to change notification settings - Fork 11
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
Small binaries can be run without any header #67
Comments
yeah - the memory area isn't cleared, and so a previous binary loaded at &40000 which has a correct header will mean that the header check on attempting to execute the binary at that memory address will pass this is actually a trickier thing to resolve than it might first seem until very recently MOS didn't actually have the ability to directly run a binary file. the only mechanism was to use the new facility to run a binary directly essentially just does an automatic
as I see it there are two potential solutions here
|
I slept on it overnight and I think the actual behavior doesn't need to be prevented, but the source of surprise - "it worked before, why doesn't it work now" - is worth addressing. It is not about single-command Here is a proposal: Edit: "Invalid binary" can become "Invalid binary, for details use REQUIRE" to guide me, a simple-minded |
While learning my way around ez80asm I started building simple assembly binaries without any header attached, and they worked, but I didn't notice that this wasn't supposed to work. Eventually I made a binary over 64 bytes and then it suddenly failed, and after some diagnosis, reduction to the simplest possible case(a "ret" and 64 null db bytes) and examining other code, I discovered that I needed the header.
My hypothesis for why this works is because the area at &40000 isn't cleared, so anything that ran previously there(like ez80asm) will still have its data. I don't have any specific suggestions for resolution - it might be sufficient to allow the small-binary case to slip through and adjust the "Invalid binary" error message to indicate more details, like a hexdump of the header area.
The text was updated successfully, but these errors were encountered: