diff -c gas-1.38/as.c d:./as.c *** gas-1.38/as.c Thu Oct 11 17:26:16 1990 --- d:./as.c Sat Nov 06 17:33:18 1993 *************** *** 1,3 **** --- 1,5 ---- + /* as.c -- changed for emx by Eberhard Mattes -- Aug 1992 */ + /* as.c - GAS main program. Copyright (C) 1987 Free Software Foundation, Inc. *************** *** 92,97 **** --- 94,104 ---- #ifdef DONTDEF gdb_symbol_file_name = 0; #endif + + #ifdef __EMX__ + _emxload_env ("GCCLOAD"); + #endif + /* * Parse arguments, but we are only interested in flags. * When we find a flag, we process it then make it's argv[] NULL. *************** *** 185,190 **** --- 192,202 ---- while(*arg) arg++; /* Skip the rest */ break; + #if defined (__EMX__) + case 'w': + /* -w means insert wait instruction */ + break; + #endif case 'W': /* -W means don't warn about things */ break; *************** *** 300,305 **** --- 312,320 ---- as_bad("Interrupted by signal %d",sig); if(here_before++) exit(1); + #if defined (__EMX__) + signal (sig, SIG_DFL); + #endif } /* end: as.c */ diff -c gas-1.38/i386.c d:./i386.c *** gas-1.38/i386.c Fri Oct 26 20:14:04 1990 --- d:./i386.c Sat Aug 29 16:14:56 1992 *************** *** 1,3 **** --- 1,5 ---- + /* i386.c -- changed for emx by Eberhard Mattes -- Aug 1992 */ + /* i386.c -- Assemble code for the Intel 80386 Copyright (C) 1989, Free Software Foundation. *************** *** 50,55 **** --- 52,62 ---- #include "i386.h" #include "i386-opcode.h" + #if defined (__EMX__) + static int npx_wait = FALSE; + static int npx_insn = FALSE; + #endif + long omagic = OMAGIC; char FLT_CHARS[] = "fFdDxX"; char EXP_CHARS[] = "eE"; *************** *** 502,507 **** --- 509,519 ---- return; } + #if defined (__EMX__) + if (flagseen['w']) + npx_insn = (*token_start == 'f'); + #endif + /* Lookup insn in hash; try intel & att naming conventions if appropriate; that is: we only use the opcode suffix 'b' 'w' or 'l' if we need to. */ current_templates = (templates *) hash_find (op_hash, token_start); *************** *** 1003,1008 **** --- 1015,1029 ---- i.imm_operands = 0; } + #if defined (__EMX__) + if (npx_wait && !npx_insn) { + char *p; + p = frag_more (1); + p[0] = 0x9b; /* wait */ + } + npx_wait = npx_insn; + #endif + /* We are ready to output the insn. */ { register char * p; *************** *** 1932,1935 **** *p = '\0'; return (reg_entry *) hash_find (reg_hash, reg_name_given); } - --- 1953,1955 ---- diff -c gas-1.38/Makefile d:./makefile *** gas-1.38/Makefile Thu Oct 18 21:26:42 1990 --- d:./makefile Thu Mar 19 15:29:34 1992 *************** *** 1,3 **** --- 1,5 ---- + # Makefile -- changed for emx by Eberhard Mattes -- Feb 1992 + # # Makefile for GAS. # Copyright (C) 1989, Free Software Foundation # *************** *** 20,32 **** # This makefile may be used to make the VAX, 68020, 80386, # SPARC, ns32k, or i860 assembler(s). ! BINDIR = /usr/local/bin ! #CC=gcc # If you are on a BSD system, un-comment the next two lines, and comment out # the lines for SystemV and HPUX below ! G0 = -g -I. #-O -Wall ! LDFLAGS = $(CFLAGS) # # To compile gas on a System Five machine, comment out the two lines above # and un-comment out the next three lines --- 22,39 ---- # This makefile may be used to make the VAX, 68020, 80386, # SPARC, ns32k, or i860 assembler(s). ! BINDIR = /emx/bin ! CC = gcc ! ! .c.o: ! $(CC) $(CFLAGS) -c $*.c + G0 = -g -I. + LDFLAGS = -L/emx/lib # If you are on a BSD system, un-comment the next two lines, and comment out # the lines for SystemV and HPUX below ! #G0 = -g -I. #-O -Wall ! #LDFLAGS = $(CFLAGS) # # To compile gas on a System Five machine, comment out the two lines above # and un-comment out the next three lines *************** *** 108,114 **** # (This option is automatically enabled when building the sparc assembler. # ! O1 = -DNO_VARARGS O2 = # -DNON_BROKEN_WORDS O3 = # -Dm68851 O4 = # -DEXEC_VERSION=1 --- 115,121 ---- # (This option is automatically enabled when building the sparc assembler. # ! O1 = # -DNO_VARARGS O2 = # -DNON_BROKEN_WORDS O3 = # -Dm68851 O4 = # -DEXEC_VERSION=1 *************** *** 131,137 **** # # To make the 68020 assembler compile as the default, un-comment the next # line, and comment out all the other lines that start with DEFAULT_GAS ! DEFAULT_GAS=a68 # # To make the VAX assembler compile as the default, un-comment the next # line and commment out all the other lines that start with DEFAULT_GAS --- 138,144 ---- # # To make the 68020 assembler compile as the default, un-comment the next # line, and comment out all the other lines that start with DEFAULT_GAS ! #DEFAULT_GAS=a68 # # To make the VAX assembler compile as the default, un-comment the next # line and commment out all the other lines that start with DEFAULT_GAS *************** *** 139,145 **** # # To make the 80386 assembler compile as the default, un-comment the next # line and commment out all the other lines that start with DEFAULT_GAS ! #DEFAULT_GAS=a386 # # To make the ns32k assembler compile as the default, un-comment the next # line and commment out all the other lines that start with DEFAULT_GAS --- 146,152 ---- # # To make the 80386 assembler compile as the default, un-comment the next # line and commment out all the other lines that start with DEFAULT_GAS ! DEFAULT_GAS=a386 # # To make the ns32k assembler compile as the default, un-comment the next # line and commment out all the other lines that start with DEFAULT_GAS *************** *** 156,172 **** # Global Sources ------------------------------------------------------------- a =\ ! as.o xrealloc.o xmalloc.o hash.o hex-value.o \ ! atof-generic.o append.o messages.o expr.o app.o \ ! frags.o input-file.o input-scrub.o output-file.o \ subsegs.o symbols.o version.o \ ! flonum-const.o flonum-copy.o flonum-mult.o strstr.o bignum-copy.o \ obstack.o #gdb.o gdb-file.o gdb-symbols.o gdb-blocks.o gdb-lines.o ! a: $(DEFAULT_GAS) ! @rm -f a ! @ln $(DEFAULT_GAS) a # I860 GAS ------------------------------------------------------------------ u = i860.o atof-ieee.o write-i860.o read-i860.o --- 163,177 ---- # Global Sources ------------------------------------------------------------- a =\ ! as.o xrealloc.o xmalloc.o hash.o hex-valu.o \ ! atof-gen.o append.o messages.o expr.o app.o \ ! frags.o input-fi.o input-sc.o output-f.o \ subsegs.o symbols.o version.o \ ! fl-const.o fl-copy.o fl-mult.o strstr.o bignum-c.o \ obstack.o #gdb.o gdb-file.o gdb-symbols.o gdb-blocks.o gdb-lines.o ! gas: $(DEFAULT_GAS) # I860 GAS ------------------------------------------------------------------ u = i860.o atof-ieee.o write-i860.o read-i860.o *************** *** 233,250 **** $(CC) -o a32k $(LDFLAGS) $a $w $(LOADLIBES) # 80386 GAS ------------------------------------------------------------------ ! x = i386.o atof-ieee.o write.o read.o ! X = i386.c i386.h i386-opcode.h i386.o: i386.c as.h read.h flonum.h frags.h struc-symbol.h expr.h ! i386.o: symbols.h hash.h md.h i386.h i386-opcode.h $(CC) $(CFLAGS) $(OPTIONS) -c i386.c ! atof-ieee.o: flonum.h ! a386: $a $x ! $(CC) -o a386 $(LDFLAGS) $a $x $(LOADLIBES) # 68020 GAS ------------------------------------------------------------------ y = m68k.o atof-ieee.o write.o read.o --- 238,255 ---- $(CC) -o a32k $(LDFLAGS) $a $w $(LOADLIBES) # 80386 GAS ------------------------------------------------------------------ ! x = i386.o atof-iee.o write.o read.o ! X = i386.c i386.h i386-opc.h i386.o: i386.c as.h read.h flonum.h frags.h struc-symbol.h expr.h ! i386.o: symbols.h hash.h md.h i386.h i386-opc.h $(CC) $(CFLAGS) $(OPTIONS) -c i386.c ! atof-iee.o: flonum.h ! a386: $a $x a386.ld ! $(CC) -o a386 $(LDFLAGS) @a386.ld $(LOADLIBES) # 68020 GAS ------------------------------------------------------------------ y = m68k.o atof-ieee.o write.o read.o *************** *** 253,259 **** atof-ieee.o: flonum.h ! m68k.o: m68k.c a.out.gnu.h as.h expr.h flonum.h frags.h hash.h m68k.o: m68k-opcode.h m68k.h md.h obstack.h struc-symbol.h $(CC) $(CFLAGS) $(OPTIONS) -c m68k.c --- 258,264 ---- atof-ieee.o: flonum.h ! m68k.o: m68k.c a_out_gnu.h as.h expr.h flonum.h frags.h hash.h m68k.o: m68k-opcode.h m68k.h md.h obstack.h struc-symbol.h $(CC) $(CFLAGS) $(OPTIONS) -c m68k.c *************** *** 266,272 **** Z = vax.c atof-vax.c vax-opcode.h vax-inst.h \ make-gas.com objrecdef.h vms.c vms-dbg.c README-vms-dbg ! vax.o: vax.c a.out.gnu.h as.h expr.h flonum.h frags.h md.h obstack.h vax.o: read.h struc-symbol.h symbols.h vax-inst.h vax-opcode.h atof-vax.o: as.h flonum.h read.h --- 271,277 ---- Z = vax.c atof-vax.c vax-opcode.h vax-inst.h \ make-gas.com objrecdef.h vms.c vms-dbg.c README-vms-dbg ! vax.o: vax.c a_out_gnu.h as.h expr.h flonum.h frags.h md.h obstack.h vax.o: read.h struc-symbol.h symbols.h vax-inst.h vax-opcode.h atof-vax.o: as.h flonum.h read.h *************** *** 291,308 **** $(CC) $(CFLAGS) -Derror=as_fatal -c xrealloc.c A =\ ! as.c xrealloc.c xmalloc.c hash.c hex-value.c \ ! atof-generic.c append.c messages.c expr.c bignum-copy.c \ ! frags.c input-file.c input-scrub.c output-file.c read.c \ subsegs.c symbols.c write.c strstr.c \ ! flonum-const.c flonum-copy.c flonum-mult.c app.c version.c \ obstack.c \ #gdb.c gdb-file.c gdb-symbols.c gdb-blocks.c \ #gdb-lines.c H = \ ! a.out.gnu.h as.h bignum.h expr.h flonum.h \ ! frags.h hash.h input-file.h md.h \ obstack.h read.h struc-symbol.h subsegs.h \ symbols.h write.h --- 296,313 ---- $(CC) $(CFLAGS) -Derror=as_fatal -c xrealloc.c A =\ ! as.c xrealloc.c xmalloc.c hash.c hex-valu.c \ ! atof-gen.c append.c messages.c expr.c bignum-c.c \ ! frags.c input-fi.c input-scr.c output-f.c read.c \ subsegs.c symbols.c write.c strstr.c \ ! fl-const.c fl-copy.c fl-mult.c app.c version.c \ obstack.c \ #gdb.c gdb-file.c gdb-symbols.c gdb-blocks.c \ #gdb-lines.c H = \ ! as.h bignum.h expr.h flonum.h \ ! frags.h hash.h input-fi.h md.h \ obstack.h read.h struc-symbol.h subsegs.h \ symbols.h write.h *************** *** 316,322 **** -rm .fname clean: ! rm -f a avax a68 a386 a32k asparc $a $v $w $x $y $z a core gmon.out bugs a.out install: a cp a $(BINDIR)/gas --- 321,328 ---- -rm .fname clean: ! -del *.o ! -del a386 install: a cp a $(BINDIR)/gas *************** *** 325,356 **** # General .o-->.h dependencies app.o: as.h ! as.o: a.out.gnu.h as.h read.h struc-symbol.h write.h ! atof-generic.o: flonum.h ! bignum-copy.o: bignum.h ! expr.o: a.out.gnu.h as.h expr.h flonum.h obstack.h read.h struc-symbol.h expr.o: symbols.h ! flonum-const.o: flonum.h ! flonum-copy.o: flonum.h ! flonum-mult.o: flonum.h ! flonum-normal.o:flonum.h ! flonum-print.o: flonum.h ! frags.o: a.out.gnu.h as.h frags.h obstack.h struc-symbol.h subsegs.h #gdb.o: as.h #gdb-blocks.o: as.h #gdb-lines.o: as.h frags.h obstack.h ! #gdb-symbols.o: a.out.gnu.h as.h struc-symbol.h hash.o: hash.h ! input-file.o: input-file.h ! input-scrub.o: as.h input-file.h read.h messages.o: as.h obstack.o: obstack.h ! read.o: a.out.gnu.h as.h expr.h flonum.h frags.h hash.h md.h obstack.h read.o: read.h struc-symbol.h symbols.h ! subsegs.o: a.out.gnu.h as.h frags.h obstack.h struc-symbol.h subsegs.h write.h ! symbols.o: a.out.gnu.h as.h frags.h hash.h obstack.h struc-symbol.h symbols.h ! write.o: a.out.gnu.h as.h md.h obstack.h struc-symbol.h subsegs.h write.o: symbols.h write.h flonum.h: bignum.h - --- 331,361 ---- # General .o-->.h dependencies app.o: as.h ! as.o: as.h read.h struc-symbol.h write.h ! atof-gen.o: flonum.h ! bignum-c.o: bignum.h ! expr.o: as.h expr.h flonum.h obstack.h read.h struc-symbol.h expr.o: symbols.h ! fl-const.o: flonum.h ! fl-copy.o: flonum.h ! fl-mult.o: flonum.h ! fl-normal.o:flonum.h ! fl-print.o: flonum.h ! frags.o: as.h frags.h obstack.h struc-symbol.h subsegs.h #gdb.o: as.h #gdb-blocks.o: as.h #gdb-lines.o: as.h frags.h obstack.h ! #gdb-symbols.o: a_out_gnu.h as.h struc-symbol.h hash.o: hash.h ! input-fi.o: input-fi.h ! input-sc.o: as.h input-fi.h read.h messages.o: as.h obstack.o: obstack.h ! read.o: as.h expr.h flonum.h frags.h hash.h md.h obstack.h read.o: read.h struc-symbol.h symbols.h ! subsegs.o: as.h frags.h obstack.h struc-symbol.h subsegs.h write.h ! symbols.o: as.h frags.h hash.h obstack.h struc-symbol.h symbols.h ! write.o: as.h md.h obstack.h struc-symbol.h subsegs.h write.o: symbols.h write.h flonum.h: bignum.h diff -c gas-1.38/output-f.c d:./output-f.c *** gas-1.38/output-f.c Fri Jan 04 19:12:56 1991 --- d:./output-f.c Thu Mar 19 15:29:34 1992 *************** *** 1,3 **** --- 1,5 ---- + /* output-f.c -- changed for emx by Eberhard Mattes -- Feb 1992 */ + /* output-file.c - Deal with the output file Copyright (C) 1987 Free Software Foundation, Inc. *************** *** 38,44 **** --- 40,50 ---- { if(name[0]=='-' && name[1]=='\0') stdoutput=stdout; + #if defined (__EMX__) + else if ( ! (stdoutput = fopen( name, "wb" )) ) + #else else if ( ! (stdoutput = fopen( name, "w" )) ) + #endif { as_perror ("FATAL: Can't create %s", name); exit(42); diff -c gas-1.38/struc-sy.h d:./struc-sy.h *** gas-1.38/struc-sy.h Fri Jul 06 19:43:12 1990 --- d:./struc-sy.h Thu Mar 19 15:29:34 1992 *************** *** 1,3 **** --- 1,5 ---- + /* struc-sy.h -- changed for emx by Eberhard Mattes -- Mar 1992 */ + /* struct_symbol.h - Internal symbol structure Copyright (C) 1987 Free Software Foundation, Inc. *************** *** 17,27 **** along with GAS; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ! #ifndef VMS ! #include "a.out.gnu.h" /* Needed to define struct nlist. Sigh. */ #else #include "a_out.h" #endif struct symbol /* our version of an nlist node */ { --- 19,33 ---- along with GAS; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ! #if defined (__EMX__) ! #include "a_out.h" ! #else ! #ifndef VMS ! #include "a.out.gnu.h" /* Needed to define struct nlist. Sigh. */ #else #include "a_out.h" #endif + #endif /* !defined (__EMX__) */ struct symbol /* our version of an nlist node */ {