summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>2004-06-04 20:33:25 +0200
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:48:49 +0200
commit6cb598cc5f1c8ae6d14381c2776338584368257e (patch)
tree9e0de9772314990061ca96735910ea5db8d4e778
parentbeba34dc223aa0dcf3e5f696966c5e8408b022c3 (diff)
downloaddev86-6cb598cc5f1c8ae6d14381c2776338584368257e.tar.gz
Import Dev86src-0.16.16.tar.gzv0.16.16
-rw-r--r--Changes9
-rw-r--r--Makefile2
-rw-r--r--as/as.c4
-rw-r--r--bcc/Makefile2
-rw-r--r--bcc/bcc.c11
-rw-r--r--bcc/codefrag.c22
-rw-r--r--bcc/const.h3
-rw-r--r--bcc/genloads.c11
-rw-r--r--bcc/hashcmd.c23
-rw-r--r--bcc/longop.c13
-rw-r--r--bcc/softop.c11
-rw-r--r--bcc/table.c7
-rw-r--r--bootblocks/boot_win.c7
-rw-r--r--ld/io.c4
-rw-r--r--makefile.in5
-rw-r--r--tests/ft.c12
16 files changed, 134 insertions, 12 deletions
diff --git a/Changes b/Changes
index 5c5210a..78a0c27 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,14 @@
For version 0.16.*.
+> Starting to remove builtin cpp from bcc-cc1, beware.
+
+> Added __BCC_VERSION__ macro, defined by bcc.c contains hex version no.
+
+> Bugfix for offsets generated by #asm when using -O option to bcc-cc1.
+ Extra compile option ASM_USES_CALLEE_REGS.
+
+> Extra checking and bugfix for mixing char values with long shifts.
+
> WARNING to distributions: I've altered the install scripts and paths
you will want to check them. Altered paths for bcc.c and normal
installs, defaults should now be good for distributions where bcc is a
diff --git a/Makefile b/Makefile
index 259385b..1b4de4a 100644
--- a/Makefile
+++ b/Makefile
@@ -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.15
+VERSION=0.16.16
TARGETS=install clean other \
bcc unproto copt as86 ld86 elksemu \
diff --git a/as/as.c b/as/as.c
index c5fee7e..fa0f9bf 100644
--- a/as/as.c
+++ b/as/as.c
@@ -193,7 +193,11 @@ char **argv;
case 'v':
outfd = STDOUT;
writes("as86 version: ");
+#ifdef VERSION
writesn(VERSION);
+#else
+ writesn("Unknown!");
+#endif
exit(1);
#ifdef I80386
case '0': case '1': case '2':
diff --git a/bcc/Makefile b/bcc/Makefile
index 8f13f6e..169eae8 100644
--- a/bcc/Makefile
+++ b/bcc/Makefile
@@ -16,7 +16,7 @@ BCFLAGS=$(ANSI) $(CFLAGS) $(LDFLAGS)
OBJS = bcc-cc1.o codefrag.o debug.o declare.o express.o exptree.o floatop.o \
function.o gencode.o genloads.o glogcode.o hardop.o input.o label.o \
loadexp.o longop.o output.o preproc.o preserve.o scan.o softop.o \
- state.o table.o type.o assign.o
+ state.o table.o type.o assign.o hashcmd.o
all: bcc-cc1 bcc
diff --git a/bcc/bcc.c b/bcc/bcc.c
index 5efc4c6..be7ee96 100644
--- a/bcc/bcc.c
+++ b/bcc/bcc.c
@@ -1082,6 +1082,15 @@ char ** argv;
if (opt_arch == 1) libdir_suffix = "/i386";
if (opt_arch == 4) libdir_suffix = "/m09";
+
+#ifdef VERSION
+ {
+ char verbuf[64];
+ sprintf(verbuf, "-D__BCC_VERSION__=0x%02x%02x%02xL",
+ VER_MAJ, VER_MIN, VER_PAT);
+ append_option(verbuf, 'p');
+ }
+#endif
}
void
@@ -1222,8 +1231,10 @@ int size;
void Usage()
{
+#ifdef VERSION
if (opt_v)
fprintf(stderr, "%s: version %s\n", progname, VERSION);
+#endif
fprintf(stderr,
"Usage: %s [-ansi] [-options] [-o output] file [files].\n", progname);
exit(1);
diff --git a/bcc/codefrag.c b/bcc/codefrag.c
index 7783562..d796810 100644
--- a/bcc/codefrag.c
+++ b/bcc/codefrag.c
@@ -1619,6 +1619,18 @@ offset_T value;
outstr(name);
outset();
outshex(value);
+#ifdef FRAMEPOINTER
+#ifdef I8088
+#ifndef NO_DEL_PUSH
+ if (framep && optimise && !callersaves && value+sp-framep >= 0
+ && !(regfuse & callee1mask)) {
+ outbyte('-');
+ outstr(funcname);
+ outstr(".off");
+ }
+#endif
+#endif
+#endif
outnl();
#ifdef FRAMEPOINTER
if (framep)
@@ -1629,6 +1641,16 @@ offset_T value;
outstr(name);
outset();
outshex(value+sp-framep);
+#ifdef I8088
+#ifndef NO_DEL_PUSH
+ if (optimise && !callersaves && value+sp-framep < 0
+ && !(regfuse & callee1mask)) {
+ outbyte('+');
+ outstr(funcname);
+ outstr(".off");
+ }
+#endif
+#endif
outnl();
}
#endif
diff --git a/bcc/const.h b/bcc/const.h
index 7055354..1c44e19 100644
--- a/bcc/const.h
+++ b/bcc/const.h
@@ -21,9 +21,8 @@
#define VERY_SMALL_MEMORY
#endif
-#define SELFTYPECHECK /* check calculated type = runtime type */
-
#ifndef VERY_SMALL_MEMORY
+#define SELFTYPECHECK /* check calculated type = runtime type */
#define DEBUG /* generate compiler-debugging code */
#define OPTIMISE /* include optimisation code */
#define BUILTIN_CPP
diff --git a/bcc/genloads.c b/bcc/genloads.c
index cf0c792..3d0f919 100644
--- a/bcc/genloads.c
+++ b/bcc/genloads.c
@@ -584,7 +584,10 @@ store_pt targreg;
if (strcmp (source->name.namep, "__AX") == 0)
{
/* Load AX register - do nothing. */
-done: source->storage = AXREG; /* in register for further use */
+done:
+ if (targreg != AXREG)
+ bugerror("specified access of register clone variable not implemented");
+ source->storage = AXREG; /* in register for further use */
source->flags = 0;
if (source->level == OFFKLUDGELEVEL)
source->level = EXPRLEVEL;
@@ -653,6 +656,12 @@ store_pt targreg;
{
if ((store_t) targreg & ALLDATREGS && source->type->scalar & CHAR)
targreg = BREG;
+#ifdef I8086
+ if (source->type->scalar & CHAR &&
+ targreg != BREG && targreg != DATREG1B ) {
+ bugerror("moving char sym into int register");
+ }
+#endif
#ifdef I80386
if (i386_32 && source->type->scalar & SHORT &&
source->indcount <= 1)
diff --git a/bcc/hashcmd.c b/bcc/hashcmd.c
new file mode 100644
index 0000000..fd22166
--- /dev/null
+++ b/bcc/hashcmd.c
@@ -0,0 +1,23 @@
+
+/* decode remaining preprocessor lines, minimal version. */
+
+/* Copyright (C) GPL V2, derived from preproc.c by RDB. */
+
+#include "bcc.h"
+#include "input.h"
+#include "os.h"
+#include "output.h"
+#include "parse.h"
+#include "sc.h"
+#include "scan.h"
+#include "table.h"
+#include "type.h"
+
+#ifndef BUILTIN_CPP
+/* docontrol() - process control statement, #line and #asm only. */
+
+PUBLIC void docontrol()
+{
+ bugerror("docontrol for tiny machines not implemented yet");
+}
+#endif
diff --git a/bcc/longop.c b/bcc/longop.c
index 2cdf62a..9f8acb3 100644
--- a/bcc/longop.c
+++ b/bcc/longop.c
@@ -39,7 +39,8 @@ struct symstruct *target;
else
scalar |= source->type->scalar;
if ((source->indcount == 0 && !shiftflag) ||
- source->storage & (DREG | OPREG | OPWORKREG))
+ source->type->scalar & CHAR ||
+ source->storage & (BREG | DREG | OPREG | OPWORKREG))
{
pres2(source, target);
push(source);
@@ -60,6 +61,16 @@ struct symstruct *target;
if (source->offset.offv == 0)
goto shiftdone;
}
+#ifdef I8088
+ /* This is ugly! But it works. I should be able to stop it being used
+ * by removing the char demotion. */
+ if (source->type->scalar & CHAR &&
+ !(source->storage & (BREG|DREG|DATREG1B))) {
+ load(source, DATREG1B);
+ outop2str("xor\tch,ch"); outnl();
+ source->storage = DATREG1;
+ }
+#endif
load(source, OPWORKREG);
switch ((op_t) op)
{
diff --git a/bcc/softop.c b/bcc/softop.c
index acb7b27..dcfa8ae 100644
--- a/bcc/softop.c
+++ b/bcc/softop.c
@@ -219,7 +219,16 @@ struct symstruct *target;
{
case DIVOP:
#ifdef I8088
- call("idiv_");
+ if (uflag)
+ call("idiv_");
+ else {
+ if (i386_32)
+ outnop1str("cdq");
+ else
+ outnop1str("cwd");
+ outop2str("idiv\t");
+ outregname(INDREG0);
+ }
#else
call("idiv");
#endif
diff --git a/bcc/table.c b/bcc/table.c
index 79dcf62..fc7d3a1 100644
--- a/bcc/table.c
+++ b/bcc/table.c
@@ -400,6 +400,13 @@ PUBLIC void dumplocs()
register struct symstruct *symptr;
int i;
+#ifdef ASM_USES_CALLEE_REGS
+ if (framep && optimise && !callersaves) {
+ regfuse |= callee1mask;
+ outnstr("! Assuming #asm uses all callee saves registers");
+ }
+#endif
+
for (i = 0; i < HASHTABSIZE; ++i)
for (symptr = hashtab[i]; symptr != NULL; symptr = symptr->next)
if (symptr->storage == LOCAL)
diff --git a/bootblocks/boot_win.c b/bootblocks/boot_win.c
index e38eebb..5fb5693 100644
--- a/bootblocks/boot_win.c
+++ b/bootblocks/boot_win.c
@@ -49,6 +49,13 @@ main()
if (rv != 0 || bs_buf[510] != 0x55 || bs_buf[511] != (char)0xAA) {
cprintf("Hard disk not bootable.\n");
floppy_only = 1;
+
+ /* Check for zapped MBR */
+ for(i=0; i<512; i++) {
+ if (bs_buf[i]) break;
+ if (i==511)
+ boot_floppy();
+ }
}
if (!floppy_only) {
diff --git a/ld/io.c b/ld/io.c
index bc8e73c..542ab63 100644
--- a/ld/io.c
+++ b/ld/io.c
@@ -626,8 +626,12 @@ PUBLIC void usage()
PUBLIC void version_msg()
{
stderr_out();
+#ifdef VERSION
putstr("ld86 version: ");
errexit(VERSION);
+#else
+ errexit("ld86 version unknown");
+#endif
}
PUBLIC void use_error(message)
diff --git a/makefile.in b/makefile.in
index 7960f05..5a10e73 100644
--- a/makefile.in
+++ b/makefile.in
@@ -150,6 +150,11 @@ bindir: $(MAKEX)
bcc: bindir
echo '#define VERSION "'"$(VERSION)"'"' > bcc/version.h
+ VER=$(VERSION) ; \
+ echo "#define VER_MAJ $${VER%%.*}" >> bcc/version.h ; \
+ VER="$${VER#*.}" ; \
+ echo "#define VER_MIN $${VER%.*}" >> bcc/version.h ; \
+ echo "#define VER_PAT $${VER#*.}" >> bcc/version.h
$(MAKEC) bcc $(MAKEARG) BCCARCH='$(BCCARCH)' bcc ncc bcc-cc1
cp -p bcc/bcc$(EXE) bin/Bcc$(EXE)
cp -p bcc/ncc$(EXE) bin/ncc$(EXE)
diff --git a/tests/ft.c b/tests/ft.c
index bce51c5..7acc557 100644
--- a/tests/ft.c
+++ b/tests/ft.c
@@ -722,13 +722,15 @@ static int last_uid=-1, last_gid=-1, last_mode=-1;
if( (cur_file_stat.st_mode&07777) != (last_mode&07777) )
printf(":%03o", cur_file_stat.st_mode & 07777);
- major = (cur_file_stat.st_rdev >> 8);
- minor = (cur_file_stat.st_rdev&0xFF);
#ifdef __linux__
- major &= 0xFFF;
- minor |= ((cur_file_stat.st_rdev&0xFF000000)>>12);
+ major = ((cur_file_stat.st_rdev >> 8) & 0xfff);
+ if (sizeof(cur_file_stat.st_rdev) > 4)
+ major |= ((cur_file_stat.st_rdev >> 32) & ~0xfff);
+ minor = (cur_file_stat.st_rdev & 0xff) |
+ ((cur_file_stat.st_rdev >> 12) & ~0xff);
#else
- major &= 0xFF;
+ major = ((cur_file_stat.st_rdev >> 8) & 0xFF);
+ minor = (cur_file_stat.st_rdev&0xFF);
#endif
switch(cur_file_stat.st_mode & S_IFMT)
{