From 2f828530e36a02c5b4c534e42ab812370c2bf7d9 Mon Sep 17 00:00:00 2001 From: Robert de Bath Date: Thu, 12 Feb 1998 22:41:49 +0100 Subject: Import Dev86src-0.14.0.tar.gz --- bcc/assign.c | 2 +- bcc/bcc.c | 20 +++++++++++++++++++- bcc/codefrag.c | 6 ++++++ bcc/genloads.c | 8 +++++++- bcc/input.c | 6 +++++- bcc/preproc.c | 2 +- bcc/scan.c | 1 + bcc/softop.c | 15 ++++++++++----- bcc/state.c | 1 + 9 files changed, 51 insertions(+), 10 deletions(-) (limited to 'bcc') diff --git a/bcc/assign.c b/bcc/assign.c index f7e2853..27d1366 100644 --- a/bcc/assign.c +++ b/bcc/assign.c @@ -133,7 +133,7 @@ struct symstruct *target; struct symstruct worksource; oldtarget = *target; - if ((typesize = target->type->typesize) >= 16 * itypesize || + if ((typesize = target->type->typesize) >= 8 * itypesize || source->indcount + target->indcount != 2) { address(source); diff --git a/bcc/bcc.c b/bcc/bcc.c index 643f766..42faf7c 100644 --- a/bcc/bcc.c +++ b/bcc/bcc.c @@ -161,6 +161,7 @@ char *strrchr P((const char *s, int c)); #ifdef REDECLARE_POSIX_FUNCTIONS int access P((const char *path, int amode)); int execv P((const char *path, char * const *argv)); +int execve P((const char *path, char * const *argv, char * const envp)); pid_t fork P((void)); pid_t getpid P((void)); int unlink P((const char *path)); @@ -196,6 +197,14 @@ FORWARD void writes P((char *s)); FORWARD void writesn P((char *s)); FORWARD void linux_patch P((char * fname)); +#ifdef __BCC__ +char ** minienviron[] = { + "PATH=/bin:/usr/bin", + "SHELL=/bin/sh", + 0 +}; +#endif + PUBLIC int main(argc, argv) int argc; char **argv; @@ -415,7 +424,12 @@ char **argv; temp=optflags; optflags=stralloc2(optflags,"86,86"); free(temp); - addarg(&optargs, "-huse16 386"); + switch(arg[2]) + { + case '1': addarg(&optargs, "-huse16 186"); break; + case '2': addarg(&optargs, "-huse16 286"); break; + case '3': addarg(&optargs, "-huse16 386"); break; + } } break; case 'P': @@ -1232,7 +1246,11 @@ struct arg_s *argp; show_who("fork failed"); fatal(""); case 0: +#ifdef __BCC__ + execve(argp->prog, argp->argv + arg0, minienviron); +#else execv(argp->prog, argp->argv + arg0); +#endif show_who("exec of "); writes(argp->prog); fatal(" failed"); diff --git a/bcc/codefrag.c b/bcc/codefrag.c index e4359bb..e7961ce 100644 --- a/bcc/codefrag.c +++ b/bcc/codefrag.c @@ -1325,6 +1325,12 @@ store_pt reg; fastin_t mulsp; int stackentry; /* signed */ +#ifdef I8088 + /* Now using imul directly so don't be so keen to shift */ + if( factor > 16 && factor != 32 && factor != 64 && factor != 0xFFFFFFFFL ) + return FALSE; +#endif + if (factor == 0) { clr(reg); diff --git a/bcc/genloads.c b/bcc/genloads.c index 652127e..e90dd5d 100644 --- a/bcc/genloads.c +++ b/bcc/genloads.c @@ -29,6 +29,7 @@ struct symstruct *source; outadd(); outregname(source->storage); outcomma(); + outimmed(); outnamoffset(source); outnl(); if (source->storage & (AXREG | ALREG)) @@ -629,7 +630,6 @@ store_pt reg; PRIVATE void outnamoffset(adr) struct symstruct *adr; { - outimmed(); if (adr->flags & LABELLED) outlabel(adr->name.label); else @@ -705,7 +705,13 @@ struct symstruct *adr; case INDREG1: case INDREG2: if (adr->level == OFFKLUDGELEVEL) + { +#ifdef I8088 + if (!indflag) +#endif + outimmed(); outnamoffset(adr); + } #ifndef MC6809 else if (adr->offset.offi != 0) #endif diff --git a/bcc/input.c b/bcc/input.c index d7667ca..5084663 100644 --- a/bcc/input.c +++ b/bcc/input.c @@ -800,7 +800,11 @@ PRIVATE void usage() fatalerror( #ifdef MC6809 "usage: cc1 [-cdfptw[-]] [-Ddefine] [-Iincdir] [-Uundef] [-o outfile] [infile]"); -#else +#else +#ifdef I80386 "usage: cc1 [-03cdfltw[-]] [-Ddefine] [-Iincdir] [-Uundef] [-o outfile] [infile]"); +#else +"usage: cc1 [-cdfltw[-]] [-Ddefine] [-Iincdir] [-Uundef] [-o outfile] [infile]"); +#endif #endif } diff --git a/bcc/preproc.c b/bcc/preproc.c index 37ca1d5..a455ee2 100644 --- a/bcc/preproc.c +++ b/bcc/preproc.c @@ -72,7 +72,7 @@ PRIVATE void asmcontrol() outstr("#asm\n"); else { - outstr("!BCC_ASM\n"); + outnstr("!BCC_ASM"); dumplocs(); } #ifndef ASM_BARE diff --git a/bcc/scan.c b/bcc/scan.c index 3aad1a2..973bcab 100644 --- a/bcc/scan.c +++ b/bcc/scan.c @@ -144,6 +144,7 @@ int asm_only; while (!asm_only || asmmode) { int sym = SYMOFCHAR(ch); + switch (sym) { case CONTROL: diff --git a/bcc/softop.c b/bcc/softop.c index e2e2b25..acb7b27 100644 --- a/bcc/softop.c +++ b/bcc/softop.c @@ -188,21 +188,26 @@ struct symstruct *target; extend(target); load(target, DREG); -#ifndef IN_FUNC /* I8088 ? */ +#if defined(I8088) if ((op_t) op != DIVOP && (op_t) op != MODOP ) { load(source, DATREG1); /* CX */ switch ((op_t) op) { case MULOP: - outnop2str("imul\tcx"); + outop2str("imul\t"); + outnregname(DATREG1); break; case SLOP: - outnop2str("shl\tax,cl"); + outop2str("shl\t"); + outregname(DREG); + outnstr(",cl"); break; case SROP: - if (uflag) outnop2str("shr\tax,cl"); - else outnop2str("sar\tax,cl"); + if (uflag) outop2str("shr\t"); + else outop2str("sar\t"); + outregname(DREG); + outnstr(",cl"); break; } } diff --git a/bcc/state.c b/bcc/state.c index 9fdb224..620b553 100644 --- a/bcc/state.c +++ b/bcc/state.c @@ -240,6 +240,7 @@ PRIVATE void doasm() nextsym(); constant.value.s[charptr-constant.value.s]='\0'; outnstr("!BCC_ASM"); + outbyte('\t'); outnstr(constant.value.s); outnstr("!BCC_ENDASM"); rparen(); -- cgit v1.2.1