Open tevorbl opened 4 years ago
OK, the emulators are deep inside the tmp directory, eg for m68k it's here:
.../tmp/ack-build/obj/plat/linux68k/emu/emu68k/emu68k
Found only a few have emulators there: linux 386, linux68k, cpm, & pcdos
cpm doesn't have FP, so can't test there. (but there are FP packages for the 8080, see here --> http://retrotechnology.com/herbs_stuff/float.html)
linux386 has the bug as reported above.
linux 68k doesn't have FP. I updated linux68k platform to include FP, & bug is repeatable there. (PR on its way)
pcdos platform prints real numbers something like this --> ////.//. counting the characters confirms the bug. And reveals another one.
Next step: try to configure platforms to make doubles 4 bytes instead of 8 and see what happens.
for example, on linux386:
output is: 3.3e-001 <--- fieldwidth is 9 chars
I think the issue is that in lang/pc/libpc/wrr.c it is assumed that exponents have only 2 digits, but linux 386 (& probably some other platforms) need 3 digits.
I fixed it by adding this code to wrr.c
and
Works for me.
The completed version of wrr.c is attached.
PS. I have a feeling there a way to test this on other platforms using qemu, but I can't figure out how. Anyone got a quick overview where to start?
wrr.c.txt