diff -Nurd linux86.old/Changes linux86/Changes --- linux86.old/Changes Wed Apr 17 21:04:43 2002 +++ linux86/Changes Tue Aug 6 09:26:54 2002 @@ -1,5 +1,38 @@ For version 0.16.*. +> The fopen function (and friends) is now a real function not a macro. + +> Ctype.h updated to ansi. + +> Libraries appear to compile properly with -O and -ansi now. + +> Copt's hash string table adjusted; should now have fewer pathological cases. + +> Order of copt's rule processing reversed; it now works from the top of a + rule file to the bottom. Also comment lines may be include in the match + lines. !BCC_EOS added to bcc-cc1 for 'end of statment'. + +> bcc-cc1's asm("") now works in declare mode too. + +> New independed cpp added, has both K&R and Ansi modes. + Changes made to the embedded cpp too to try and fix some bad bits. + +> Conditional assembler added around push and pop of 'si' and 'di' if the + optimiser (and as86's optimiser) are to be run. + +> Signed keyward added to bcc-cc1 for 'signed char' also words with other + int types but is usually just a noiseword. + +> As86 macro syntax altered, you new don't have to include any brackets. + +> Various test and old document files removed. + +> Gcc warnings in ar86 cleaned up. + +> Mk_dist now make incremental patch files too. + +> Update magic file. + > Various updates to the bios libc, the vt52 and ansi emulations are now seperated (and can be both included if needed) and don't have to be linked. Conio functions work properly in bios and msdos. diff -Nurd linux86.old/Makefile linux86/Makefile --- linux86.old/Makefile Sun Jul 28 21:14:11 2002 +++ linux86/Makefile Sun Aug 4 10:17:16 2002 @@ -2,7 +2,7 @@ # This file is part of the Linux-8086 Development environment and is # distributed under the GNU General Public License. -VERSION=0.16.7 +VERSION=0.16.8 TARGETS= \ clean bcc unproto copt as86 ld86 elksemu \ diff -Nurd linux86.old/Mk_dist linux86/Mk_dist --- linux86.old/Mk_dist Sun Jul 28 18:02:50 2002 +++ linux86/Mk_dist Sun Aug 11 07:46:51 2002 @@ -1,4 +1,4 @@ -#!/bin/sh - +#!/bin/bash - # # This script builds _and checks_ all the distribution files from my source # directory. It's very selective because I've got a lot of historical and @@ -68,15 +68,46 @@ rm -f /tmp/bootblocks.tar.gz /tmp/doselks.tar.gz /tmp/libc-8086-$VERSION.tar.gz -echo Extracting previous version -rm -f $ARCDIR/Dev86src-$VERSION.tar.gz +MINOR=${VERSION##*.} +MAJOR=${VERSION%.*} +MID=${MAJOR##*.} +MAJOR=${MAJOR%.*} +OLDVER= -mkdir ${TMPDIST}.tmp -( cd ${TMPDIST}.tmp - tar xzf `ls -tr $ARCDIR/Dev86src*.0.tar.gz | tail -1` - mv * ${TMPDIST}.old -) -rmdir ${TMPDIST}.tmp +case "$VERSION" in +0.0.0 ) BASEVER=0.0.0.0 ;; # Naa. +*.0.0 ) BASEVER=$((MAJOR-1)).$MID.$MINOR ;; +*.*.0 ) BASEVER=$MAJOR.$((MID-1)).$MINOR ;; +* ) BASEVER=$MAJOR.$MID.$((MINOR-1)) + OLDVER=$MAJOR.$MID.0 + ;; +esac +if [ "$MAJOR.$MID.$((MINOR-1))" != "$BASEVER" ] +then PATCHNAME="$VERSION-$BASEVER" +else PATCHNAME="$VERSION" +fi + +[ -f $ARCDIR/Dev86src-$BASEVER.tar.gz ] && { + echo "Extracting previous version ($BASEVER)" + + mkdir ${TMPDIST}.tmp + ( cd ${TMPDIST}.tmp + tar xzf $ARCDIR/Dev86src-$BASEVER.tar.gz + mv * ${TMPDIST}.old + ) + rmdir ${TMPDIST}.tmp +} + +[ "$OLDVER" != "" -a -f $ARCDIR/Dev86src-$OLDVER.tar.gz ] && { + echo "Extracting previous version ($OLDVER)" + + mkdir ${TMPDIST}.tmp + ( cd ${TMPDIST}.tmp + tar xzf $ARCDIR/Dev86src-$OLDVER.tar.gz + mv * ${TMPDIST}.vold + ) + rmdir ${TMPDIST}.tmp +} # ARCDIR=${TMPDIR}/arc ; mkdir -p ${ARCDIR} cd ${TMPDIST} @@ -101,21 +132,39 @@ rm -f $EXCL rm -f `find . -type l` -echo Generating patch against previous .0 version. - cd ${TMPDIR} +[ -d ${TMPSRC}.old ] && { +echo "Generating patch against version $BASEVER." + mv ${TMPSRC}.old/bootblocks boot.old mv ${TMPSRC}/bootblocks boot -diff -Nurd ${TMPSRC}.old ${TMPSRC} > ${ARCDIR}/Dev86src-$VERSION.patch +diff -Nurd ${TMPSRC}.old ${TMPSRC} > ${ARCDIR}/patch-$PATCHNAME mv boot.old ${TMPSRC}.old/bootblocks mv boot ${TMPSRC}/bootblocks -diff -Nurd ${TMPSRC}.old/bootblocks ${TMPSRC}/bootblocks >> ${ARCDIR}/Dev86src-$VERSION.patch +diff -Nurd ${TMPSRC}.old/bootblocks ${TMPSRC}/bootblocks >> ${ARCDIR}/patch-$PATCHNAME -gzip -f9 ${ARCDIR}/Dev86src-$VERSION.patch +gzip -f9 ${ARCDIR}/patch-$PATCHNAME +} + +[ -d ${TMPSRC}.vold ] && { +echo "Generating patch against version $OLDVER." + +mv ${TMPSRC}.vold/bootblocks boot.old +mv ${TMPSRC}/bootblocks boot + +diff -Nurd ${TMPSRC}.vold ${TMPSRC} > ${ARCDIR}/patch-$VERSION-$OLDVER + +mv boot.old ${TMPSRC}.vold/bootblocks +mv boot ${TMPSRC}/bootblocks + +diff -Nurd ${TMPSRC}.vold/bootblocks ${TMPSRC}/bootblocks >> ${ARCDIR}/patch-$VERSION-$OLDVER + +gzip -f9 ${ARCDIR}/patch-$VERSION-$OLDVER +} echo Creating full source archive. ln -s ${TMPSRC} dev86-$VERSION diff -Nurd linux86.old/bcc/assign.c linux86/bcc/assign.c --- linux86.old/bcc/assign.c Tue Jul 23 14:47:45 2002 +++ linux86/bcc/assign.c Sat Aug 3 17:41:53 2002 @@ -356,7 +356,7 @@ load(target, DREG); if (target->type == sctype) sctoi(); -#ifdef I8088 +#if defined(I8088) && defined(I80386) else if (tscalar & SHORT) { if (tscalar & UNSIGNED) diff -Nurd linux86.old/bcc/bcc.c linux86/bcc/bcc.c --- linux86.old/bcc/bcc.c Wed Jul 31 23:17:08 2002 +++ linux86/bcc/bcc.c Sun Aug 11 07:37:01 2002 @@ -302,9 +302,9 @@ command_opts('p'); if (!opt_e) { - command_opts('c'); if (opt_arch<5 && !do_as) command_opt("-t"); + command_opts('c'); } if (!opt_I) @@ -337,6 +337,9 @@ command_reset(); newfilename(file, !(do_optim || do_as), 's', (opt_arch != 3 && opt_arch<5)); + if (opt_arch<5 && !do_as) + command_opt("-t"); + command_opts('c'); command_arch(); @@ -361,8 +364,8 @@ } command_opt(optim_rules); - command_opt("rules.start"); command_opts('o'); + command_opt("rules.start"); if (opt_O) { sprintf(buf, "rules.%c86", opt_O); @@ -435,6 +438,9 @@ command_opt("-o"); command_opt(executable_name); + if (opt_arch < 2) + command_opt("-y"); + command_opts('l'); if (opt_arch != 2) { @@ -754,6 +760,9 @@ case 'X': append_option(opt_arg, 'l'); break; + case 'u': + append_option(opt_arg, 'u'); + break; case 'L': append_option(argv[ar], 'l'); @@ -767,6 +776,8 @@ do_optim=1; if (!opt_arg[1] && ( opt_arg[0] >= '1' && opt_arg[0] <= '3' )) opt_O = opt_arg[0]; + else if (opt_arg[0] == '-') + append_option(opt_arg, 'o'); else { char * p = xalloc(strlen(opt_arg)+8); @@ -935,6 +946,8 @@ opt_arch = 2; prepend_option("-D__unix__", 'p'); prepend_option("-D__linux__", 'p'); + /* This one works (in Debian potato), /usr/bin/gcc crashes. */ + add_prefix("/usr/bin/i486-linuxlibc1-"); break; case '8': /* Use 'c386' program as compiler */ opt_arch = 3; diff -Nurd linux86.old/bcc/codefrag.c linux86/bcc/codefrag.c --- linux86.old/bcc/codefrag.c Tue Jul 23 21:23:08 2002 +++ linux86/bcc/codefrag.c Sat Aug 3 17:38:27 2002 @@ -375,6 +375,7 @@ outhiaccum(); outncregname(BREG); } +#ifdef I80386 PUBLIC void ustoi() { outmovzx(); @@ -383,6 +384,7 @@ outshortregname(DREG); outnl(); } +#endif /* I80386 */ #endif /* I8088 */ #ifdef MC6809 diff -Nurd linux86.old/bcc/debug.c linux86/bcc/debug.c --- linux86.old/bcc/debug.c Sun Jan 11 12:18:34 1998 +++ linux86/bcc/debug.c Sun Aug 4 07:49:17 2002 @@ -161,7 +161,7 @@ { if (!debugon) return; - comment(); + outstr("! Debug: "); if (exp->tag < FIRSTOP && exp->tag > LASTOP) outstr("unknown op"); else @@ -186,7 +186,7 @@ PUBLIC void debugswap() { if (debugon) - outnstr("* swapping"); + outnstr("! Debug: expression subtree swapping"); } PRIVATE void outindchars(byte, count) diff -Nurd linux86.old/bcc/declare.c linux86/bcc/declare.c --- linux86.old/bcc/declare.c Tue Jul 30 23:41:52 2002 +++ linux86/bcc/declare.c Sat Aug 3 21:09:43 2002 @@ -693,8 +693,34 @@ if( main_flag > 2 ) globl("environ"); } +#ifdef I8088 + regfuse = 0; +#endif lbrace(); compound(); +#ifdef I8088 + if (regfuse & callee1mask) { + outstr("! Register"); + if (regfuse & INDREG0 & callee1mask) outstr(" BX"); + if (regfuse & INDREG1 & callee1mask) outstr(" SI"); + if (regfuse & INDREG2 & callee1mask) outstr(" DI"); + outstr(" used in function "); + outnstr(funcname); + if (optimise && !callersaves) { + outstr(funcname); + outnstr(".off = 0"); + } + } else + if (optimise && !callersaves) { + outstr(funcname); + outstr(".off = "); +#ifndef I80386 + outnhex(4); +#else + outnhex(i386_32?12:4); +#endif + } +#endif clearfunclabels(); } @@ -1122,6 +1148,7 @@ PUBLIC void semicolon() { + outnstr("!BCC_EOS"); if (sym != SEMICOLON) need(';'); else diff -Nurd linux86.old/bcc/function.c linux86/bcc/function.c --- linux86.old/bcc/function.c Sat Jan 12 12:05:43 2002 +++ linux86/bcc/function.c Sat Aug 3 19:53:20 2002 @@ -271,7 +271,18 @@ PUBLIC void popframe() { #ifdef STUPIDFRAME - poplist(callee1mask); /*XXX: Add if round this */ +#ifndef NO_DEL_PUSH + if (optimise && !callersaves) { + outstr("if "); + outstr(funcname); + outnstr(".off=0"); + } + poplist(callee1mask); + if (optimise && !callersaves) + outnstr("endif"); +#else + poplist(callee1mask); +#endif poplist(FRAMEREG); #else poplist(frame1list); @@ -313,7 +324,18 @@ pushreg(FRAMEREG); regtransfer(STACKREG, FRAMEREG); framep = sp; - pushlist(callee1mask); /*XXX: Add if round this */ +#ifndef NO_DEL_PUSH + if (optimise && !callersaves) { + outstr("if "); + outstr(funcname); + outnstr(".off=0"); + } + pushlist(callee1mask); + if (optimise && !callersaves) + outnstr("endif"); +#else + pushlist(callee1mask); +#endif # else /* not STUPIDFRAME */ # ifdef CANHANDLENOFRAME if (stackarg || softsp != -frameregsize) /* args or locals */ diff -Nurd linux86.old/bcc/gencode.h linux86/bcc/gencode.h --- linux86.old/bcc/gencode.h Thu Jan 10 07:43:56 2002 +++ linux86/bcc/gencode.h Sat Aug 3 17:58:37 2002 @@ -47,6 +47,7 @@ EXTERN offset_T softsp; /* software sp (leads sp during declares) */ EXTERN offset_T sp; /* hardware relative stack ptr */ /* depends on zero init */ +EXTERN store_t regfuse; /* registers in use in function. */ #ifdef FRAMEPOINTER EXTERN bool_t stackarg; /* nonzero to show function has arg on stack */ #endif diff -Nurd linux86.old/bcc/genloads.c linux86/bcc/genloads.c --- linux86.old/bcc/genloads.c Sat Jul 24 14:36:08 1999 +++ linux86/bcc/genloads.c Sat Aug 3 19:53:36 2002 @@ -784,10 +784,19 @@ bumplc(); else { + int off; if (switchnow != NULL && adr->flags == TEMP) - outswoffset(adr->offset.offi); + outswoffset(off = adr->offset.offi); else - outoffset(adr->offset.offi - framep); + outoffset(off = adr->offset.offi - framep); +#ifndef NO_DEL_PUSH + if (optimise && !callersaves && off < 0) + { + outstr("+"); + outstr(funcname); + outstr(".off"); + } +#endif } outindleft(); } @@ -948,12 +957,15 @@ #endif case INDREG0: outstr(ireg0str); + regfuse |= INDREG0; break; case INDREG1: outstr(ireg1str); + regfuse |= INDREG1; break; case INDREG2: outstr(ireg2str); + regfuse |= INDREG2; break; case LOCAL: outstr(localregstr); @@ -996,7 +1008,7 @@ } } -#ifdef I8088 +#if defined(I8088) && defined(I80386) /* print register name for short type */ PUBLIC void outshortregname(reg) diff -Nurd linux86.old/bcc/input.c linux86/bcc/input.c --- linux86.old/bcc/input.c Sun Jul 28 11:12:47 2002 +++ linux86/bcc/input.c Sun Aug 4 07:44:42 2002 @@ -609,6 +609,9 @@ definestring("__HAS_NO_FLOATS__"); #endif ctext = flag['t']; +#ifdef DEBUG + if (ctext) debugon = 1; +#endif watchlc = flag['w']; setoutbufs(); inputinit(fname, fd); diff -Nurd linux86.old/bcc/preserve.c linux86/bcc/preserve.c --- linux86.old/bcc/preserve.c Sat Jul 24 12:31:27 1999 +++ linux86/bcc/preserve.c Sat Aug 3 19:53:53 2002 @@ -6,6 +6,7 @@ #include "gencode.h" #include "reg.h" #include "type.h" +#include "scan.h" /* change stack ptr without changing condition codes */ @@ -18,11 +19,20 @@ #ifdef FRAMEPOINTER if (newsp != framep || (!(bool_t) absflag && switchnow != NULL)) { + int off; outleasp(); if (!(bool_t) absflag && switchnow != NULL) - outswoffset(newsp); + outswoffset(off = newsp); else - outoffset(newsp - framep); + outoffset(off = newsp - framep); +#ifndef NO_DEL_PUSH + if (optimise && !callersaves && off < 0) + { + outstr("+"); + outstr(funcname); + outstr(".off"); + } +#endif outindframereg(); outnl(); } diff -Nurd linux86.old/bcc/state.c linux86/bcc/state.c --- linux86.old/bcc/state.c Tue Jul 23 21:00:24 2002 +++ linux86/bcc/state.c Sat Aug 3 16:02:29 2002 @@ -779,6 +779,7 @@ semicolon(); break; case SEMICOLON: + outnstr("!BCC_EOS"); nextsym(); return; case ASMSYM: diff -Nurd linux86.old/copt/copt.c linux86/copt/copt.c --- linux86.old/copt/copt.c Sat Jun 8 07:44:56 2002 +++ linux86/copt/copt.c Sat Aug 3 14:05:25 2002 @@ -43,7 +43,11 @@ #define KEEPCOMMENTS #define MAXLINE 1024 +#ifdef __BCC__ #define HASHSIZE 107 +#else +#define HASHSIZE 1999 +#endif #define NOCHAR '\177' #define VARNUM 10 @@ -112,7 +116,7 @@ struct hash_s *hp; char *chkstr; char *cp; - int hashval; + unsigned int hashval; /* Clear the hashing table if not already done */ if (!hash_init) { @@ -131,7 +135,7 @@ /* Determine hashing value of string */ hashval = 0; for (cp = chkstr; *cp; cp++) - hashval += *cp; + hashval = hashval*75 + *cp; hashval %= HASHSIZE; /* Check if the string is already in the hashing table */ @@ -238,14 +242,25 @@ rp = (struct rule_s *)mymalloc(sizeof(struct rule_s)); rp->old = readlist(fp, '=', '#'); rp->new = readlist(fp, '\0', '#'); - rp->next = first; if (rp->old == NULL || rp->new == NULL) { free(rp); break; } + +/* This put the rules into the table in reverse order; this is confusing * + rp->next = first; first = rp; if (last == NULL) last = rp; +*/ + rp->next = NULL; + if (last) { + last->next = rp; + last = rp; + } else { + first = last = rp; + } + } /* Close pattern file */ @@ -679,6 +694,11 @@ if (!ins->comment_flg) pat = pat->next; + else if (ins->text[0]==pat->text[0]) /* Matching a comment! */ + { + if (match(ins->text, pat->text)) + pat = pat->next; + } ins = ins->next; } @@ -688,7 +708,7 @@ lp1 = cur; cur = cur->prev; while (lp1 != ins) { -#if 0 /* I'd like to keep the comment lines but this doesn't work XXX */ +#if 0 if( lp1->comment_flg ) { lp2 = lp1; diff -Nurd linux86.old/copt/rules.186 linux86/copt/rules.186 --- linux86.old/copt/rules.186 Sat Feb 7 11:11:09 1998 +++ linux86/copt/rules.186 Sat Aug 3 21:28:02 2002 @@ -28,3 +28,13 @@ = push #%1 +mov ax,*%1 +push ax += +push *%1 + +mov bx,*%1 +push bx += +push *%1 + diff -Nurd linux86.old/copt/rules.386 linux86/copt/rules.386 --- linux86.old/copt/rules.386 Sat Feb 7 16:07:44 1998 +++ linux86/copt/rules.386 Sat Aug 3 21:37:27 2002 @@ -1,5 +1,7 @@ # Rules to optimize BCC assembler output for 386 +# Many of these rules are very broken, ho hum. + # Rules for loading a long constant xor ax,ax @@ -351,7 +353,7 @@ mov %[ax|bx|cx|dx|si|di]2,%[#|*]0%1 push %[ax|bx|cx|dx|si|di]2 = -push word %0%1 +push %0%1 # Shifting rules diff -Nurd linux86.old/copt/rules.86 linux86/copt/rules.86 --- linux86.old/copt/rules.86 Fri Jan 22 19:06:03 1999 +++ linux86/copt/rules.86 Tue Aug 6 19:58:52 2002 @@ -2,76 +2,90 @@ # Rules for loading short variables -mov %0$0[%2],%3 -= -mov %0[%2],%3 - mov %2,%[ax|bx|cx|dx]1 mov %[ax|bx|cx|dx]1,%2 = mov %2,%1 -# Breaks: a = b = 125; -# mov %[ax|bx|cx|dx]3,%[#|*]0%1 -# mov %2[%4],%[ax|bx|cx|dx]3 -# = -# mov word ptr %2[%4],%0%1 - -# This gets a few back. +# Assign a constant mov %[ax|bx|cx|dx]3,%[#|*]0%1 mov %2[%4],%[ax|bx|cx|dx]3 -mov %[ax|bx|cx|dx]3,%5 +!BCC_EOS = mov word ptr %2[%4],%0%1 -mov %3,%5 +!BCC_EOS -mov %[ax|bx|cx|dx]3,%[#|*]0%1 -mov %[ax|bx|cx|dx]2,%[ax|bx|cx|dx]3 +# Assign a constant char +mov al,%[#|*]0%1 +mov %2,al +!BCC_EOS = -mov %2,%0%1 - -# Breaks: a = b = 'a'; -# mov al,%[#|*]0%1 -# mov %2,al -# = -# mov byte ptr %2,%0%1 +mov byte ptr %2,%0%1 +!BCC_EOS +# Assign a constant long from a small int xor ax,ax mov bx,%[#|*]0%1 mov [%2],ax mov [%2+2],bx +!BCC_EOS = mov word ptr [%2],#0 mov word ptr [%2+2],%0%1 +!BCC_EOS +# Assign a constant long from a 2^16 mod int. mov ax,%[#|*]0%1 xor bx,bx mov [%2],ax mov [%2+2],bx +!BCC_EOS = mov word ptr [%2],%0%1 mov word ptr [%2+2],#0 +!BCC_EOS +# Assign a constant long from a big int mov ax,%[#|*]4%1 mov bx,%[#|*]5%3 mov [%2],ax mov [%2+2],bx +!BCC_EOS = mov word ptr [%2],%4%1 mov word ptr [%2+2],%5%3 +!BCC_EOS +# rule for (char*) *x++ +mov bx,%1 +%[inc|dec]2 bx +mov %1,bx +mov al,-1[bx] +xor ah,ah += +mov bx,%1 +%2 word ptr %1 +mov al,[bx] +xor ah,ah # Rules for incrementing short variables +mov %[ax|bx|si|di]2,%1 +%[inc|dec]3 %[ax|bx|si|di]2 +mov %1,%[ax|bx|si|di]2 +!BCC_EOS += +%3 word ptr %1 +!BCC_EOS -mov %[ax|bx]2,%1 -%[inc|dec]3 %[ax|bx]2 -mov %1,%[ax|bx]2 +mov %[ax|bx|si|di]2,%1 +%[inc|dec]3 %[ax|bx|si|di]2 +mov %1,%[ax|bx|si|di]2 = %3 word ptr %1 mov %2,%1 -# Rules for manipulating characters +# Rules for manipulating characters with register char*s inc %[si|di]* inc %[si|di]* @@ -140,37 +154,44 @@ # Rules for manipulating short values -# This is the broken rule - Chad - -#mov %[ax|bx]2,%1 -#%[add|and|xor|sub|or]4 %[ax|bx]2,%3 -#mov %1,%[ax|bx]2 -#= -#mov %2,%3 -#%4 %1,%2 +# These rules only apply at end of statment. +mov %[ax|bx]2,%1 +%[add|and|xor|sub|or]4 %[ax|bx]2,%3 +mov %1,%[ax|bx]2 +!BCC_EOS += +mov %2,%3 +%4 %1,%2 +!BCC_EOS mov %[ax|bx]2,%1 %[add|and|xor|or]4 %[ax|bx]2,%3 mov %3,%[ax|bx]2 +!BCC_EOS = mov %2,%1 %4 %3,%2 - -mov %[ax|bx]4,%1 -%[add|and|xor|sub|or]2 %[si|di]3,%[ax|bx]4 -= -%2 %3,%1 +!BCC_EOS mov al,%1 xor ah,ah %[add|and|xor|sub|or]2 ax,%[#|*]0%3 mov %1,al +!BCC_EOS = %2 byte ptr %1,%0%3 +!BCC_EOS +# This is safe with an embedded assign. +mov %[ax|bx]4,%1 +%[add|and|xor|sub|or]2 %[si|di]3,%[ax|bx]4 += +%2 %3,%1 # Rules for comparing short values +# Compare doesn't need to leave any register in a specific state. + mov %[ax|bx]3,%1[%4] cmp %[ax|bx]3,%[#|*]0%2 = @@ -348,9 +369,11 @@ jmp .%1 .%2: +!BCC_EOS .%1: = .%2: +!BCC_EOS .%1: jmp .%1 @@ -445,4 +468,83 @@ pop cx pop dx = -! push/pop +! push/pop float + +# Long right shift by 16 unsigned +mov ax,%1 +mov bx,%2 +xchg bx,ax +xor bx,bx += +mov ax,%2 +xor bx,bx + +# Long right shift by 16 signed +mov ax,%1 +mov bx,%2 +xchg bx,ax +cwd += +mov ax,%2 +cwd + +# Load long and exchange +mov ax,%1 +mov bx,%2 +xchg bx,ax += +mov bx,%1 +mov ax,%2 + +# Repeated clear. +xor bx,bx +xchg bx,ax +xor ax,ax += +xchg bx,ax +xor ax,ax + +# Long expression assigned to an int +cwd +mov bx,dx +mov %1,ax +!BCC_EOS += +mov %1,ax +!BCC_EOS + +# Load unsigned into high word of long +mov ax,%1 +xchg bx,ax +xor ax,ax += +mov bx,%1 +xor ax,ax + +# Souped up strcpy; "while(*d++ = *s++);" in a function with no reg vars. +.%3: +!BCC_EOS +.%4: +mov bx,%1 +inc bx +mov %1,bx +mov si,%2 +inc si +mov %2,si +mov al,-1[bx] +mov -1[si],al +test al,al +jne .%3 += +.%4: +mov si,%1 +mov di,%2 +.%3: +lodsb +stosb +test al,al +jne .%3 +mov %1,si +mov %2,di +!BCC_EOS + diff -Nurd linux86.old/copt/rules.end linux86/copt/rules.end --- linux86.old/copt/rules.end Fri Feb 13 21:39:38 1998 +++ linux86/copt/rules.end Sat Aug 3 21:25:07 2002 @@ -15,8 +15,3 @@ pop di pop bp ret - -pmov %1,%2 -= -push %1 -mov %1,%2 diff -Nurd linux86.old/copt/rules.i linux86/copt/rules.i --- linux86.old/copt/rules.i Mon May 10 21:49:56 1999 +++ linux86/copt/rules.i Sat Aug 3 21:50:04 2002 @@ -57,7 +57,7 @@ inc sp inc sp = -mov ax,#%1 +mov ax,%0%1 mov es,ax mov ax,%[#|*]0%1 @@ -66,7 +66,7 @@ inc sp inc sp = -mov ax,#%1 +mov ax,%0%1 mov es,ax push %0[%1] @@ -290,5 +290,5 @@ mov ax,ax = -! +!mov ax,ax diff -Nurd linux86.old/copt/rules.start linux86/copt/rules.start --- linux86.old/copt/rules.start Fri Feb 13 21:40:44 1998 +++ linux86/copt/rules.start Sat Aug 3 21:24:39 2002 @@ -17,7 +17,3 @@ = proc_end -push %1 -mov %1,%2 -= -pmov %1,%2 diff -Nurd linux86.old/cpp/Makefile linux86/cpp/Makefile --- linux86.old/cpp/Makefile Sun Jul 28 19:54:58 2002 +++ linux86/cpp/Makefile Sat Aug 3 07:18:31 2002 @@ -5,11 +5,11 @@ bcc-cpp: main.o cpp.o hash.o token1.o token2.o $(CC) $(CFLAGS) -o bcc-cpp main.o cpp.o hash.o token1.o token2.o -realclean: clean - rm -f bcc-cpp token1.h token2.h +clean realclean: + rm -f bcc-cpp main.o cpp.o hash.o token1.o token2.o tmp.h -clean: - rm -f main.o cpp.o hash.o token1.o token2.o +maintclean: realclean + rm -f token1.h token2.h main.o: cc.h cpp.o: cc.h @@ -20,7 +20,9 @@ token2.o: token2.h token1.h: token1.tok - gperf -aptTc -N is_ctok -H hash1 token1.tok > token1.h + gperf -aptTc -N is_ctok -H hash1 token1.tok > tmp.h + mv tmp.h token1.h token2.h: token2.tok - gperf -aptTc -k1,3 -N is_ckey -H hash2 token2.tok > token2.h + gperf -aptTc -k1,3 -N is_ckey -H hash2 token2.tok > tmp.h + mv tmp.h token2.h diff -Nurd linux86.old/cpp/c.c linux86/cpp/c.c --- linux86.old/cpp/c.c Tue Jul 30 23:42:29 2002 +++ linux86/cpp/c.c Sun Aug 11 07:33:53 2002 @@ -1,14 +1,14 @@ #include #include -#if __STDC__ +#if __STDC__ == (1UL) #define strong_alias(Y,X) asm("export _" #X, "_" #X " = _" #Y ) #else #define strong_alias(Y,X) asm("export _" "X", "_" "X" " = _" "Y" ) #endif #if __STDC__ -#define comb(x,y) x##y +#define comb(x,y) x ## y #warning Using Ansi combine #elif __BCC__ #define comb(x,y) x/**/y @@ -36,7 +36,13 @@ int i1, i2, i3; printf("sizeof(long double) = %d\n", sizeof(long double)); +#ifdef __GNUC__ + printf("sizeof(long float) = ERROR!\n"); + printf("sizeof(long long) = %d\n", sizeof(long long)); +#else printf("sizeof(long float) = %d\n", sizeof(long float)); + printf("sizeof(long long) = ERROR!\n"); +#endif printf("sizeof(double) = %d\n", sizeof(double)); printf("sizeof(float) = %d\n", sizeof(float)); diff -Nurd linux86.old/cpp/cpp.c linux86/cpp/cpp.c --- linux86.old/cpp/cpp.c Fri Aug 2 19:54:38 2002 +++ linux86/cpp/cpp.c Sun Aug 11 07:33:57 2002 @@ -28,6 +28,12 @@ * TODO: * #asm -> asm("...") translation. * ?: in #if expressions + * __DATE__ and __TIME__ macros. + * Add #line directive. + * Poss: Seperate current directory for #include from errors (#line). + * Poss: C99 Variable macro args. + * \n in "\n" in a stringized argument. + * Comments in stringized arguments should be deleted. */ #define KEEP_SPACE 0 @@ -44,7 +50,11 @@ char * c_fname; int c_lineno = 0; +#ifdef __BCC__ +typedef long int_type; /* Used for preprocessor expressions */ +#else typedef int int_type; /* Used for preprocessor expressions */ +#endif static int curtok = 0; /* Used for preprocessor expressions */ static int fi_count = 0; @@ -132,7 +142,7 @@ } /* Special for quoted strings */ - *curword = 0; + *curword = '\0'; ch = chget(); if( ch == EOF ) return ch; @@ -274,6 +284,12 @@ { if( state < 6 ) { + if( ch == 'u' || ch == 'U' ) + { + if( cc < WORDSIZE-1 ) *p++ = ch; /* Clip to WORDSIZE */ + *p = '\0'; cc++; + ch = chget(); + } if( ch == 'l' || ch == 'L' ) { if( cc < WORDSIZE-1 ) *p++ = ch; /* Clip to WORDSIZE */ @@ -406,7 +422,7 @@ *p++ = ch; } else unchget(ch); - *p = 0; + *p = '\0'; return TK_STR; } @@ -720,26 +736,23 @@ if( ch == ch1 ) { *p = '\0'; + p = strdup(curword); - fd = open_include(curword, "r", (ch=='"')); - if( fd == 0 ) - cerror("Cannot open include file"); - do { ch = pgetc(); } while(ch == ' ' || ch == '\t'); unchget(ch); + do { ch1 = pgetc(); } while(ch1 == ' ' || ch1 == '\t'); + unchget(ch1); do_proc_tail(); - if( fd ) - { - saved_files[fi_count] = curfile; - saved_fname[fi_count] = c_fname; - saved_lines[fi_count] = c_lineno; - fi_count++; + saved_files[fi_count] = curfile; + saved_fname[fi_count] = c_fname; + saved_lines[fi_count] = c_lineno; + + fd = open_include(p, "r", (ch=='"')); + if( fd ) { + fi_count++; + curfile = fd; + } else + cerror("Cannot open include file"); - curfile = fd; - c_fname = malloc(strlen(curword)+1); - if( c_fname == 0 ) cfatal("Preprocessor out of memory"); - strcpy(c_fname, curword); - c_lineno = 1; - } return; } *p++ = ch; @@ -778,7 +791,7 @@ len = WORDSIZE; ptr = malloc(sizeof(struct define_item) + WORDSIZE); if(ptr==0) cfatal("Preprocessor out of memory"); - ptr->value[cc=0] = 0; + ptr->value[cc=0] = '\0'; /* Add in arguments */ if( ch1 == '(' ) @@ -832,7 +845,7 @@ } if (cc) ptr->value[cc++] = ' ';/* Byte of lookahead for recursive macros */ - ptr->value[cc++] = 0; + ptr->value[cc++] = '\0'; #if CPP_DEBUG if (cc == 1) @@ -1212,8 +1225,10 @@ value = get_expression(0); if (curtok == ')') curtok = get_onetok(SKIP_SPACE); - else + else { curtok = '$'; + cerror("Expected ')'"); + } } return sign<0 ? -value: value; @@ -1248,7 +1263,7 @@ arg_list[ac].name = realloc(arg_list[ac].name, len); } arg_list[ac].name[cc++] = *data_str; - arg_list[ac].name[cc] = 0; + arg_list[ac].name[cc] = '\0'; } for(;;) { @@ -1290,7 +1305,7 @@ #endif arg_list[ac].value[cc++] = ch; - arg_list[ac].value[cc] = 0; + arg_list[ac].value[cc] = '\0'; } if (commas_found || args_found) args_found = commas_found+1; @@ -1359,12 +1374,12 @@ } #endif - rv = malloc(4); *rv = 0; len = 4; + rv = malloc(4); *rv = '\0'; len = 4; while(*data_str) { p = curword; - if (dialect != DI_KNR) { + if (dialect == DI_ANSI) { if (in_quote == 2) in_quote = 1; else if (in_quote) { @@ -1396,7 +1411,7 @@ data_str+=2; while(*data_str == ' ' || *data_str == '\t') data_str++; - if (*data_str == 0) { /* Hummm */ + if (*data_str == '\0') { /* Hummm */ data_str--; cerror("'##' operator at end of macro"); } @@ -1417,7 +1432,7 @@ rv[cc++] = *data_str++; continue; } - *p = 0; s = curword; + *p = '\0'; s = curword; for (ac=0; ac0 && (rv[cc-1] == ' ' || rv[cc-1] == '\t')) cc--; rv[cc++] = '"'; - rv[cc++] = 0; + rv[cc++] = '\0'; ansi_stringize = 0; s = ""; break; @@ -1465,6 +1480,6 @@ cc = strlen(rv); } - rv[cc] = 0; + rv[cc] = '\0'; return rv; } diff -Nurd linux86.old/cpp/hash.c linux86/cpp/hash.c --- linux86.old/cpp/hash.c Sat Jul 27 20:27:53 2002 +++ linux86/cpp/hash.c Sat Aug 3 07:26:07 2002 @@ -23,7 +23,7 @@ struct hashentry ** hashtable; int hashsize = 0xFF; /* 2^X -1 */ int hashcount = 0; -static int hashvalue(); +static int hashvalue _P((int namespace, char * word)); void * read_entry(namespace, word) diff -Nurd linux86.old/cpp/main.c linux86/cpp/main.c --- linux86.old/cpp/main.c Fri Aug 2 18:34:14 2002 +++ linux86/cpp/main.c Sat Aug 3 08:07:16 2002 @@ -21,6 +21,8 @@ void undefine_macro _P((char *)); void cmsg _P((char * mtype, char * str)); char * token_txn _P((int)); +void pr_indent _P((int)); +void hash_line _P((void)); char * include_paths[MAXINCPATH]; @@ -28,6 +30,7 @@ int last_line = -1; int debug_mode = 0; int p_flag = 0; +int exit_code = 0; char * outfile = 0; FILE * ofd = 0; @@ -146,7 +149,7 @@ print_toks_cpp(); if (outfile) fclose(ofd); - exit(0); + exit(exit_code); } void @@ -192,24 +195,34 @@ char * mode; int checkrel; { - FILE * fd; + FILE * fd = 0; int i; - char buf[256]; + char buf[256], *p; if( checkrel ) { - fd=fopen(fname, mode); - if( fd ) return fd; + strcpy(buf, c_fname); + p = strrchr(buf, '/'); + if (p) *++p = 0; else *(p=buf) = 0; + strcpy(p, fname); + + fd=fopen(buf, mode); } - for(i=0; i #include "cc.h" +#ifdef __GNUC__ +__inline +#endif +static unsigned int hash1 _P((register const char *, register unsigned int)); + #include "token1.h" diff -Nurd linux86.old/cpp/token1.h linux86/cpp/token1.h --- linux86.old/cpp/token1.h Thu Jan 1 01:00:00 1970 +++ linux86/cpp/token1.h Sat Aug 3 18:21:06 2002 @@ -0,0 +1,117 @@ +/* C code produced by gperf version 2.7.1 (19981006 egcs) */ +/* Command-line: gperf -aptTc -N is_ctok -H hash1 token1.tok */ + +#define TOTAL_KEYWORDS 23 +#define MIN_WORD_LENGTH 2 +#define MAX_WORD_LENGTH 3 +#define MIN_HASH_VALUE 2 +#define MAX_HASH_VALUE 63 +/* maximum key range = 62, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#endif +static unsigned int +hash1 (str, len) + register const char *str; + register unsigned int len; +{ + static unsigned char asso_values[] = + { + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 1, 64, 64, 64, 3, 25, 64, + 64, 64, 13, 18, 64, 8, 30, 15, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 5, 0, 20, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 30, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 23, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64 + }; + return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]]; +} + +#ifdef __GNUC__ +__inline +#endif +struct token_trans * +is_ctok (str, len) + register const char *str; + register unsigned int len; +{ + static struct token_trans wordlist[] = + { + {""}, {""}, + {"==", TK_EQ_OP}, + {"!=", TK_NE_OP}, + {""}, + {"%=", TK_MOD_ASSIGN}, + {""}, + {"<=", TK_LE_OP}, + {"<<=", TK_LEFT_ASSIGN}, + {""}, + {"-=", TK_SUB_ASSIGN}, + {""}, + {"<<", TK_LEFT_OP}, + {""}, {""}, + {"*=", TK_MUL_ASSIGN}, + {""}, + {"/=", TK_DIV_ASSIGN}, + {"--", TK_DEC_OP}, + {""}, + {"+=", TK_ADD_ASSIGN}, + {""}, + {">=", TK_GE_OP}, + {">>=", TK_RIGHT_ASSIGN}, + {""}, + {"|=", TK_OR_ASSIGN}, + {""}, + {"&=", TK_AND_ASSIGN}, + {""}, {""}, + {"->", TK_PTR_OP}, + {""}, + {"^=", TK_XOR_ASSIGN}, + {""}, {""}, {""}, {""}, {""}, + {"++", TK_INC_OP}, + {""}, {""}, {""}, + {">>", TK_RIGHT_OP}, + {""}, {""}, {""}, {""}, {""}, + {"||", TK_OR_OP}, + {""}, {""}, {""}, + {"&&", TK_AND_OP}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {"..", TK_WORD}, + {"...", TK_ELLIPSIS} + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = hash1 (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register const char *s = wordlist[key].name; + + if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) + return &wordlist[key]; + } + } + return 0; +} diff -Nurd linux86.old/cpp/token2.c linux86/cpp/token2.c --- linux86.old/cpp/token2.c Sat Jul 27 20:34:15 2002 +++ linux86/cpp/token2.c Sat Aug 3 07:25:40 2002 @@ -3,4 +3,9 @@ #include #include "cc.h" +#ifdef __GNUC__ +__inline +#endif +static unsigned int hash2 _P((register const char *, register unsigned int)); + #include "token2.h" diff -Nurd linux86.old/cpp/token2.h linux86/cpp/token2.h --- linux86.old/cpp/token2.h Thu Jan 1 01:00:00 1970 +++ linux86/cpp/token2.h Sat Aug 3 18:21:06 2002 @@ -0,0 +1,139 @@ +/* C code produced by gperf version 2.7.1 (19981006 egcs) */ +/* Command-line: gperf -aptTc -k1,3 -N is_ckey -H hash2 token2.tok */ + +#define TOTAL_KEYWORDS 34 +#define MIN_WORD_LENGTH 2 +#define MAX_WORD_LENGTH 8 +#define MIN_HASH_VALUE 2 +#define MAX_HASH_VALUE 69 +/* maximum key range = 68, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#endif +static unsigned int +hash2 (str, len) + register const char *str; + register unsigned int len; +{ + static unsigned char asso_values[] = + { + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 5, 70, 70, 70, 70, 70, 0, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 0, 70, 5, 5, 10, + 10, 20, 20, 25, 70, 0, 70, 70, 50, 70, + 0, 15, 0, 70, 15, 0, 40, 20, 0, 0, + 70, 70, 10, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70 + }; + register int hval = len; + + switch (hval) + { + default: + case 3: + hval += asso_values[(unsigned char)str[2]]; + case 2: + case 1: + hval += asso_values[(unsigned char)str[0]]; + break; + } + return hval; +} + +#ifdef __GNUC__ +__inline +#endif +struct token_trans * +is_ckey (str, len) + register const char *str; + register unsigned int len; +{ + static struct token_trans wordlist[] = + { + {""}, {""}, + {"if", TK_IF}, + {""}, + {"void", TK_VOID}, + {"while", TK_WHILE}, + {"switch", TK_SWITCH}, + {""}, + {"__LINE__", TK_LINE}, + {""}, {""}, + {"static", TK_STATIC}, + {"do", TK_DO}, + {"__FILE__", TK_FILE}, + {"case", TK_CASE}, + {"const", TK_CONST}, + {"sizeof", TK_SIZEOF}, + {""}, + {"continue", TK_CONTINUE}, + {"char", TK_CHAR}, + {"short", TK_SHORT}, + {"struct", TK_STRUCT}, + {""}, {""}, + {"else", TK_ELSE}, + {"union", TK_UNION}, + {""}, {""}, + {"unsigned", TK_UNSIGNED}, + {""}, + {"break", TK_BREAK}, + {"signed", TK_SIGNED}, + {""}, {""}, {""}, {""}, + {"double", TK_DOUBLE}, + {"default", TK_DEFAULT}, + {"for", TK_FOR}, + {""}, + {"float", TK_FLOAT}, + {""}, {""}, + {"int", TK_INT}, + {"enum", TK_ENUM}, + {""}, {""}, + {"typedef", TK_TYPEDEF}, + {"register", TK_REGISTER}, + {"auto", TK_AUTO}, + {""}, {""}, {""}, {""}, + {"long", TK_LONG}, + {""}, {""}, {""}, + {"volatile", TK_VOLATILE}, + {""}, {""}, + {"return", TK_RETURN}, + {""}, {""}, {""}, {""}, + {"extern", TK_EXTERN}, + {""}, {""}, + {"goto", TK_GOTO} + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = hash2 (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register const char *s = wordlist[key].name; + + if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) + return &wordlist[key]; + } + } + return 0; +} diff -Nurd linux86.old/libc/bios/Makefile linux86/libc/bios/Makefile --- linux86.old/libc/bios/Makefile Sun May 26 11:08:20 2002 +++ linux86/libc/bios/Makefile Sat Aug 3 13:04:40 2002 @@ -15,7 +15,7 @@ COBJ=bios_putc.o bios_getc.o DSRC=bios_disk.c -DOBJ=bios_disk_read.o bios_disk_write.o bios_disk_reset.o bios_get_dpt.o +DOBJ=bios_disk_rd.o bios_disk_wr.o bios_disk_rs.o bios_get_dpt.o OBJ=$(AOBJ) $(BOBJ) $(COBJ) $(DOBJ) \ time.o fileops.o fs_dos.o rawio.o vt52.o ansi.o diff -Nurd linux86.old/libc/bios/bios_disk.c linux86/libc/bios/bios_disk.c --- linux86.old/libc/bios/bios_disk.c Sun May 26 13:27:02 2002 +++ linux86/libc/bios/bios_disk.c Sat Aug 3 13:05:04 2002 @@ -5,7 +5,7 @@ #include #include -#ifdef L_bios_disk_read +#ifdef L_bios_disk_rd _bios_disk_read(drive, cyl, head, sect, length, buffer) { #asm @@ -52,7 +52,7 @@ } #endif -#ifdef L_bios_disk_write +#ifdef L_bios_disk_wr _bios_disk_write(drive, cyl, head, sect, length, buffer) { #asm @@ -127,7 +127,7 @@ } #endif -#ifdef L_bios_disk_reset +#ifdef L_bios_disk_rs _bios_disk_reset(drive) { #asm diff -Nurd linux86.old/libc/include/stdarg.h linux86/libc/include/stdarg.h --- linux86.old/libc/include/stdarg.h Sat Jan 25 17:22:09 1997 +++ linux86/libc/include/stdarg.h Sat Aug 3 08:13:15 2002 @@ -43,5 +43,5 @@ #endif /* __STDARG_H */ #if __FIRST_ARG_IN_AX__ -#error First arg is in a register, stdarg.h cannot take its address +#warning First arg is in a register, stdarg.h cannot take its address #endif diff -Nurd linux86.old/libc/include/stdlib.h linux86/libc/include/stdlib.h --- linux86.old/libc/include/stdlib.h Sat Jul 20 12:26:59 1996 +++ linux86/libc/include/stdlib.h Tue Aug 6 07:57:03 2002 @@ -14,10 +14,7 @@ #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 -extern void * malloc __P ((size_t)); -extern void * calloc __P ((size_t, size_t)); -extern void free __P ((void *)); -extern void * realloc __P ((void *, size_t)); +#include extern int rand __P ((void)); extern void srand __P ((unsigned int seed)); @@ -29,6 +26,10 @@ extern double strtod __P ((const char * nptr, char ** endptr)); #endif +extern long int atol __P ((__const char *__nptr)); +extern double atof __P ((__const char *__nptr)); +extern int atoi __P ((__const char *__nptr)); + /* Returned by `div'. */ typedef struct { @@ -42,5 +43,9 @@ long int quot; /* Quotient. */ long int rem; /* Remainder. */ } ldiv_t; + + +extern char *getenv __P ((__const char *__name)); +extern char *mktemp __P ((char *__template)); #endif /* __STDLIB_H */ diff -Nurd linux86.old/libc/string/string.c linux86/libc/string/string.c --- linux86.old/libc/string/string.c Mon Mar 22 19:11:39 1999 +++ linux86/libc/string/string.c Mon Aug 5 20:50:41 2002 @@ -139,6 +139,7 @@ xor ax,ax ; so return zero jmp sc_3 sc_2: + cmc sbb ax,ax ; Collect correct val (-1,1). orb al,#1 sc_3: diff -Nurd linux86.old/makefile.in linux86/makefile.in --- linux86.old/makefile.in Wed Jul 31 23:29:00 2002 +++ linux86/makefile.in Sat Aug 3 22:45:50 2002 @@ -95,7 +95,7 @@ ############################################################################## -LIBARGS= CC=ncc CCFLAGS= AR=$(AR) ARFLAGS=$(ARFLAGS) +LIBARGS= CC=ncc "CCFLAGS=-O" AR=$(AR) ARFLAGS=$(ARFLAGS) # Season in the top makefile ELKSSRC= %ELKSSRC% diff -Nurd linux86.old/man/bcc.1 linux86/man/bcc.1 --- linux86.old/man/bcc.1 Tue May 28 20:51:10 2002 +++ linux86/man/bcc.1 Fri Aug 2 21:16:48 2002 @@ -14,6 +14,7 @@ .RB [ -o\ outfile ] .RB [ -ansi ] .RB [ -Ccc1_option ] +.RB [ -Pcpp_option ] .RB [ -Iinclude_dir ] .RB [ -Lld_option ] .RB [ -Ttmpdir ] @@ -160,10 +161,6 @@ .B -c produce object file .TP -.B -e -run the preprocess pass separately. This takes less memory, and may help -or harm by giving more traditional semantics like token pasting with /**/. -.TP .B -f error (float emulation not supported) .TP @@ -207,12 +204,7 @@ .B bcc-cc1 understands, only some will be useful for the .B -C -option of bcc. The code generator is normally used as a combined C preprocessor -and generator but the -.B -e -and -.B -ansi -options of bcc split the operation. +option of bcc. .TP .B -0 8086 target (works even on 80386 host, not on 6809)