diff --git a/Source/Libs/KLibc/GNUmakefile b/Source/Libs/KLibc/GNUmakefile index 19610d5..2215c38 100644 --- a/Source/Libs/KLibc/GNUmakefile +++ b/Source/Libs/KLibc/GNUmakefile @@ -1,41 +1,51 @@ -RFILES1 = lib.c/cstuff.lib lib.a/main.lib -RFILE_F = fmath/cfloats.lib -RFILE_T = tmath/trans.lib -RFILES2 = imath/math.lib sys.a/syslib.lib +RFILES1 = lib.c/cstuff.l lib.a/main.l +RFILE_F = fmath/cfloats.l +RFILE_T = tmath/trans.l +RFILES2 = imath/math.l sys.a/syslib.l all: libc.a libct.a before-libc: - cd lib.c; $(MAKE) $(MAKEFLAGS) - cd lib.c; $(MAKE) $(MAKEFLAGS) dbg.l - cd lib.a; $(MAKE) $(MAKEFLAGS) - cd fmath; $(MAKE) $(MAKEFLAGS) - cd imath; $(MAKE) $(MAKEFLAGS) - cd sys.a; $(MAKE) $(MAKEFLAGS) -# cd sys.a; $(MAKE) $(MAKEFLAGS) cstart.r + cd lib.c; $(MAKE) -f GNUMakefile $(MAKEFLAGS) + cd lib.c; $(MAKE) -f GNUMakefile $(MAKEFLAGS) dbg.l + cd lib.a; $(MAKE) -f GNUMakefile $(MAKEFLAGS) + cd fmath; $(MAKE) -f GNUMakefile $(MAKEFLAGS) + cd imath; $(MAKE) -f GNUMakefile $(MAKEFLAGS) + cd sys.a; $(MAKE) -f GNUMakefile $(MAKEFLAGS) +# cd sys.a; $(MAKE) -f GNUMakefile $(MAKEFLAGS) cstart.r before-libct: - cd tmath; $(MAKE) $(MAKEFLAGS) + cd tmath; $(MAKE) -f GNUMakefile $(MAKEFLAGS) clean: - cd lib.c; make $(MAKEFLAGS) clean - cd lib.a; make $(MAKEFLAGS) clean - cd fmath; make $(MAKEFLAGS) clean - cd imath; make $(MAKEFLAGS) clean - cd tmath; make $(MAKEFLAGS) clean - cd sys.a; make $(MAKEFLAGS) clean - -del libc.a - -del libct.a + cd lib.c; make -f GNUMakefile $(MAKEFLAGS) clean + cd lib.a; make -f GNUMakefile $(MAKEFLAGS) clean + cd fmath; make -f GNUMakefile $(MAKEFLAGS) clean + cd imath; make -f GNUMakefile $(MAKEFLAGS) clean + cd tmath; make -f GNUMakefile $(MAKEFLAGS) clean + cd sys.a; make -f GNUMakefile $(MAKEFLAGS) clean + -rm libc.a + -rm libct.a libc.a: before-libc $(RFILES1) $(RFILE_F) $(RFILES2) - -del libc.a - lwar --merge libc.a $(RFILES1) $(RFILE_F) $(RFILES2) + -rm libc.a + lwar --create libc.a $(RFILES1) $(RFILE_F) $(RFILES2) libct.a: before-libct $(RFILES1) $(RFILE_T) $(RFILES2) before-libct - -del libct.a - lwar --merge libct.a $(RFILES1) $(RFILE_T) $(RFILES2) + -rm libct.a + lwar --create libct.a $(RFILES1) $(RFILE_T) $(RFILES2) install: clib.l clibt.l copy -rw=$(LIB) clib.l clibt.l +# Package up libraries for testing +cmoc_kreider: libct.a + rm -rf $@/lib $@/defs + mkdir $@/lib + cp libct.a $@/lib + mkdir $@/defs + cp -r ../../../Defs/* $@/defs + cp $(NITROS9DIR)/lib/libnos96809l1.a $@/lib + tar cvzf $@.tgz $@ + .PHONY: dummy before-libc before-libct diff --git a/Source/Libs/KLibc/cmoc.make b/Source/Libs/KLibc/cmoc.make index 9d78c9d..5354036 100644 --- a/Source/Libs/KLibc/cmoc.make +++ b/Source/Libs/KLibc/cmoc.make @@ -2,7 +2,7 @@ MAKEFLAGS+=-rR AFLAGS= --pragma=index0tonone,condundefzero,undefextern,dollarnotlocal,noforwardrefmax -CFLAGS= -I/dd/defs -O2 -nodefaultlibs --function-stack=0 --os9 +CFLAGS= -I../../../../Defs -I../defs -O2 -nodefaultlibs --function-stack=0 --os9 # default top level to current dir TOP?= $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) @@ -14,6 +14,7 @@ O2U?= tr '\015' '\012' #our scripts DCCMOC = $(TOP)/dccmoc.sed RMA2LW = $(TOP)/rma2lw.sed +CC = $(CMOC) # implicit rules to compile with CMOC/lwasm %.s: %.a $(RMA2LW) diff --git a/Source/Libs/KLibc/cmoc_kreider/Makefile b/Source/Libs/KLibc/cmoc_kreider/Makefile new file mode 100644 index 0000000..ec7f481 --- /dev/null +++ b/Source/Libs/KLibc/cmoc_kreider/Makefile @@ -0,0 +1,2 @@ +helloworld: helloworld.c + cmoc --os9 -nodefaultlibs -Idefs -o helloworld helloworld.c -Llib -lct -lnos96809l1 \ No newline at end of file diff --git a/Source/Libs/KLibc/cmoc_kreider/helloworld.c b/Source/Libs/KLibc/cmoc_kreider/helloworld.c new file mode 100644 index 0000000..f00d381 --- /dev/null +++ b/Source/Libs/KLibc/cmoc_kreider/helloworld.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("Hello, CMOC OS-9 World!\n"); + return 0; +} \ No newline at end of file diff --git a/Source/Libs/KLibc/dccmoc.sed b/Source/Libs/KLibc/dccmoc.sed index f749081..878ca09 100644 --- a/Source/Libs/KLibc/dccmoc.sed +++ b/Source/Libs/KLibc/dccmoc.sed @@ -1,2 +1,2 @@ -s:^#[\t ]*asm:asm { /* #asm */: -s:^#[\t ]*endasm:} /* #endasm */: +s:^#[[:space:]]*asm:asm { /* #asm */: +s:^#[[:space:]]*endasm:} /* #endasm */: diff --git a/Source/Libs/KLibc/fmath/GNUMakefile b/Source/Libs/KLibc/fmath/GNUMakefile new file mode 100644 index 0000000..04d4f1f --- /dev/null +++ b/Source/Libs/KLibc/fmath/GNUMakefile @@ -0,0 +1,9 @@ +include ../cmoc.make + +OFILES = cfloats.o + +cfloats.l: $(OFILES) + lwar -c $@ $^ + +clean: + -rm *.l *.o *.list *.map \ No newline at end of file diff --git a/Source/Libs/KLibc/imath/GNUMakefile b/Source/Libs/KLibc/imath/GNUMakefile new file mode 100644 index 0000000..062b5bc --- /dev/null +++ b/Source/Libs/KLibc/imath/GNUMakefile @@ -0,0 +1,11 @@ +include ../cmoc.make + +OFILES = abs.o minmax.o uminmax.o clmul.o cldiv.o cludiv.o claddsub.o clcompare.o \ + clbits.o clnegcompl.o clconvert.o clmove.o clincdec.o clshifts.o \ + clcommon.o ccmult.o ccmod.o ccdiv.o cshifts.o rpterr.o + +math.l: $(OFILES) + lwar -c $@ $^ + +clean: + -rm *.l *.o *.list *.map \ No newline at end of file diff --git a/Source/Libs/KLibc/imath/clcommon.a b/Source/Libs/KLibc/imath/clcommon.a index b9e10cf..6af8c61 100644 --- a/Source/Libs/KLibc/imath/clcommon.a +++ b/Source/Libs/KLibc/imath/clcommon.a @@ -4,6 +4,10 @@ psect clcommon_a,0,0,1,0,0 + vsect +_flacc: rmb 8 floating point & longs accumlator + endsect + _lbexit: tfr cc,a save carry puls x get ret adr stx 2,s overwrite ls word diff --git a/Source/Libs/KLibc/imath/rpterr.a b/Source/Libs/KLibc/imath/rpterr.a index 0dca8d2..52f51d4 100644 --- a/Source/Libs/KLibc/imath/rpterr.a +++ b/Source/Libs/KLibc/imath/rpterr.a @@ -1,11 +1,7 @@ - ifp1 - use /dd/defs/os9defs.a - endc - psect rpterr_a,0,0,0,0,0 -_rpterr: std errno,y +_rpterr: std _errno,y pshs y,b os9 F$ID puls y,b diff --git a/Source/Libs/KLibc/lib.a/GNUmakefile b/Source/Libs/KLibc/lib.a/GNUmakefile index ba3c282..963a27a 100644 --- a/Source/Libs/KLibc/lib.a/GNUmakefile +++ b/Source/Libs/KLibc/lib.a/GNUmakefile @@ -8,7 +8,7 @@ OFILES4 = system.o reverse.o strings.o strcmp.o strlen.o strncpy.o strncat.o \ OFILES5 = stringsu.o strucmp.o strnucmp.o case.o strclr.o memccpy.o memchr.o \ memcmp.o memcpy.o memset.o atol.o atoi.o iob_data.o chcodes.o OFILES6 = sleep.o setjmp.o strass.o realloc.o calloc.o memory.o rand.o -OFILES7 = gs1.o gs2.o ss1.o ss2.o ss3.o +OFILES7 = gs1.o gs2.o ss1.o ss2.o ss3.o MUL168.o OFILES = $(OFILES1) $(OFILES2) $(OFILES3) $(OFILES4) $(OFILES5) \ $(OFILES6) $(OFILES7) @@ -17,10 +17,10 @@ NFILES = atof.o scale.o ldexp.o frexp.o include ../cmoc.make -main.lib: $(OFILES) +main.l: $(OFILES) lwar -c $@ $^ clean: - -rm *.o *.s *.cp + -rm *.o *.s *.cp *.list *.map $(OFILES): GNUmakefile $(DCCMOC) $(RMA2LW) diff --git a/Source/Libs/KLibc/lib.a/datmods.a b/Source/Libs/KLibc/lib.a/datmods.a index 974e194..5d727db 100644 --- a/Source/Libs/KLibc/lib.a/datmods.a +++ b/Source/Libs/KLibc/lib.a/datmods.a @@ -41,9 +41,6 @@ * In all cases, 'datptr' points to the lock byte. * User space starts at 'datptr' + 1 - ifp1 - use /dd/defs/os9defs.a - endc pag psect datmods_a,0,0,1,0,0 diff --git a/Source/Libs/KLibc/lib.a/devtyp.a b/Source/Libs/KLibc/lib.a/devtyp.a index 80fecca..b391646 100644 --- a/Source/Libs/KLibc/lib.a/devtyp.a +++ b/Source/Libs/KLibc/lib.a/devtyp.a @@ -3,10 +3,6 @@ psect devtyp_a,0,0,0,0,0 - ifp1 - use /dd/defs/os9defs.a - endc - isatty: ldd 2,s get pn pshs d bsr devtyp check it out diff --git a/Source/Libs/KLibc/lib.a/errmsg.a b/Source/Libs/KLibc/lib.a/errmsg.a index 9314855..905a57b 100644 --- a/Source/Libs/KLibc/lib.a/errmsg.a +++ b/Source/Libs/KLibc/lib.a/errmsg.a @@ -6,7 +6,7 @@ _errmsg: lbsr _prgname pshs d leau _2,pcr - leax _iob+26,y + leax __iob+26,y pshs x,u lbsr fprintf leas 6,s @@ -15,7 +15,7 @@ _errmsg: ldd 8,s pshs d,x,u ldu 12,s - leax _iob+26,y + leax __iob+26,y pshs x,u lbsr fprintf leas 10,s diff --git a/Source/Libs/KLibc/lib.a/fopen.a b/Source/Libs/KLibc/lib.a/fopen.a index 91d7f25..b296ebe 100644 --- a/Source/Libs/KLibc/lib.a/fopen.a +++ b/Source/Libs/KLibc/lib.a/fopen.a @@ -5,17 +5,17 @@ * input: d = pn * x = *mode -* u = *_iob = fp -* output: _iob allocated of necessary, iniz _flag in any case +* u = *__iob = fp +* output: __iob allocated of necessary, iniz _flag in any case * to _READ or _WRITE or both. Stash path num in _fd. -* setbase will fill in the rest since _iob is static +* setbase will fill in the rest since __iob is static * and all zeros setiob pshs d save path number stu -2,s check for fp bne setiob3 if already have one - leau _iob,y + leau __iob,y lda #_NFILE setiob1 ldb _flag+1,u andb #_READ+_WRITE @@ -24,7 +24,7 @@ setiob1 ldb _flag+1,u deca bne setiob1 ldd #$c8 e$pthful - std errno,y + std _errno,y clra clrb puls x,pc @@ -127,7 +127,7 @@ openit7 ldd ,s openit8 cmpb #'d beq openit10 openit9 ldd #$cb E$BMode -erret std errno,y +erret std _errno,y ldd #-1 bra openit13 diff --git a/Source/Libs/KLibc/lib.a/getc.a b/Source/Libs/KLibc/lib.a/getc.a index 9c0fa4f..0e37762 100644 --- a/Source/Libs/KLibc/lib.a/getc.a +++ b/Source/Libs/KLibc/lib.a/getc.a @@ -74,14 +74,14 @@ fillbuf ldd _flag,u pshs u stack fp lbsr _setbase init iob leas 2,s -fillbu2 leax _iob,y +fillbu2 leax __iob,y pshs x cmpu ,s++ bne fillbu3 if not stdin ldb _flag+1,u andb #_SCF beq fillbu3 if rbf - leax _iob+13,y + leax __iob+13,y pshs x lbsr fflush flush std out if scf on std in leas 2,s diff --git a/Source/Libs/KLibc/lib.a/gets.a b/Source/Libs/KLibc/lib.a/gets.a index 26c516a..0ad5468 100644 --- a/Source/Libs/KLibc/lib.a/gets.a +++ b/Source/Libs/KLibc/lib.a/gets.a @@ -14,7 +14,7 @@ gets: pshs u bra gets2 gets1 stb ,u+ -gets2 leax _iob,y +gets2 leax __iob,y pshs x lbsr getc leas 2,s diff --git a/Source/Libs/KLibc/lib.a/gs1.a b/Source/Libs/KLibc/lib.a/gs1.a index 0b667e1..f4078e2 100644 --- a/Source/Libs/KLibc/lib.a/gs1.a +++ b/Source/Libs/KLibc/lib.a/gs1.a @@ -3,10 +3,6 @@ * remember to declare the returns as long!!! * - ifp1 - use /dd/defs/os9defs.a - endc - psect gs1,0,0,1,0,0 _gs_size: @@ -22,7 +18,7 @@ common1 pshs U ldx #-1 return -1 tfr X,U sign extend clra - std errno,Y only an error sometimes + std _errno,Y only an error sometimes common2 stx _flacc,Y top half leax _flacc,Y need a pointer for lmove stu 2,X bottom half diff --git a/Source/Libs/KLibc/lib.a/gs2.a b/Source/Libs/KLibc/lib.a/gs2.a index 2de04e7..5c523c1 100644 --- a/Source/Libs/KLibc/lib.a/gs2.a +++ b/Source/Libs/KLibc/lib.a/gs2.a @@ -2,10 +2,6 @@ * handler for _gs_rdy, _gs_opt, _gs_opt, _gs_devnm * - ifp1 - use /dd/defs/os9defs.a - endc - psect gs2,0,0,1,0,0 _gs_rdy: diff --git a/Source/Libs/KLibc/lib.a/iob_data.a b/Source/Libs/KLibc/lib.a/iob_data.a index c5628d6..121d461 100644 --- a/Source/Libs/KLibc/lib.a/iob_data.a +++ b/Source/Libs/KLibc/lib.a/iob_data.a @@ -1,10 +1,13 @@ - psect iob_data_a,0,0,1,0,0 - ifp1 use ../defs/stdio.a endc - vsect -_iob: fdb 0 _ptr + +__iob EXPORT + + SECTION rwdata + +__iob EQU * + fdb 0 _ptr fdb 0 _base fdb 0 _end fdb _READ _flag diff --git a/Source/Libs/KLibc/lib.a/printf.a b/Source/Libs/KLibc/lib.a/printf.a index f644bdf..f52c7a8 100644 --- a/Source/Libs/KLibc/lib.a/printf.a +++ b/Source/Libs/KLibc/lib.a/printf.a @@ -18,7 +18,7 @@ dectbl fdb 10000,1000,100,10 printf: pshs u leau 6,s *expr - leax _iob+13,y + leax __iob+13,y ldd 4,s *format bra printf1 @@ -369,7 +369,7 @@ blanks ldd fldsiz+6,s getdec clr ,-s clr ,-s leau -1,u back up to char - leax _chcodes,y + leax __chcodes,y bra getdec2 getdec1 ldd ,s diff --git a/Source/Libs/KLibc/lib.a/putc.a b/Source/Libs/KLibc/lib.a/putc.a index ef3959a..8509592 100644 --- a/Source/Libs/KLibc/lib.a/putc.a +++ b/Source/Libs/KLibc/lib.a/putc.a @@ -107,7 +107,7 @@ putw: pshs u * closes all 16 files _tidyup: pshs u - leax _iob,y point to array beg + leax __iob,y point to array beg ldb #_NFILE set up loop count pshs b diff --git a/Source/Libs/KLibc/lib.a/puts.a b/Source/Libs/KLibc/lib.a/puts.a index eac0dc2..51d85dc 100644 --- a/Source/Libs/KLibc/lib.a/puts.a +++ b/Source/Libs/KLibc/lib.a/puts.a @@ -12,7 +12,7 @@ * -> *s (or c) puts: pshs u - leax _iob+13,y stdout fp + leax __iob+13,y stdout fp ldd 4,s *s pshs d,x stack *s,fp bsr fputs diff --git a/Source/Libs/KLibc/lib.a/sleep.a b/Source/Libs/KLibc/lib.a/sleep.a index efdb2e8..759f99c 100644 --- a/Source/Libs/KLibc/lib.a/sleep.a +++ b/Source/Libs/KLibc/lib.a/sleep.a @@ -11,9 +11,6 @@ f$tps set $25 *F$NMLink set $21 - ifp1 - use /dd/defs/os9defs.a - endc vsect _tps: rmb 2 diff --git a/Source/Libs/KLibc/lib.a/ss1.a b/Source/Libs/KLibc/lib.a/ss1.a index e5cdaa0..048ec10 100644 --- a/Source/Libs/KLibc/lib.a/ss1.a +++ b/Source/Libs/KLibc/lib.a/ss1.a @@ -3,10 +3,6 @@ * _ss_pfd, _ss_ssig, _ss_tiks * - ifp1 - use /dd/defs/os9defs.a - endc - psect ss1,0,0,1,0,0 _ss_rel: diff --git a/Source/Libs/KLibc/lib.a/ss2.a b/Source/Libs/KLibc/lib.a/ss2.a index 9b99f26..4b115a2 100644 --- a/Source/Libs/KLibc/lib.a/ss2.a +++ b/Source/Libs/KLibc/lib.a/ss2.a @@ -2,11 +2,6 @@ * handler for _ss_attr, _ss_size, _ss_lock * - ifp1 - use /dd/defs/os9defs.a - endc - - psect ss2,0,0,1,0,0 _ss_lock: pshs U diff --git a/Source/Libs/KLibc/lib.a/ss3.a b/Source/Libs/KLibc/lib.a/ss3.a index 1f04db1..3cb4939 100644 --- a/Source/Libs/KLibc/lib.a/ss3.a +++ b/Source/Libs/KLibc/lib.a/ss3.a @@ -2,11 +2,6 @@ * handler for _ss_wtrk * - ifp1 - use /dd/defs/os9defs.a - endc - - psect ss3,0,0,1,0,0 _ss_wtrk: pshs Y,U diff --git a/Source/Libs/KLibc/lib.a/stat.a b/Source/Libs/KLibc/lib.a/stat.a index 005860a..e33919d 100644 --- a/Source/Libs/KLibc/lib.a/stat.a +++ b/Source/Libs/KLibc/lib.a/stat.a @@ -76,7 +76,7 @@ cmpnam lda ,x clenup leas 33,s done w/ scratch area puls y,u,pc error clra - std errno error code + std _errno error code ldd #-1 error flag bra clenup device fcs "@" diff --git a/Source/Libs/KLibc/lib.c/GNUmakefile b/Source/Libs/KLibc/lib.c/GNUmakefile index 7c908d4..2aa6105 100644 --- a/Source/Libs/KLibc/lib.c/GNUmakefile +++ b/Source/Libs/KLibc/lib.c/GNUmakefile @@ -1,17 +1,19 @@ OFILES = prof.o pwent.o getopt.o adump.o defdrive.o popen.o \ - asctime.o ctime.o localtime.o mktime.o omktime.o u2otime.o isleap.o timevars.o + asctime.o ctime.o localtime.o mktime.o isleap.o timevars.o -DFILES = dbg.r getsp.r +MISSING = omktime.o u2otime.o + +DFILES = dbg.o getsp.o include ../cmoc.make -cstuff.lib: $(OFILES) +cstuff.l: $(OFILES) lwar -c $@ $^ -dbg.lib: $(DFILES) /dd/defs/dbg.h +dbg.l: $(DFILES) ../defs/dbg.h lwar -c $@ $^ clean: - -rm *.o *.s *.cp + -rm *.o *.s *.cp *.l $(OFILES): GNUmakefile $(DCCMOC) $(RMA2LW) diff --git a/Source/Libs/KLibc/lib.c/asctime.c b/Source/Libs/KLibc/lib.c/asctime.c index 863b2f4..deaf279 100644 --- a/Source/Libs/KLibc/lib.c/asctime.c +++ b/Source/Libs/KLibc/lib.c/asctime.c @@ -61,7 +61,7 @@ static char *months[] = { char * asctime(tmp) -struct tm *tmp; +const struct tm *tmp; { #ifdef ASMOPT #asm diff --git a/Source/Libs/KLibc/lib.c/ctime.c b/Source/Libs/KLibc/lib.c/ctime.c index 1a5e211..a47e80f 100644 --- a/Source/Libs/KLibc/lib.c/ctime.c +++ b/Source/Libs/KLibc/lib.c/ctime.c @@ -15,7 +15,7 @@ #else char * ctime(ticks) -time_t *ticks; +const time_t *ticks; { return (asctime(localtime(ticks))); } diff --git a/Source/Libs/KLibc/lib.c/dbg.c b/Source/Libs/KLibc/lib.c/dbg.c index b98e09e..98813bb 100644 --- a/Source/Libs/KLibc/lib.c/dbg.c +++ b/Source/Libs/KLibc/lib.c/dbg.c @@ -124,9 +124,9 @@ _dumprof(){} /*page*/ char *h1 = -{"addr 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 2 4 6 8 a c e \n"}; +"addr 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 2 4 6 8 a c e \n"; char *h2 = -{"---- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ----------------\n"}; +"---- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ----------------\n"; /* ** full screen display of 256 bytes from the prom @@ -252,7 +252,7 @@ char *s; ** converts integer 'n' into 'd' digits in string 's'. */ -static itoh(n, d, s) +static char *itoh(n, d, s) int n, d; char *s; { @@ -297,7 +297,7 @@ char *s; } -static skipspace(s) +static char *skipspace(s) char *s; { while (*s == ' ') @@ -311,7 +311,7 @@ static showsp() char *p; strcpy(p = line, uspmsg); - p = itoh(sp, 4, p + strlen(p)); + p = itoh((int)sp, 4, p + strlen(p)); strcpy(p, "\n"); writeln(2, line, strlen(line)); } diff --git a/Source/Libs/KLibc/lib.c/defdrive.c b/Source/Libs/KLibc/lib.c/defdrive.c index 745db42..9e45f25 100644 --- a/Source/Libs/KLibc/lib.c/defdrive.c +++ b/Source/Libs/KLibc/lib.c/defdrive.c @@ -1,8 +1,9 @@ +#include #include static char d[12]; -getdrive() +static char *getdrive() { char *np; char c; @@ -10,7 +11,7 @@ getdrive() struct mod_config *mp; register char *p; - if ((mp = modlink("Init", 0x0c, 0)) != -1) + if ((mp = (struct mod_config *)modlink("Init", 0x0c, 0)) != -1) { np = (char *)mp + mp->m_sysdrive; p = d; @@ -18,7 +19,7 @@ getdrive() *p++ = c; *p++ = (c & 0x7f); *p = 0; - munlink(mp); + munlink((struct mod_com *)mp); return (d); } return (0); diff --git a/Source/Libs/KLibc/lib.c/popen.c b/Source/Libs/KLibc/lib.c/popen.c index 4d85940..ed3a3d6 100644 --- a/Source/Libs/KLibc/lib.c/popen.c +++ b/Source/Libs/KLibc/lib.c/popen.c @@ -1,4 +1,4 @@ -/*#define MAIN /* Only use when testing routines */ +/*#define MAIN */ /* Only use when testing routines */ #ifdef MAIN #define DEBUG @@ -33,7 +33,7 @@ static int _pid[PIPEMAX]; FILE *popen(command, type) - char *command, *type; + const char *command, *type; { register char *p = command; char *parameter; diff --git a/Source/Libs/KLibc/lib.c/prof.c b/Source/Libs/KLibc/lib.c/prof.c index 47cc47d..386e027 100644 --- a/Source/Libs/KLibc/lib.c/prof.c +++ b/Source/Libs/KLibc/lib.c/prof.c @@ -7,6 +7,7 @@ */ #include +#include #define MAXFUNC 63 /* maximum number of unique functions */ diff --git a/Source/Libs/KLibc/rma2lw.sed b/Source/Libs/KLibc/rma2lw.sed index 6000949..0ceb108 100644 --- a/Source/Libs/KLibc/rma2lw.sed +++ b/Source/Libs/KLibc/rma2lw.sed @@ -1,13 +1,16 @@ # translate name: into name EXPORT followed by name #s/^\([a-zA-Z_][a-zA-Z0-9$_]\+\):/\1 EXPORT\n\1/ -s/^\([a-zA-Z_][a-zA-Z0-9$_]\+\):/_\1 EXPORT\n\1 EXPORT\n_\1\n\1/ +s/^\([a-zA-Z_][a-zA-Z0-9$_]\+\)/_\1 EXPORT\n\1 EXPORT\n_\1\n\1/ +# for macOS: +s/^\([a-zA-Z_][a-zA-Z0-9$_]*\):/\1 EXPORT\ +_\1 EXPORT\n_\1\n\1/ # translate sections -s/^[\t ]\+psect.*/ SECTION code/ -s/^[\t ]\+vsect.*/ SECTION bss/ -s/^[\t ]\+csect[\t ]\+\(.*\)/ SECTION _constant\n org \1/ -s/^[\t ]\+csect/ SECTION _constant/ -s/^[\t ]\+endsect.*/ ENDSECT\n SECTION code/ -s/^[\t ]\+ends.*/ ENDSECT\n SECTION code/ +s/^\([[:space:]]*\)psect.*/ SECTION code/ +s/^\([[:space:]]*\)vsect.*/ SECTION bss/ +s/^\([[:space:]]*\)csect[[[:space:]]]\+\(.*\)/ SECTION _constant\n org \1/ +s/^\([[:space:]]*\)csect/ SECTION _constant/ +s/^\([[:space:]]*\)endsect.*/ ENDSECT\n SECTION code/ +s/^\([[:space:]]*\)ends.*/ ENDSECT\n SECTION code/ # convert fail / warn directives -s/^[\t ]\+fail\(.*\)/ ERROR\1/ -s/^[\t ]\+warn\(.*\)/ WARNING\1/ +s/^\([[:space:]]*\)fail\(.*\)/ ERROR\1/ +s/^\([[:space:]]*\)warn\(.*\)/ WARNING\1/ \ No newline at end of file diff --git a/Source/Libs/KLibc/sys.a/GNUMakefile b/Source/Libs/KLibc/sys.a/GNUMakefile new file mode 100644 index 0000000..8e3c83a --- /dev/null +++ b/Source/Libs/KLibc/sys.a/GNUMakefile @@ -0,0 +1,22 @@ +include ../cmoc.make + +OFILES = abort.o signal.o chown.o chmod.o stat.o access.o create.o \ + open.o read.o write.o lseek.o misc.o mod.o dir.o brk.o ibrk.o sbrk.o mem.o \ + time.o process.o id.o intercept.o syscall.o syscommon.o \ + profdummy.o tidyup.o cfinish.o cfinish2.o + +syslib.l: $(OFILES) + lwar -c $@ $^ + +#cstart.o: cstart.a +# $(LWLINK) -o=rels/cstart.o cstart.a +# copy -rw=/DD/Lib rels/cstart.o + +#root.o: root.a +# $(LWLINK) -o=rels/root.o root.a +# copy -rw=/DD/Lib rels/root.o + +clean: + -rm *.l *.o *.list *.map + +$(OFILES): GNUmakefile $(DCCMOC) $(RMA2LW) diff --git a/Source/Libs/KLibc/sys.a/abort.a b/Source/Libs/KLibc/sys.a/abort.a index cf9df7d..cb70f22 100644 --- a/Source/Libs/KLibc/sys.a/abort.a +++ b/Source/Libs/KLibc/sys.a/abort.a @@ -1,5 +1,3 @@ - use /dd/defs/os9defs.a - psect abort,0,0,1,0,0 abort: pshs d,x,y,u leax core,pcr @@ -11,7 +9,7 @@ abort: pshs d,x,y,u cmpd #-1 bne abort10 - ldd errno,y + ldd _errno,y os9 F$Exit abort10 leas 4,s diff --git a/Source/Libs/KLibc/sys.a/access.a b/Source/Libs/KLibc/sys.a/access.a index b01b8af..8d15e13 100644 --- a/Source/Libs/KLibc/sys.a/access.a +++ b/Source/Libs/KLibc/sys.a/access.a @@ -4,9 +4,6 @@ pmode equ $0b r/w for owner, r for others - ifp1 - use /dd/defs/os9defs.a - endc psect access_a,0,0,2,0,0 * access(name,mode) diff --git a/Source/Libs/KLibc/sys.a/brk.a b/Source/Libs/KLibc/sys.a/brk.a index 88148bc..2fbd511 100644 --- a/Source/Libs/KLibc/sys.a/brk.a +++ b/Source/Libs/KLibc/sys.a/brk.a @@ -1,7 +1,6 @@ * * Adjust memory allocation * - use /dd/defs/os9defs.a psect brk,0,0,6,0,0 * brk(pnt) set memory size to pnt, allocating or deallocating diff --git a/Source/Libs/KLibc/sys.a/cfinish.a b/Source/Libs/KLibc/sys.a/cfinish.a index 81f7b87..ddccd4d 100644 --- a/Source/Libs/KLibc/sys.a/cfinish.a +++ b/Source/Libs/KLibc/sys.a/cfinish.a @@ -1,5 +1,3 @@ - use /dd/defs/os9defs.a - psect cfinish_a,0,0,1,0,0 * normal exit - buffers flushed if there are any exit: lbsr _dumprof profile dump (if necessary) @@ -8,6 +6,6 @@ exit: lbsr _dumprof profile dump (if necessary) * abnormal exit - no buffer flushing * the argument to either exit entry is taken to be the * F$EXIT status -_exit: ldd 2,s get the exit status +aexit: ldd 2,s get the exit status os9 F$Exit and bye-bye! endsect diff --git a/Source/Libs/KLibc/sys.a/cfinish2.a b/Source/Libs/KLibc/sys.a/cfinish2.a new file mode 100644 index 0000000..bd1fc91 --- /dev/null +++ b/Source/Libs/KLibc/sys.a/cfinish2.a @@ -0,0 +1,7 @@ + psect cfinish2_a,0,0,1,0,0 +* abnormal exit - no buffer flushing +* the argument to either exit entry is taken to be the +* F$EXIT status +_exit: ldd 2,s get the exit status + os9 F$Exit and bye-bye! + endsect diff --git a/Source/Libs/KLibc/sys.a/chmod.a b/Source/Libs/KLibc/sys.a/chmod.a index 7826bf3..30303a9 100644 --- a/Source/Libs/KLibc/sys.a/chmod.a +++ b/Source/Libs/KLibc/sys.a/chmod.a @@ -1,6 +1,3 @@ - ifp1 - use /dd/defs/os9defs.a - endc *Carry equ %00000001 *Write. equ 2 write access *FD.Att equ 0 FD offset to attr diff --git a/Source/Libs/KLibc/sys.a/chown.a b/Source/Libs/KLibc/sys.a/chown.a index 019923e..e67e570 100644 --- a/Source/Libs/KLibc/sys.a/chown.a +++ b/Source/Libs/KLibc/sys.a/chown.a @@ -1,6 +1,3 @@ - ifp1 - use /dd/defs/os9defs.a - endc *Carry equ %00000001 *Write. equ 2 write access *FD.Att equ 0 FD offset to attr diff --git a/Source/Libs/KLibc/sys.a/create.a b/Source/Libs/KLibc/sys.a/create.a index 3f617ed..3d95799 100644 --- a/Source/Libs/KLibc/sys.a/create.a +++ b/Source/Libs/KLibc/sys.a/create.a @@ -1,9 +1,6 @@ * file creation calls * pmode equ $0b r/w for owner, r for others - ifp1 - use /dd/defs/os9defs.a - endc psect create_a,0,0,1,0,0 * creat(fname,mode) creat: ldx 2,s diff --git a/Source/Libs/KLibc/sys.a/css.a b/Source/Libs/KLibc/sys.a/css.a index 6f1b5e9..149006c 100644 --- a/Source/Libs/KLibc/sys.a/css.a +++ b/Source/Libs/KLibc/sys.a/css.a @@ -1,7 +1,3 @@ - ifp1 - use ..../defs/os9defs.a - endc - pushzero macro clr ,-s clear a byte on stack endm diff --git a/Source/Libs/KLibc/sys.a/cstart.a b/Source/Libs/KLibc/sys.a/cstart.a index b9821b9..52ea380 100644 --- a/Source/Libs/KLibc/sys.a/cstart.a +++ b/Source/Libs/KLibc/sys.a/cstart.a @@ -1,7 +1,3 @@ - ifp1 - use /dd/defs/os9defs.a - endc - * 09-04-85 CK add stack space for one file. * branch short on clrbss to ensure clear * 04-09-86 CK fix memory wrap bug in stkcheck diff --git a/Source/Libs/KLibc/sys.a/dir.a b/Source/Libs/KLibc/sys.a/dir.a index b016a91..59a5d75 100644 --- a/Source/Libs/KLibc/sys.a/dir.a +++ b/Source/Libs/KLibc/sys.a/dir.a @@ -2,7 +2,6 @@ * Directory change system calls * - use /dd/defs/os9defs.a psect dir_a,0,0,1,0,0 * chdir(dirname) diff --git a/Source/Libs/KLibc/sys.a/ibrk.a b/Source/Libs/KLibc/sys.a/ibrk.a index e544b36..c3f7771 100644 --- a/Source/Libs/KLibc/sys.a/ibrk.a +++ b/Source/Libs/KLibc/sys.a/ibrk.a @@ -1,17 +1,16 @@ * * Make pointers within initial memory allocation * - use /dd/defs/os9defs.a psect ibrk,0,0,6,0,0 * ibrk(size) get memory within data allocation ibrk: ldd 2,s get the size required - addd _mtop,y add in the current top + addd __mtop,y add in the current top bcs ibrk20 if it wraps round - error - cmpd _stbot,y overlap stack? + cmpd __stbot,y overlap stack? bhs ibrk20 yes - error pshs d no - save top - ldx _mtop,y reset to bottom + ldx __mtop,y reset to bottom clra sbloop cmpx 0,s reached the end? @@ -19,9 +18,9 @@ sbloop cmpx 0,s reached the end? sta ,x+ no - clear and bump bra sbloop -ibrk10 ldd _mtop,y return value +ibrk10 ldd __mtop,y return value puls x restore new top - stx _mtop,y and save for next time + stx __mtop,y and save for next time rts ibrk20 ldb #$ED E$NoRAM memory full diff --git a/Source/Libs/KLibc/sys.a/id.a b/Source/Libs/KLibc/sys.a/id.a index e9b7d03..7027176 100644 --- a/Source/Libs/KLibc/sys.a/id.a +++ b/Source/Libs/KLibc/sys.a/id.a @@ -1,9 +1,6 @@ * * Identity system calls * - ifp1 - use /dd/defs/os9defs.a - endc * * Equates for level one pointers (sorry!) D.Proc equ $4b diff --git a/Source/Libs/KLibc/sys.a/intercept.a b/Source/Libs/KLibc/sys.a/intercept.a index 2b54ef6..92c3ae9 100644 --- a/Source/Libs/KLibc/sys.a/intercept.a +++ b/Source/Libs/KLibc/sys.a/intercept.a @@ -5,7 +5,6 @@ * an 'entry name clash' error in the loader if an attempt is made * to use both. - use /dd/defs/os9defs.a psect intercept_a,0,0,1,0,0 vsect diff --git a/Source/Libs/KLibc/sys.a/lseek.a b/Source/Libs/KLibc/sys.a/lseek.a index 253815a..16a7241 100644 --- a/Source/Libs/KLibc/sys.a/lseek.a +++ b/Source/Libs/KLibc/sys.a/lseek.a @@ -2,7 +2,6 @@ * File i/o system calls * - use /dd/defs/os9defs.a psect lseek_a,0,0,3,0,0 * lseek(fd,offset,type) @@ -21,7 +20,7 @@ lseek10 cmpd #1 from here? ldb #E$Seek lserr clra - std errno,y + std _errno,y ldd #-1 leax _flacc,y std 0,x diff --git a/Source/Libs/KLibc/sys.a/mem.a b/Source/Libs/KLibc/sys.a/mem.a index 0a4872f..fba4157 100644 --- a/Source/Libs/KLibc/sys.a/mem.a +++ b/Source/Libs/KLibc/sys.a/mem.a @@ -1,7 +1,6 @@ * * Variable common to brk() and sbrk() * - use /dd/defs/os9defs.a psect mem_a,0,0,6,0,0 vsect diff --git a/Source/Libs/KLibc/sys.a/misc.a b/Source/Libs/KLibc/sys.a/misc.a index 036ac67..db6ae4a 100644 --- a/Source/Libs/KLibc/sys.a/misc.a +++ b/Source/Libs/KLibc/sys.a/misc.a @@ -2,7 +2,6 @@ * Miscellaneous system calls * - use /dd/defs/os9defs.a psect misc_a,0,0,1,0,0 * lock(flag) diff --git a/Source/Libs/KLibc/sys.a/mod.a b/Source/Libs/KLibc/sys.a/mod.a index 5911e64..e85c203 100644 --- a/Source/Libs/KLibc/sys.a/mod.a +++ b/Source/Libs/KLibc/sys.a/mod.a @@ -3,12 +3,12 @@ * shiftla macro - rept \1 lsla - endr + lsla + lsla + lsla endm - use /dd/defs/os9defs.a psect mod_a,0,0,1,0,0 * modlink(modname,type,language) diff --git a/Source/Libs/KLibc/sys.a/open.a b/Source/Libs/KLibc/sys.a/open.a index f35d7a6..8d38f8b 100644 --- a/Source/Libs/KLibc/sys.a/open.a +++ b/Source/Libs/KLibc/sys.a/open.a @@ -4,9 +4,6 @@ pmode equ $0b r/w for owner, r for others - ifp1 - use /dd/defs/os9defs.a - endc psect open_a,0,0,2,0,0 * open(name,mode) diff --git a/Source/Libs/KLibc/sys.a/process.a b/Source/Libs/KLibc/sys.a/process.a index 9488dc8..aa0cffb 100644 --- a/Source/Libs/KLibc/sys.a/process.a +++ b/Source/Libs/KLibc/sys.a/process.a @@ -1,7 +1,6 @@ * * Process system calls * - use /dd/defs/os9defs.a psect process_a,0,0,2,0,0 * kill(pid,signal) diff --git a/Source/Libs/KLibc/sys.a/read.a b/Source/Libs/KLibc/sys.a/read.a index 07f88dc..2f8ff29 100644 --- a/Source/Libs/KLibc/sys.a/read.a +++ b/Source/Libs/KLibc/sys.a/read.a @@ -2,7 +2,6 @@ * File i/o system calls * - use /dd/defs/os9defs.a psect read_a,0,0,2,0,0 * read(fd,buf,count) diff --git a/Source/Libs/KLibc/sys.a/sbrk.a b/Source/Libs/KLibc/sys.a/sbrk.a index 017586f..4a2588a 100644 --- a/Source/Libs/KLibc/sys.a/sbrk.a +++ b/Source/Libs/KLibc/sys.a/sbrk.a @@ -1,11 +1,10 @@ * * Request memory from OS * - use /dd/defs/os9defs.a psect sbrk,0,0,6,0,0 * sbrk(size) get memory from system -sbrk: ldd memend,y get hi bound +sbrk: ldd __memend,y get hi bound pshs d save it ldd 4,s get the size required cmpd _spare,y any spare left? @@ -25,7 +24,7 @@ sbrk: ldd memend,y get hi bound ldb #E$MemFul out of memory lbra _os9err return error -sbrk10 std memend,y save new memory address +sbrk10 std __memend,y save new memory address addd _spare,y add in spare bytes subd 0,s less old base std _spare,y is new spare value @@ -36,14 +35,14 @@ sbrk20 leas 2,s junk scratch pshs d subd 4,s less size std _spare,y updated value - ldd memend,y get hi bound + ldd __memend,y get hi bound subd ,s++ base of free memory pshs d save clra ldx 0,s sbrk30 sta ,x+ clear out the new memory - cmpx memend,y + cmpx __memend,y blo sbrk30 puls d,pc diff --git a/Source/Libs/KLibc/sys.a/signal.a b/Source/Libs/KLibc/sys.a/signal.a index 1fd9ae5..54def9c 100644 --- a/Source/Libs/KLibc/sys.a/signal.a +++ b/Source/Libs/KLibc/sys.a/signal.a @@ -1,4 +1,3 @@ - use /dd/defs/os9defs.a * signal system call * * The main objective here is to maintain a table of diff --git a/Source/Libs/KLibc/sys.a/stat.a b/Source/Libs/KLibc/sys.a/stat.a index f5cf1ae..b0eafdb 100644 --- a/Source/Libs/KLibc/sys.a/stat.a +++ b/Source/Libs/KLibc/sys.a/stat.a @@ -5,9 +5,6 @@ * 05-13-87 return char cnt on ss.ready * 01-09-85 added more calls - ifp1 - use /dd/defs/os9defs.a - endc psect stat_a,0,0,3,0,0 * getstat(code,path[,buffer][,count]) diff --git a/Source/Libs/KLibc/sys.a/syscommon.a b/Source/Libs/KLibc/sys.a/syscommon.a index f6df549..64e0e71 100644 --- a/Source/Libs/KLibc/sys.a/syscommon.a +++ b/Source/Libs/KLibc/sys.a/syscommon.a @@ -1,6 +1,6 @@ psect syscommon_a,0,0,1,0,0 _os9err: clra - std errno,y indicate in system error indicator + std _errno,y indicate in system error indicator ldd #-1 return error status rts diff --git a/Source/Libs/KLibc/sys.a/time.a b/Source/Libs/KLibc/sys.a/time.a index 8dc8c15..619cd23 100644 --- a/Source/Libs/KLibc/sys.a/time.a +++ b/Source/Libs/KLibc/sys.a/time.a @@ -3,7 +3,6 @@ * - use /dd/defs/os9defs.a psect time_a,0,0,1,0,0 * setime(buffer) diff --git a/Source/Libs/KLibc/sys.a/write.a b/Source/Libs/KLibc/sys.a/write.a index 4663b33..9132fd2 100644 --- a/Source/Libs/KLibc/sys.a/write.a +++ b/Source/Libs/KLibc/sys.a/write.a @@ -2,7 +2,6 @@ * File i/o system calls * - use /dd/defs/os9defs.a psect write_a,0,0,3,0,0 * write(fd,buf,count) diff --git a/Source/Libs/KLibc/tmath/GNUMakefile b/Source/Libs/KLibc/tmath/GNUMakefile new file mode 100644 index 0000000..bff1913 --- /dev/null +++ b/Source/Libs/KLibc/tmath/GNUMakefile @@ -0,0 +1,11 @@ +include ../cmoc.make + +OFILES = trig.o hyp.o log.o trnser.o dsqrt.o dinc.o \ + dtype.o dmul.o ddiv.o daddsub.o dser.o dcmpr.o + +trans.l: $(OFILES) + lwar -c $@ $^ + +clean: + -rm temp* trans.l $(OFILES) *.list *.map + diff --git a/Source/Libs/KLibc/tmath/daddsub.a b/Source/Libs/KLibc/tmath/daddsub.a index 500c4f1..d3cccbd 100644 --- a/Source/Libs/KLibc/tmath/daddsub.a +++ b/Source/Libs/KLibc/tmath/daddsub.a @@ -1,10 +1,5 @@ psect daddsub_a,0,0,0,0,0 - ifp1 - use mdefs.a - endc - - * dneg negate double x points to * on return _dneg: ldb #7 double byte index diff --git a/Source/Libs/KLibc/tmath/ddiv.a b/Source/Libs/KLibc/tmath/ddiv.a index 07eab90..d21814a 100644 --- a/Source/Libs/KLibc/tmath/ddiv.a +++ b/Source/Libs/KLibc/tmath/ddiv.a @@ -1,9 +1,5 @@ psect ddiv_a,0,0,0,0,0 - ifp1 - use mdefs.a - endc - * divide double on stack by one X-> _ddiv: lbsr _aprep diff --git a/Source/Libs/KLibc/tmath/dinc.a b/Source/Libs/KLibc/tmath/dinc.a index 35fae2b..536cef0 100644 --- a/Source/Libs/KLibc/tmath/dinc.a +++ b/Source/Libs/KLibc/tmath/dinc.a @@ -1,9 +1,5 @@ psect dinc_a,0,0,0,0,0 - ifp1 - use mdefs.a - endc - * increment or decrement double pointed to by x _dinc: pshs x,y diff --git a/Source/Libs/KLibc/tmath/dmul.a b/Source/Libs/KLibc/tmath/dmul.a index 0ac4c9e..8fb9b7d 100644 --- a/Source/Libs/KLibc/tmath/dmul.a +++ b/Source/Libs/KLibc/tmath/dmul.a @@ -1,9 +1,5 @@ psect dmul_a,0,0,0,0,0 - ifp1 - use mdefs.a - endc - * multiply number on stack by one X-> _dmul: lbsr _aprep diff --git a/Source/Libs/KLibc/tmath/dser.a b/Source/Libs/KLibc/tmath/dser.a index 5c913d3..1e926ea 100644 --- a/Source/Libs/KLibc/tmath/dser.a +++ b/Source/Libs/KLibc/tmath/dser.a @@ -1,12 +1,11 @@ psect dser_a,0,0,0,0,0 - ifp1 - use mdefs.a - endc + use mdefs.a + vsect _deg: rmb 1 rmb WBC*8 -_mthtop: rmb 0 +_mthtop: equ . endsect * aprep preps x,s for +,-,*,/ operators @@ -119,7 +118,7 @@ _errz pshs b save error code clra cmpb #43 underflow? lbne _rpterr - std errno,y + std _errno,y rts _mzer diff --git a/Source/Libs/KLibc/tmath/dsqrt.a b/Source/Libs/KLibc/tmath/dsqrt.a index 4aa2201..5bf596f 100644 --- a/Source/Libs/KLibc/tmath/dsqrt.a +++ b/Source/Libs/KLibc/tmath/dsqrt.a @@ -1,7 +1,5 @@ psect dsqrt_a,0,0,0,0,0 - use mdefs.a - trunc: lbsr _dprep bsr _dints lbra _mret diff --git a/Source/Libs/KLibc/tmath/hyp.a b/Source/Libs/KLibc/tmath/hyp.a index 741e4e3..6a112a8 100644 --- a/Source/Libs/KLibc/tmath/hyp.a +++ b/Source/Libs/KLibc/tmath/hyp.a @@ -1,10 +1,5 @@ psect hyp_a,0,0,0,0,0 - ifp1 - use mdefs.a - endc - - sinh: lbsr _dprep lbsr SINH diff --git a/Source/Libs/KLibc/tmath/log.a b/Source/Libs/KLibc/tmath/log.a index feee033..68b0f22 100644 --- a/Source/Libs/KLibc/tmath/log.a +++ b/Source/Libs/KLibc/tmath/log.a @@ -1,9 +1,5 @@ psect log_a,0,0,0,0,0 - ifp1 - use mdefs.a - endc - pow: lbsr _bdprep lbsr YTOX @@ -11,7 +7,7 @@ pow: exp: lbsr _dprep - lbsr _exp + lbsr llexp lbra _mret exp10: @@ -27,7 +23,7 @@ log10: log: lbsr _dprep - lbsr _log + lbsr lllog lbra _mret pag @@ -35,11 +31,11 @@ log: * 2 LEVELS ON MATH STACK YTOX lbsr _dexg - lbsr _log + lbsr lllog bcs YTOX2 lbsr _dmuls bcs YTOX1 - bsr _exp + bsr llexp YTOX1 rts YTOX2 leax WBC,x @@ -57,7 +53,7 @@ ANTILG lbsr _denter lbsr _dmuls puls y - bcc _exp + bcc llexp rts @@ -67,7 +63,7 @@ ANTILG LOG10 pshs y - lbsr _log + lbsr lllog bcs LOG11 leay LN10,pcr lbsr _denter @@ -90,7 +86,7 @@ SHANG set ESHANG QUAD set EQUAD ITER set EITER -_exp: +llexp: pshs y leas -TRSP,s trans var leay LN2,pcr remove factors LN(2) @@ -216,7 +212,7 @@ SHANG set ESHANG QUAD set EQUAD ITER set EITER -_log: +lllog: pshs y leas -TRSP,s trans var lda ,x check for zero diff --git a/Source/Libs/KLibc/tmath/mdefs.a b/Source/Libs/KLibc/tmath/mdefs.a index 0ead0e6..4ea4e16 100644 --- a/Source/Libs/KLibc/tmath/mdefs.a +++ b/Source/Libs/KLibc/tmath/mdefs.a @@ -26,7 +26,7 @@ EXM equ $7E EXPONENT UNUSED MASK * set up variable stack for transcendentals - csect + section _constant EABS rmb WBC ESHX rmb WBC EORD rmb WBC diff --git a/Source/Libs/KLibc/tmath/trig.a b/Source/Libs/KLibc/tmath/trig.a index 46f283f..2b8df14 100644 --- a/Source/Libs/KLibc/tmath/trig.a +++ b/Source/Libs/KLibc/tmath/trig.a @@ -1,9 +1,5 @@ psect dtrig_a,0,0,0,0,0 - ifp1 - use mdefs.a - endc - acos: lbsr _dprep lbsr ACOS diff --git a/Source/Libs/KLibc/tmath/trnser.a b/Source/Libs/KLibc/tmath/trnser.a index 8196189..03d2559 100644 --- a/Source/Libs/KLibc/tmath/trnser.a +++ b/Source/Libs/KLibc/tmath/trnser.a @@ -1,7 +1,5 @@ psect trnser_a,0,0,0,0,0 - use mdefs.a - * SHIFT TAKES CARE OF THE SHIDT FOR CORDIC * SHX=2**-ITER * X * y gones diff --git a/Source/Text/Sed/GNUmakefile b/Source/Text/Sed/GNUmakefile index 0efb273..746f436 100644 --- a/Source/Text/Sed/GNUmakefile +++ b/Source/Text/Sed/GNUmakefile @@ -1,4 +1,4 @@ -CFLAGS=-g -m32 -Wno-implicit-int -Wno-implicit-function-declaration +CFLAGS=-g -Wno-implicit-int -Wno-implicit-function-declaration sed: sed0.o sed1.o cc $(CFLAGS) -o sed *.o diff --git a/Source/Text/Sed/sed0.c b/Source/Text/Sed/sed0.c index b91344e..c46f79f 100644 --- a/Source/Text/Sed/sed0.c +++ b/Source/Text/Sed/sed0.c @@ -124,7 +124,7 @@ fcomp() op = lastre; - if(rline(linebuf) < 0) return; + if(rline(linebuf) < 0) return 0; if(*linebuf == '#') { if(linebuf[1] == 'n') nflag = 1; diff --git a/Source/Text/Sed/sed1.c b/Source/Text/Sed/sed1.c index d208a32..0fe89ed 100644 --- a/Source/Text/Sed/sed1.c +++ b/Source/Text/Sed/sed1.c @@ -28,7 +28,7 @@ char *file; for(;;) { if((execp = gline(linebuf)) == badp) { close(f); - return; + return 0; } spend = execp; @@ -411,7 +411,7 @@ reptr *ipc; while(*p1 != '\n') { if(*p1++ == 0) { delflag++; - return; + return 0; } }