adapted for changed floating point package
This commit is contained in:
parent
ed19a3d568
commit
d12053873a
|
@ -1,15 +1,17 @@
|
|||
EMHOME=../../..
|
||||
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
|
||||
P = mloop
|
||||
FILES=deffile $P0 $P1 $P2 $P3 $P4 $P5 $P6 $P7 $P8 $P9 $Pa $Pb $Pc
|
||||
CPP=../../../lib/cpp
|
||||
b=../../../lib/em
|
||||
CPP=$(EMHOME)/lib/cpp
|
||||
b=$(EMHOME)/lib/em
|
||||
CFLAGS=-I$(EMHOME)/h -O
|
||||
FLTRAP=
|
||||
|
||||
all: $(INTS) em
|
||||
|
||||
em: em.c
|
||||
$(CC) -o em -I../../../h em.c
|
||||
$(CC) $(CFLAGS) -o em em.c
|
||||
|
||||
tmp.s: $(FILES)
|
||||
cat $(FILES) > tmp.s
|
||||
|
@ -46,8 +48,8 @@ em4_t--p: tmp.s compile con_float.o
|
|||
|
||||
con_float.o: con_float.c
|
||||
case `ack_sys` in m68k2|pmds) \
|
||||
acc -mm68k4 -c -L -O con_float.c;; \
|
||||
*) acc -c -L -O con_float.c;; \
|
||||
acc -I$(EMHOME)/mach -mm68k4 -c -L -O con_float.c;; \
|
||||
*) acc -c -I$(EMHOME)/mach -L -O con_float.c;; \
|
||||
esac
|
||||
|
||||
compile: Makefile
|
||||
|
|
|
@ -1,26 +1,13 @@
|
|||
/* 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
|
||||
constants goes undetected
|
||||
*/
|
||||
con_float(argval, str, res)
|
||||
|
||||
#include <con_float>
|
||||
|
||||
con_float(str, argval, res)
|
||||
char *str, *res;
|
||||
{
|
||||
double f;
|
||||
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++;
|
||||
float_cst(str, argval, res);
|
||||
}
|
||||
|
|
|
@ -188,9 +188,9 @@ dofloat:
|
|||
movem.l a0/a1/d0-d2,-(sp)
|
||||
move.l a3,-(sp)
|
||||
add.l d0,a3
|
||||
move.l d0,-(sp)
|
||||
move.l a4,-(sp)
|
||||
move.l a4,flt_label
|
||||
move.l d0,-(sp)
|
||||
bsr _con_float
|
||||
lea 12(sp),sp
|
||||
clr.l flt_label
|
||||
|
|
|
@ -212,10 +212,14 @@ fif_l: adroff ; move.w (a5),d0
|
|||
#else
|
||||
checkfsize
|
||||
4:
|
||||
move.l sp,-(sp)
|
||||
jsr .fif4
|
||||
add.l #4,sp
|
||||
jmp (a4)
|
||||
8:
|
||||
move.l sp,-(sp)
|
||||
jsr .fif8
|
||||
add.l #4,sp
|
||||
jmp (a4)
|
||||
#endif
|
||||
fif_z:
|
||||
|
@ -228,20 +232,16 @@ fef_l: adroff ; move.w (a5),d0
|
|||
#else
|
||||
checkfsize
|
||||
4:
|
||||
move.l (sp)+,d0
|
||||
clr.l -(sp)
|
||||
move.l d0,-(sp)
|
||||
move.l sp,-(sp)
|
||||
sub.l #4,(sp)
|
||||
jsr .fef4
|
||||
#ifndef lword
|
||||
add.l #2,sp
|
||||
#endif
|
||||
jmp (a4)
|
||||
8:
|
||||
move.l (sp)+,d0
|
||||
move.l (sp)+,d1
|
||||
clr.l -(sp)
|
||||
move.l d1,-(sp)
|
||||
move.l d0,-(sp)
|
||||
move.l sp,-(sp)
|
||||
sub.l #4,(sp)
|
||||
jsr .fef8
|
||||
#ifndef lword
|
||||
add.l #2,sp
|
||||
|
|
|
@ -344,7 +344,6 @@ lhalt:
|
|||
clr.l (a1)+ !skip file name
|
||||
bra 4b !only new line
|
||||
9:
|
||||
clr.l -(sp)
|
||||
.sect .data
|
||||
emlast: .asciz "em_last"
|
||||
mess1: .asciz "no line processed yet\n"
|
||||
|
|
Loading…
Reference in a new issue