From ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 30 Apr 2002 20:54:58 +0000 Subject: NASM 0.98p3.2 --- Changes | 3 + MODIFIED | 49 +++-- Makefile.bc2 | 238 ---------------------- Makefile.bor | 82 -------- Makefile.dj | 81 -------- Makefile.dos | 78 -------- Makefile.in | 9 +- Makefile.lcc | 110 ----------- Makefile.sc | 114 ----------- Makefile.scw | 114 ----------- Makefile.unx | 97 --------- Makefile.vc | 77 -------- Makefile.wc | 119 ----------- Makefile.wcw | 119 ----------- Mkfiles/Makefile.bc2 | 238 ++++++++++++++++++++++ Mkfiles/Makefile.bor | 82 ++++++++ Mkfiles/Makefile.dj | 81 ++++++++ Mkfiles/Makefile.dos | 78 ++++++++ Mkfiles/Makefile.lcc | 110 +++++++++++ Mkfiles/Makefile.sc | 114 +++++++++++ Mkfiles/Makefile.scw | 114 +++++++++++ Mkfiles/Makefile.unx | 97 +++++++++ Mkfiles/Makefile.vc | 77 ++++++++ Mkfiles/Makefile.wc | 119 +++++++++++ Mkfiles/Makefile.wcw | 119 +++++++++++ c16.mac | 41 ++++ c32.mac | 26 +++ changes.asm | 292 +++++++++++++++++++++++++++ eval.c | 29 +-- exebin.mac | 57 ++++++ insns.bas | 541 --------------------------------------------------- insns.dat | 34 ++-- macros.bas | 176 ----------------- macros.c | 2 +- nasm.h | 2 +- outform.h | 10 + rdoff/Makefile.in | 6 +- standard.mac | 4 +- zoutieee.c | 27 +-- 39 files changed, 1753 insertions(+), 2013 deletions(-) delete mode 100644 Makefile.bc2 delete mode 100644 Makefile.bor delete mode 100644 Makefile.dj delete mode 100644 Makefile.dos delete mode 100644 Makefile.lcc delete mode 100644 Makefile.sc delete mode 100644 Makefile.scw delete mode 100644 Makefile.unx delete mode 100644 Makefile.vc delete mode 100644 Makefile.wc delete mode 100644 Makefile.wcw create mode 100644 Mkfiles/Makefile.bc2 create mode 100644 Mkfiles/Makefile.bor create mode 100644 Mkfiles/Makefile.dj create mode 100644 Mkfiles/Makefile.dos create mode 100644 Mkfiles/Makefile.lcc create mode 100644 Mkfiles/Makefile.sc create mode 100644 Mkfiles/Makefile.scw create mode 100644 Mkfiles/Makefile.unx create mode 100644 Mkfiles/Makefile.vc create mode 100644 Mkfiles/Makefile.wc create mode 100644 Mkfiles/Makefile.wcw create mode 100644 c16.mac create mode 100644 c32.mac create mode 100644 changes.asm create mode 100644 exebin.mac delete mode 100644 insns.bas delete mode 100644 macros.bas diff --git a/Changes b/Changes index 57584bdb..a2a291d8 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ Change log for NASM =================== +This is the Changelog for the official releases; this is a modified +version. For the changes from the official release, see the MODIFIED file. + 0.90 released October 1996 -------------------------- diff --git a/MODIFIED b/MODIFIED index f7626f35..b91f956e 100644 --- a/MODIFIED +++ b/MODIFIED @@ -2,17 +2,44 @@ This is a modified version of NASM, modified and released by H. Peter Anvin ; it is not the original form released by the NASM authors. -The changes include: -1. Merged nasm098p3.zip with nasm-0.97.tar.gz to create a fully - buildable version for Unix systems (Makefile.in updates, etc.) +For release 0.98.3.2: -2. Changed insns.pl to create the instruction tables in nasm.h and - names.c, so that a new instruction can be added by adding it *only* - to insns.dat. +* Merged in John S. Fine's changes from his 0.98-J4 prerelease; see + http://www.csoft.net/cz/johnfine/ -3. Added the following new instructions: SYSENTER, SYSEXIT, FXSAVE, - FXRSTOR, UD1, UD2 (the latter two are two opcodes that Intel - guarantee will never be used; one of them is documented as UD2 in - Intel documentation, the other one just as "Undefined Opcode" -- - calling it UD1 seemed to make sense.) +* Changed previous "spotless" Makefile target (appropriate for distribution) + to "distclean", and added "cleaner" target which is same as "clean" + except deletes files generated by Perl scripts; "spotless" is union. + +* Removed BASIC programs from distribution. Get a Perl interpreter + instead (see below.) + +* Calling this "pre-release 3.2" rather than "p3-hpa2" because of + John's contributions. + +* Actually link in the IEEE output format (zoutieee.c); fix a bunch of + compiler warnings in that file. Note I don't know what IEEE output + is supposed to look like, so these changes were made "blind". + + +For release 0.98p3-hpa: + +* Merged nasm098p3.zip with nasm-0.97.tar.gz to create a fully + buildable version for Unix systems (Makefile.in updates, etc.) + +* Changed insns.pl to create the instruction tables in nasm.h and + names.c, so that a new instruction can be added by adding it *only* + to insns.dat. + +* Added the following new instructions: SYSENTER, SYSEXIT, FXSAVE, + FXRSTOR, UD1, UD2 (the latter two are two opcodes that Intel + guarantee will never be used; one of them is documented as UD2 in + Intel documentation, the other one just as "Undefined Opcode" -- + calling it UD1 seemed to make sense.) + +* A note on the BASIC programs included: forget them. insns.bas is + already out of date. Get yourself a Perl interpreter for your + platform of choice at: + + http://www.cpan.org/ports/index.html diff --git a/Makefile.bc2 b/Makefile.bc2 deleted file mode 100644 index 92ec9d2e..00000000 --- a/Makefile.bc2 +++ /dev/null @@ -1,238 +0,0 @@ -# Makefile for the Netwide Assembler under 16-bit DOS (aimed at Borland C) -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. -# -# This makefile is made for compile NASM and NDISASM on a 16 bit dos -# compiler like Microsoft C, or Borland C. This should work on all -# verioson of Turbo C++ and Borland C++ from version 3.0 and upwords. -# I'm not fully sure how it will handel on Microsoft C, but all the -# switches are documented, and it shouldn't be a problem to change it -# over. -# -# It does show a few of my preferances, like putting the OBJ files -# in a seperat directory, but if you just set OBJD to '.', it will -# drop them all in the current directory (though you still need to -# make the directory it's self). -# -# Most everything is remarked, and explaned in full, it should be -# easy to convert it to another compiler. I tried to make the devision -# of information logical, and easy to follow. -# -# BEFORE YOU USE THIS MAKE FILE!!! -# -# Make sure the line below is set to the propper location of your standard -# Libaries, if not you'll get some errors. Make sure to keep the trailing -# backslash, as it's needed, and remeber to use \\ not \ as that will cause -# some errors. -# -# Also inportant, if you get a DGROUP error when you compile NASM, remove -# or comment out the 'NASMSize=l' line, and uncoment (remove the #) from the -# NASMSize=h line. Then run 'make Clean' to delete the object files. Then run -# make again to re-build NASM as huge. -# -# History: -# 06/13/97: * Added the EXED varable for the location to put the EXE files. -# * Because different versions of Borland and Turbo C have -# different GROUPings for the DGROUP, some version, when you -# compile NASM, you will get a DGROUP overflow error, making it -# so NASM has to be compiled as huge. As this isn't a constant -# through systems (and apperently some version of Borland, -# compileing as huge causes some errors) the NASMSize verable -# has been added to spicify what size of code you want to -# compile as and defaults to large. -# 06/16/97: * Added 'merge dupicate strings' to the options for compiles. - -NASMSize=l #Compile Nasm as Large -#NASMSize=h #Compile Nasm as Huge - -LIB =c:\\tc\\lib\\ #location standard libaries - -OBJD=obj\\ #directory to put OBJ files in -EXED=.\ #directory to put the EXE files. -CC = tcc #compiler -LINK = tlink #linker -CCFLAGS = /d /c /O /A /m$(NASMSize) /n$(OBJD) #compiler flags for NASM - #/d=merge dupicate strings - #/c=compile only - #/O=Optimise jumps - #/A=ANSI standard C - #/m$(NASMSize>=the model to use - #/n$(OBJD)= put the OBJ files in the diectory given. - -DCCFLAGS = /d /c /O /A /mh /n$(OBJD) #compiler flags for NDISASM - #/d=merge dupicate strings - #/c=compile only - #/O=Optimise jumps - #/A=ANSI standard C - #/mh=Model huge - #/n$(OBJD)= put the OBJ files in the diectory given. - #NOTE: Huge model is used, and the array in insnsd.c is large enough to - #over size the d-group in large mode. - -LINKFLAGS = /c /x #linker flags - #/c=case segnificance on symboles - #/x=No map file at all - -LIBRARIES = #any libaries to add, out side of the standard libary -EXE = .exe #executable file extention (keep the . as the start) -OBJ = obj #OBJ file extention - -NASM_ASM=$(CC) $(CCFLAGS) $&.c #Command line for NASM -DASM_ASM=$(CC) $(DCCFLAGS) $&.c #command line for NDISASM - -# NOTE: $& is used to create the file name, as it only gives the name it's -# self, where as using $* would have give the full path of the file it -# want's done. This becomes a problem if the OBJ files are in a seperate -# directory, becuse it will then try to find the source file in the OBJ -# dir. - -################################################################ -#The OBJ files that NASM is dependent on - -NASMOBJS = $(OBJD)nasm.$(OBJ) $(OBJD)nasmlib.$(OBJ) $(OBJD)float.$(OBJ) \ - $(OBJD)insnsa.$(OBJ) $(OBJD)assemble.$(OBJ) $(OBJD)labels.$(OBJ) \ - $(OBJD)parser.$(OBJ) $(OBJD)outform.$(OBJ) $(OBJD)preproc.$(OBJ) \ - $(OBJD)listing.$(OBJ) $(OBJD)eval.$(OBJ) - -################################################################ -#The OBJ files that NDISASM is dependent on - -NDISASMOBJS = $(OBJD)ndisasm.$(OBJ) $(OBJD)disasm.$(OBJ) $(OBJD)sync.$(OBJ) \ - $(OBJD)nasmlibd.$(OBJ) $(OBJD)insnsd.$(OBJ) - -################################################################ -#The OBJ file for the output formats. - -OUTOBJ= $(OBJD)outbin.$(OBJ) $(OBJD)outaout.$(OBJ) $(OBJD)outcoff.$(OBJ) \ - $(OBJD)outelf.$(OBJ) $(OBJD)outobj.$(OBJ) $(OBJD)outas86.$(OBJ) \ - $(OBJD)outrdf.$(OBJ) $(OBJD)outdbg.$(OBJ) - - -################################################################ -# Build everything - -all : nasm$(EXE) ndisasm$(EXE) - -################################################################ -#NASM, NDISASM compile, I hope it's self explanitorie - -nasm$(EXE): $(NASMOBJS) $(OUTOBJ) - $(LINK) $(LINKFLAGS) @&&^ #command for the linker - $(LIB)c0$(NASMSize).obj $(NASMOBJS) $(OUTOBJ) #OBJ file list - $(EXED)nasm$(EXE) #EXE file name -# No need of a map file - $(LIB)c$(NASMSize).lib $(LIBRARIES) #Libaries needed -^ - -ndisasm$(EXE): $(NDISASMOBJS) - $(LINK) $(LINKFLAGS) @&&^ #command for the linker - $(LIB)c0h.obj $(NDISASMOBJS) #OBJ file list - $(EXED)ndisasm$(EXE) #EXE file name -# No need of a map file - $(LIB)ch.lib $(LIBRARIES) #Libaries needed -^ - -################################################################ -# Dependencies for all of NASM's obj files - -$(OBJD)assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h - $(NASM_ASM) - -$(OBJD)float.$(OBJ): float.c nasm.h - $(NASM_ASM) - -$(OBJD)labels.$(OBJ): labels.c nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h - $(NASM_ASM) - -$(OBJD)eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h - $(NASM_ASM) - -$(OBJD)nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ - listing.h outform.h - $(NASM_ASM) - -$(OBJD)nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c - $(NASM_ASM) - -$(OBJD)preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)insnsa.$(OBJ): insnsa.c nasm.h insns.h - $(NASM_ASM) - -################################################################ -# Dependencies for all of NDISASM's obj files - -$(OBJD)disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c - $(DASM_ASM) - -$(OBJD)ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h - $(DASM_ASM) - -$(OBJD)sync.$(OBJ): sync.c sync.h - $(DASM_ASM) - -$(OBJD)insnsd.$(OBJ): insnsd.c nasm.h insns.h - $(DASM_ASM) - -# This is a kludge from the word go, as we can't use the nasmlib.obj compiled -# for NASM, as it's could be the wrong model size, so we have to compile it -# again as huge to make sure. -# -# So as not to overwrite the nasmlib.obj for NASM (if it did, that -# could cause all kinds of problems) it compiles it into nasmlibd.obj. -# -# the -o... switch tells it the name to compile the obj file to, right here -# $(OBJD)nasmlibd.obj - -$(OBJD)nasmlibd.$(OBJ): nasmlib.c nasm.h nasmlib.h - $(CC) $(DCCFLAGS) -o$(OBJD)nasmlibd.obj nasmlib.c - -################################################################ -# Dependencies for all of the output format's OBJ files - -$(OBJD)outas86.$(OBJ): outas86.c nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)outaout.$(OBJ): outaout.c nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)outbin.$(OBJ): outbin.c nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)outelf.$(OBJ): outelf.c nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)outobj.$(OBJ): outobj.c nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h - $(NASM_ASM) - -$(OBJD)outform.$(OBJ): outform.c outform.h nasm.h - $(NASM_ASM) - -################################################################ -# A quick way to delete the OBJ files as well as the binaries. - -clean : - del $(OBJD)*.obj - del nasm$(EXE) - del ndisasm$(EXE) - -# Makefile created by Fox Cutter --01/27/97 diff --git a/Makefile.bor b/Makefile.bor deleted file mode 100644 index 90e96fba..00000000 --- a/Makefile.bor +++ /dev/null @@ -1,82 +0,0 @@ -# Makefile for the Netwide Assembler under 16-bit DOS -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. -# -# This Makefile is designed to build NASM using a 16-bit DOS C -# compiler such as Borland C, and has been tested with Borland C 2.3 -# and Borland Make. - -# CC = cl -# CCFLAGS = /c /O /AL -# LINK = cl -CC = bcc -CCFLAGS = -c -O -ml -A -LINK = tlink /c /Lc:\bc\lib -LINKFLAGS = -LIBRARIES = -EXE = .exe# -OBJ = obj# - -.c.$(OBJ): - $(CC) $(CCFLAGS) $*.c - -NASMOBJS1 = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) -NASMOBJS2 = assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) -NASMOBJS3 = outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) -NASMOBJS4 = outobj.$(OBJ) outas86.$(OBJ) outdbg.$(OBJ) outrdf.$(OBJ) -NASMOBJS5 = preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) - -NASMOBJS = $(NASMOBJS1) $(NASMOBJS2) $(NASMOBJS3) $(NASMOBJS4) $(NASMOBJS5) - -NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ - insnsd.$(OBJ) - -all : nasm$(EXE) ndisasm$(EXE) - -# We have to have a horrible kludge here to get round the 128 character -# limit, as usual... -nasm$(EXE): $(NASMOBJS) -# $(LINK) /Fenasm.exe a*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj - echo c0l.obj $(NASMOBJS1) +> nasmobjs.tmp - echo $(NASMOBJS2) +>> nasmobjs.tmp - echo $(NASMOBJS3) +>> nasmobjs.tmp - echo $(NASMOBJS4) +>> nasmobjs.tmp - echo $(NASMOBJS5),nasm.exe,,cl.lib, >> nasmobjs.tmp - $(LINK) /Tde @nasmobjs.tmp - -ndisasm$(EXE): $(NDISASMOBJS) -# $(LINK) /Fendisasm.exe $(NDISASMOBJS) - $(LINK) /Tde $(NDISASMOBJS),ndisasm.exe,,cl.lib, - -assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h -disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c -eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h -float.$(OBJ): float.c nasm.h -insnsa.$(OBJ): insnsa.c nasm.h insns.h -insnsd.$(OBJ): insnsd.c nasm.h insns.h -labels.$(OBJ): labels.c nasm.h nasmlib.h -listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h -nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ - listing.h outform.h -nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h -ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h -outas86.$(OBJ): outas86.c nasm.h nasmlib.h -outaout.$(OBJ): outaout.c nasm.h nasmlib.h -outbin.$(OBJ): outbin.c nasm.h nasmlib.h -outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h -outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h -outelf.$(OBJ): outelf.c nasm.h nasmlib.h -outobj.$(OBJ): outobj.c nasm.h nasmlib.h -outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h -outform.$(OBJ): outform.c outform.h nasm.h -parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c -preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h -sync.$(OBJ): sync.c sync.h - -clean : - del *.obj - del nasm$(EXE) - del ndisasm$(EXE) diff --git a/Makefile.dj b/Makefile.dj deleted file mode 100644 index 6d932f38..00000000 --- a/Makefile.dj +++ /dev/null @@ -1,81 +0,0 @@ -# host: dos -# target: dos 32bit -# Makefile for the Netwide Assembler -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. - -# makefile designed for djgpp 2.xx -# djgpp is GNU C compiler ported by mighty DJ Delorie -# www.delorie.com and any simtel mirror - -# You may need to adjust these values. - -CC = gcc -CFLAGS = -O2 -I. - -# You _shouldn't_ need to adjust anything below this line. - -.c.o: - $(CC) -c $(CFLAGS) $*.c - -NASM = nasm.o nasmlib.o float.o insnsa.o assemble.o labels.o \ - parser.o outform.o outbin.o outaout.o outcoff.o outelf.o \ - outobj.o outas86.o outrdf.o outdbg.o preproc.o listing.o \ - eval.o - -NDISASM = ndisasm.o disasm.o sync.o nasmlib.o insnsd.o - -all: nasm.exe ndisasm.exe - -nasm.exe: $(NASM) - $(CC) -o $@ $(NASM) - -ndisasm.exe: $(NDISASM) - $(CC) -o $@ $(NDISASM) - -assemble.o: assemble.c nasm.h nasmlib.h assemble.h insns.h -disasm.o: disasm.c nasm.h disasm.h sync.h insns.h names.c -eval.o: eval.c eval.h nasm.h nasmlib.h -float.o: float.c nasm.h -insnsa.o: insnsa.c nasm.h insns.h -insnsd.o: insnsd.c nasm.h insns.h -labels.o: labels.c nasm.h nasmlib.h -listing.o: listing.c nasm.h nasmlib.h listing.h -nasm.o: nasm.c nasm.h nasmlib.h preproc.h parser.h assemble.h labels.h \ - outform.h listing.h -nasmlib.o: nasmlib.c nasm.h nasmlib.h -ndisasm.o: ndisasm.c nasm.h nasmlib.h sync.h disasm.h -outaout.o: outaout.c nasm.h nasmlib.h outform.h -outas86.o: outas86.c nasm.h nasmlib.h outform.h -outbin.o: outbin.c nasm.h nasmlib.h outform.h -outcoff.o: outcoff.c nasm.h nasmlib.h outform.h -outdbg.o: outdbg.c nasm.h nasmlib.h outform.h -outelf.o: outelf.c nasm.h nasmlib.h outform.h -outform.o: outform.c outform.h nasm.h -outobj.o: outobj.c nasm.h nasmlib.h outform.h -outrdf.o: outrdf.c nasm.h nasmlib.h outform.h -parser.o: parser.c nasm.h nasmlib.h parser.h float.h names.c -preproc.o: preproc.c nasm.h nasmlib.h macros.c -sync.o: sync.c sync.h - -# These two source files are automagically generated from a single -# instruction-table file by a Perl script. They're distributed, -# though, so it isn't necessary to have Perl just to recompile NASM -# from the distribution. - -insnsa.c insnsd.c: insns.dat insns.pl - perl insns.pl insns.dat - -# This source file is generated from the standard macros file -# `standard.mac' by another Perl script. Again, it's part of the -# standard distribution. - -macros.c: standard.mac macros.pl - perl macros.pl standard.mac - -clean: - rm -f *.o nasm ndisasm - diff --git a/Makefile.dos b/Makefile.dos deleted file mode 100644 index 94403fc1..00000000 --- a/Makefile.dos +++ /dev/null @@ -1,78 +0,0 @@ -# Makefile for the Netwide Assembler under 16-bit DOS -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. -# -# This Makefile is designed to build NASM using a 16-bit DOS C -# compiler such as Microsoft C, provided you have a compatible MAKE. -# It's been tested with Microsoft C 5.x plus Borland Make. (Yes, I -# know it's silly, but...) - -CC = cl /c /O /AL /Gt -QCL = qcl /c /AL /Gt -LINK = cl -LINKFLAGS = -LIBRARIES = -EXE = .exe# -OBJ = obj# - -.c.$(OBJ): - $(CC) $*.c - -NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ - assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ - outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ - outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ - preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) - -NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ - insnsd.$(OBJ) - -all : nasm$(EXE) ndisasm$(EXE) - -# We have to have a horrible kludge here to get round the 128 character -# limit, as usual... -LINKOBJS = a*.obj e*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj -nasm$(EXE): $(NASMOBJS) - cl /Fenasm.exe /F 4000 $(LINKOBJS) - -ndisasm$(EXE): $(NDISASMOBJS) - cl /Fendisasm.exe $(NDISASMOBJS) - -assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h -disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c -eval.$(OBJ): eval.c eval.h nasm.h nasmlib.h -float.$(OBJ): float.c nasm.h -labels.$(OBJ): labels.c nasm.h nasmlib.h -listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h -nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ - listing.h outform.h -nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h -ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h -outas86.$(OBJ): outas86.c nasm.h nasmlib.h -outaout.$(OBJ): outaout.c nasm.h nasmlib.h -outbin.$(OBJ): outbin.c nasm.h nasmlib.h -outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h -outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h -outelf.$(OBJ): outelf.c nasm.h nasmlib.h -outobj.$(OBJ): outobj.c nasm.h nasmlib.h -outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h -outform.$(OBJ): outform.c outform.h nasm.h -parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c -preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h -sync.$(OBJ): sync.c sync.h - -# Another grotty hack: QC is less likely to run out of memory than -# CL proper; and we don't need any optimisation in these modules -# since they're just data. -insnsa.$(OBJ): insnsa.c nasm.h insns.h - $(QCL) insnsa.c -insnsd.$(OBJ): insnsd.c nasm.h insns.h - $(QCL) insnsd.c - -clean : - del *.obj - del nasm$(EXE) - del ndisasm$(EXE) diff --git a/Makefile.in b/Makefile.in index 063e492e..750eb8a3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -90,9 +90,14 @@ clean: rm -f *.o nasm ndisasm cd rdoff; $(MAKE) clean -spotless: clean +distclean: clean rm -f config.* Makefile *~ - cd rdoff; $(MAKE) spotless + cd rdoff; $(MAKE) distclean + +cleaner: clean + rm -f insnsa.c insnsd.c insnsi.h insnsn.c macros.c + +spotless: distclean cleaner rdf: cd rdoff; $(MAKE) diff --git a/Makefile.lcc b/Makefile.lcc deleted file mode 100644 index 1f6fdcbd..00000000 --- a/Makefile.lcc +++ /dev/null @@ -1,110 +0,0 @@ -# host: windows nt/95 -# target: windows nt/95 -# Makefile for the Netwide Assembler -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. - -# makefile designed for lcc-win32 -# lcc-win32 is lcc (c compiler coded by guys from princeton uni) -# ported to win32 by jacob navia -# available at http://www.remcomp.com/lcc-win32/ - -CFLAGS = -c -O -g2 -CC = lcc.exe $(CFLAGS) -LFLAGS = -subsystem console -s -LD = lcclnk.exe $(LFLAGS) -OBJ = obj - -.c.${OBJ}: - $(CC) -o $@ $*.c - -NASM = nasm.${OBJ} nasmlib.${OBJ} float.${OBJ} insnsa.${OBJ} assemble.${OBJ} labels.${OBJ} \ - parser.${OBJ} outform.${OBJ} outbin.${OBJ} outaout.${OBJ} outcoff.${OBJ} outelf.${OBJ} \ - outobj.${OBJ} outas86.${OBJ} outrdf.${OBJ} outdbg.${OBJ} preproc.${OBJ} listing.${OBJ} \ - eval.${OBJ} - -NDISASM = ndisasm.${OBJ} disasm.${OBJ} sync.${OBJ} nasmlib.${OBJ} insnsd.${OBJ} - -all: nasm ndisasm - -# linker response files -# that may take long, too much spawning command.com :) -NASM.LNK: makefile.lcc - echo nasm.$(OBJ) > NASM.LNK - echo nasmlib.$(OBJ) >> NASM.LNK - echo eval.$(OBJ) >> NASM.LNK - echo float.$(OBJ) >> NASM.LNK - echo insnsa.$(OBJ) >> NASM.LNK - echo assemble.$(OBJ) >> NASM.LNK - echo labels.$(OBJ) >> NASM.LNK - echo listing.$(OBJ) >> NASM.LNK - echo parser.$(OBJ) >> NASM.LNK - echo preproc.$(OBJ) >> NASM.LNK - echo outform.$(OBJ) >> NASM.LNK - echo outbin.$(OBJ) >> NASM.LNK - echo outaout.$(OBJ) >> NASM.LNK - echo outcoff.$(OBJ) >> NASM.LNK - echo outelf.$(OBJ) >> NASM.LNK - echo outobj.$(OBJ) >> NASM.LNK - echo outas86.$(OBJ) >> NASM.LNK - echo outrdf.$(OBJ) >> NASM.LNK - echo outdbg.$(OBJ) >> NASM.LNK - -NDISASM.LNK: makefile.lcc - echo ndisasm.$(OBJ) > NDISASM.LNK - echo disasm.$(OBJ) >> NDISASM.LNK - echo sync.$(OBJ) >> NDISASM.LNK - echo nasmlib.$(OBJ) >> NDISASM.LNK - echo insnsd.$(OBJ) >> NDISASM.LNK - -nasm: $(NASM) nasm.lnk - $(LD) -o nasm.exe @nasm.lnk - -ndisasm: $(NDISASM) ndisasm.lnk - $(LD) -o ndisasm.exe @ndisasm.lnk - -assemble.${OBJ}: assemble.c nasm.h nasmlib.h assemble.h insns.h -disasm.${OBJ}: disasm.c nasm.h disasm.h sync.h insns.h names.c -eval.${OBJ}: eval.c eval.h nasm.h nasmlib.h -float.${OBJ}: float.c nasm.h -insnsa.${OBJ}: insnsa.c nasm.h insns.h -insnsd.${OBJ}: insnsd.c nasm.h insns.h -labels.${OBJ}: labels.c nasm.h nasmlib.h -listing.${OBJ}: listing.c nasm.h nasmlib.h listing.h -nasm.${OBJ}: nasm.c nasm.h nasmlib.h preproc.h parser.h assemble.h labels.h \ - outform.h listing.h -nasmlib.${OBJ}: nasmlib.c nasm.h nasmlib.h -ndisasm.${OBJ}: ndisasm.c nasm.h nasmlib.h sync.h disasm.h -outaout.${OBJ}: outaout.c nasm.h nasmlib.h outform.h -outas86.${OBJ}: outas86.c nasm.h nasmlib.h outform.h -outbin.${OBJ}: outbin.c nasm.h nasmlib.h outform.h -outcoff.${OBJ}: outcoff.c nasm.h nasmlib.h outform.h -outdbg.${OBJ}: outdbg.c nasm.h nasmlib.h outform.h -outelf.${OBJ}: outelf.c nasm.h nasmlib.h outform.h -outform.${OBJ}: outform.c outform.h nasm.h -outobj.${OBJ}: outobj.c nasm.h nasmlib.h outform.h -outrdf.${OBJ}: outrdf.c nasm.h nasmlib.h outform.h -parser.${OBJ}: parser.c nasm.h nasmlib.h parser.h float.h names.c -preproc.${OBJ}: preproc.c nasm.h nasmlib.h macros.c -sync.${OBJ}: sync.c sync.h - -# These two source files are automagically generated from a single -# instruction-table file by a Perl script. They're distributed, -# though, so it isn't necessary to have Perl just to recompile NASM -# from the distribution. - -insnsa.c insnsd.c: insns.dat insns.pl - perl insns.pl insns.dat - -# This source file is generated from the standard macros file -# `standard.mac' by another Perl script. Again, it's part of the -# standard distribution. - -macros.c: standard.mac macros.pl - perl macros.pl standard.mac - -clean: - rm -f *.${OBJ} nasm.exe ndisasm.exe diff --git a/Makefile.sc b/Makefile.sc deleted file mode 100644 index b5d0e35c..00000000 --- a/Makefile.sc +++ /dev/null @@ -1,114 +0,0 @@ -# Makefile for the Netwide Assembler under 32-bit DOS(tm) -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. -# -# This Makefile is designed to build NASM using the 32-bit WIN32 C -# compiler Symantec(tm) C++ 7.5, provided you have a MAKE-utility -# that's compatible to SMAKE. - -CC = sc -CCFLAGS = -c -a1 -mx -Nc -w2 -w7 -o+time -5 -# -5 optimize for pentium (tm) -# -c compile only -# -o-all no optimizations (to avoid problems in disasm.c) -# -o+time optimize for speed -# -o+space optimize for size -# -A1 byte alignment for structures -# -mn compile for Win32 executable -# -mx compile for DOS386 (DOSX) executable -# -Nc create COMDAT records -# -w2 possible unattended assignment: off -# -w7 for loops with empty instruction-body - -LINK = link -LINKFLAGS = /noi /exet:DOSX -# /noignorecase all symbols are case-sensitive -# /exet:NT Exetype: NT (Win32) -# /exet:DOSX Exetype: DOSX (DOS32) -# /su:console Subsystem: Console (Console-App) - -LIBRARIES = -EXE = .exe -OBJ = obj - -.c.$(OBJ): - $(CC) $(CCFLAGS) $*.c - - -# -# modules needed for different programs -# - -NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ - assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ - outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ - outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ - preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) - -NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ - insnsd.$(OBJ) - - -# -# programs to create -# - -all : nasm$(EXE) ndisasm$(EXE) - - -# -# We have to have a horrible kludge here to get round the 128 character -# limit, as usual... we'll simply use LNK-files :) -# -nasm$(EXE): $(NASMOBJS) - $(LINK) $(LINKFLAGS) @<< -cx.obj $(NASMOBJS) -nasm.exe -<< - -ndisasm$(EXE): $(NDISASMOBJS) - $(LINK) $(LINKFLAGS) @<< -cx.obj $(NDISASMOBJS) -ndisasm.exe -<< - - - -# -# modules for programs -# - -disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c -assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h -eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h -float.$(OBJ): float.c nasm.h -labels.$(OBJ): labels.c nasm.h nasmlib.h -listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h -nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ - listing.h outform.h -nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h -ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h -outas86.$(OBJ): outas86.c nasm.h nasmlib.h -outaout.$(OBJ): outaout.c nasm.h nasmlib.h -outbin.$(OBJ): outbin.c nasm.h nasmlib.h -outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h -outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h -outelf.$(OBJ): outelf.c nasm.h nasmlib.h -outobj.$(OBJ): outobj.c nasm.h nasmlib.h -outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h -outform.$(OBJ): outform.c outform.h nasm.h -parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c -preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h -sync.$(OBJ): sync.c sync.h -insnsa.$(OBJ): insnsa.c nasm.h insns.h -insnsd.$(OBJ): insnsd.c nasm.h insns.h - - - -clean : - del *.obj - del nasm$(EXE) - del ndisasm$(EXE) diff --git a/Makefile.scw b/Makefile.scw deleted file mode 100644 index 6953b464..00000000 --- a/Makefile.scw +++ /dev/null @@ -1,114 +0,0 @@ -# Makefile for the Netwide Assembler under 32-bit Windows(tm) -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. -# -# This Makefile is designed to build NASM using the 32-bit WIN32 C -# compiler Symantec(tm) C++ 7.5, provided you have a MAKE-utility -# that's compatible to SMAKE. - -CC = sc -CCFLAGS = -c -a1 -mn -Nc -w2 -w7 -o+time -5 -# -5 optimize for pentium (tm) -# -c compile only -# -o-all no optimizations (to avoid problems in disasm.c) -# -o+time optimize for speed -# -o+space optimize for size -# -A1 byte alignment for structures -# -mn compile for Win32 executable -# -mx compile for DOS386 (DOSX) executable -# -Nc create COMDAT records -# -w2 possible unattended assignment: off -# -w7 for loops with empty instruction-body - -LINK = link -LINKFLAGS = /noi /exet:NT /su:console -# /noignorecase all symbols are case-sensitive -# /exet:NT Exetype: NT (Win32) -# /exet:DOSX Exetype: DOSX (DOS32) -# /su:console Subsystem: Console (Console-App) - -LIBRARIES = -EXE = .exe -OBJ = obj - -.c.$(OBJ): - $(CC) $(CCFLAGS) $*.c - - -# -# modules needed for different programs -# - -NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ - assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ - outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ - outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ - preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) - -NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ - insnsd.$(OBJ) - - -# -# programs to create -# - -all : nasmw$(EXE) ndisasmw$(EXE) - - -# -# We have to have a horrible kludge here to get round the 128 character -# limit, as usual... we'll simply use LNK-files :) -# -nasmw$(EXE): $(NASMOBJS) - $(LINK) $(LINKFLAGS) @<< -$(NASMOBJS) -nasmw.exe; -<< - -ndisasmw$(EXE): $(NDISASMOBJS) - $(LINK) $(LINKFLAGS) @<< -$(NDISASMOBJS) -ndisasmw.exe; -<< - - - -# -# modules for programs -# - -disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c -assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h -eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h -float.$(OBJ): float.c nasm.h -labels.$(OBJ): labels.c nasm.h nasmlib.h -listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h -nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ - listing.h outform.h -nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h -ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h -outas86.$(OBJ): outas86.c nasm.h nasmlib.h -outaout.$(OBJ): outaout.c nasm.h nasmlib.h -outbin.$(OBJ): outbin.c nasm.h nasmlib.h -outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h -outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h -outelf.$(OBJ): outelf.c nasm.h nasmlib.h -outobj.$(OBJ): outobj.c nasm.h nasmlib.h -outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h -outform.$(OBJ): outform.c outform.h nasm.h -parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c -preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h -sync.$(OBJ): sync.c sync.h -insnsa.$(OBJ): insnsa.c nasm.h insns.h -insnsd.$(OBJ): insnsd.c nasm.h insns.h - - - -clean : - del *.obj - del nasmw$(EXE) - del ndisasmw$(EXE) diff --git a/Makefile.unx b/Makefile.unx deleted file mode 100644 index f74d5440..00000000 --- a/Makefile.unx +++ /dev/null @@ -1,97 +0,0 @@ -# Unix fall-back makefile for the Netwide Assembler. For use if -# `configure' fails to generate a workable Makefile. -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. - -# You may need to adjust these values. - -prefix = /usr/local -CC = cc -CFLAGS = -O -I. - -# You _shouldn't_ need to adjust anything below this line. - -exec_prefix = ${prefix} -bindir = ${exec_prefix}/bin -mandir = ${prefix}/man - -INSTALL = install -c -INSTALL_PROGRAM = ${INSTALL} -INSTALL_DATA = ${INSTALL} -m 644 - -.c.o: - $(CC) -c $(CFLAGS) $*.c - -NASM = nasm.o nasmlib.o float.o insnsa.o assemble.o labels.o \ - parser.o outform.o outbin.o outaout.o outcoff.o outelf.o \ - outobj.o outas86.o outrdf.o outdbg.o preproc.o listing.o \ - eval.o - -NDISASM = ndisasm.o disasm.o sync.o nasmlib.o insnsd.o - -all: nasm ndisasm - -nasm: $(NASM) - $(CC) -o nasm $(NASM) - -ndisasm: $(NDISASM) - $(CC) -o ndisasm $(NDISASM) - -assemble.o: assemble.c nasm.h nasmlib.h assemble.h insns.h -disasm.o: disasm.c nasm.h disasm.h sync.h insns.h names.c -eval.o: eval.c eval.h nasm.h nasmlib.h -float.o: float.c nasm.h -insnsa.o: insnsa.c nasm.h insns.h -insnsd.o: insnsd.c nasm.h insns.h -labels.o: labels.c nasm.h nasmlib.h -listing.o: listing.c nasm.h nasmlib.h listing.h -nasm.o: nasm.c nasm.h nasmlib.h preproc.h parser.h assemble.h labels.h \ - outform.h listing.h -nasmlib.o: nasmlib.c nasm.h nasmlib.h -ndisasm.o: ndisasm.c nasm.h nasmlib.h sync.h disasm.h -outaout.o: outaout.c nasm.h nasmlib.h outform.h -outas86.o: outas86.c nasm.h nasmlib.h outform.h -outbin.o: outbin.c nasm.h nasmlib.h outform.h -outcoff.o: outcoff.c nasm.h nasmlib.h outform.h -outdbg.o: outdbg.c nasm.h nasmlib.h outform.h -outelf.o: outelf.c nasm.h nasmlib.h outform.h -outform.o: outform.c outform.h nasm.h -outobj.o: outobj.c nasm.h nasmlib.h outform.h -outrdf.o: outrdf.c nasm.h nasmlib.h outform.h -parser.o: parser.c nasm.h nasmlib.h parser.h float.h names.c -preproc.o: preproc.c nasm.h nasmlib.h macros.c -sync.o: sync.c sync.h - -# These two source files are automagically generated from a single -# instruction-table file by a Perl script. They're distributed, -# though, so it isn't necessary to have Perl just to recompile NASM -# from the distribution. - -insnsa.c insnsd.c: insns.dat insns.pl - perl insns.pl insns.dat - -# This source file is generated from the standard macros file -# `standard.mac' by another Perl script. Again, it's part of the -# standard distribution. - -macros.c: standard.mac macros.pl - perl macros.pl standard.mac - -install: nasm ndisasm - $(INSTALL_PROGRAM) nasm $(bindir)/nasm - $(INSTALL_PROGRAM) ndisasm $(bindir)/ndisasm - $(INSTALL_DATA) nasm.1 $(mandir)/man1/nasm.1 - $(INSTALL_DATA) ndisasm.1 $(mandir)/man1/ndisasm.1 - -clean: - rm -f *.o nasm ndisasm - $(MAKE) -C rdoff clean - -rdf: - $(MAKE) -C rdoff - -rdf_install install_rdf: - $(MAKE) -C rdoff install diff --git a/Makefile.vc b/Makefile.vc deleted file mode 100644 index 80beba4f..00000000 --- a/Makefile.vc +++ /dev/null @@ -1,77 +0,0 @@ -# Makefile for the Netwide Assembler under Win32 -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. -# -# This Makefile is designed to build NASM as a Win32 command- -# line executable. It's been tested with Visual C++ 1.10. - -CC = cl /c /O -QCL = cl /c -LINK = cl -LINKFLAGS = -LIBRARIES = -EXE = .exe# -OBJ = obj# -SUFFIX = w# # by default, this makefile produces nasmw.exe and ndisasmw.exe - -.c.$(OBJ): - $(CC) $*.c - -NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ - assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ - outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ - outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ - preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) - -NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ - insnsd.$(OBJ) - -all : nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE) - -# We have to have a horrible kludge here to get round the 128 character -# limit, as usual... -LINKOBJS = a*.obj e*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj -nasm$(SUFFIX)$(EXE): $(NASMOBJS) - cl /Fenasm$(SUFFIX).exe $(LINKOBJS) - -ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS) - cl /Fendisasm$(SUFFIX).exe $(NDISASMOBJS) - -assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h -disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c -eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h -float.$(OBJ): float.c nasm.h -labels.$(OBJ): labels.c nasm.h nasmlib.h -listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h -nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ - listing.h outform.h -nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h -ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h -outas86.$(OBJ): outas86.c nasm.h nasmlib.h -outaout.$(OBJ): outaout.c nasm.h nasmlib.h -outbin.$(OBJ): outbin.c nasm.h nasmlib.h -outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h -outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h -outelf.$(OBJ): outelf.c nasm.h nasmlib.h -outobj.$(OBJ): outobj.c nasm.h nasmlib.h -outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h -outform.$(OBJ): outform.c outform.h nasm.h -parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c -preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h -sync.$(OBJ): sync.c sync.h - -# Another grotty hack: QC is less likely to run out of memory than -# CL proper; and we don't need any optimisation in these modules -# since they're just data. -insnsa.$(OBJ): insnsa.c nasm.h insns.h - $(QCL) insnsa.c -insnsd.$(OBJ): insnsd.c nasm.h insns.h - $(QCL) insnsd.c - -clean : - del *.obj - del nasm$(SUFFIX)$(EXE) - del ndisasm$(SUFFIX)$(EXE) diff --git a/Makefile.wc b/Makefile.wc deleted file mode 100644 index 6f0d48a5..00000000 --- a/Makefile.wc +++ /dev/null @@ -1,119 +0,0 @@ -# host: watcom c (dos, windows, os/2) -# target: dos 32bit -# Makefile for the Netwide Assembler -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. -# -# this makefile is designed for use with dos version of Watcom C 32 bit -# compiler, it generates dos 32 bit executable -# it has been tested with -# borland make.exe 4.0 -# microsoft nmake.exe 1.3 -# watcom wmake.exe /u 3.2 (remember about that /u option :) -# -# all this should compile under watcom c 9.5, 10.0, 10.5 and 10.6 -# i dont know about 11.0 because i didnt yet see it - -CFLAGS = -fpi -mf -3r -s -bt=dos -oilrt -# -fpi inline math + emulation -# -mf flat model (isnt it by default :) -# -3r 386 register calling (does everyone have pentium nowadays ?) -# -s no stack checking -# -bt=dos target system - dos -# -oilrt mega cool optimization :) - -CC = wcc386.exe $(CFLAGS) -# compiler -LFLAGS = SYSTEM dos4g -# linker flags -# target system - dos4gw -LD = wlink.exe $(LFLAGS) -# linker -OBJ = obj -# whatever - -.c.$(OBJ): - $(CC) $*.c - -NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ - assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ - outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ - outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ - preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) - -NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ - insnsd.$(OBJ) - -all : nasm.exe ndisasm.exe - echo This is dummy command for dumb make - -nasm.exe: $(NASMOBJS) NASM.LNK - $(LD) @NASM.LNK - -ndisasm.exe: $(NDISASMOBJS) NDISASM.LNK - $(LD) @NDISASM.LNK - -# linker response files -# that may take long, too much spawning command.com :) -NASM.LNK: makefile.wc - echo N nasm.exe > NASM.LNK - echo F nasm.$(OBJ) >> NASM.LNK - echo F nasmlib.$(OBJ) >> NASM.LNK - echo F eval.$(OBJ) >> NASM.LNK - echo F float.$(OBJ) >> NASM.LNK - echo F insnsa.$(OBJ) >> NASM.LNK - echo F assemble.$(OBJ) >> NASM.LNK - echo F labels.$(OBJ) >> NASM.LNK - echo F listing.$(OBJ) >> NASM.LNK - echo F parser.$(OBJ) >> NASM.LNK - echo F preproc.$(OBJ) >> NASM.LNK - echo F outform.$(OBJ) >> NASM.LNK - echo F outbin.$(OBJ) >> NASM.LNK - echo F outaout.$(OBJ) >> NASM.LNK - echo F outcoff.$(OBJ) >> NASM.LNK - echo F outelf.$(OBJ) >> NASM.LNK - echo F outobj.$(OBJ) >> NASM.LNK - echo F outas86.$(OBJ) >> NASM.LNK - echo F outrdf.$(OBJ) >> NASM.LNK - echo F outdbg.$(OBJ) >> NASM.LNK - -NDISASM.LNK: makefile.wc - echo N ndisasm.exe > NDISASM.LNK - echo F ndisasm.$(OBJ) >> NDISASM.LNK - echo F disasm.$(OBJ) >> NDISASM.LNK - echo F sync.$(OBJ) >> NDISASM.LNK - echo F nasmlib.$(OBJ) >> NDISASM.LNK - echo F insnsd.$(OBJ) >> NDISASM.LNK - -assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h -disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c -eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h -float.$(OBJ): float.c nasm.h -insnsa.$(OBJ): insnsa.c nasm.h insns.h -insnsd.$(OBJ): insnsd.c nasm.h insns.h -labels.$(OBJ): labels.c nasm.h nasmlib.h -listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h -nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ - listing.h outform.h -nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h -ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h -outas86.$(OBJ): outas86.c nasm.h nasmlib.h -outaout.$(OBJ): outaout.c nasm.h nasmlib.h -outbin.$(OBJ): outbin.c nasm.h nasmlib.h -outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h -outelf.$(OBJ): outelf.c nasm.h nasmlib.h -outobj.$(OBJ): outobj.c nasm.h nasmlib.h -outform.$(OBJ): outform.c outform.h nasm.h -parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c -preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h -sync.$(OBJ): sync.c sync.h - -clean : - del *.obj - del *.lnk - del nasm.exe - del ndisasm.exe - diff --git a/Makefile.wcw b/Makefile.wcw deleted file mode 100644 index d592c695..00000000 --- a/Makefile.wcw +++ /dev/null @@ -1,119 +0,0 @@ -# host: watcom c (dos, windows, os/2) -# target: windows nt character mode executable -# Makefile for the Netwide Assembler -# -# The Netwide Assembler is copyright (C) 1996 Simon Tatham and -# Julian Hall. All rights reserved. The software is -# redistributable under the licence given in the file "Licence" -# distributed in the NASM archive. -# -# this makefile is designed for use with of Watcom C 32 bit compiler -# it generates win32 console (character mode) executable -# it has been tested with -# borland make.exe 4.0 -# microsoft nmake.exe 1.3 -# watcom wmake.exe /u 3.2 (remember about that /u option :) -# -# all this should compile under watcom c 9.5, 10.0, 10.5 and 10.6 -# i dont know about 11.0 because i didnt yet see it - -CFLAGS = -fpi -mf -3r -s -bt=dos -oilrt -# -fpi inline math + emulation -# -mf flat model (isnt it by default :) -# -3r 386 register calling (does everyone have pentium nowadays ?) -# -s no stack checking -# -bt=nt target system - windows nt -# -oilrt mega cool optimization :) - -CC = wcc386.exe $(CFLAGS) -# compiler -LFLAGS = SYSTEM nt -# linker flags -# target system nt - character mode -LD = wlink.exe $(LFLAGS) -# linker -OBJ = obj -# whatever - -.c.$(OBJ): - $(CC) $*.c - -NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ - assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ - outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ - outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ - preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) - -NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ - insnsd.$(OBJ) - -all : nasm.exe ndisasm.exe - echo This is dummy command for dumb make - -nasm.exe: $(NASMOBJS) NASM.LNK - $(LD) @NASM.LNK - -ndisasm.exe: $(NDISASMOBJS) NDISASM.LNK - $(LD) @NDISASM.LNK - -# linker response files -# that may take long, too much spawning command.com :) -NASM.LNK: makefile.wcw - echo N nasm.exe > NASM.LNK - echo F nasm.$(OBJ) >> NASM.LNK - echo F nasmlib.$(OBJ) >> NASM.LNK - echo F eval.$(OBJ) >> NASM.LNK - echo F float.$(OBJ) >> NASM.LNK - echo F insnsa.$(OBJ) >> NASM.LNK - echo F assemble.$(OBJ) >> NASM.LNK - echo F labels.$(OBJ) >> NASM.LNK - echo F listing.$(OBJ) >> NASM.LNK - echo F parser.$(OBJ) >> NASM.LNK - echo F preproc.$(OBJ) >> NASM.LNK - echo F outform.$(OBJ) >> NASM.LNK - echo F outbin.$(OBJ) >> NASM.LNK - echo F outaout.$(OBJ) >> NASM.LNK - echo F outcoff.$(OBJ) >> NASM.LNK - echo F outelf.$(OBJ) >> NASM.LNK - echo F outobj.$(OBJ) >> NASM.LNK - echo F outas86.$(OBJ) >> NASM.LNK - echo F outrdf.$(OBJ) >> NASM.LNK - echo F outdbg.$(OBJ) >> NASM.LNK - -NDISASM.LNK: makefile.wcw - echo N ndisasm.exe > NDISASM.LNK - echo F ndisasm.$(OBJ) >> NDISASM.LNK - echo F disasm.$(OBJ) >> NDISASM.LNK - echo F sync.$(OBJ) >> NDISASM.LNK - echo F nasmlib.$(OBJ) >> NDISASM.LNK - echo F insnsd.$(OBJ) >> NDISASM.LNK - -assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h -disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c -eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h -float.$(OBJ): float.c nasm.h -insnsa.$(OBJ): insnsa.c nasm.h insns.h -insnsd.$(OBJ): insnsd.c nasm.h insns.h -labels.$(OBJ): labels.c nasm.h nasmlib.h -listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h -nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ - listing.h outform.h -nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h -ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h -outas86.$(OBJ): outas86.c nasm.h nasmlib.h -outaout.$(OBJ): outaout.c nasm.h nasmlib.h -outbin.$(OBJ): outbin.c nasm.h nasmlib.h -outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h -outelf.$(OBJ): outelf.c nasm.h nasmlib.h -outobj.$(OBJ): outobj.c nasm.h nasmlib.h -outform.$(OBJ): outform.c outform.h nasm.h -parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c -preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h -sync.$(OBJ): sync.c sync.h - -clean : - del *.obj - del *.lnk - del nasm.exe - del ndisasm.exe - diff --git a/Mkfiles/Makefile.bc2 b/Mkfiles/Makefile.bc2 new file mode 100644 index 00000000..92ec9d2e --- /dev/null +++ b/Mkfiles/Makefile.bc2 @@ -0,0 +1,238 @@ +# Makefile for the Netwide Assembler under 16-bit DOS (aimed at Borland C) +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. +# +# This makefile is made for compile NASM and NDISASM on a 16 bit dos +# compiler like Microsoft C, or Borland C. This should work on all +# verioson of Turbo C++ and Borland C++ from version 3.0 and upwords. +# I'm not fully sure how it will handel on Microsoft C, but all the +# switches are documented, and it shouldn't be a problem to change it +# over. +# +# It does show a few of my preferances, like putting the OBJ files +# in a seperat directory, but if you just set OBJD to '.', it will +# drop them all in the current directory (though you still need to +# make the directory it's self). +# +# Most everything is remarked, and explaned in full, it should be +# easy to convert it to another compiler. I tried to make the devision +# of information logical, and easy to follow. +# +# BEFORE YOU USE THIS MAKE FILE!!! +# +# Make sure the line below is set to the propper location of your standard +# Libaries, if not you'll get some errors. Make sure to keep the trailing +# backslash, as it's needed, and remeber to use \\ not \ as that will cause +# some errors. +# +# Also inportant, if you get a DGROUP error when you compile NASM, remove +# or comment out the 'NASMSize=l' line, and uncoment (remove the #) from the +# NASMSize=h line. Then run 'make Clean' to delete the object files. Then run +# make again to re-build NASM as huge. +# +# History: +# 06/13/97: * Added the EXED varable for the location to put the EXE files. +# * Because different versions of Borland and Turbo C have +# different GROUPings for the DGROUP, some version, when you +# compile NASM, you will get a DGROUP overflow error, making it +# so NASM has to be compiled as huge. As this isn't a constant +# through systems (and apperently some version of Borland, +# compileing as huge causes some errors) the NASMSize verable +# has been added to spicify what size of code you want to +# compile as and defaults to large. +# 06/16/97: * Added 'merge dupicate strings' to the options for compiles. + +NASMSize=l #Compile Nasm as Large +#NASMSize=h #Compile Nasm as Huge + +LIB =c:\\tc\\lib\\ #location standard libaries + +OBJD=obj\\ #directory to put OBJ files in +EXED=.\ #directory to put the EXE files. +CC = tcc #compiler +LINK = tlink #linker +CCFLAGS = /d /c /O /A /m$(NASMSize) /n$(OBJD) #compiler flags for NASM + #/d=merge dupicate strings + #/c=compile only + #/O=Optimise jumps + #/A=ANSI standard C + #/m$(NASMSize>=the model to use + #/n$(OBJD)= put the OBJ files in the diectory given. + +DCCFLAGS = /d /c /O /A /mh /n$(OBJD) #compiler flags for NDISASM + #/d=merge dupicate strings + #/c=compile only + #/O=Optimise jumps + #/A=ANSI standard C + #/mh=Model huge + #/n$(OBJD)= put the OBJ files in the diectory given. + #NOTE: Huge model is used, and the array in insnsd.c is large enough to + #over size the d-group in large mode. + +LINKFLAGS = /c /x #linker flags + #/c=case segnificance on symboles + #/x=No map file at all + +LIBRARIES = #any libaries to add, out side of the standard libary +EXE = .exe #executable file extention (keep the . as the start) +OBJ = obj #OBJ file extention + +NASM_ASM=$(CC) $(CCFLAGS) $&.c #Command line for NASM +DASM_ASM=$(CC) $(DCCFLAGS) $&.c #command line for NDISASM + +# NOTE: $& is used to create the file name, as it only gives the name it's +# self, where as using $* would have give the full path of the file it +# want's done. This becomes a problem if the OBJ files are in a seperate +# directory, becuse it will then try to find the source file in the OBJ +# dir. + +################################################################ +#The OBJ files that NASM is dependent on + +NASMOBJS = $(OBJD)nasm.$(OBJ) $(OBJD)nasmlib.$(OBJ) $(OBJD)float.$(OBJ) \ + $(OBJD)insnsa.$(OBJ) $(OBJD)assemble.$(OBJ) $(OBJD)labels.$(OBJ) \ + $(OBJD)parser.$(OBJ) $(OBJD)outform.$(OBJ) $(OBJD)preproc.$(OBJ) \ + $(OBJD)listing.$(OBJ) $(OBJD)eval.$(OBJ) + +################################################################ +#The OBJ files that NDISASM is dependent on + +NDISASMOBJS = $(OBJD)ndisasm.$(OBJ) $(OBJD)disasm.$(OBJ) $(OBJD)sync.$(OBJ) \ + $(OBJD)nasmlibd.$(OBJ) $(OBJD)insnsd.$(OBJ) + +################################################################ +#The OBJ file for the output formats. + +OUTOBJ= $(OBJD)outbin.$(OBJ) $(OBJD)outaout.$(OBJ) $(OBJD)outcoff.$(OBJ) \ + $(OBJD)outelf.$(OBJ) $(OBJD)outobj.$(OBJ) $(OBJD)outas86.$(OBJ) \ + $(OBJD)outrdf.$(OBJ) $(OBJD)outdbg.$(OBJ) + + +################################################################ +# Build everything + +all : nasm$(EXE) ndisasm$(EXE) + +################################################################ +#NASM, NDISASM compile, I hope it's self explanitorie + +nasm$(EXE): $(NASMOBJS) $(OUTOBJ) + $(LINK) $(LINKFLAGS) @&&^ #command for the linker + $(LIB)c0$(NASMSize).obj $(NASMOBJS) $(OUTOBJ) #OBJ file list + $(EXED)nasm$(EXE) #EXE file name +# No need of a map file + $(LIB)c$(NASMSize).lib $(LIBRARIES) #Libaries needed +^ + +ndisasm$(EXE): $(NDISASMOBJS) + $(LINK) $(LINKFLAGS) @&&^ #command for the linker + $(LIB)c0h.obj $(NDISASMOBJS) #OBJ file list + $(EXED)ndisasm$(EXE) #EXE file name +# No need of a map file + $(LIB)ch.lib $(LIBRARIES) #Libaries needed +^ + +################################################################ +# Dependencies for all of NASM's obj files + +$(OBJD)assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h + $(NASM_ASM) + +$(OBJD)float.$(OBJ): float.c nasm.h + $(NASM_ASM) + +$(OBJD)labels.$(OBJ): labels.c nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h + $(NASM_ASM) + +$(OBJD)eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h + $(NASM_ASM) + +$(OBJD)nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ + listing.h outform.h + $(NASM_ASM) + +$(OBJD)nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c + $(NASM_ASM) + +$(OBJD)preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)insnsa.$(OBJ): insnsa.c nasm.h insns.h + $(NASM_ASM) + +################################################################ +# Dependencies for all of NDISASM's obj files + +$(OBJD)disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c + $(DASM_ASM) + +$(OBJD)ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h + $(DASM_ASM) + +$(OBJD)sync.$(OBJ): sync.c sync.h + $(DASM_ASM) + +$(OBJD)insnsd.$(OBJ): insnsd.c nasm.h insns.h + $(DASM_ASM) + +# This is a kludge from the word go, as we can't use the nasmlib.obj compiled +# for NASM, as it's could be the wrong model size, so we have to compile it +# again as huge to make sure. +# +# So as not to overwrite the nasmlib.obj for NASM (if it did, that +# could cause all kinds of problems) it compiles it into nasmlibd.obj. +# +# the -o... switch tells it the name to compile the obj file to, right here +# $(OBJD)nasmlibd.obj + +$(OBJD)nasmlibd.$(OBJ): nasmlib.c nasm.h nasmlib.h + $(CC) $(DCCFLAGS) -o$(OBJD)nasmlibd.obj nasmlib.c + +################################################################ +# Dependencies for all of the output format's OBJ files + +$(OBJD)outas86.$(OBJ): outas86.c nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)outaout.$(OBJ): outaout.c nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)outbin.$(OBJ): outbin.c nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)outelf.$(OBJ): outelf.c nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)outobj.$(OBJ): outobj.c nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h + $(NASM_ASM) + +$(OBJD)outform.$(OBJ): outform.c outform.h nasm.h + $(NASM_ASM) + +################################################################ +# A quick way to delete the OBJ files as well as the binaries. + +clean : + del $(OBJD)*.obj + del nasm$(EXE) + del ndisasm$(EXE) + +# Makefile created by Fox Cutter --01/27/97 diff --git a/Mkfiles/Makefile.bor b/Mkfiles/Makefile.bor new file mode 100644 index 00000000..90e96fba --- /dev/null +++ b/Mkfiles/Makefile.bor @@ -0,0 +1,82 @@ +# Makefile for the Netwide Assembler under 16-bit DOS +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. +# +# This Makefile is designed to build NASM using a 16-bit DOS C +# compiler such as Borland C, and has been tested with Borland C 2.3 +# and Borland Make. + +# CC = cl +# CCFLAGS = /c /O /AL +# LINK = cl +CC = bcc +CCFLAGS = -c -O -ml -A +LINK = tlink /c /Lc:\bc\lib +LINKFLAGS = +LIBRARIES = +EXE = .exe# +OBJ = obj# + +.c.$(OBJ): + $(CC) $(CCFLAGS) $*.c + +NASMOBJS1 = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) +NASMOBJS2 = assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) +NASMOBJS3 = outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) +NASMOBJS4 = outobj.$(OBJ) outas86.$(OBJ) outdbg.$(OBJ) outrdf.$(OBJ) +NASMOBJS5 = preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) + +NASMOBJS = $(NASMOBJS1) $(NASMOBJS2) $(NASMOBJS3) $(NASMOBJS4) $(NASMOBJS5) + +NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ + insnsd.$(OBJ) + +all : nasm$(EXE) ndisasm$(EXE) + +# We have to have a horrible kludge here to get round the 128 character +# limit, as usual... +nasm$(EXE): $(NASMOBJS) +# $(LINK) /Fenasm.exe a*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj + echo c0l.obj $(NASMOBJS1) +> nasmobjs.tmp + echo $(NASMOBJS2) +>> nasmobjs.tmp + echo $(NASMOBJS3) +>> nasmobjs.tmp + echo $(NASMOBJS4) +>> nasmobjs.tmp + echo $(NASMOBJS5),nasm.exe,,cl.lib, >> nasmobjs.tmp + $(LINK) /Tde @nasmobjs.tmp + +ndisasm$(EXE): $(NDISASMOBJS) +# $(LINK) /Fendisasm.exe $(NDISASMOBJS) + $(LINK) /Tde $(NDISASMOBJS),ndisasm.exe,,cl.lib, + +assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h +disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c +eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h +float.$(OBJ): float.c nasm.h +insnsa.$(OBJ): insnsa.c nasm.h insns.h +insnsd.$(OBJ): insnsd.c nasm.h insns.h +labels.$(OBJ): labels.c nasm.h nasmlib.h +listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h +nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ + listing.h outform.h +nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h +ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h +outas86.$(OBJ): outas86.c nasm.h nasmlib.h +outaout.$(OBJ): outaout.c nasm.h nasmlib.h +outbin.$(OBJ): outbin.c nasm.h nasmlib.h +outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h +outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h +outelf.$(OBJ): outelf.c nasm.h nasmlib.h +outobj.$(OBJ): outobj.c nasm.h nasmlib.h +outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h +outform.$(OBJ): outform.c outform.h nasm.h +parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c +preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h +sync.$(OBJ): sync.c sync.h + +clean : + del *.obj + del nasm$(EXE) + del ndisasm$(EXE) diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj new file mode 100644 index 00000000..6d932f38 --- /dev/null +++ b/Mkfiles/Makefile.dj @@ -0,0 +1,81 @@ +# host: dos +# target: dos 32bit +# Makefile for the Netwide Assembler +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. + +# makefile designed for djgpp 2.xx +# djgpp is GNU C compiler ported by mighty DJ Delorie +# www.delorie.com and any simtel mirror + +# You may need to adjust these values. + +CC = gcc +CFLAGS = -O2 -I. + +# You _shouldn't_ need to adjust anything below this line. + +.c.o: + $(CC) -c $(CFLAGS) $*.c + +NASM = nasm.o nasmlib.o float.o insnsa.o assemble.o labels.o \ + parser.o outform.o outbin.o outaout.o outcoff.o outelf.o \ + outobj.o outas86.o outrdf.o outdbg.o preproc.o listing.o \ + eval.o + +NDISASM = ndisasm.o disasm.o sync.o nasmlib.o insnsd.o + +all: nasm.exe ndisasm.exe + +nasm.exe: $(NASM) + $(CC) -o $@ $(NASM) + +ndisasm.exe: $(NDISASM) + $(CC) -o $@ $(NDISASM) + +assemble.o: assemble.c nasm.h nasmlib.h assemble.h insns.h +disasm.o: disasm.c nasm.h disasm.h sync.h insns.h names.c +eval.o: eval.c eval.h nasm.h nasmlib.h +float.o: float.c nasm.h +insnsa.o: insnsa.c nasm.h insns.h +insnsd.o: insnsd.c nasm.h insns.h +labels.o: labels.c nasm.h nasmlib.h +listing.o: listing.c nasm.h nasmlib.h listing.h +nasm.o: nasm.c nasm.h nasmlib.h preproc.h parser.h assemble.h labels.h \ + outform.h listing.h +nasmlib.o: nasmlib.c nasm.h nasmlib.h +ndisasm.o: ndisasm.c nasm.h nasmlib.h sync.h disasm.h +outaout.o: outaout.c nasm.h nasmlib.h outform.h +outas86.o: outas86.c nasm.h nasmlib.h outform.h +outbin.o: outbin.c nasm.h nasmlib.h outform.h +outcoff.o: outcoff.c nasm.h nasmlib.h outform.h +outdbg.o: outdbg.c nasm.h nasmlib.h outform.h +outelf.o: outelf.c nasm.h nasmlib.h outform.h +outform.o: outform.c outform.h nasm.h +outobj.o: outobj.c nasm.h nasmlib.h outform.h +outrdf.o: outrdf.c nasm.h nasmlib.h outform.h +parser.o: parser.c nasm.h nasmlib.h parser.h float.h names.c +preproc.o: preproc.c nasm.h nasmlib.h macros.c +sync.o: sync.c sync.h + +# These two source files are automagically generated from a single +# instruction-table file by a Perl script. They're distributed, +# though, so it isn't necessary to have Perl just to recompile NASM +# from the distribution. + +insnsa.c insnsd.c: insns.dat insns.pl + perl insns.pl insns.dat + +# This source file is generated from the standard macros file +# `standard.mac' by another Perl script. Again, it's part of the +# standard distribution. + +macros.c: standard.mac macros.pl + perl macros.pl standard.mac + +clean: + rm -f *.o nasm ndisasm + diff --git a/Mkfiles/Makefile.dos b/Mkfiles/Makefile.dos new file mode 100644 index 00000000..94403fc1 --- /dev/null +++ b/Mkfiles/Makefile.dos @@ -0,0 +1,78 @@ +# Makefile for the Netwide Assembler under 16-bit DOS +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. +# +# This Makefile is designed to build NASM using a 16-bit DOS C +# compiler such as Microsoft C, provided you have a compatible MAKE. +# It's been tested with Microsoft C 5.x plus Borland Make. (Yes, I +# know it's silly, but...) + +CC = cl /c /O /AL /Gt +QCL = qcl /c /AL /Gt +LINK = cl +LINKFLAGS = +LIBRARIES = +EXE = .exe# +OBJ = obj# + +.c.$(OBJ): + $(CC) $*.c + +NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ + assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ + outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ + outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ + preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) + +NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ + insnsd.$(OBJ) + +all : nasm$(EXE) ndisasm$(EXE) + +# We have to have a horrible kludge here to get round the 128 character +# limit, as usual... +LINKOBJS = a*.obj e*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj +nasm$(EXE): $(NASMOBJS) + cl /Fenasm.exe /F 4000 $(LINKOBJS) + +ndisasm$(EXE): $(NDISASMOBJS) + cl /Fendisasm.exe $(NDISASMOBJS) + +assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h +disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c +eval.$(OBJ): eval.c eval.h nasm.h nasmlib.h +float.$(OBJ): float.c nasm.h +labels.$(OBJ): labels.c nasm.h nasmlib.h +listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h +nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ + listing.h outform.h +nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h +ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h +outas86.$(OBJ): outas86.c nasm.h nasmlib.h +outaout.$(OBJ): outaout.c nasm.h nasmlib.h +outbin.$(OBJ): outbin.c nasm.h nasmlib.h +outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h +outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h +outelf.$(OBJ): outelf.c nasm.h nasmlib.h +outobj.$(OBJ): outobj.c nasm.h nasmlib.h +outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h +outform.$(OBJ): outform.c outform.h nasm.h +parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c +preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h +sync.$(OBJ): sync.c sync.h + +# Another grotty hack: QC is less likely to run out of memory than +# CL proper; and we don't need any optimisation in these modules +# since they're just data. +insnsa.$(OBJ): insnsa.c nasm.h insns.h + $(QCL) insnsa.c +insnsd.$(OBJ): insnsd.c nasm.h insns.h + $(QCL) insnsd.c + +clean : + del *.obj + del nasm$(EXE) + del ndisasm$(EXE) diff --git a/Mkfiles/Makefile.lcc b/Mkfiles/Makefile.lcc new file mode 100644 index 00000000..1f6fdcbd --- /dev/null +++ b/Mkfiles/Makefile.lcc @@ -0,0 +1,110 @@ +# host: windows nt/95 +# target: windows nt/95 +# Makefile for the Netwide Assembler +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. + +# makefile designed for lcc-win32 +# lcc-win32 is lcc (c compiler coded by guys from princeton uni) +# ported to win32 by jacob navia +# available at http://www.remcomp.com/lcc-win32/ + +CFLAGS = -c -O -g2 +CC = lcc.exe $(CFLAGS) +LFLAGS = -subsystem console -s +LD = lcclnk.exe $(LFLAGS) +OBJ = obj + +.c.${OBJ}: + $(CC) -o $@ $*.c + +NASM = nasm.${OBJ} nasmlib.${OBJ} float.${OBJ} insnsa.${OBJ} assemble.${OBJ} labels.${OBJ} \ + parser.${OBJ} outform.${OBJ} outbin.${OBJ} outaout.${OBJ} outcoff.${OBJ} outelf.${OBJ} \ + outobj.${OBJ} outas86.${OBJ} outrdf.${OBJ} outdbg.${OBJ} preproc.${OBJ} listing.${OBJ} \ + eval.${OBJ} + +NDISASM = ndisasm.${OBJ} disasm.${OBJ} sync.${OBJ} nasmlib.${OBJ} insnsd.${OBJ} + +all: nasm ndisasm + +# linker response files +# that may take long, too much spawning command.com :) +NASM.LNK: makefile.lcc + echo nasm.$(OBJ) > NASM.LNK + echo nasmlib.$(OBJ) >> NASM.LNK + echo eval.$(OBJ) >> NASM.LNK + echo float.$(OBJ) >> NASM.LNK + echo insnsa.$(OBJ) >> NASM.LNK + echo assemble.$(OBJ) >> NASM.LNK + echo labels.$(OBJ) >> NASM.LNK + echo listing.$(OBJ) >> NASM.LNK + echo parser.$(OBJ) >> NASM.LNK + echo preproc.$(OBJ) >> NASM.LNK + echo outform.$(OBJ) >> NASM.LNK + echo outbin.$(OBJ) >> NASM.LNK + echo outaout.$(OBJ) >> NASM.LNK + echo outcoff.$(OBJ) >> NASM.LNK + echo outelf.$(OBJ) >> NASM.LNK + echo outobj.$(OBJ) >> NASM.LNK + echo outas86.$(OBJ) >> NASM.LNK + echo outrdf.$(OBJ) >> NASM.LNK + echo outdbg.$(OBJ) >> NASM.LNK + +NDISASM.LNK: makefile.lcc + echo ndisasm.$(OBJ) > NDISASM.LNK + echo disasm.$(OBJ) >> NDISASM.LNK + echo sync.$(OBJ) >> NDISASM.LNK + echo nasmlib.$(OBJ) >> NDISASM.LNK + echo insnsd.$(OBJ) >> NDISASM.LNK + +nasm: $(NASM) nasm.lnk + $(LD) -o nasm.exe @nasm.lnk + +ndisasm: $(NDISASM) ndisasm.lnk + $(LD) -o ndisasm.exe @ndisasm.lnk + +assemble.${OBJ}: assemble.c nasm.h nasmlib.h assemble.h insns.h +disasm.${OBJ}: disasm.c nasm.h disasm.h sync.h insns.h names.c +eval.${OBJ}: eval.c eval.h nasm.h nasmlib.h +float.${OBJ}: float.c nasm.h +insnsa.${OBJ}: insnsa.c nasm.h insns.h +insnsd.${OBJ}: insnsd.c nasm.h insns.h +labels.${OBJ}: labels.c nasm.h nasmlib.h +listing.${OBJ}: listing.c nasm.h nasmlib.h listing.h +nasm.${OBJ}: nasm.c nasm.h nasmlib.h preproc.h parser.h assemble.h labels.h \ + outform.h listing.h +nasmlib.${OBJ}: nasmlib.c nasm.h nasmlib.h +ndisasm.${OBJ}: ndisasm.c nasm.h nasmlib.h sync.h disasm.h +outaout.${OBJ}: outaout.c nasm.h nasmlib.h outform.h +outas86.${OBJ}: outas86.c nasm.h nasmlib.h outform.h +outbin.${OBJ}: outbin.c nasm.h nasmlib.h outform.h +outcoff.${OBJ}: outcoff.c nasm.h nasmlib.h outform.h +outdbg.${OBJ}: outdbg.c nasm.h nasmlib.h outform.h +outelf.${OBJ}: outelf.c nasm.h nasmlib.h outform.h +outform.${OBJ}: outform.c outform.h nasm.h +outobj.${OBJ}: outobj.c nasm.h nasmlib.h outform.h +outrdf.${OBJ}: outrdf.c nasm.h nasmlib.h outform.h +parser.${OBJ}: parser.c nasm.h nasmlib.h parser.h float.h names.c +preproc.${OBJ}: preproc.c nasm.h nasmlib.h macros.c +sync.${OBJ}: sync.c sync.h + +# These two source files are automagically generated from a single +# instruction-table file by a Perl script. They're distributed, +# though, so it isn't necessary to have Perl just to recompile NASM +# from the distribution. + +insnsa.c insnsd.c: insns.dat insns.pl + perl insns.pl insns.dat + +# This source file is generated from the standard macros file +# `standard.mac' by another Perl script. Again, it's part of the +# standard distribution. + +macros.c: standard.mac macros.pl + perl macros.pl standard.mac + +clean: + rm -f *.${OBJ} nasm.exe ndisasm.exe diff --git a/Mkfiles/Makefile.sc b/Mkfiles/Makefile.sc new file mode 100644 index 00000000..b5d0e35c --- /dev/null +++ b/Mkfiles/Makefile.sc @@ -0,0 +1,114 @@ +# Makefile for the Netwide Assembler under 32-bit DOS(tm) +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. +# +# This Makefile is designed to build NASM using the 32-bit WIN32 C +# compiler Symantec(tm) C++ 7.5, provided you have a MAKE-utility +# that's compatible to SMAKE. + +CC = sc +CCFLAGS = -c -a1 -mx -Nc -w2 -w7 -o+time -5 +# -5 optimize for pentium (tm) +# -c compile only +# -o-all no optimizations (to avoid problems in disasm.c) +# -o+time optimize for speed +# -o+space optimize for size +# -A1 byte alignment for structures +# -mn compile for Win32 executable +# -mx compile for DOS386 (DOSX) executable +# -Nc create COMDAT records +# -w2 possible unattended assignment: off +# -w7 for loops with empty instruction-body + +LINK = link +LINKFLAGS = /noi /exet:DOSX +# /noignorecase all symbols are case-sensitive +# /exet:NT Exetype: NT (Win32) +# /exet:DOSX Exetype: DOSX (DOS32) +# /su:console Subsystem: Console (Console-App) + +LIBRARIES = +EXE = .exe +OBJ = obj + +.c.$(OBJ): + $(CC) $(CCFLAGS) $*.c + + +# +# modules needed for different programs +# + +NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ + assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ + outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ + outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ + preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) + +NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ + insnsd.$(OBJ) + + +# +# programs to create +# + +all : nasm$(EXE) ndisasm$(EXE) + + +# +# We have to have a horrible kludge here to get round the 128 character +# limit, as usual... we'll simply use LNK-files :) +# +nasm$(EXE): $(NASMOBJS) + $(LINK) $(LINKFLAGS) @<< +cx.obj $(NASMOBJS) +nasm.exe +<< + +ndisasm$(EXE): $(NDISASMOBJS) + $(LINK) $(LINKFLAGS) @<< +cx.obj $(NDISASMOBJS) +ndisasm.exe +<< + + + +# +# modules for programs +# + +disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c +assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h +eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h +float.$(OBJ): float.c nasm.h +labels.$(OBJ): labels.c nasm.h nasmlib.h +listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h +nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ + listing.h outform.h +nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h +ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h +outas86.$(OBJ): outas86.c nasm.h nasmlib.h +outaout.$(OBJ): outaout.c nasm.h nasmlib.h +outbin.$(OBJ): outbin.c nasm.h nasmlib.h +outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h +outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h +outelf.$(OBJ): outelf.c nasm.h nasmlib.h +outobj.$(OBJ): outobj.c nasm.h nasmlib.h +outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h +outform.$(OBJ): outform.c outform.h nasm.h +parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c +preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h +sync.$(OBJ): sync.c sync.h +insnsa.$(OBJ): insnsa.c nasm.h insns.h +insnsd.$(OBJ): insnsd.c nasm.h insns.h + + + +clean : + del *.obj + del nasm$(EXE) + del ndisasm$(EXE) diff --git a/Mkfiles/Makefile.scw b/Mkfiles/Makefile.scw new file mode 100644 index 00000000..6953b464 --- /dev/null +++ b/Mkfiles/Makefile.scw @@ -0,0 +1,114 @@ +# Makefile for the Netwide Assembler under 32-bit Windows(tm) +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. +# +# This Makefile is designed to build NASM using the 32-bit WIN32 C +# compiler Symantec(tm) C++ 7.5, provided you have a MAKE-utility +# that's compatible to SMAKE. + +CC = sc +CCFLAGS = -c -a1 -mn -Nc -w2 -w7 -o+time -5 +# -5 optimize for pentium (tm) +# -c compile only +# -o-all no optimizations (to avoid problems in disasm.c) +# -o+time optimize for speed +# -o+space optimize for size +# -A1 byte alignment for structures +# -mn compile for Win32 executable +# -mx compile for DOS386 (DOSX) executable +# -Nc create COMDAT records +# -w2 possible unattended assignment: off +# -w7 for loops with empty instruction-body + +LINK = link +LINKFLAGS = /noi /exet:NT /su:console +# /noignorecase all symbols are case-sensitive +# /exet:NT Exetype: NT (Win32) +# /exet:DOSX Exetype: DOSX (DOS32) +# /su:console Subsystem: Console (Console-App) + +LIBRARIES = +EXE = .exe +OBJ = obj + +.c.$(OBJ): + $(CC) $(CCFLAGS) $*.c + + +# +# modules needed for different programs +# + +NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ + assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ + outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ + outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ + preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) + +NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ + insnsd.$(OBJ) + + +# +# programs to create +# + +all : nasmw$(EXE) ndisasmw$(EXE) + + +# +# We have to have a horrible kludge here to get round the 128 character +# limit, as usual... we'll simply use LNK-files :) +# +nasmw$(EXE): $(NASMOBJS) + $(LINK) $(LINKFLAGS) @<< +$(NASMOBJS) +nasmw.exe; +<< + +ndisasmw$(EXE): $(NDISASMOBJS) + $(LINK) $(LINKFLAGS) @<< +$(NDISASMOBJS) +ndisasmw.exe; +<< + + + +# +# modules for programs +# + +disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c +assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h +eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h +float.$(OBJ): float.c nasm.h +labels.$(OBJ): labels.c nasm.h nasmlib.h +listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h +nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ + listing.h outform.h +nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h +ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h +outas86.$(OBJ): outas86.c nasm.h nasmlib.h +outaout.$(OBJ): outaout.c nasm.h nasmlib.h +outbin.$(OBJ): outbin.c nasm.h nasmlib.h +outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h +outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h +outelf.$(OBJ): outelf.c nasm.h nasmlib.h +outobj.$(OBJ): outobj.c nasm.h nasmlib.h +outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h +outform.$(OBJ): outform.c outform.h nasm.h +parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c +preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h +sync.$(OBJ): sync.c sync.h +insnsa.$(OBJ): insnsa.c nasm.h insns.h +insnsd.$(OBJ): insnsd.c nasm.h insns.h + + + +clean : + del *.obj + del nasmw$(EXE) + del ndisasmw$(EXE) diff --git a/Mkfiles/Makefile.unx b/Mkfiles/Makefile.unx new file mode 100644 index 00000000..f74d5440 --- /dev/null +++ b/Mkfiles/Makefile.unx @@ -0,0 +1,97 @@ +# Unix fall-back makefile for the Netwide Assembler. For use if +# `configure' fails to generate a workable Makefile. +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. + +# You may need to adjust these values. + +prefix = /usr/local +CC = cc +CFLAGS = -O -I. + +# You _shouldn't_ need to adjust anything below this line. + +exec_prefix = ${prefix} +bindir = ${exec_prefix}/bin +mandir = ${prefix}/man + +INSTALL = install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 + +.c.o: + $(CC) -c $(CFLAGS) $*.c + +NASM = nasm.o nasmlib.o float.o insnsa.o assemble.o labels.o \ + parser.o outform.o outbin.o outaout.o outcoff.o outelf.o \ + outobj.o outas86.o outrdf.o outdbg.o preproc.o listing.o \ + eval.o + +NDISASM = ndisasm.o disasm.o sync.o nasmlib.o insnsd.o + +all: nasm ndisasm + +nasm: $(NASM) + $(CC) -o nasm $(NASM) + +ndisasm: $(NDISASM) + $(CC) -o ndisasm $(NDISASM) + +assemble.o: assemble.c nasm.h nasmlib.h assemble.h insns.h +disasm.o: disasm.c nasm.h disasm.h sync.h insns.h names.c +eval.o: eval.c eval.h nasm.h nasmlib.h +float.o: float.c nasm.h +insnsa.o: insnsa.c nasm.h insns.h +insnsd.o: insnsd.c nasm.h insns.h +labels.o: labels.c nasm.h nasmlib.h +listing.o: listing.c nasm.h nasmlib.h listing.h +nasm.o: nasm.c nasm.h nasmlib.h preproc.h parser.h assemble.h labels.h \ + outform.h listing.h +nasmlib.o: nasmlib.c nasm.h nasmlib.h +ndisasm.o: ndisasm.c nasm.h nasmlib.h sync.h disasm.h +outaout.o: outaout.c nasm.h nasmlib.h outform.h +outas86.o: outas86.c nasm.h nasmlib.h outform.h +outbin.o: outbin.c nasm.h nasmlib.h outform.h +outcoff.o: outcoff.c nasm.h nasmlib.h outform.h +outdbg.o: outdbg.c nasm.h nasmlib.h outform.h +outelf.o: outelf.c nasm.h nasmlib.h outform.h +outform.o: outform.c outform.h nasm.h +outobj.o: outobj.c nasm.h nasmlib.h outform.h +outrdf.o: outrdf.c nasm.h nasmlib.h outform.h +parser.o: parser.c nasm.h nasmlib.h parser.h float.h names.c +preproc.o: preproc.c nasm.h nasmlib.h macros.c +sync.o: sync.c sync.h + +# These two source files are automagically generated from a single +# instruction-table file by a Perl script. They're distributed, +# though, so it isn't necessary to have Perl just to recompile NASM +# from the distribution. + +insnsa.c insnsd.c: insns.dat insns.pl + perl insns.pl insns.dat + +# This source file is generated from the standard macros file +# `standard.mac' by another Perl script. Again, it's part of the +# standard distribution. + +macros.c: standard.mac macros.pl + perl macros.pl standard.mac + +install: nasm ndisasm + $(INSTALL_PROGRAM) nasm $(bindir)/nasm + $(INSTALL_PROGRAM) ndisasm $(bindir)/ndisasm + $(INSTALL_DATA) nasm.1 $(mandir)/man1/nasm.1 + $(INSTALL_DATA) ndisasm.1 $(mandir)/man1/ndisasm.1 + +clean: + rm -f *.o nasm ndisasm + $(MAKE) -C rdoff clean + +rdf: + $(MAKE) -C rdoff + +rdf_install install_rdf: + $(MAKE) -C rdoff install diff --git a/Mkfiles/Makefile.vc b/Mkfiles/Makefile.vc new file mode 100644 index 00000000..80beba4f --- /dev/null +++ b/Mkfiles/Makefile.vc @@ -0,0 +1,77 @@ +# Makefile for the Netwide Assembler under Win32 +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. +# +# This Makefile is designed to build NASM as a Win32 command- +# line executable. It's been tested with Visual C++ 1.10. + +CC = cl /c /O +QCL = cl /c +LINK = cl +LINKFLAGS = +LIBRARIES = +EXE = .exe# +OBJ = obj# +SUFFIX = w# # by default, this makefile produces nasmw.exe and ndisasmw.exe + +.c.$(OBJ): + $(CC) $*.c + +NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ + assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ + outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ + outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ + preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) + +NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ + insnsd.$(OBJ) + +all : nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE) + +# We have to have a horrible kludge here to get round the 128 character +# limit, as usual... +LINKOBJS = a*.obj e*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj +nasm$(SUFFIX)$(EXE): $(NASMOBJS) + cl /Fenasm$(SUFFIX).exe $(LINKOBJS) + +ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS) + cl /Fendisasm$(SUFFIX).exe $(NDISASMOBJS) + +assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h +disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c +eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h +float.$(OBJ): float.c nasm.h +labels.$(OBJ): labels.c nasm.h nasmlib.h +listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h +nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ + listing.h outform.h +nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h +ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h +outas86.$(OBJ): outas86.c nasm.h nasmlib.h +outaout.$(OBJ): outaout.c nasm.h nasmlib.h +outbin.$(OBJ): outbin.c nasm.h nasmlib.h +outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h +outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h +outelf.$(OBJ): outelf.c nasm.h nasmlib.h +outobj.$(OBJ): outobj.c nasm.h nasmlib.h +outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h +outform.$(OBJ): outform.c outform.h nasm.h +parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c +preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h +sync.$(OBJ): sync.c sync.h + +# Another grotty hack: QC is less likely to run out of memory than +# CL proper; and we don't need any optimisation in these modules +# since they're just data. +insnsa.$(OBJ): insnsa.c nasm.h insns.h + $(QCL) insnsa.c +insnsd.$(OBJ): insnsd.c nasm.h insns.h + $(QCL) insnsd.c + +clean : + del *.obj + del nasm$(SUFFIX)$(EXE) + del ndisasm$(SUFFIX)$(EXE) diff --git a/Mkfiles/Makefile.wc b/Mkfiles/Makefile.wc new file mode 100644 index 00000000..6f0d48a5 --- /dev/null +++ b/Mkfiles/Makefile.wc @@ -0,0 +1,119 @@ +# host: watcom c (dos, windows, os/2) +# target: dos 32bit +# Makefile for the Netwide Assembler +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. +# +# this makefile is designed for use with dos version of Watcom C 32 bit +# compiler, it generates dos 32 bit executable +# it has been tested with +# borland make.exe 4.0 +# microsoft nmake.exe 1.3 +# watcom wmake.exe /u 3.2 (remember about that /u option :) +# +# all this should compile under watcom c 9.5, 10.0, 10.5 and 10.6 +# i dont know about 11.0 because i didnt yet see it + +CFLAGS = -fpi -mf -3r -s -bt=dos -oilrt +# -fpi inline math + emulation +# -mf flat model (isnt it by default :) +# -3r 386 register calling (does everyone have pentium nowadays ?) +# -s no stack checking +# -bt=dos target system - dos +# -oilrt mega cool optimization :) + +CC = wcc386.exe $(CFLAGS) +# compiler +LFLAGS = SYSTEM dos4g +# linker flags +# target system - dos4gw +LD = wlink.exe $(LFLAGS) +# linker +OBJ = obj +# whatever + +.c.$(OBJ): + $(CC) $*.c + +NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ + assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ + outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ + outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ + preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) + +NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ + insnsd.$(OBJ) + +all : nasm.exe ndisasm.exe + echo This is dummy command for dumb make + +nasm.exe: $(NASMOBJS) NASM.LNK + $(LD) @NASM.LNK + +ndisasm.exe: $(NDISASMOBJS) NDISASM.LNK + $(LD) @NDISASM.LNK + +# linker response files +# that may take long, too much spawning command.com :) +NASM.LNK: makefile.wc + echo N nasm.exe > NASM.LNK + echo F nasm.$(OBJ) >> NASM.LNK + echo F nasmlib.$(OBJ) >> NASM.LNK + echo F eval.$(OBJ) >> NASM.LNK + echo F float.$(OBJ) >> NASM.LNK + echo F insnsa.$(OBJ) >> NASM.LNK + echo F assemble.$(OBJ) >> NASM.LNK + echo F labels.$(OBJ) >> NASM.LNK + echo F listing.$(OBJ) >> NASM.LNK + echo F parser.$(OBJ) >> NASM.LNK + echo F preproc.$(OBJ) >> NASM.LNK + echo F outform.$(OBJ) >> NASM.LNK + echo F outbin.$(OBJ) >> NASM.LNK + echo F outaout.$(OBJ) >> NASM.LNK + echo F outcoff.$(OBJ) >> NASM.LNK + echo F outelf.$(OBJ) >> NASM.LNK + echo F outobj.$(OBJ) >> NASM.LNK + echo F outas86.$(OBJ) >> NASM.LNK + echo F outrdf.$(OBJ) >> NASM.LNK + echo F outdbg.$(OBJ) >> NASM.LNK + +NDISASM.LNK: makefile.wc + echo N ndisasm.exe > NDISASM.LNK + echo F ndisasm.$(OBJ) >> NDISASM.LNK + echo F disasm.$(OBJ) >> NDISASM.LNK + echo F sync.$(OBJ) >> NDISASM.LNK + echo F nasmlib.$(OBJ) >> NDISASM.LNK + echo F insnsd.$(OBJ) >> NDISASM.LNK + +assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h +disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c +eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h +float.$(OBJ): float.c nasm.h +insnsa.$(OBJ): insnsa.c nasm.h insns.h +insnsd.$(OBJ): insnsd.c nasm.h insns.h +labels.$(OBJ): labels.c nasm.h nasmlib.h +listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h +nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ + listing.h outform.h +nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h +ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h +outas86.$(OBJ): outas86.c nasm.h nasmlib.h +outaout.$(OBJ): outaout.c nasm.h nasmlib.h +outbin.$(OBJ): outbin.c nasm.h nasmlib.h +outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h +outelf.$(OBJ): outelf.c nasm.h nasmlib.h +outobj.$(OBJ): outobj.c nasm.h nasmlib.h +outform.$(OBJ): outform.c outform.h nasm.h +parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c +preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h +sync.$(OBJ): sync.c sync.h + +clean : + del *.obj + del *.lnk + del nasm.exe + del ndisasm.exe + diff --git a/Mkfiles/Makefile.wcw b/Mkfiles/Makefile.wcw new file mode 100644 index 00000000..d592c695 --- /dev/null +++ b/Mkfiles/Makefile.wcw @@ -0,0 +1,119 @@ +# host: watcom c (dos, windows, os/2) +# target: windows nt character mode executable +# Makefile for the Netwide Assembler +# +# The Netwide Assembler is copyright (C) 1996 Simon Tatham and +# Julian Hall. All rights reserved. The software is +# redistributable under the licence given in the file "Licence" +# distributed in the NASM archive. +# +# this makefile is designed for use with of Watcom C 32 bit compiler +# it generates win32 console (character mode) executable +# it has been tested with +# borland make.exe 4.0 +# microsoft nmake.exe 1.3 +# watcom wmake.exe /u 3.2 (remember about that /u option :) +# +# all this should compile under watcom c 9.5, 10.0, 10.5 and 10.6 +# i dont know about 11.0 because i didnt yet see it + +CFLAGS = -fpi -mf -3r -s -bt=dos -oilrt +# -fpi inline math + emulation +# -mf flat model (isnt it by default :) +# -3r 386 register calling (does everyone have pentium nowadays ?) +# -s no stack checking +# -bt=nt target system - windows nt +# -oilrt mega cool optimization :) + +CC = wcc386.exe $(CFLAGS) +# compiler +LFLAGS = SYSTEM nt +# linker flags +# target system nt - character mode +LD = wlink.exe $(LFLAGS) +# linker +OBJ = obj +# whatever + +.c.$(OBJ): + $(CC) $*.c + +NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \ + assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \ + outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \ + outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \ + preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) + +NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \ + insnsd.$(OBJ) + +all : nasm.exe ndisasm.exe + echo This is dummy command for dumb make + +nasm.exe: $(NASMOBJS) NASM.LNK + $(LD) @NASM.LNK + +ndisasm.exe: $(NDISASMOBJS) NDISASM.LNK + $(LD) @NDISASM.LNK + +# linker response files +# that may take long, too much spawning command.com :) +NASM.LNK: makefile.wcw + echo N nasm.exe > NASM.LNK + echo F nasm.$(OBJ) >> NASM.LNK + echo F nasmlib.$(OBJ) >> NASM.LNK + echo F eval.$(OBJ) >> NASM.LNK + echo F float.$(OBJ) >> NASM.LNK + echo F insnsa.$(OBJ) >> NASM.LNK + echo F assemble.$(OBJ) >> NASM.LNK + echo F labels.$(OBJ) >> NASM.LNK + echo F listing.$(OBJ) >> NASM.LNK + echo F parser.$(OBJ) >> NASM.LNK + echo F preproc.$(OBJ) >> NASM.LNK + echo F outform.$(OBJ) >> NASM.LNK + echo F outbin.$(OBJ) >> NASM.LNK + echo F outaout.$(OBJ) >> NASM.LNK + echo F outcoff.$(OBJ) >> NASM.LNK + echo F outelf.$(OBJ) >> NASM.LNK + echo F outobj.$(OBJ) >> NASM.LNK + echo F outas86.$(OBJ) >> NASM.LNK + echo F outrdf.$(OBJ) >> NASM.LNK + echo F outdbg.$(OBJ) >> NASM.LNK + +NDISASM.LNK: makefile.wcw + echo N ndisasm.exe > NDISASM.LNK + echo F ndisasm.$(OBJ) >> NDISASM.LNK + echo F disasm.$(OBJ) >> NDISASM.LNK + echo F sync.$(OBJ) >> NDISASM.LNK + echo F nasmlib.$(OBJ) >> NDISASM.LNK + echo F insnsd.$(OBJ) >> NDISASM.LNK + +assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h +disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c +eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h +float.$(OBJ): float.c nasm.h +insnsa.$(OBJ): insnsa.c nasm.h insns.h +insnsd.$(OBJ): insnsd.c nasm.h insns.h +labels.$(OBJ): labels.c nasm.h nasmlib.h +listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h +nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ + listing.h outform.h +nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h +ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h +outas86.$(OBJ): outas86.c nasm.h nasmlib.h +outaout.$(OBJ): outaout.c nasm.h nasmlib.h +outbin.$(OBJ): outbin.c nasm.h nasmlib.h +outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h +outelf.$(OBJ): outelf.c nasm.h nasmlib.h +outobj.$(OBJ): outobj.c nasm.h nasmlib.h +outform.$(OBJ): outform.c outform.h nasm.h +parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c +preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h +sync.$(OBJ): sync.c sync.h + +clean : + del *.obj + del *.lnk + del nasm.exe + del ndisasm.exe + diff --git a/c16.mac b/c16.mac new file mode 100644 index 00000000..2853db51 --- /dev/null +++ b/c16.mac @@ -0,0 +1,41 @@ +; NASM macro set to make interfacing to 16-bit programs easier -*- nasm -*- + +%imacro proc 1 ; begin a procedure definition +%push proc + global %1 +%1: push bp + mov bp,sp +%ifdef FARCODE PASCAL ; arguments may start at bp+4 or bp+6 +%assign %$arg 6 +%define %$firstarg 6 +%else +%assign %$arg 4 +%define %$firstarg 4 +%endif +%define %$procname %1 +%endmacro + +%imacro arg 0-1 2 ; used with the argument name as a label +%00 equ %$arg + ; we could possibly be adding some + ; debug information at this point...? +%assign %$arg %1+%$arg +%endmacro + +%imacro endproc 0 +%ifnctx proc +%error Mismatched `endproc'/`proc' +%else + mov sp,bp + pop bp +%ifdef PASCAL + retf %$arg - %$firstarg +%elifdef FARCODE + retf +%else + retn +%endif +__end_%$procname: ; useful for calculating function size +%pop +%endif +%endmacro diff --git a/c32.mac b/c32.mac new file mode 100644 index 00000000..6abad995 --- /dev/null +++ b/c32.mac @@ -0,0 +1,26 @@ +; NASM macro set to make interfacing to 32-bit programs easier -*- nasm -*- + +%imacro proc 1 ; begin a procedure definition +%push proc + global %1 +%1: push ebp + mov ebp,esp +%assign %$arg 8 +%define %$procname %1 +%endmacro + +%imacro arg 0-1 4 ; used with the argument name as a label +%00 equ %$arg +%assign %$arg %1+%$arg +%endmacro + +%imacro endproc 0 +%ifnctx proc +%error Mismatched `endproc'/`proc' +%else + leave + ret +__end_%$procname: ; useful for calculating function size +%pop +%endif +%endmacro diff --git a/changes.asm b/changes.asm new file mode 100644 index 00000000..3ae24edf --- /dev/null +++ b/changes.asm @@ -0,0 +1,292 @@ +;This file demonstrates many of the differences between NASM version X and NASM +;version 0.97 +; +; changes.asm is copyright (C) 1998 John S. Fine +; +; It may be redistributed under the same conditions as NASM as described in +; Licence file in the NASM archive +;_________________________________ +; +; nasm changes.asm -l changes.lst +; +; When assembled without any -d switches, it includes examples which: +; Work correctly in version X +; and Work incorrectly and/or display warnings in version 0.97 +; and Do not prevent the generation of output in version 0.97 +; +; Not all the differences can be seen in the .lst file. I suggest that you use +; "ndisasm changes" to examine the code actually generated. +;_________________________________ +; +; nasm changes.asm -l changes.lst -doldmsg +; +; When assembled with -doldmsg, it adds examples which: +; Work correctly in version X +; and Generate error messages in version 0.97 and do not generate output +;_________________________________ +; +; nasm changes.asm -l changes.lst -doldcrash +; +; When assembled with -doldcrash, it adds examples which: +; Work correctly in version X +; and Cause NASM to crash in version 0.97 +;_________________________________ +; +; nasm changes.asm -l changes.lst -dnewmsg +; +; When assembled with -dnewmsg, it adds examples which: +; Generate error messages in version X +; and Generate wrong output without warning or error message in version 0.97 +;----------------------------------------------------------------------------- + +; Please note that I have reported the name of the person who made the +; correction based on very limited information. In several cases, I am sure I +; will identify the wrong author. Please send me any corrections; I don't +; intend to insult or exclude anyone. + +;----------------------------------------------------------------------------- +; Bug fixed by Simon in assemble() +; +; The following generated "call next" / "call next-1" instead of +; two copies of "call next" +; + times 2 a16 call next +next: + +;----------------------------------------------------------------------------- +; Bug fixed by John in parse_line() (and other routines) +; +; This used to jmp to prior.1, when it should be here.1 +; +prior: +.1: +here: jmp .1 +.1: + +;----------------------------------------------------------------------------- +; Bug fixed by John in assemble() +; +; Strings used in dq and dt were not zero filled correctly +; + dq 'b' + + +;----------------------------------------------------------------------------- +; Bug fixed by Simon in isn_names[] +; +; Was not recognised as an instruction +; + int01 + +;----------------------------------------------------------------------------- +; Bug fixed by Jim Hague in ??? +; +; Forward references were instruction level rather than per operand +; + shr word [forwardref],1 +forwardref: + +;----------------------------------------------------------------------------- +; Bug fixed by John in preproc.c +; +; It used to silently discard id characters appended to a multi-line +; macro parameter (such as the x in %1x below). +; +%macro xxx 1 +%1: nop +%{1}x: jmp %1x +%endmacro +xxx yyy + +%ifdef oldmsg +;*************************************************************** +; +; The following examples will generate error messages in 0.97 and will generate +; correct output in the new version. + +;----------------------------------------------------------------------------- +; Bug fixed by Simon in isns.dat +; +; The optional "near" was not permitted on JMP and CALL +; + jmp near here + +;----------------------------------------------------------------------------- +; Feature added by Simon in stdscan() +; +; You can now use the numeric value of strings in %assign +; +%assign xxx 'ABCD' + dd xxx + +;----------------------------------------------------------------------------- +; Feature added by John in add_vectors() +; +; Stranger address expressions are now supported as long as they resolve to +; something valid. +; + mov ax, [eax + ebx + ecx - eax] + +;----------------------------------------------------------------------------- +; Bug fixed by Simon in ??? +; +; The EQU directive affected local labels in a way that was inconsistent +; between passes +; +.local: +neither equ $ + jmp .local + +;----------------------------------------------------------------------------- +; Feature added by Jules in parse_line +; +; You can override a size specifier +; +%define arg1 dword [bp+4] + cmp word arg1, 2 + +;----------------------------------------------------------------------------- +; Bug fixed by John in preproc.c +; +; You could not use a label on the same line with a macro invocation, if the +; macro definition began with a preprocessor directive. +; + struc mytype +.long resd 1 + endstruc + +lbl istruc mytype + at mytype.long, dd 'ABCD' + iend + +;----------------------------------------------------------------------------- +; Warning removed by John in preproc.c +; +; In order to allow macros that extend the definition of instructions, I +; disabled the warning on a multi-line macro referencing itself. +; +%endif ;NASM 0.97 doesn't handle %0 etc. inside false %if +%macro push 1-* ; +%rep %0 ; +push %1 ; +%rotate 1 ; +%endrep ; +%endmacro ; +%ifdef oldmsg ; + + push ax,bx + +;----------------------------------------------------------------------------- +; Warning removed by John in preproc.c +; +; To support other types of macros that extend the definition of instructions, +; I disabled the warning on a multi-line macro called with the wrong number of +; parameters. PUSH and POP can be extended equally well by either method, but +; other intruction extensions may need one method or the other, so I made both +; work. +; +; Note that neither of these warnings was really needed, because a later stage +; of NASM would almost always give an adequate error message if the macro use +; really was wrong. +; +%endif +%macro pop 2-* +%rep %0 +pop %1 +%rotate 1 +%endrep +%endmacro +%ifdef oldmsg + + pop ax,bx +%endif + + +%ifdef newmsg ;*************************************************************** + +;----------------------------------------------------------------------------- +; Bug fixed by John in parse_line() (and other routines) +; +; This invalid code used to assemble without errors +; +myself equ myself+1 + jmp myself + +;----------------------------------------------------------------------------- +; Change made by John in preproc.c +; +; In 0.97, an id that appears as a label on a macro invocation was always +; prepended to the first line of the macro expansion. That caused several +; bugs, but also could be used in tricks like the arg macro in c16.mac and +; c32.mac. +; +; In version X, an id that appears as a label on a macro invocation will +; normally be defined as a label for the address at which the macro is +; invoked, regardless of whether the first line of the macro expansion is +; something that can take a label. The new token %00 may be used for any +; of the situations in which the old prepend behavior was doing something +; tricky but useful. %00 can also be used more than once and in places +; other than the start of the expansion. +; +%endif +%assign arg_off 0 + +%imacro arg 0-1 2 ;arg defined the old way + equ arg_off +%assign arg_off %1+arg_off +%endmacro + +%ifdef newmsg +arg_example arg +%endif + +%imacro arg2 0-1 2 ;arg defined the new way +%00 equ arg_off +%assign arg_off %1+arg_off +%endmacro + +%ifdef oldmsg +arg_example2 arg2 + +;----------------------------------------------------------------------------- +; Change made by Jules and John in INSNS.DAT +; +; Various instruction in which the size of an immediate is built-in to the +; instruction set, now allow you to redundantly specify that size as long +; as you specify it correctly +; + AAD byte 5 + AAM byte 5 + BT bx, byte 3 + BTC cx, byte 4 + BTR dx, byte 5 + BTS si, byte 6 + IN eax, byte 0x40 + INT byte 21h + OUT byte 70h, ax + RET word 2 + RETN word 2 + RETF word 4 + +; note "ENTER" has not been changed yet. + +%endif + +%ifdef oldcrash ;************************************************************* + +This_label_is_256_characters_long__There_used_to_be_a_bug_in_stdscan_which_made_it_crash_when_it_did_a_keyword_search_on_any_label_longer_than_255_characters__Now_anything_longer_than_MAX_KEYWORD_is_always_a_symbol__It_will_not_even_try_a_keyword_search___ + +;----------------------------------------------------------------------------- +; Bug fixed by John in preproc.c +; +; Builds of NASM that prohibit dereferencing a NULL pointer used to crash if a +; macro that started with a blank line was invoked with a label +; +%macro empty_macro 0 + +%endm + +emlabel empty_macro + jmp emlabel + +%endif diff --git a/eval.c b/eval.c index 6dd3f4df..a44ff7b3 100644 --- a/eval.c +++ b/eval.c @@ -698,33 +698,24 @@ static expr *expr6(int critical) break; } - /* - * Since the whole line is parsed before the label it - * defines is given to the label manager, we have - * problems with lines such as - * - * end: TIMES 512-(end-start) DB 0 - * - * where `end' is not known on pass one, despite not - * really being a forward reference, and due to - * criticality it is _needed_. Hence we check our label - * against the currently defined one, and do our own - * resolution of it if we have to. - */ type = EXPR_SIMPLE; /* might get overridden by UNKNOWN */ - if (i == TOKEN_BASE) { + if (i == TOKEN_BASE) + { label_seg = location->segment; label_ofs = 0; } else if (i == TOKEN_HERE) { label_seg = location->segment; label_ofs = location->offset; - } else if (!labelfunc(tokval->t_charptr,&label_seg,&label_ofs)) { + } else { + if (!labelfunc(tokval->t_charptr,&label_seg,&label_ofs)) + { if (critical == 2) { error (ERR_NONFATAL, "symbol `%s' undefined", tokval->t_charptr); return NULL; } else if (critical == 1) { - error (ERR_NONFATAL, "symbol `%s' not defined before use", + error (ERR_NONFATAL, + "symbol `%s' not defined before use", tokval->t_charptr); return NULL; } else { @@ -735,12 +726,12 @@ static expr *expr6(int critical) label_ofs = 1; } } - addtotemp(type, label_ofs); - if (label_seg!=NO_SEG) { - addtotemp(EXPR_SEGBASE + label_seg, 1L); if (opflags && is_extern (tokval->t_charptr)) *opflags |= OPFLAG_EXTERN; } + addtotemp(type, label_ofs); + if (label_seg!=NO_SEG) + addtotemp(EXPR_SEGBASE + label_seg, 1L); break; } i = scan(scpriv, tokval); diff --git a/exebin.mac b/exebin.mac new file mode 100644 index 00000000..022183fa --- /dev/null +++ b/exebin.mac @@ -0,0 +1,57 @@ +; -*- nasm -*- +; NASM macro file to allow the `bin' output format to generate +; simple .EXE files by constructing the EXE header by hand. +; Adapted from a contribution by Yann Guidon + +%define EXE_stack_size EXE_realstacksize + +%macro EXE_begin 0 + ORG 0E0h + section .text + +header_start: + db 4Dh,5Ah ; EXE file signature + dw EXE_allocsize % 512 + dw (EXE_allocsize + 511) / 512 + dw 0 ; relocation information: none + dw (header_end-header_start)/16 ; header size in paragraphs + dw (EXE_absssize + EXE_realstacksize) / 16 ; min extra mem + dw (EXE_absssize + EXE_realstacksize) / 16 ; max extra mem + dw -10h ; Initial SS (before fixup) + dw EXE_endbss + EXE_realstacksize ; Initial SP (1K DPMI+1K STACK) + dw 0 ; (no) Checksum + dw 100h ; Initial IP - start just after the header + dw -10h ; Initial CS (before fixup) + dw 0 ; file offset to relocation table: none + dw 0 ; (no overlay) + align 16,db 0 +header_end: + +EXE_startcode: + section .data +EXE_startdata: + section .bss +EXE_startbss: +%endmacro + +%macro EXE_stack 1 +EXE_realstacksize equ %1 +%define EXE_stack_size EXE_bogusstacksize ; defeat EQU in EXE_end +%endmacro + +%macro EXE_end 0 + section .text +EXE_endcode: + section .data +EXE_enddata: + section .bss + alignb 4 +EXE_endbss: + +EXE_acodesize equ (EXE_endcode-EXE_startcode+3) & (~3) +EXE_datasize equ EXE_enddata-EXE_startdata +EXE_absssize equ (EXE_endbss-EXE_startbss+3) & (~3) +EXE_allocsize equ EXE_acodesize + EXE_datasize + +EXE_stack_size equ 0x800 ; default if nothing else was used +%endmacro diff --git a/insns.bas b/insns.bas deleted file mode 100644 index 5178aa63..00000000 --- a/insns.bas +++ /dev/null @@ -1,541 +0,0 @@ -' INFO_1: Converter for INSNS.DAT to INSNSA.C and INSNSD.C -' -' INFO_2: Written by Mark Junker in 1997 -' InterNet: mjs@prg.hannover.sgh-net.de -' FIDO: Mark Junker@2:2437/47.21 -' -' COMMENT: While I wrote this program I often asked me, if it isn't easier -' to write an interpreter for Perl-scripts :] -' -' COMMENT: To start the program press SHIFT+F5 within the QBasic IDE -' or start it from the command-line with QBASIC /RUN MACROS -' -' -' THIS PROGRAM NEEDS TO BE UPDATED -- it doesn't create insnsi.h -' and insnsn.c. However, Perl interpreters are now available for both -' DOS and Windows, so it seems pointless to spend the effort. -' - -DEFINT A-Z - -DECLARE FUNCTION ReplaceOp$ (a$) -DECLARE FUNCTION StrTrimLeft$ (a$, b$) -DECLARE FUNCTION StrTrimRight$ (a$, b$) -DECLARE FUNCTION StrTrim$ (a$, b$) -DECLARE SUB StrSplitString (SplitString$, SplitChars$, SplitField$(), SplitCount%) -DECLARE FUNCTION Min% (a%, b%) -DECLARE FUNCTION StrInstrLeft% (SearchStart%, SearchIn$, SearchFor$) -DECLARE FUNCTION StrAscii% (a$) - - -CONST MaxOpCodeBase = 3 -CONST MaxOpCodeType = 8 - -CLS -DIM LineData$(1 TO 2) -DIM StrucData$(1 TO 5) -DIM OpCodeList$(0 TO 255) -DIM OpCodeByte(1 TO MaxOpCodeType, 1 TO MaxOpCodeBase) -DIM OpCodeStat(1 TO 10) ' don't need mode :) - -Instructs$ = "" -LineOfs$ = "" - -OPEN "I", 1, "insns.dat" -OPEN "B", 3, "insns.tmp" - -qt$ = CHR$(34) -crlf$ = CHR$(13) + CHR$(10) - - -' -' preprocessing the current file -' - -HexChar$ = "0123456789ABCDEF" - -PRINT "Preprocessing INSNS.DAT" -OpCodes = 0 -OpCodeDebug = 0 -NowLineOfs& = 1 -lineNr = 0 -WHILE NOT EOF(1) - lineNr = lineNr + 1 - IF (lineNr AND 15) = 0 THEN - LOCATE , 1 - PRINT lineNr, OpCodes, OpCodeDebug; - END IF - - LINE INPUT #1, l$ - CALL StrSplitString(l$, ";", LineData$(), SplitCount) - IF SplitCount THEN - LineData$(1) = StrTrim$(LineData$(1), CHR$(9) + " ") - IF LEN(LineData$(1)) THEN - CALL StrSplitString(LineData$(1), " ", StrucData$(), cntSplit) - IF cntSplit <> 4 THEN - PRINT "line"; lineNr; " does not contain four fields" - END - END IF - - tst$ = UCASE$(StrucData$(2)) - res$ = "" - cnt% = 1 - isfirst = 1 - op = 1 - p = StrInstrLeft(1, tst$ + ",", "|:,") - WHILE p - h$ = ReplaceOp$(MID$(tst$, op, p - op)) - IF LEN(h$) THEN - SELECT CASE MID$(tst$, p, 1) - CASE "" - IF isfirst THEN - res$ = res$ + h$ - ELSE - res$ = res$ + "|" + h$ - END IF - isfirst = 0 - CASE "," - IF isfirst THEN - res$ = res$ + h$ + "," - ELSE - res$ = res$ + "|" + h$ + "," - END IF - cnt% = cnt% + 1 - isfirst = 1 - CASE "|" - IF isfirst THEN - res$ = res$ + h$ - ELSE - res$ = res$ + "|" + h$ - END IF - isfirst = 0 - CASE ":" - res$ = res$ + h$ + "|COLON," - cnt% = cnt% + 1 - END SELECT - END IF - op = p + 1 - p = StrInstrLeft(op, tst$ + ",", "|:,") - WEND - FOR a = cnt% + 1 TO 3 - res$ = res$ + ",0" - NEXT - StrucData$(2) = res$ - IF LEFT$(res$, 2) = "0," THEN cnt% = cnt% - 1 - StrucData$(5) = LTRIM$(STR$(cnt%)) - - NoDebug = 0 - res$ = "" - tst$ = UCASE$(StrucData$(4)) - op = 1 - p = INSTR(tst$ + ",", ",") - isfirst = 1 - WHILE p - h$ = MID$(tst$, op, p - op) - IF h$ = "ND" THEN - NoDebug = 1 - ELSE - IF isfirst THEN - res$ = res$ + "IF_" + h$ - ELSE - res$ = res$ + "|IF_" + h$ - END IF - isfirst = 0 - END IF - op = p + 1 - p = INSTR(op, tst$ + ",", ",") - WEND - StrucData$(4) = res$ - - tst$ = UCASE$(StrucData$(3)) - SELECT CASE tst$ - CASE "IGNORE" - GOTO skipOpCode - CASE "\0", "\340" - OpCodeDebug = OpCodeDebug + 1 ' don't forget to increment - GOTO skipOpCode - END SELECT - - AddRegs = 0 - AddCCode = 0 - NextIsOpCode = 0 - opCodeVal$ = "" - op = 1 - p = INSTR(tst$ + "\", "\") - DO WHILE p - h$ = MID$(tst$, op, p - op) - IF LEFT$(h$, 1) = "X" THEN - opCodeVal$ = CHR$(VAL("&H" + MID$(h$, 2))) - EXIT DO - ELSE - SELECT CASE h$ - CASE "1", "2", "3" - NextIsOpCode = 1 - CASE "4" - opCodeVal$ = CHR$(&H7) + CHR$(&H17) + CHR$(&H1F) - EXIT DO - CASE "5" - opCodeVal$ = CHR$(&HA1) + CHR$(&HA9) - EXIT DO - CASE "6" - opCodeVal$ = CHR$(&H6) + CHR$(&HE) + CHR$(&H16) + CHR$(&H1E) - EXIT DO - CASE "7" - opCodeVal$ = CHR$(&HA0) + CHR$(&HA8) - EXIT DO - CASE "10", "11", "12" - NextIsOpCode = 1 - AddRegs = VAL(h$) - 9 - CASE "330" - NextIsOpCode = 1 - AddCCode = VAL(h$) - 329 - CASE "17" - opCodeVal$ = CHR$(0) - EXIT DO - CASE ELSE - IF NextIsOpCode THEN - PRINT "Line:"; lineNr - PRINT "Unknown value: " + h$ - END - END IF - END SELECT - END IF - op = p + 1 - p = INSTR(op, tst$ + "\", "\") - LOOP - IF (p = 0) THEN - PRINT "No opcode found in line"; lineNr - PRINT "Line:" - PRINT l$ - END - END IF - - IF NoDebug = 0 THEN - FOR a = 1 TO LEN(opCodeVal$) - h = ASC(MID$(opCodeVal$, a, 1)) - OpCodeStr$ = MKI$(OpCodeDebug) - IF AddRegs THEN - EndNr = 7 - ELSEIF AddCCode THEN - EndNr = 15 - ELSE - EndNr = 0 - END IF - FOR b = 0 TO EndNr - OpCodeList$(h + b) = OpCodeList$(h + b) + OpCodeStr$ - NEXT - NEXT - OpCodeDebug = OpCodeDebug + 1 - END IF - -skipOpCode: - OpCodes = OpCodes + 1 - LineOfs$ = LineOfs$ + MKL$(NowLineOfs&) - LineLg = 1 - h$ = CHR$(NoDebug) - PUT #3, NowLineOfs&, h$ - NowLineOfs& = NowLineOfs& + 1 - FOR a = 1 TO 5 - lg = LEN(StrucData$(a)) - h$ = CHR$(lg) + StrucData$(a) - PUT #3, NowLineOfs&, h$ - NowLineOfs& = NowLineOfs& + lg + 1 - LineLg = LineLg + lg + 1 - NEXT - LineOfs$ = LineOfs$ + MKI$(LineLg) - END IF - END IF -WEND -LOCATE , 1 -PRINT lineNr, OpCodes, OpCodeDebug - - -' -' creating insnsa.c -' - - -PRINT "Creating INSNSA.C" - -OPEN "O", 2, "insnsa.c" -strBegStart$ = "static struct itemplate instrux_" -strBegEnd$ = "[] = {" -strEnd$ = " {-1}" + crlf$ + "};" + crlf$ - -PRINT #2, "/* This file auto-generated from insns.dat by insns.bas - don't edit it */" -PRINT #2, "" -PRINT #2, "#include " -PRINT #2, "#include " + qt$ + "nasm.h" + qt$ -PRINT #2, "#include " + qt$ + "insns.h" + qt$ -PRINT #2, "" - -oldOpCode$ = "" -pOfs = 1 -FOR a = 1 TO OpCodes - LineOfs& = CVL(MID$(LineOfs$, pOfs, 4)) - l$ = SPACE$(CVI(MID$(LineOfs$, pOfs + 4, 2))) - pOfs = pOfs + 6 - GET #3, LineOfs&, l$ - - ' split data into fields - NoDebug = ASC(LEFT$(l$, 1)) - pLn = 2 - FOR b = 1 TO 5 - lgLn = ASC(MID$(l$, pLn, 1)) - StrucData$(b) = MID$(l$, pLn + 1, lgLn) - pLn = pLn + lgLn + 1 - NEXT - - IF oldOpCode$ <> StrucData$(1) THEN - Instructs$ = Instructs$ + StrucData$(1) + CHR$(0) - IF LEN(oldOpCode$) THEN PRINT #2, strEnd$ - PRINT #2, strBegStart$ + StrucData$(1) + strBegEnd$ - oldOpCode$ = StrucData$(1) - END IF - SELECT CASE UCASE$(StrucData$(3)) - CASE "IGNORE" - CASE ELSE - PRINT #2, " {I_" + oldOpCode$ + ", " + StrucData$(5) + ", {" + StrucData$(2) + "}, " + qt$ + StrucData$(3) + qt$ + ", " + StrucData$(4) + "}," - END SELECT -NEXT -IF LEN(oldOpCode$) THEN PRINT #2, strEnd$ - -PRINT #2, "struct itemplate *nasm_instructions[] = {" -op = 1 -p = INSTR(Instructs$, CHR$(0)) -WHILE p - h$ = MID$(Instructs$, op, p - op) - PRINT #2, " instrux_" + h$ + "," - op = p + 1 - p = INSTR(op, Instructs$, CHR$(0)) -WEND -PRINT #2, "};" - -CLOSE 2 - - - -' -' creating insnsd.c -' - - -PRINT "Creating INSNSD.C" - -OPEN "O", 2, "insnsd.c" - -PRINT #2, "/* This file auto-generated from insns.dat by insns.bas - don't edit it */" -PRINT #2, "" -PRINT #2, "#include " -PRINT #2, "#include " + qt$ + "nasm.h" + qt$ -PRINT #2, "#include " + qt$ + "insns.h" + qt$ -PRINT #2, "" - - -PRINT #2, "static struct itemplate instrux[] = {" -pOfs = 1 -FOR a = 1 TO OpCodes - LineOfs& = CVL(MID$(LineOfs$, pOfs, 4)) - l$ = SPACE$(CVI(MID$(LineOfs$, pOfs + 4, 2))) - pOfs = pOfs + 6 - GET #3, LineOfs&, l$ - - ' split data into fields - NoDebug = ASC(LEFT$(l$, 1)) - pLn = 2 - FOR b = 1 TO 5 - lgLn = ASC(MID$(l$, pLn, 1)) - StrucData$(b) = MID$(l$, pLn + 1, lgLn) - pLn = pLn + lgLn + 1 - NEXT - - IF NoDebug OR (UCASE$(StrucData$(3)) = "IGNORE") THEN - ' ignorieren - ELSE - PRINT #2, " {I_" + StrucData$(1) + ", " + StrucData$(5) + ", {" + StrucData$(2) + "}, " + qt$ + StrucData$(3) + qt$ + ", " + StrucData$(4) + "}," - END IF -NEXT -PRINT #2, " {-1}" + crlf$ + "};" + crlf$ - - -OpCodeBegS$ = "static struct itemplate *itable_" -OpCodeBegE$ = "[] = {" -OpCodeEnd$ = " NULL" + crlf$ + "};" + crlf$ - -FOR a = 0 TO 255 - PRINT #2, OpCodeBegS$ + RIGHT$("00" + HEX$(a), 2) + OpCodeBegE$ - h$ = OpCodeList$(a) - FOR b = 1 TO LEN(h$) STEP 2 - OpCodePos = CVI(MID$(h$, b, 2)) - PRINT #2, " instrux +" + STR$(OpCodePos) + "," - NEXT - PRINT #2, OpCodeEnd$ -NEXT - -PRINT #2, "struct itemplate **itable[] = {" -FOR a = 0 TO 255 - PRINT #2, " itable_" + RIGHT$("00" + HEX$(a), 2) + "," -NEXT -PRINT #2, "};" - -CLOSE 2 - - - -CLOSE 3 -KILL "insns.tmp" -CLOSE 1 -SYSTEM - -FUNCTION ReplaceOp$ (a$) - tst$ = UCASE$(a$) - SELECT CASE tst$ -' CASE "ND" -' ReplaceOp$ = "" - CASE "VOID", "" - ReplaceOp$ = "0" - CASE "IMM" - ReplaceOp$ = "IMMEDIATE" - CASE "MEM" - ReplaceOp$ = "MEMORY" - CASE "MEM8", "MEM16", "MEM32", "MEM64", "MEM80" - ReplaceOp$ = "MEMORY|BITS" + MID$(tst$, 4) - CASE "REG8", "REG16", "REG32" - ReplaceOp$ = tst$ - CASE "RM8", "RM16", "RM32" - ReplaceOp$ = "REGMEM|BITS" + MID$(tst$, 3) - CASE "IMM8", "IMM16", "IMM32" - ReplaceOp$ = "IMMEDIATE|BITS" + MID$(tst$, 4) - CASE ELSE - ReplaceOp$ = tst$ - END SELECT -END FUNCTION - -FUNCTION Min% (a%, b%) - IF a% < b% THEN Min% = a% ELSE Min% = b% -END FUNCTION - -FUNCTION StrAscii (a$) - IF LEN(a$) = 0 THEN - StrAscii = -1 - ELSE - StrAscii = ASC(a$) - END IF -END FUNCTION - -' same as =INSTR(SearchStart, SearchIn, ANY SearchFor$) in PowerBASIC(tm) -' -FUNCTION StrInstrLeft (SearchStart, SearchIn$, SearchFor$) - ValuesCount = LEN(SearchFor$) - MaxValue = LEN(SearchIn$) + 1 - MinValue = MaxValue - FOR Counter1 = 1 TO ValuesCount - SearchChar$ = MID$(SearchFor$, Counter1, 1) - hVal2 = INSTR(SearchStart, SearchIn$, SearchChar$) - IF hVal2 > 0 THEN MinValue = Min%(hVal2, MinValue) - NEXT - IF MinValue = MaxValue THEN MinValue = 0 - StrInstrLeft = MinValue -END FUNCTION - -' -' This is a very damn fuckin' shit version of this splitting routine. -' At this time, it's not very useful :] -' -SUB StrSplitString (SplitString$, SplitChars$, SplitField$(), SplitCount) - StartIndex = LBOUND(SplitField$) - LastIndex = UBOUND(SplitField$) - ActualIndex& = StartIndex - SplitCount = 0 - - LastPos = 1 - FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$ + CHR$(34)) - GetDirect = 0 - EndLoop = 0 - TempString$ = "" - DO WHILE FoundPos > 0 - FoundCharVal = StrAscii(MID$(SplitString$, FoundPos, 1)) - PosDiff = (FoundPos - LastPos) + 1 - SELECT CASE FoundCharVal - CASE 34 - TempString$ = TempString$ + MID$(SplitString$, LastPos, PosDiff - 1) - SELECT CASE EndLoop - CASE 0 - EndLoop = 2 - CASE 3 - EndLoop = 0 - END SELECT - CASE ELSE - TempString$ = TempString$ + MID$(SplitString$, LastPos, PosDiff - 1) - SplitField$(ActualIndex&) = TempString$ - TempString$ = "" - ActualIndex& = ActualIndex& + 1 - IF ActualIndex& > LastIndex THEN - ActualIndex& = LastIndex - EndLoop = 1 - END IF - END SELECT - SELECT CASE EndLoop - CASE 0 - DO - LastPos = FoundPos + 1 - FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$) - LOOP WHILE LastPos = FoundPos - FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$ + CHR$(34)) - CASE 1 - FoundPos = 0 - LastPos = LEN(SplitString$) + 1 - CASE 2 - EndLoop = 3 - LastPos = FoundPos + 1 - FoundPos = StrInstrLeft(LastPos, SplitString$, CHR$(34)) - IF FoundPos = 0 THEN - SplitString$ = SplitString$ + CHR$(34) - FoundPos = LEN(SplitString$) - END IF - END SELECT - LOOP - IF EndLoop = 0 THEN - IF LEN(TempString$) > 0 THEN - SplitField$(ActualIndex&) = TempString$ - ELSEIF LastPos <= LEN(SplitString$) THEN - SplitField$(ActualIndex&) = MID$(SplitString$, LastPos) - ELSE - ActualIndex& = ActualIndex& - 1 - END IF - END IF - FOR a = ActualIndex& + 1 TO LastIndex - SplitField$(a) = "" - NEXT - SplitCount = (ActualIndex& - StartIndex) + 1 -END SUB - -FUNCTION StrTrim$ (a$, b$) - StrTrim$ = StrTrimRight$(StrTrimLeft$(a$, b$), b$) -END FUNCTION - -FUNCTION StrTrimLeft$ (a$, b$) 'public - p = 0 - l = LEN(a$) - DO - p = p + 1 - t$ = MID$(a$, p, 1) - LOOP WHILE (p < l) AND (INSTR(b$, t$) > 0) - StrTrimLeft$ = MID$(a$, p) -END FUNCTION - -FUNCTION StrTrimRight$ (a$, b$) 'public - l = LEN(a$) - p = l + 1 - DO - p = p - 1 - IF p > 0 THEN - t$ = MID$(a$, p, 1) - ELSE - t$ = "" - END IF - LOOP WHILE (p > 0) AND (INSTR(b$, t$) > 0) - StrTrimRight$ = LEFT$(a$, p) -END FUNCTION - - \ No newline at end of file diff --git a/insns.dat b/insns.dat index 1659422a..1e5b9d62 100644 --- a/insns.dat +++ b/insns.dat @@ -12,9 +12,9 @@ AAA void \1\x37 8086 AAD void \2\xD5\x0A 8086 -AAD imm \1\xD5\24 8086 +AAD imm \1\xD5\24 8086,SB AAM void \2\xD4\x0A 8086 -AAM imm \1\xD4\24 8086 +AAM imm \1\xD4\24 8086,SB AAS void \1\x3F 8086 ADC mem,reg8 \300\1\x10\101 8086,SM ADC reg8,reg8 \300\1\x10\101 8086 @@ -102,26 +102,26 @@ BT mem,reg16 \320\300\2\x0F\xA3\101 386,SM BT reg16,reg16 \320\300\2\x0F\xA3\101 386 BT mem,reg32 \321\300\2\x0F\xA3\101 386,SM BT reg32,reg32 \321\300\2\x0F\xA3\101 386 -BT rm16,imm \320\300\2\x0F\xBA\204\25 386 -BT rm32,imm \321\300\2\x0F\xBA\204\25 386 +BT rm16,imm \320\300\2\x0F\xBA\204\25 386,SB +BT rm32,imm \321\300\2\x0F\xBA\204\25 386,SB BTC mem,reg16 \320\300\2\x0F\xBB\101 386,SM BTC reg16,reg16 \320\300\2\x0F\xBB\101 386 BTC mem,reg32 \321\300\2\x0F\xBB\101 386,SM BTC reg32,reg32 \321\300\2\x0F\xBB\101 386 -BTC rm16,imm \320\300\2\x0F\xBA\207\25 386 -BTC rm32,imm \321\300\2\x0F\xBA\207\25 386 +BTC rm16,imm \320\300\2\x0F\xBA\207\25 386,SB +BTC rm32,imm \321\300\2\x0F\xBA\207\25 386,SB BTR mem,reg16 \320\300\2\x0F\xB3\101 386,SM BTR reg16,reg16 \320\300\2\x0F\xB3\101 386 BTR mem,reg32 \321\300\2\x0F\xB3\101 386,SM BTR reg32,reg32 \321\300\2\x0F\xB3\101 386 -BTR rm16,imm \320\300\2\x0F\xBA\206\25 386 -BTR rm32,imm \321\300\2\x0F\xBA\206\25 386 +BTR rm16,imm \320\300\2\x0F\xBA\206\25 386,SB +BTR rm32,imm \321\300\2\x0F\xBA\206\25 386,SB BTS mem,reg16 \320\300\2\x0F\xAB\101 386,SM BTS reg16,reg16 \320\300\2\x0F\xAB\101 386 BTS mem,reg32 \321\300\2\x0F\xAB\101 386,SM BTS reg32,reg32 \321\300\2\x0F\xAB\101 386 -BTS rm16,imm \320\300\2\x0F\xBA\205\25 386 -BTS rm32,imm \321\300\2\x0F\xBA\205\25 386 +BTS rm16,imm \320\300\2\x0F\xBA\205\25 386,SB +BTS rm32,imm \321\300\2\x0F\xBA\205\25 386,SB CALL imm \322\1\xE8\64 8086 CALL imm|near \322\1\xE8\64 8086 CALL imm|far \322\1\x9A\34\37 8086,ND @@ -420,9 +420,9 @@ IMUL reg16,imm8 \320\1\x6B\100\15 286 IMUL reg16,imm \320\1\x69\100\31 286,SM IMUL reg32,imm8 \321\1\x6B\100\15 386 IMUL reg32,imm \321\1\x69\100\41 386,SM -IN reg_al,imm \1\xE4\25 8086 -IN reg_ax,imm \320\1\xE5\25 8086 -IN reg_eax,imm \321\1\xE5\25 386 +IN reg_al,imm \1\xE4\25 8086,SB +IN reg_ax,imm \320\1\xE5\25 8086,SB +IN reg_eax,imm \321\1\xE5\25 386,SB IN reg_al,reg_dx \1\xEC 8086 IN reg_ax,reg_dx \320\1\xED 8086 IN reg_eax,reg_dx \321\1\xED 386 @@ -435,7 +435,7 @@ INCBIN ignore ignore ignore INSB void \1\x6C 186 INSD void \321\1\x6D 386 INSW void \320\1\x6D 186 -INT imm \1\xCD\24 8086 +INT imm \1\xCD\24 8086,SB INT01 void \1\xF1 P6,ND INT1 void \1\xF1 P6 INT3 void \1\xCC 8086 @@ -840,11 +840,11 @@ RESQ ignore ignore ignore REST ignore ignore ignore RESW ignore ignore ignore RET void \1\xC3 8086 -RET imm \1\xC2\30 8086 +RET imm \1\xC2\30 8086,SW RETF void \1\xCB 8086 -RETF imm \1\xCA\30 8086 +RETF imm \1\xCA\30 8086,SW RETN void \1\xC3 8086 -RETN imm \1\xC2\30 8086 +RETN imm \1\xC2\30 8086,SW ROL rm8,unity \300\1\xD0\200 8086 ROL rm8,reg_cl \300\1\xD2\200 8086 ROL rm8,imm \300\1\xC0\200\25 186,SB diff --git a/macros.bas b/macros.bas deleted file mode 100644 index 89ba846b..00000000 --- a/macros.bas +++ /dev/null @@ -1,176 +0,0 @@ -' INFO_1: Converter for STANDARD.MAC to MACRO.C -' -' INFO_2: Written by Mark Junker in 1997 -' InterNet: mjs@prg.hannover.sgh-net.de -' FIDO: Mark Junker@2:2437/47.21 -' -' COMMENT: To start the program press SHIFT+F5 within the QBasic IDE -' or start it from the command-line with QBASIC /RUN MACROS -' - -DEFINT A-Z - -DECLARE FUNCTION StrTrimLeft$ (a$, b$) -DECLARE FUNCTION StrTrimRight$ (a$, b$) -DECLARE FUNCTION StrTrim$ (a$, b$) -DECLARE SUB StrSplitString (SplitString$, SplitChars$, SplitField$(), SplitCount%) -DECLARE FUNCTION Min% (a%, b%) -DECLARE FUNCTION StrInstrLeft% (SearchStart%, SearchIn$, SearchFor$) -DECLARE FUNCTION StrAscii% (a$) - - -CLS -DIM LineData$(1 TO 2) - -OPEN "I", 1, "STANDARD.MAC" -OPEN "O", 2, "macros.c" - -PRINT #2, "/* This file auto-generated from standard.mac by macros.bas - don't edit it */" -PRINT #2, "" -PRINT #2, "static char *stdmac[] = {" - -WHILE NOT EOF(1) - LINE INPUT #1, l$ - CALL StrSplitString(l$, ";", LineData$(), SplitCount) - IF SplitCount THEN - LineData$(1) = StrTrim$(LineData$(1), CHR$(9) + " ") - IF LEN(LineData$(1)) THEN - PRINT #2, " " + CHR$(34) + LineData$(1) + CHR$(34) + "," - END IF - END IF -WEND -PRINT #2, " NULL" -PRINT #2, "};" - -CLOSE 2 -CLOSE 1 -SYSTEM - -FUNCTION Min% (a%, b%) - IF a% < b% THEN Min% = a% ELSE Min% = b% -END FUNCTION - -FUNCTION StrAscii (a$) - IF LEN(a$) = 0 THEN - StrAscii = -1 - ELSE - StrAscii = ASC(a$) - END IF -END FUNCTION - -' same as =INSTR(SearchStart, SearchIn, ANY SearchFor$) in PowerBASIC(tm) -' -FUNCTION StrInstrLeft (SearchStart, SearchIn$, SearchFor$) - ValuesCount = LEN(SearchFor$) - MaxValue = LEN(SearchIn$) + 1 - MinValue = MaxValue - FOR Counter1 = 1 TO ValuesCount - SearchChar$ = MID$(SearchFor$, Counter1, 1) - hVal2 = INSTR(SearchStart, SearchIn$, SearchChar$) - IF hVal2 > 0 THEN MinValue = Min%(hVal2, MinValue) - NEXT - IF MinValue = MaxValue THEN MinValue = 0 - StrInstrLeft = MinValue -END FUNCTION - -' -' This is a very damn fuckin' shit version of this splitting routine. -' At this time, it's not very useful :] -' -SUB StrSplitString (SplitString$, SplitChars$, SplitField$(), SplitCount) - StartIndex = LBOUND(SplitField$) - LastIndex = UBOUND(SplitField$) - ActualIndex& = StartIndex - SplitCount = 0 - - LastPos = 1 - FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$ + CHR$(34)) - GetDirect = 0 - EndLoop = 0 - TempString$ = "" - DO WHILE FoundPos > 0 - FoundCharVal = StrAscii(MID$(SplitString$, FoundPos, 1)) - PosDiff = (FoundPos - LastPos) + 1 - SELECT CASE FoundCharVal - CASE 34 - TempString$ = TempString$ + MID$(SplitString$, LastPos, PosDiff - 1) - SELECT CASE EndLoop - CASE 0 - EndLoop = 2 - CASE 3 - EndLoop = 0 - END SELECT - CASE ELSE - TempString$ = TempString$ + MID$(SplitString$, LastPos, PosDiff - 1) - SplitField$(ActualIndex&) = TempString$ - TempString$ = "" - ActualIndex& = ActualIndex& + 1 - IF ActualIndex& > LastIndex THEN - ActualIndex& = LastIndex - EndLoop = 1 - END IF - END SELECT - SELECT CASE EndLoop - CASE 0 - DO - LastPos = FoundPos + 1 - FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$) - LOOP WHILE LastPos = FoundPos - FoundPos = StrInstrLeft(LastPos, SplitString$, SplitChars$ + CHR$(34)) - CASE 1 - FoundPos = 0 - LastPos = LEN(SplitString$) + 1 - CASE 2 - EndLoop = 3 - LastPos = FoundPos + 1 - FoundPos = StrInstrLeft(LastPos, SplitString$, CHR$(34)) - IF FoundPos = 0 THEN - SplitString$ = SplitString$ + CHR$(34) - FoundPos = LEN(SplitString$) - END IF - END SELECT - LOOP - IF EndLoop = 0 THEN - IF LEN(TempString$) > 0 THEN - SplitField$(ActualIndex&) = TempString$ - ELSEIF LastPos <= LEN(SplitString$) THEN - SplitField$(ActualIndex&) = MID$(SplitString$, LastPos) - ELSE - ActualIndex& = ActualIndex& - 1 - END IF - END IF - FOR a = ActualIndex& + 1 TO LastIndex - SplitField$(a) = "" - NEXT - SplitCount = (ActualIndex& - StartIndex) + 1 -END SUB - -FUNCTION StrTrim$ (a$, b$) - StrTrim$ = StrTrimRight$(StrTrimLeft$(a$, b$), b$) -END FUNCTION - -FUNCTION StrTrimLeft$ (a$, b$) 'public - p = 0 - l = LEN(a$) - DO - p = p + 1 - t$ = MID$(a$, p, 1) - LOOP WHILE (p < l) AND (INSTR(b$, t$) > 0) - StrTrimLeft$ = MID$(a$, p) -END FUNCTION - -FUNCTION StrTrimRight$ (a$, b$) 'public - l = LEN(a$) - p = l + 1 - DO - p = p - 1 - IF p > 0 THEN - t$ = MID$(a$, p, 1) - ELSE - t$ = "" - END IF - LOOP WHILE (p > 0) AND (INSTR(b$, t$) > 0) - StrTrimRight$ = LEFT$(a$, p) -END FUNCTION - - \ No newline at end of file diff --git a/macros.c b/macros.c index ea02959a..ed70a75e 100644 --- a/macros.c +++ b/macros.c @@ -2,7 +2,7 @@ static char *stdmac[] = { "%define __NASM_MAJOR__ 0", - "%define __NASM_MINOR__ 97", + "%define __NASM_MINOR__ 98", "%define __FILE__", "%define __LINE__", "%define __SECT__", diff --git a/nasm.h b/nasm.h index 3ea75f2e..e73d8a6f 100644 --- a/nasm.h +++ b/nasm.h @@ -13,7 +13,7 @@ #define NASM_MAJOR_VER 0 #define NASM_MINOR_VER 98 -#define NASM_VER "0.98 pre-release 3" +#define NASM_VER "0.98 pre-release 3.2" #ifndef NULL #define NULL 0 diff --git a/outform.h b/outform.h index 2e7a32d0..87313d41 100644 --- a/outform.h +++ b/outform.h @@ -95,6 +95,9 @@ #ifndef OF_RDF2 #define OF_RDF2 #endif +#ifndef OF_IEEE +#define OF_IEEE +#endif #endif /* OF_ALL */ /* turn on groups of formats specified.... */ @@ -138,6 +141,9 @@ #ifndef OF_RDF2 #define OF_RDF2 #endif +#ifndef OF_IEEE +#define OF_IEEE +#endif #endif /* finally... override any format specifically specifed to be off */ @@ -191,6 +197,7 @@ extern struct ofmt of_obj; extern struct ofmt of_win32; extern struct ofmt of_rdf; extern struct ofmt of_rdf2; +extern struct ofmt of_ieee; extern struct ofmt of_dbg; struct ofmt *drivers[]={ @@ -224,6 +231,9 @@ struct ofmt *drivers[]={ #ifdef OF_RDF2 &of_rdf2, #endif +#ifdef OF_IEEE + &of_ieee, +#endif #ifdef OF_DBG &of_dbg, #endif diff --git a/rdoff/Makefile.in b/rdoff/Makefile.in index 5ab409de..ed66fc4f 100644 --- a/rdoff/Makefile.in +++ b/rdoff/Makefile.in @@ -62,9 +62,13 @@ nasmlib.o: $(top_srcdir)/nasmlib.c clean: rm -f *.o rdfdump ldrdf rdx rdflib rdf2bin rdf2com -spotless: clean +distclean: clean rm -f Makefile +cleaner: clean + +spotless: distclean + install: rdfdump ldrdf rdx rdflib rdf2bin rdf2com $(INSTALL_PROGRAM) rdfdump $(bindir)/rdfdump $(INSTALL_PROGRAM) ldrdf $(bindir)/ldrdf diff --git a/standard.mac b/standard.mac index 0be81088..5f862980 100644 --- a/standard.mac +++ b/standard.mac @@ -1,10 +1,10 @@ -; Standard macro set for NASM 0.97 -*- nasm -*- +; Standard macro set for NASM 0.98 -*- nasm -*- ; Note that although some user-level forms of directives are defined ; here, not all of them are: the user-level form of a format-specific ; directive should be defined in the module for that directive. %define __NASM_MAJOR__ 0 -%define __NASM_MINOR__ 97 +%define __NASM_MINOR__ 98 ; These two need to be defined, though the actual definitions will ; be constantly updated during preprocessing. diff --git a/zoutieee.c b/zoutieee.c index b36098a6..8475e95f 100644 --- a/zoutieee.c +++ b/zoutieee.c @@ -127,7 +127,7 @@ static struct ieeeSection { char *name; } *seghead, **segtail, *ieee_seg_needs_update; -static struct ieeeObjData { +struct ieeeObjData { struct ieeeObjData *next; unsigned char data[HUNKSIZE]; }; @@ -1169,39 +1169,39 @@ static long ieee_putlr(struct ieeeFixupp *p) if (p->id1 < 0) sprintf(buf,"%lX",-p->id1); else - sprintf(buf,"L%X,10,/",p->id1); + sprintf(buf,"L%lX,10,/",p->id1); break; case FT_OFS: - sprintf(buf,"R%X,%lX,+",p->id1,p->addend); + sprintf(buf,"R%lX,%lX,+",p->id1,p->addend); break; case FT_REL: - sprintf(buf,"R%X,%lX,+,P,-,%X,-",p->id1,p->addend,p->size); + sprintf(buf,"R%lX,%lX,+,P,-,%X,-",p->id1,p->addend,p->size); break; case FT_WRT: if (p->id2 < 0) - sprintf(buf,"R%X,%lX,+,L%X,+,%lX,-",p->id2,p->addend,p->id2,-p->id1*16); + sprintf(buf,"R%lX,%lX,+,L%lX,+,%lX,-",p->id2,p->addend,p->id2,-p->id1*16); else - sprintf(buf,"R%X,%lX,+,L%X,+,L%X,-",p->id2,p->addend,p->id2,p->id1); + sprintf(buf,"R%lX,%lX,+,L%lX,+,L%lX,-",p->id2,p->addend,p->id2,p->id1); break; case FT_EXT: - sprintf(buf,"X%X",p->id1,p->id1); + sprintf(buf,"X%lX",p->id1); break; case FT_EXTREL: - sprintf(buf,"X%X,P,-,%X,-",p->id1,size); + sprintf(buf,"X%lX,P,-,%lX,-",p->id1,size); break; case FT_EXTSEG: /* We needed a non-ieee hack here. * We introduce the Y variable, which is the low * limit of the native segment the extern resides in */ - sprintf(buf,"Y%X,10,/",p->id1); + sprintf(buf,"Y%lX,10,/",p->id1); break; case FT_EXTWRT: if (p->id2 < 0) - sprintf(buf,"X%X,Y%X,+,%lX,-",p->id2,p->id2,-p->id1*16); + sprintf(buf,"X%lX,Y%lX,+,%lX,-",p->id2,p->id2,-p->id1*16); else - sprintf(buf,"X%X,Y%X,+,L%X,-",p->id2,p->id2,p->id1); + sprintf(buf,"X%lX,Y%lX,+,L%lX,-",p->id2,p->id2,p->id1); break; } ieee_putascii("LR(%s,%lX).\r\n", buf, size); @@ -1316,9 +1316,10 @@ static void dbgls_deflabel (char *name, long segment, long offset, int is_global, char *special) { struct ieeeSection *seg; - int used_special = FALSE; /* have we used the special text? */ + int used_special; /* have we used the special text? */ - (void) special; + /* Keep compiler from warning about special and used_special */ + used_special = special ? FALSE : FALSE; /* * If it's a special-retry from pass two, discard it. -- cgit v1.2.1