summaryrefslogtreecommitdiff
path: root/bcc
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>1998-02-12 22:41:49 +0100
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:40:21 +0200
commit2f828530e36a02c5b4c534e42ab812370c2bf7d9 (patch)
treec26ea035d122f5374ed4c9ef39c6748742541ef5 /bcc
parent48f0b3eb836162d41622cedc1eb5f5168168fb8e (diff)
downloaddev86-2f828530e36a02c5b4c534e42ab812370c2bf7d9.tar.gz
Import Dev86src-0.14.0.tar.gzv0.14.0
Diffstat (limited to 'bcc')
-rw-r--r--bcc/assign.c2
-rw-r--r--bcc/bcc.c20
-rw-r--r--bcc/codefrag.c6
-rw-r--r--bcc/genloads.c8
-rw-r--r--bcc/input.c6
-rw-r--r--bcc/preproc.c2
-rw-r--r--bcc/scan.c1
-rw-r--r--bcc/softop.c15
-rw-r--r--bcc/state.c1
9 files changed, 51 insertions, 10 deletions
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();