alexfru / SmallerC

Simple C compiler
BSD 2-Clause "Simplified" License
1.35k stars 155 forks source link

Improve Intel 8086 compatibility #25

Closed humbertocsjr closed 4 years ago

humbertocsjr commented 4 years ago

Hello, I am not a speaker of the English language, so I did not put any explanation in the initial request, as I have worked quite a lot with retrocomputing, especially with 8086, I will try to include in the 8086 support little by little the excellent compiler that you did, I am even seeing about 32bit and 64bit calculation in 16bit and 8087 emulation to be able to add to the compiler, so I do not send dozens of requests with small changes, would it be better to wait for me to implement bigger changes before sending a new request? Do you think it best to implement a flag to tell if the output should be at 8086 to interfere less with the code that is currently generated for 80186 or higher? Or in the scenarios where code is generated for 80186 can I replace it to make it more compatible with 8086?

alexfru commented 4 years ago

Smaller C wasn't really designed to properly support 16-bit and 64-bit CPUs. I'm not going to change that design in Smaller C as it exists today (if I do, it'll be a separate and quite different project, likely with a different name). I'm not going to accept patches like this. If you can contribute a macro file like sys/80186.h but for the 8086 with all the macros for the instructions that don't exist on the 8086, I may accept it.