Mail Archives: djgpp/1992/09/20/09:43:11
Hi,
I have got a problem using emu387 from djgpp1.08. It generates
a segmentation violation when you try to calculate a sqare root
(see the following typescript). I originally discovered the
problem when I played around with hexcalc (one of the sample
progs). The problem disappears, if I use the old (djgpp1.05)
emu387. When I tried to recompile the emulator in order to
find the reason, I ran into some other problems:
1. function exit in eprintf.c must be declared "void volatile"
to compile properly.
2. the makefile contains the following rule:
emu387 : crt0.o main.o $(O) $(E)
@>emu.rf crt0.o main.o $(O) $(E)
ld -o emu387 @emu.rf -L/139/lib -lc -N -Tb0000020
@>emu.rf $(O) $(E)
gcc -o emutest main.o @emu.rf
The "-L/139/lib" is obviously wrong and has to be replaced by
"-L../lib", if you are using the standard djgcc directory structure.
3. when I comared the old e17.cc from dgpp105 with the new one (the
sqrt-function is defined in e17.cc), I found the following change:
/* left = (left << 2) + (val >> 62); */ <-- old e17.cc from djgpp105
left = (left << 2) + (((unsigned *)val)[1] >> 30);
After de-commenting the first line and hiding the second one, I
got another error ("illegal char % in line 275"), which was a
message generated by as.exe (the assembler): the g++ - compiler
emitted illegal code! (something like "shr%ax ....").
Now I have given up. Does anybody know what to do? In the meantime I'm
still using the old emu387, which does not have any more problems, as
far as I know.
Greetings from Dirk
- Raw text -