Do you perhaps happen to know, what would be the easiest way to modify my AEC-to-x86 compiler (you can run the core of it in browser: https://flatassembler.github.io/compiler ) to be able to target i486? Right now, I think it targets i486, except relying on the
fcomip instruction which exists only on i686 and newer. At first I thought I might replace
fcomip with something like:
fsubp fist dword [result] cmp dword [result],0
But the problem with that is that I'd also need to replace every
jg and every
jl, which, given the way the compiler is structured, is not a simple task (I'm afraid it's too error-prone). Do you have a better idea?
Is there a way to push FPU flags (ones affected by
fcomp) and pop them into CPU flags that would work on both i486 and 64-bit x86 processors?