adapted for changed floating point package

This commit is contained in:
ceriel 1989-07-31 14:54:53 +00:00
parent ed19a3d568
commit d12053873a
5 changed files with 22 additions and 34 deletions

View file

@ -1,15 +1,17 @@
EMHOME=../../..
INTS=em2_t--- em2_---- em2_t-cp em2_t-c- em2_t--p \ INTS=em2_t--- em2_---- em2_t-cp em2_t-c- em2_t--p \
em4_t--- em4_---- em4_t-cp em4_t-c- em4_t--p em4_t--- em4_---- em4_t-cp em4_t-c- em4_t--p
P = mloop P = mloop
FILES=deffile $P0 $P1 $P2 $P3 $P4 $P5 $P6 $P7 $P8 $P9 $Pa $Pb $Pc FILES=deffile $P0 $P1 $P2 $P3 $P4 $P5 $P6 $P7 $P8 $P9 $Pa $Pb $Pc
CPP=../../../lib/cpp CPP=$(EMHOME)/lib/cpp
b=../../../lib/em b=$(EMHOME)/lib/em
CFLAGS=-I$(EMHOME)/h -O
FLTRAP= FLTRAP=
all: $(INTS) em all: $(INTS) em
em: em.c em: em.c
$(CC) -o em -I../../../h em.c $(CC) $(CFLAGS) -o em em.c
tmp.s: $(FILES) tmp.s: $(FILES)
cat $(FILES) > tmp.s cat $(FILES) > tmp.s
@ -46,8 +48,8 @@ em4_t--p: tmp.s compile con_float.o
con_float.o: con_float.c con_float.o: con_float.c
case `ack_sys` in m68k2|pmds) \ case `ack_sys` in m68k2|pmds) \
acc -mm68k4 -c -L -O con_float.c;; \ acc -I$(EMHOME)/mach -mm68k4 -c -L -O con_float.c;; \
*) acc -c -L -O con_float.c;; \ *) acc -c -I$(EMHOME)/mach -L -O con_float.c;; \
esac esac
compile: Makefile compile: Makefile

View file

@ -1,26 +1,13 @@
/* unfortunately, we cannot just do an atof and convert result to float /* unfortunately, we cannot just do an atof and convert result to float
is neccessary, because that might result in over/underflow at an if neccessary, because that might result in over/underflow at an
unexpected moment. For the time being, overflow in floating point unexpected moment. For the time being, overflow in floating point
constants goes undetected constants goes undetected
*/ */
con_float(argval, str, res)
#include <con_float>
con_float(str, argval, res)
char *str, *res; char *str, *res;
{ {
double f; float_cst(str, argval, res);
double atof();
int i;
double frexp(), ldexp();
int j;
float fl;
char *p;
f = atof(str);
if (f == 0 || argval == 8) {
p = (char *) &f;
while (argval--) *res++ = *p++;
return;
}
fl = f;
p = (char *) &fl;
while (argval--) *res++ = *p++;
} }

View file

@ -188,9 +188,9 @@ dofloat:
movem.l a0/a1/d0-d2,-(sp) movem.l a0/a1/d0-d2,-(sp)
move.l a3,-(sp) move.l a3,-(sp)
add.l d0,a3 add.l d0,a3
move.l d0,-(sp)
move.l a4,-(sp) move.l a4,-(sp)
move.l a4,flt_label move.l a4,flt_label
move.l d0,-(sp)
bsr _con_float bsr _con_float
lea 12(sp),sp lea 12(sp),sp
clr.l flt_label clr.l flt_label

View file

@ -212,10 +212,14 @@ fif_l: adroff ; move.w (a5),d0
#else #else
checkfsize checkfsize
4: 4:
move.l sp,-(sp)
jsr .fif4 jsr .fif4
add.l #4,sp
jmp (a4) jmp (a4)
8: 8:
move.l sp,-(sp)
jsr .fif8 jsr .fif8
add.l #4,sp
jmp (a4) jmp (a4)
#endif #endif
fif_z: fif_z:
@ -228,20 +232,16 @@ fef_l: adroff ; move.w (a5),d0
#else #else
checkfsize checkfsize
4: 4:
move.l (sp)+,d0 move.l sp,-(sp)
clr.l -(sp) sub.l #4,(sp)
move.l d0,-(sp)
jsr .fef4 jsr .fef4
#ifndef lword #ifndef lword
add.l #2,sp add.l #2,sp
#endif #endif
jmp (a4) jmp (a4)
8: 8:
move.l (sp)+,d0 move.l sp,-(sp)
move.l (sp)+,d1 sub.l #4,(sp)
clr.l -(sp)
move.l d1,-(sp)
move.l d0,-(sp)
jsr .fef8 jsr .fef8
#ifndef lword #ifndef lword
add.l #2,sp add.l #2,sp

View file

@ -344,7 +344,6 @@ lhalt:
clr.l (a1)+ !skip file name clr.l (a1)+ !skip file name
bra 4b !only new line bra 4b !only new line
9: 9:
clr.l -(sp)
.sect .data .sect .data
emlast: .asciz "em_last" emlast: .asciz "em_last"
mess1: .asciz "no line processed yet\n" mess1: .asciz "no line processed yet\n"