-
Notifications
You must be signed in to change notification settings - Fork 5
Gcc fixes #1
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
base: master
Are you sure you want to change the base?
Gcc fixes #1
Conversation
Otherwise gcc generates the FP code and does not allow to clobber %bp.
gcc doesn't allow to put same registers to both input and clobber lists. Instead we can put it into an output list - gcc will then consider it clobbered for obvious reasons.
gcc does not allow 'mov' in this case, and clang does not allow movzbl.
Unfortunately gcc does not understand -Oz.
gcc emits .code16gcc so there is no need to add more.
|
Hi Stas! Thanks a lot for your contribution. Please allow me a few weeks for review, because just right now, I'm moving to a new house and this takes a lot of time. I see you have a lot more experience with DOS, so if this builds and runs with both GCC and LLVM, I'll be happy to merge --- and I'll probably have to rethink the project's name (any suggestions?). |
|
Hi Felix! Well, I have to admit that I've deciphered all of As an exercise I reworked the arg0 stuff the So while it is very good that you got this working |
|
Wow, thanks for this great work! I have to admit, I had NO idea about DOS before starting this and just used some online documentation to "get it work". The only things I'm proud of is a) doing once in my life printf() and malloc() on my own .. haha .. I guess others did it better and b) the build system based on GNU make I'm still working on (if I find the time) So if you actually fixed the b0rked way to get argv[0], I'm happy to merge that as well, thanks a lot! My only goal was to use a modern compiler in a Linux or *BSD environment to create workable DOS .COM binaries. I kind of reached that (far from perfect) by getting my own game to run in dosbox and then abandoned it for lack of time. I see this project isn't of much use to the public, still it's fun and I'm really thankful for your contribution. So far I looked through your code of this PR and it looks very good. Just allow me the time to do some Q/A testing (just to be sure it doesn't break anything) and then I hope I'm able to understand your argv[0]-fix as well :) |
This doesn't mean that the compiler works.
But dev86 can already do that.
Perhaps other people were no as naive as myself |
|
well it IS good for something, isn't it? This memory model is an old (and long overcome) PITA. I wasn't aware that segmentation was an issue accessing the environment in DOS. But if you do it using assembly, it helps creating an environment for C programmers .... nevertheless, I'll have a look at "dev86" now, maybe all of this was in vain ... :) |
|
Here's how dev86 does the environment access:
Because the environment resides in a different
For "small" memory model only, and for that we |
|
Stas, you're very direct and harsh ;) Still this is ok! I didn't know about "dev86" and I didn't want to use another compiler (watcom), so this is what I came up with. Please don't think about my tiny home-brewn project as "competition", that's not the point. After looking around and not finding what I was looking for, I just decided to do it on my own. And that's all. Sorry for giving you a sleepless night debugging this "crap", but I'm thankful for the explanations as well as the improvements. Expect a merge soon and please understand, this is just a project of a guy curious about old computer architectures (see my C64 stuff as well, hehe). It's not about competition. Thanks again for your contribution :) |
|
Sorry about being harsh and good luck with |
|
Hi Felix! I recently explored the 64-bit porting of |
This patch set makes gcc fully supported and enabled by default.