diff options
author | Robert de Bath <rdebath@poboxes.com> | 2012-08-13 22:10:14 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-29 16:29:38 +0100 |
commit | 7903db3a2614185b8eeb420fb770db1f7735d458 (patch) | |
tree | 21c2b1f315b017c2a56c0c23f10f302ce2b7c6ad | |
parent | 5b6aee2a90b337856aa23fd24a4637f488929ed0 (diff) | |
download | dev86-release.tar.gz |
Various non-dist release toolingrelease
-rw-r--r-- | 00index | 21 | ||||
-rwxr-xr-x | Copy_dist | 88 | ||||
-rw-r--r-- | ELKS-Rel-dates | 137 | ||||
-rw-r--r-- | NewCompiler | 121 | ||||
-rw-r--r-- | NewPATHS | 55 | ||||
-rw-r--r-- | README.ash | 115 | ||||
-rw-r--r-- | README.dos | 18 | ||||
-rw-r--r-- | TODO | 96 | ||||
-rw-r--r-- | compile.bat | 215 | ||||
-rw-r--r-- | limits.c | 66 | ||||
-rwxr-xr-x | mkdos | 60 | ||||
-rw-r--r-- | mkdosbin | 14 | ||||
-rwxr-xr-x | mkzip | 22 |
13 files changed, 1028 insertions, 0 deletions
@@ -0,0 +1,21 @@ +This is a cross development C compiler, assembler and linker environment +for the production of 8086 executables (Optionally MSDOS COM) + +All you need is in the 'Dev86src-X.Y.Z.tar.gz' file, the others provide only +parts of this or just the binaries. + +Dev86src-X.Y.Z.tar.gz The complete source +as86-X.Y.Z.tar.gz The assembler source only +bin86-X.Y.Z.tar.gz The source to the standard 'bin86' package. + +Dev86bin-X.Y.Z.tar.gz Linux-386 ELF binaries (libc6) +Dev86dos-X.Y.Z.zip Msdos binaries for making COM files. +Dev86clb-X.Y.Z.zip Libc binaries all the libc archive files + pre-compiled. (For DOS, minix or any machine + without GNU make installed) + +patch-*.gz Patch files, two version numbers mean the + patch is between those versions. One means + it's between X.Y.Z and X.Y.(Z-1). + +Robert. diff --git a/Copy_dist b/Copy_dist new file mode 100755 index 0000000..996605b --- /dev/null +++ b/Copy_dist @@ -0,0 +1,88 @@ +set -x +trap "exit 1" 1 2 3 15 + +SRCDIRS='bcc unproto as ar ld copt man elksemu dis88 tests libbsd bin86' +DISTFILES='Libc_version Makefile README COPYING MAGIC Changes Contributors + mkcompile mkcompile2 later.c GNUmakefile libcompat + ifdef.c makefile.in' + +DIR=`pwd` +rm -rf /tmp/linux-86 /tmp/linux-86.old /tmp/linux-86-dist +mkdir /tmp/linux-86 + +#----------------------------------------------------------------------- + +cd $DIR + make -C libc Libc_version + make -C bin86 ungrab + VER=`cat Libc_version` + + cp -a $DISTFILES $SRCDIRS /tmp/linux-86 + +#----------------------------------------------------------------------- + +cd $DIR + +LIBC_FILES='Makefile Make.defs crt0.c + README COPYING KERNEL + New_subdir Pre_main Config_sh Config.dflt' + +mkdir /tmp/linux-86/libc +cd libc +set +x +LIBC_DIRS="`for i in */Makefile */Config; do dirname $i; done | sort -u`" +set -x + +cp -a $LIBC_FILES include $LIBC_DIRS /tmp/linux-86/libc/. + +#----------------------------------------------------------------------- + +cd $DIR +make -C bootblocks distribution +make -C doselks distribution + +mkdir /tmp/linux-86/bootblocks +cd /tmp/linux-86/bootblocks + tar xzf /tmp/bootblocks.tar.gz + +mkdir /tmp/linux-86/doselks +cd /tmp/linux-86/doselks + tar xzf /tmp/doselks.tar.gz + +cd /tmp + [ "`id -un`" = "root" ] && + { + chown -R root:root linux-86 + chmod -R og=u-w linux-86 + } + +rm -f /tmp/bootblocks.tar.gz /tmp/doselks.tar.gz /tmp/libc-8086-$VER.tar.gz + +cd /tmp/linux-86 + make -s clean realclean + set +x + mv as/obj1 /tmp/linux-86-obj1 + EXCL="`find . -name '*.o' -o -name '*.obj' \ + -o -name '*.lib' -o -name '*.bak' \ + -o -name '*~' -o -name '*.exe' \ + -o -name '*.orig' -o -name '*.rej' \ + `" + mv /tmp/linux-86-obj1 as/obj1 + set -x + rm -f $EXCL + rm -f `find . -type l` + +mkdir /tmp/linux-86.tmp + cd /tmp/linux-86.tmp + tar xzf `ls -tr $DIR/arc/Dev86src*.tar.gz | tail -1` + mv linux-86 /tmp/linux-86.old +cd /tmp + rmdir linux-86.tmp + +mkdir -p /tmp/Dist +chmod 777 /tmp/Dist + + diff -Nurd linux-86.old linux-86 > /tmp/Dist/Dev86src-$VER.patch + gzip -v9f /tmp/Dist/Dev86src-$VER.patch + +exit 0 diff --git a/ELKS-Rel-dates b/ELKS-Rel-dates new file mode 100644 index 0000000..d29d48a --- /dev/null +++ b/ELKS-Rel-dates @@ -0,0 +1,137 @@ + +For ELKS/linuxmt + +Date: Sat, 2 Dec 1995 14:04:01 -0800 (PST) +Subject: Linux/16 0.00.4.0 released... +From: Chad Page <page0588@sundance.sjsu.edu> + +Date: Wed, 6 Dec 1995 16:14:30 -0800 (PST) +Subject: Linux16-0.00.4.1.tar.gz released. +From: Chad Page <page0588@sundance.sjsu.edu> + +Date: Fri, 23 Feb 1996 15:01:12 -0800 (PST) +Subject: Linux/16 0.0.5.0 out (ELKS 0.0.13 + some build fixes) +From: Chad Page <page0588@sundance.sjsu.edu> + +Date: Sun, 8 Sep 1996 09:07:18 +0100 (BST) +Subject: ELKS release 0.0.44snap +From: Chad Page <page0588@sundance.sjsu.edu> + +Date: Sat, 7 Dec 1996 18:27:10 -0800 (PST) +Subject: elks-pre0.0.45 now at tsx-11... +From: Chad Page <page0588@sundance.sjsu.edu> + +------------------------------------------------------------------------- + +Date: Sat, 4 Jan 1997 19:37:46 -0800 (PST) +Subject: 0.0.48 out on linux.mit.edu... +From: Chad Page <page0588@sundance.SJSU.EDU> + +Date: Wed, 8 Jan 1997 19:05:20 -0800 (PST) +Subject: 0.0.49 released... +From: Chad Page <page0588@sundance.SJSU.EDU> + +Date: Thu, 9 Jan 1997 18:01:39 -0800 (PST) +Subject: 0.0.50 out (featuring file writes!) +From: Chad Page <page0588@sundance.SJSU.EDU> + +Date: Sat, 11 Jan 1997 22:36:44 -0800 (PST) +Subject: 0.0.51 released... +From: Chad Page <page0588@sundance.SJSU.EDU> + +Date: Wed, 15 Jan 1997 18:52:39 -0800 (PST) +Subject: 0.0.52 out - was Re: Snapshots, anyone? +From: Chad Page <page0588@sundance.SJSU.EDU> + +Date: Fri, 28 Feb 1997 17:13:30 -0800 (PST) +Subject: 0.0.53 now up on my site (others soon) +From: Chad Page <cpage@comp3244.resnet.sjsu.edu> + +Date: Wed, 5 Mar 1997 22:49:38 -0800 (PST) +Subject: 0.0.54 released (vroom! :) +From: Chad Page <cpage@comp3244.resnet.sjsu.edu> + +Date: Thu, 27 Mar 1997 12:45:22 -0800 (PST) +Subject: 0.0.55 posted on my site (others to follow RSN) +From: Chad Page <cpage@comp3244.resnet.sjsu.edu> + +Date: Sun, 30 Mar 1997 15:48:14 -0800 (PST) +Subject: 0.0.56 released +From: Chad Page <cpage@comp3244.resnet.sjsu.edu> + +Date: Sun, 20 Apr 1997 21:03:33 -0700 (PDT) +Subject: 0.0.57 is out! +From: Chad Page <cpage@comp3244.resnet.sjsu.edu> + +Date: Fri, 25 Apr 1997 23:51:34 -0700 (PDT) +Subject: 0.0.58 released... +From: Chad Page <cpage@comp3244.resnet.sjsu.edu> + +Date: Tue, 29 Apr 1997 18:51:11 -0700 (PDT) +Subject: 0.0.59 on linux,tsx-11.mit.edu +From: Chad Page <cpage@comp3244.resnet.sjsu.edu> + +Date: Thu, 1 May 1997 18:59:34 -0700 (PDT) +Subject: 0.0.60 posted on linux.mit.edu +From: Chad Page <cpage@comp3244.resnet.sjsu.edu> + +Date: Sun, 11 May 1997 20:36:23 -0700 (PDT) +Subject: pre-0.0.61 thrown together and released :) +From: Chad Page <cpage@comp3244.resnet.sjsu.edu> + +Date: Sun, 29 Jun 1997 15:22:46 -0400 (EDT) +Subject: elks-0.0.62 put up on linux.mit.edu +From: Chad Page <chad@aleph1.mit.edu> + +Date: Fri, 8 Aug 1997 14:38:01 +0100 (BST) +Subject: ELKS 0.0.63 +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Tue, 19 Aug 1997 17:59:06 +0100 (BST) +Subject: ELKS 0.0.64 on ftp.ecs.soton.ac.uk +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Wed, 20 Aug 1997 20:27:45 +0100 (BST) +Subject: ELKS 0.0.65 on ftp.ecs.soton.ac.uk +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Wed, 15 Oct 1997 15:07:46 +0100 (BST) +Subject: ELKS 0.0.66 available on ftp.ecs.soton.ac.uk +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Wed, 15 Oct 1997 15:07:46 +0100 (BST) +Subject: ELKS 0.0.66 available on ftp.ecs.soton.ac.uk +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Sat, 22 Nov 1997 22:10:18 +0000 (GMT) +Subject: ELKS 0.0.67 on ftp.ecs.soton.ac.uk +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Sun, 8 Feb 1998 23:26:41 +0000 (GMT) +Subject: ELKS 0.0.68 on ftp.ecs.soton.ac.uk +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Tue, 24 Mar 1998 20:51:47 +0000 (GMT) +Subject: ELKS 0.0.69 on ftp.ecs.soton.ac.uk +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Sun, 10 May 1998 18:14:04 +0100 (BST) +Subject: ELKS 0.0.70 available on ftp.ecs.soton.ac.uk +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Mon, 25 May 1998 04:00:38 +0100 (BST) +Subject: ELKS 0.0.71 available from ftp.ecs.soton.ac.uk +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Sun, 14 Jun 1998 19:34:06 +0100 (BST) +Subject: ELKS 0.0.72 released +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Fri, 23 Oct 1998 13:53:28 +0100 (BST) +Subject: ELKS 0.0.73 available +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + +Date: Thu, 3 Dec 1998 18:17:43 +0000 (GMT) +Subject: ELKS 0.0.74 available on ftp.ecs.soton.ac.uk +From: Alistair Riddoch <ajr@ecs.soton.ac.uk> + diff --git a/NewCompiler b/NewCompiler new file mode 100644 index 0000000..1633320 --- /dev/null +++ b/NewCompiler @@ -0,0 +1,121 @@ + +1) Convert symbols -> typed name. +2) Convert symbols -> name with offset. + +Use scan & sort methods. + 1) Scan for labels & use of labels into a file + 2) Sort file so that use of a label immediatly follows definition. + 3) Foreach fixup seek & fix. + +Passes + CPP + does # scanning + does token scanning + produces tokenised file as output. (designed for top speed read/write) + file contains fixup slots for token numbers. + ?file still holds whitespace, line numbers and comments as tokens. + ?cpp does infix -> rpn + create fixup list of variable names and offsets where referenced. + + token file is records of form: + byte: token type (zero is a no-op, has no string. (ptr++)) + byte: string length with nul. (next-> ptr=ptr+ptr.len+2 ) + ascii: string with null. (doesn't need to be copied on read.) + + If the string is a keyword it may not be nul terminated. + If length == 0 then string is 256 bytes (inc nul) + Tokens 0xF0 to 0xFE are for data used in format conversion not + compiling. Token 0xFF is a file type confirmation (magic number) + CC1 + sort and apply fixup list. Each token name is assigned a unique no. + CC2 + generate code line by line, do NO fixups. + no hash should be needed as cc1 replaces variables by numbers and + C defines variables before use. + Use array of pointers so out of scope variable takes only 2 bytes. + create meta assembler file. + OPT + read & write meta assembler file. + peephole optimise. + AS + read & write meta assembler file. + converter for text assembler. + converter has variable -> type converter. + output file contains only DB/DW/DD like items. + does all address size opts. + LD + read meta assembler + create binary with holes for linkages. + single binary for all objects. + create binary fixup list. (sort it) + + library operations (see ranlib) + ld -r ==> cat (except include filename at start of each) (cat ok tho) + ?does ranlib convert ld-r to *.a ? + SORT + merge fixup lists for all files. + FIXUP + fixup binary with sorted fixup list. + +sort & fixup program + Reads list of fixup files, sort and merge them + output a) sorted fixup + b) apply fixup to object + Multiple fixup types.. + i) Binary bytes 1, 2, 4 + ii) Hex number 1..8 + Multiple values + i) Literal in definition. + ii) Bases(N) + Literal in definition. + iii) fixup definition number (first fixup, second etc) + c) ascii dump of fixups. + + fixups may have library number to allow duplicates. + flags to note if (each file) input is already sorted. + +ranlib + read archive of objects + create sorted list of lable -> objects to import. + Perhaps a bitmap ? Compressed bitmap ? + +ld + foreach library. + ld scans it's fixup list for undefined refs scans import list at + same time. Puts list of objects to import into sorted (uniq) list. + Adds objects to binary and merges fixups. + + Weak fixups. + Definitions from a library have a library number added to them. + Fixup doesn't complain (much) about inter-library collisions. + Import list in ranlib means links to same library have preference. + Otherwise use lowest library number (object is library zero). + Complain if definition is in earlier library. + +fixup list format + token + len + string format. + token are: + + 0xFF 6 "Fixup0" + 0x01 n "label name" + 0x02 n "library id" + + 0x10 n "define literal" + 0x11 0 -- value is next id number. + + 0x20 n "litteral offset from base 0" + 0x21 n "litteral offset from base 1" + 0x22 n "litteral offset from base 2" + 0x23 n "litteral offset from base 3" + + 0x05 n "to fixup file id" + 0x06 n "to fixup file offset" + + Strings may be suffixed with nuls others prefixed to bring up to multiple + of 2, 4 or 8 bytes. + +Dead code elimination + Which pass? + May run over entire function, "goto" instruction. + + Early stage can trap "if (constant)" but labels are live and may revive + initialisations. diff --git a/NewPATHS b/NewPATHS new file mode 100644 index 0000000..545c7ed --- /dev/null +++ b/NewPATHS @@ -0,0 +1,55 @@ + +Build and DOS + + ~/bin + ~/lib + ~/include + ~/man + +ELKS Native + + /usr/bin + /usr/lib + /usr/include + /usr/man + /lib/liberror.txt + +Cross + + /usr/bin + /usr/lib/bcc + /usr/lib/bcc/include + /usr/man + +Local Cross + + /usr/local/bin + /usr/local/lib/bcc + /usr/local/lib/bcc/include + /usr/local/man + +-------------------------------- +1) i386 is always under lib + +*) BCC_DIR == / --> add to paths for Native + +*) BCC_DIR == /usr --> Non-native +*) BCC_DIR == /usr/local --> Non-native + +*) BCC_DIR == '' --> Like Native, not "/usr" +*) BCC_DIR == . --> Like Native, uses pwd. + + DOS or build dir. + Instead of /usr add the current path to bcc less the exe name and + the last piece IF it's /bin. The paths with and without /bin are + both added to the exe list (/bin first). + + POSS: If exe is a symlink add both before and after, after first. + +*) BCC_DIR is an env var who's existance overrides built in. +*) --> No need for ncc, it's same as BCC_DIR="" bcc + +-------------------------------- + +Remove default_libdir[03] +Add default_libdir and default_libsuffix. diff --git a/README.ash b/README.ash new file mode 100644 index 0000000..b245154 --- /dev/null +++ b/README.ash @@ -0,0 +1,115 @@ +Building /bin/ash + +After doing make install for 'bcc' unpack ash-linux-0.2.tar.gz; within this +rename builtins to builtins.in then patch with this patchfile. + +You'll also need to turn on 'JOBS' on line 58 of shell.h when libc can +provide the functions. + +If you don't install the elksemu kernel patch you'll also have to make +sure that the programs that are run by the make file are interpreted +through elksemu. If it's installed you should be able just to type 'make'. + +diff -ru ash-linux-0.2/Makefile ash/Makefile +--- ash-linux-0.2/Makefile Sun May 15 20:16:13 1994 ++++ ash/Makefile Sat Mar 16 11:28:19 1996 +@@ -1,5 +1,9 @@ + # Makefile,v 1.7 1993/08/09 04:58:18 mycroft Exp + ++CC=bcc ++CFLAGS=-e -DSHELL ++LDFLAGS=-s ++ + PROG= sh + SRCS= builtins.c cd.c dirent.c echo.c error.c eval.c exec.c expand.c \ + input.c jobs.c mail.c main.c memalloc.c miscbltin.c \ +@@ -14,8 +18,8 @@ + + OBJS = $(OBJ1) $(OBJ2) + +-CFLAGS = -O2 -fomit-frame-pointer -m486 -DSHELL -I/usr/include/bsd -I. +-LDFLAGS = -s -lbsd ++# CFLAGS = -O2 -fomit-frame-pointer -m486 -DSHELL -I/usr/include/bsd -I. ++# LDFLAGS = -s -lbsd + + CLEANFILES =\ + builtins.c builtins.h init.c mkinit mknodes mksyntax \ +@@ -32,7 +36,7 @@ + token.def: mktokens + sh ./mktokens + +-builtins.h builtins.c: mkbuiltins builtins ++builtins.h builtins.c: mkbuiltins builtins.in + sh ./mkbuiltins + + init.c: mkinit $(SRCS) +Only in ash-linux-0.2: builtins +Only in ash: builtins.in +diff -ru ash-linux-0.2/main.c ash/main.c +--- ash-linux-0.2/main.c Mon Oct 4 19:47:56 1993 ++++ ash/main.c Sun Feb 18 21:57:59 1996 +@@ -321,9 +321,9 @@ + /* + * Should never be called. + */ +-#endif + + void + exit(exitstatus) { + _exit(exitstatus); + } ++#endif +diff -ru ash-linux-0.2/miscbltin.c ash/miscbltin.c +--- ash-linux-0.2/miscbltin.c Mon Oct 4 19:47:56 1993 ++++ ash/miscbltin.c Sun Feb 18 21:56:14 1996 +@@ -45,6 +45,7 @@ + + #include <sys/types.h> + #include <sys/stat.h> ++#include <ctype.h> + #include "shell.h" + #include "options.h" + #include "var.h" +@@ -208,14 +209,18 @@ + umask(mask); + } else { + #ifndef __linux__ ++#ifndef __BCC__ + void *set; + if ((set = setmode (ap)) == 0) + #endif ++#endif + error("Illegal number: %s", ap); + + #ifndef __linux__ ++#ifndef __BCC__ + mask = getmode (set, ~mask & 0777); + umask(~mask & 0777); ++#endif + #endif + } + } +diff -ru ash-linux-0.2/mkbuiltins ash/mkbuiltins +--- ash-linux-0.2/mkbuiltins Sun Apr 18 18:37:04 1993 ++++ ash/mkbuiltins Mon Feb 12 19:42:46 1996 +@@ -54,7 +54,7 @@ + #include "builtins.h" + + ! +-awk '/^[^#]/ {if('$havejobs' || $2 != "-j") print $0}' builtins | ++awk '/^[^#]/ {if('$havejobs' || $2 != "-j") print $0}' builtins.in | + sed 's/-j//' > $temp + awk '{ printf "int %s();\n", $1}' $temp + echo ' +diff -ru ash-linux-0.2/shell.h ash/shell.h +--- ash-linux-0.2/shell.h Mon Oct 4 19:47:56 1993 ++++ ash/shell.h Sat Mar 16 11:28:54 1996 +@@ -60,7 +60,7 @@ + #define DIRENT 1 + #define UDIR 0 + #define ATTY 0 +-#define BSD ++/* #define BSD */ + /* #define DEBUG */ + + #ifdef __STDC__ diff --git a/README.dos b/README.dos new file mode 100644 index 0000000..bb28f26 --- /dev/null +++ b/README.dos @@ -0,0 +1,18 @@ +Dear dos user,
+
+You'll find a little documentation in the txt subdirectory, they are
+the converted manual pages. This is about all the documentation there
+is but you must be able to get the source the same place you got this.
+(These programs are distributed under GPL and it is a condition of the
+copyright)
+
+To use the compiler make sure the zip is uncompressed with the -d option
+and put the BCC/BIN subdirectory into the path. You should then be able
+to use BCC. NOTE: under dos the default executable form is a small mode
+(64k+64k) COM file, DOS fails if the COM file is more than 63k long.
+
+It's probably not a good idea to unpack this over an older version.
+
+Have fun!
+
+Rob.
@@ -0,0 +1,96 @@ + +bcc-cc1: + Output markers when the contents of a register is discarded. + +bcc-cc1: + Still crashes on 8086. + +Add in 'smalllibc.c' as an example. (Do TCC support right? ie: dev86 libc?) + +Check for (text,data,bss,stack,heap) elks file format support. + +bcc-cc1: + Remove demotion of constant integers and '&' results to chars. + +---------------------------------------------------------------------------- + +DOS Talk command: + 1) Port to bcc + 2) Make emulation into 'linux' + +---------------------------------------------------------------------------- + +BIOS Library changes: + Make lots of "bit's" libraries eg: + + -Obios_vt52.o + -Obios_ansi.o + -Obios_fat.o + -Obios_rofat.o + -Obios_minix.o + -Obios_ramdisk.o + -- in extended memory, use block device for bzImage ? + + Each one has an 'entry' function that means it is linked into the pre-main + function processing. + (Add to -O option second search for path/<file>.o ) + +---------------------------------------------------------------------------- +Changes file -> bin86 dist. + +---------------------------------------------------------------------------- +Make doselks the normal way to execute programs under DOS. +Have the DOS version of the linker create an EXE file including the doselks +com file as an 'interpreter'. + +Or only do this for the bcc program so it can call ELKS bcc-cc1, as86 etc. +Special exec function, elks exe's included in a dos .EXE file? + +---------------------------------------------------------------------------- +/* +There's a documented code generator feature in BCC. +This fails because char is always unsigned +*/ + +char c; +func() +{ + if( (c=fgetc()) != -1 ) return -1; + return c&0xFF; +} +---------------------------------------------------------------------------- +GCC-ELKS, sbrk(), brk() + +---------------------------------------------------------------------------- +Full cross compile without install. + Make the host tools + Make the libraries with host compiled tools + Make the i86 tools + (optional) Make the libraries with i86 tools. + Install as either i386 or i86. + + 1) Install ncc under "." + 2) Do an 8086 tool compile. + 3) Do a libcompile with ncc. + 4) Install i386 from ncc tree. + +Initial make ? + make cross + make native + +---------------------------------------------------------------------------- +For 'as' ... + +Update 6809/const.h. + +Produce bsd symbol tables. + +Accept gas format. + +Decide how to choose between 8-bit and 32-bit branches. 16-bit branches in +32-bit mode are unusable because top 16 bits of PC are messed up. + +Buffer for printing of listing. + +Need to make assembler remember the code it generated in the penultimate +pass and regenerate code of exactly the same length in the last pass. diff --git a/compile.bat b/compile.bat new file mode 100644 index 0000000..7c4955c --- /dev/null +++ b/compile.bat @@ -0,0 +1,215 @@ +@echo off
+cl -Ms -nologo -O -c -Fo%TMP%\bcc.obj bcc\bcc.c
+if errorlevel 1 goto exit_now
+
+cl -Ms -o bin\bcc.exe %TMP%\bcc.obj %LIB%\setargv.obj -link /NOE
+if errorlevel 1 goto exit_now
+
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\main.obj cpp\main.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\cpp.obj cpp\cpp.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\hash.obj cpp\hash.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\token1.obj cpp\token1.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\token2.obj cpp\token2.c
+if errorlevel 1 goto exit_now
+
+if exist %TMP%\doslib.lib del %TMP%\doslib.lib
+lib %TMP%\doslib.lib +%TMP%\cpp.obj +%TMP%\hash.obj +%TMP%\token1.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\token2.obj;
+if errorlevel 1 goto exit_now
+
+cl -Ml -o lib\bcc-cpp.exe %TMP%\main.obj %TMP%\doslib.lib
+if errorlevel 1 goto exit_now
+
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\bcc-cc1.obj bcc\bcc-cc1.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\assign.obj bcc\assign.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\codefrag.obj bcc\codefrag.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\debug.obj bcc\debug.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\declare.obj bcc\declare.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\express.obj bcc\express.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\exptree.obj bcc\exptree.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\floatop.obj bcc\floatop.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\function.obj bcc\function.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\gencode.obj bcc\gencode.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\genloads.obj bcc\genloads.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\glogcode.obj bcc\glogcode.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\hardop.obj bcc\hardop.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\input.obj bcc\input.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\label.obj bcc\label.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\loadexp.obj bcc\loadexp.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\longop.obj bcc\longop.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\output.obj bcc\output.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\preproc.obj bcc\preproc.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\preserve.obj bcc\preserve.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\scan.obj bcc\scan.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\softop.obj bcc\softop.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\state.obj bcc\state.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\table.obj bcc\table.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\type.obj bcc\type.c
+if errorlevel 1 goto exit_now
+
+if exist %TMP%\doslib.lib del %TMP%\doslib.lib
+lib %TMP%\doslib.lib +%TMP%\assign.obj +%TMP%\codefrag.obj +%TMP%\debug.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\declare.obj +%TMP%\express.obj +%TMP%\exptree.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\floatop.obj +%TMP%\function.obj +%TMP%\gencode.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\genloads.obj +%TMP%\glogcode.obj +%TMP%\hardop.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\input.obj +%TMP%\label.obj +%TMP%\loadexp.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\longop.obj +%TMP%\output.obj +%TMP%\preproc.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\preserve.obj +%TMP%\scan.obj +%TMP%\softop.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\state.obj +%TMP%\table.obj +%TMP%\type.obj;
+if errorlevel 1 goto exit_now
+
+cl -Ml -o lib\bcc-cc1.exe %TMP%\bcc-cc1.obj %TMP%\doslib.lib
+if errorlevel 1 goto exit_now
+
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\alloc.obj as\alloc.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\as.obj as\as.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\assemble.obj as\assemble.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\errors.obj as\errors.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\express.obj as\express.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\genbin.obj as\genbin.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\genlist.obj as\genlist.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\genobj.obj as\genobj.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\gensym.obj as\gensym.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\keywords.obj as\keywords.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\macro.obj as\macro.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\mops.obj as\mops.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\pops.obj as\pops.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\readsrc.obj as\readsrc.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\scan.obj as\scan.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\table.obj as\table.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\typeconv.obj as\typeconv.c
+if errorlevel 1 goto exit_now
+
+if exist %TMP%\doslib.lib del %TMP%\doslib.lib
+lib %TMP%\doslib.lib +%TMP%\as.obj +%TMP%\assemble.obj +%TMP%\errors.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\express.obj +%TMP%\genbin.obj +%TMP%\genlist.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\genobj.obj +%TMP%\gensym.obj +%TMP%\keywords.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\macro.obj +%TMP%\mops.obj +%TMP%\pops.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\readsrc.obj +%TMP%\scan.obj +%TMP%\table.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\typeconv.obj;
+if errorlevel 1 goto exit_now
+
+cl -Ml -o bin\as86.exe %TMP%\alloc.obj %TMP%\doslib.lib
+if errorlevel 1 goto exit_now
+
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\ld.obj ld\ld.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\dumps.obj ld\dumps.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\io.obj ld\io.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\linksyms.obj ld\linksyms.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\readobj.obj ld\readobj.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\table.obj ld\table.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\typeconv.obj ld\typeconv.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\writebin.obj ld\writebin.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\writex86.obj ld\writex86.c
+if errorlevel 1 goto exit_now
+
+if exist %TMP%\doslib.lib del %TMP%\doslib.lib
+lib %TMP%\doslib.lib +%TMP%\dumps.obj +%TMP%\io.obj +%TMP%\linksyms.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\readobj.obj +%TMP%\table.obj +%TMP%\typeconv.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\writebin.obj +%TMP%\writex86.obj;
+if errorlevel 1 goto exit_now
+
+cl -Ml -o bin\ld86.exe %TMP%\ld.obj %TMP%\doslib.lib
+if errorlevel 1 goto exit_now
+
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\unproto.obj unproto\unproto.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\error.obj unproto\error.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\hash.obj unproto\hash.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\strsave.obj unproto\strsave.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\symbol.obj unproto\symbol.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\tok_clas.obj unproto\tok_clas.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\tok_io.obj unproto\tok_io.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\tok_pool.obj unproto\tok_pool.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\unproto.obj unproto\unproto.c
+if errorlevel 1 goto exit_now
+cl -Ml -nologo -O -DPOSIX_HEADERS_MISSING -c -Fo%TMP%\vstring.obj unproto\vstring.c
+if errorlevel 1 goto exit_now
+
+if exist %TMP%\doslib.lib del %TMP%\doslib.lib
+lib %TMP%\doslib.lib +%TMP%\error.obj +%TMP%\hash.obj +%TMP%\strsave.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\symbol.obj +%TMP%\tok_clas.obj +%TMP%\tok_io.obj;
+if errorlevel 1 goto exit_now
+lib %TMP%\doslib.lib +%TMP%\tok_pool.obj +%TMP%\unproto.obj +%TMP%\vstring.obj;
+if errorlevel 1 goto exit_now
+
+cl -Ml -o lib\unproto.exe %TMP%\unproto.obj %TMP%\doslib.lib
+if errorlevel 1 goto exit_now
+
+echo Compile complete.
+:exit_now
diff --git a/limits.c b/limits.c new file mode 100644 index 0000000..8cf6777 --- /dev/null +++ b/limits.c @@ -0,0 +1,66 @@ + + +#if ~0==-1 + +#define UINT_MAX (~0U) +#define INT_MAX ((int)((~0U)>>1)) +#define INT_MIN (~(int)((~0U)>>1)) + +#define ULONG_MAX (~0UL) +#define LONG_MAX ((long)((~0UL)>>1)) +#define LONG_MIN (~(long)((~0UL)>>1)) + +#define USHRT_MAX ((unsigned short)-1) +#define SHRT_MAX ((int)(((unsigned short)-1)>>1)) +#define SHRT_MIN (~(int)(((unsigned short)-1)>>1)) + +#define UCHAR_MAX ((unsigned char)-1) + +#if 255 == '\377' +#define CHAR_MAX UCHAR_MAX +#define CHAR_MIN 0 +#else +#define CHAR_MAX ((int)(((unsigned char)-1)>>1)) +#define CHAR_MIN (~(int)(((unsigned char)-1)>>1)) +#endif + +#endif + +main() +{ + printf("UCHAR_MAX %d\n", UCHAR_MAX); + printf("CHAR_MAX %d\n", CHAR_MAX); + printf("CHAR_MIN %d\n", CHAR_MIN); + + if (USHRT_MAX == UINT_MAX && SHRT_MAX == INT_MAX && SHRT_MIN == INT_MIN) + printf("SHORT AS INT\n"); + else { + printf("USHRT_MAX %u\n", USHRT_MAX); + printf("SHRT_MAX %d\n", SHRT_MAX); + printf("SHRT_MIN %d\n", SHRT_MIN); + } + + printf("UINT_MAX %u\n", UINT_MAX); + printf("INT_MAX %d\n", INT_MAX); + printf("INT_MIN %d\n", INT_MIN); + + if (ULONG_MAX == UINT_MAX && LONG_MAX == INT_MAX && LONG_MIN == INT_MIN) + printf("LONG AS INT\n"); + else { + printf("ULONG_MAX %lu\n", ULONG_MAX); + printf("LONG_MAX %ld\n", LONG_MAX); + printf("LONG_MIN %ld\n", LONG_MIN); + } + + if( sizeof(int) < 4 ) printf("SMALL_INTS\n"); + if( sizeof(char *) <= 2 ) printf("SMALL_MEMORY\n"); + if( sizeof(long) == 8 ) printf("LONG_8_BYTE\n"); + if( sizeof(int) != sizeof(char*) ) { + if( sizeof(long) == sizeof(char*) ) + printf("LONG_PTR_SIZE %d\n", sizeof(char*)); + else + printf("EVIL_PTR_SIZE %d\n", sizeof(char*)); + } + if( sizeof(int) != sizeof(long) ) + printf("TRUE_LONGS %d\n", sizeof(long)); +} @@ -0,0 +1,60 @@ +#!/bin/sh + +echo Making compile.bat +sh mkcompile + +grep '^VERSION=' Makefile | +sed -e 's/VERSION=/#define VERSION "/' -e 's/$/"/' > bcc/version.h + +ln -s tok_class.c unproto/tok_clas.c +dos -r call\ compile -r exitemu +rm unproto/tok_clas.c bcc/version.h + +none() { +( +echo H: +echo 'cd 8086' +echo call compile +echo exitemu + +) | tr -d '\015' | sed 's/$/
/' > $HOME/autoexec.bat + +dos +rm $HOME/autoexec.bat +} + +[ -f bin/bcc.exe -a -f bin/as86.exe -a -f bin/ld86.exe ] || exit 1 +[ -f lib/bcc-cc1.exe -a -f lib/bcc-cpp.exe -a -f lib/unproto.exe ] || exit 1 + +mkdir -p txt +( +cd man + TERM=dumb + export TERM + export PAGER + unset PAGER + + for i in bcc as86 ld86 + do man ./$i.1 | ul | sed 's/$/
/g' > ../txt/$i.txt + done +) +rm -f Dev86dos.zip + +rm -f Bcc +ln -s . Bcc +ln -s ../kinclude/arch include/arch + +zip -9rp Dev86dos.zip \ + Bcc/README.dos \ + Bcc/txt/* \ + Bcc/bin/bcc.exe \ + Bcc/bin/as86.exe \ + Bcc/bin/ld86.exe \ + Bcc/lib/bcc-cc1.exe \ + Bcc/lib/bcc-cpp.exe \ + Bcc/lib/unproto.exe \ + Bcc/include/* \ + Bcc/lib/crt0.o Bcc/lib/libdos.a +rm include/arch Bcc +exit + diff --git a/mkdosbin b/mkdosbin new file mode 100644 index 0000000..02a4cac --- /dev/null +++ b/mkdosbin @@ -0,0 +1,14 @@ +#!/bin/sh + +sh mkcompile + +( +echo c: +echo 'cd \tmp\linux-86' + +) | tr -d '\015' | sed 's/$/
/' > $HOME/autoexec.bat + +dos + +rm $HOME/autoexec.bat + @@ -0,0 +1,22 @@ + +FILES1="as ld bcc unproto libc elksemu ar pcc doselks" +FILES2=" linuxmt mc6502 asxxxx bootblocks" +FILES3="bin lib include mkcompile mkcompile2 compile.bat later.c ifdef.c" + +NOTFILES="mc6502/roms/* mc6502/history/* mc6502/old/* mc6502/arc/*" + +rm -f include lib/*.[ao] lib/i386/*.[ao] +ln -s /usr/bcc/include include + +mkdir -p lib lib/i386 +p=/usr/bcc/lib/bcc +cp -pf $p/i86/*.[ao] lib/. +cp -pf $p/i386/*.[ao] lib/i386/. + +EXCL="`find $FILES1 -name '*.o' -o -name '*.obj' \ + -o -name '*.lib' -o -name '*.bak' \ + -o -name '*~' -o -name '*.exe' \ + -o -name '*.orig' -o -name '*.rej' \ + `" +#rm bigzip.zip +zip -urp bigzip $FILES1 $FILES2 $FILES3 -x $NOTFILES $EXCL |