diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e7b98d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.o +RELEASE/ +*.exe diff --git a/Makefile b/Makefile index 3746c04..d537f98 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ INCLUDES=-I. # new gnu compilers have a really annoying default behavior of wrapping # error message lines. The default should be NO-WRAPPING. -OPTIONS=-O2 -Wall -x c++ -fmessage-length=0 -fno-exceptions +OPTIONS=-O3 -Wall -x c++ -fmessage-length=0 -fno-exceptions CFLAGS=$(INCLUDES) $(OPTIONS) OBJECTS = \ diff --git a/Makefile.dj2 b/Makefile.dj2 index 71bf6e4..95dcf52 100644 --- a/Makefile.dj2 +++ b/Makefile.dj2 @@ -19,7 +19,8 @@ INCLUDES=-I. # error message lines. The default should be NO-WRAPPING. OPTIONS=-O2 -Wall -fmessage-length=0 -fno-exceptions CFLAGS=$(INCLUDES) $(OPTIONS) -CC=gpp +CC=i586-pc-msdosdjgpp-c++ +STRIP=i586-pc-msdosdjgpp-strip OBJECTS = \ globals.o \ @@ -45,16 +46,14 @@ OBJECTS = \ all : tpasm.exe tpasm.exe : $(OBJECTS) - $(CC) -O $(OBJECTS) -lstdcxx -o tpasm.exe + $(CC) -O $(OBJECTS) -o tpasm.exe + $(STRIP) tpasm.exe clean : - del *.o - del outfiles\*.o - del processors\*.o - del tpasm.exe - -install : - copy tpasm.exe c:\dos + rm -f *.o + rm -f outfiles/*.o + rm -f processors/*.o + rm -f tpasm.exe # suffix rules (this makes sure that the ".o" files # end up in their respective directories on all systems) diff --git a/Makefile.win b/Makefile.win index 2febad3..8590aec 100644 --- a/Makefile.win +++ b/Makefile.win @@ -1,67 +1,124 @@ -# make file for tpasm -- win32 version - -DEBUGGING=OFF - -OUTEXE=tpasm.exe - -CC=cl -LINK=link - -# compiler options in use: -# -# /c compile without linking -# /O2 optimize for speed -# /MD use MSVCRT DLL -# /W3 warning level 3 -# /TP compile as c++ -# - -CC_FLAGS=/nologo /c /O2 /MD /W3 /TP /I "." /D strncasecmp=strnicmp /D strcasecmp=stricmp -LINK_FLAGS=/nologo /subsystem:console /incremental:no /out:"$(OUTEXE)" - -OBJS=\ - "globals.obj" \ - "tpasm.obj" \ - "memory.obj" \ - "files.obj" \ - "symbols.obj" \ - "label.obj" \ - "segment.obj" \ - "pseudo.obj" \ - "parser.obj" \ - "expression.obj" \ - "context.obj" \ - "alias.obj" \ - "macro.obj" \ - "listing.obj" \ - "outfile.obj" \ - "processors.obj" \ - "support.obj" \ - "outfiles/intel_seg.obj" \ - "outfiles/mot_seg.obj" \ - "outfiles/text_sym.obj" \ - "outfiles/sunplus_sym.obj" \ - "processors/6805.obj" \ - "processors/68hc11.obj" \ - "processors/6502.obj" \ - "processors/sunplus.obj" \ - "processors/8051.obj" \ - "processors/pic.obj" \ - "processors/avr.obj" \ - "processors/z80.obj" - -all : "$(OUTEXE)" - -clean: - del *.obj - del $(OUTEXE) - -cleanall: - del *.obj - del $(OUTEXE) - -"$(OUTEXE)" : $(OBJS) - $(LINK) $(LINK_FLAGS) $(OBJS) - -.c.obj: - $(CC) $(CC_FLAGS) $*.c /Fo$@ +# Project: tpasm +# Makefile created by Dev-C++ 5.11 + +CPP = g++.exe +CC = gcc.exe +WINDRES = windres.exe +OBJ = globals.o tpasm.o memory.o files.o alias.o context.o expression.o label.o listing.o macro.o parser.o pseudo.o segment.o symbols.o outfile.o processors.o support.o processors/68hc11.o processors/6502.o processors/6805.o processors/6809.o processors/8051.o processors/avr.o processors/c166.o processors/ctxp1.o processors/pic.o processors/sunplus.o processors/z80.o outfiles/intel_seg.o outfiles/mot_seg.o outfiles/sunplus_sym.o outfiles/text_sym.o outfiles/text_incl.o +LINKOBJ = globals.o tpasm.o memory.o files.o alias.o context.o expression.o label.o listing.o macro.o parser.o pseudo.o segment.o symbols.o outfile.o processors.o support.o processors/68hc11.o processors/6502.o processors/6805.o processors/6809.o processors/8051.o processors/avr.o processors/c166.o processors/ctxp1.o processors/pic.o processors/sunplus.o processors/z80.o outfiles/intel_seg.o outfiles/mot_seg.o outfiles/sunplus_sym.o outfiles/text_sym.o outfiles/text_incl.o +LIBS = -L"E:/_TOOLS/Dev-Cpp/MinGW64/lib32" -L"E:/_TOOLS/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32" -static-libgcc -m32 +INCS = -I"E:/_TOOLS/Dev-Cpp/MinGW64/include" -I"E:/_TOOLS/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"E:/_TOOLS/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"E:/_DEVEL/GitHub/TPASM" +CXXINCS = -I"E:/_TOOLS/Dev-Cpp/MinGW64/include" -I"E:/_TOOLS/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"E:/_TOOLS/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"E:/_TOOLS/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++" -I"E:/_DEVEL/GitHub/TPASM" +BIN = tpasm-1.12.exe +CXXFLAGS = $(CXXINCS) -O2 -m32 +CFLAGS = $(INCS) -O2 -m32 +RM = rm.exe -f + +.PHONY: all all-before all-after clean clean-custom + +all: all-before $(BIN) all-after + +clean: clean-custom + ${RM} $(OBJ) $(BIN) + +$(BIN): $(OBJ) + $(CPP) $(LINKOBJ) -o $(BIN) $(LIBS) + +globals.o: globals.c + $(CPP) -c globals.c -o globals.o $(CXXFLAGS) + +tpasm.o: tpasm.c + $(CPP) -c tpasm.c -o tpasm.o $(CXXFLAGS) + +memory.o: memory.c + $(CPP) -c memory.c -o memory.o $(CXXFLAGS) + +files.o: files.c + $(CPP) -c files.c -o files.o $(CXXFLAGS) + +alias.o: alias.c + $(CPP) -c alias.c -o alias.o $(CXXFLAGS) + +context.o: context.c + $(CPP) -c context.c -o context.o $(CXXFLAGS) + +expression.o: expression.c + $(CPP) -c expression.c -o expression.o $(CXXFLAGS) + +label.o: label.c + $(CPP) -c label.c -o label.o $(CXXFLAGS) + +listing.o: listing.c + $(CPP) -c listing.c -o listing.o $(CXXFLAGS) + +macro.o: macro.c + $(CPP) -c macro.c -o macro.o $(CXXFLAGS) + +parser.o: parser.c + $(CPP) -c parser.c -o parser.o $(CXXFLAGS) + +pseudo.o: pseudo.c + $(CPP) -c pseudo.c -o pseudo.o $(CXXFLAGS) + +segment.o: segment.c + $(CPP) -c segment.c -o segment.o $(CXXFLAGS) + +symbols.o: symbols.c + $(CPP) -c symbols.c -o symbols.o $(CXXFLAGS) + +outfile.o: outfile.c + $(CPP) -c outfile.c -o outfile.o $(CXXFLAGS) + +processors.o: processors.c + $(CPP) -c processors.c -o processors.o $(CXXFLAGS) + +support.o: support.c + $(CPP) -c support.c -o support.o $(CXXFLAGS) + +processors/68hc11.o: processors/68hc11.c + $(CPP) -c processors/68hc11.c -o processors/68hc11.o $(CXXFLAGS) + +processors/6502.o: processors/6502.c + $(CPP) -c processors/6502.c -o processors/6502.o $(CXXFLAGS) + +processors/6805.o: processors/6805.c + $(CPP) -c processors/6805.c -o processors/6805.o $(CXXFLAGS) + +processors/6809.o: processors/6809.c + $(CPP) -c processors/6809.c -o processors/6809.o $(CXXFLAGS) + +processors/8051.o: processors/8051.c + $(CPP) -c processors/8051.c -o processors/8051.o $(CXXFLAGS) + +processors/avr.o: processors/avr.c + $(CPP) -c processors/avr.c -o processors/avr.o $(CXXFLAGS) + +processors/c166.o: processors/c166.c + $(CPP) -c processors/c166.c -o processors/c166.o $(CXXFLAGS) + +processors/ctxp1.o: processors/ctxp1.c + $(CPP) -c processors/ctxp1.c -o processors/ctxp1.o $(CXXFLAGS) + +processors/pic.o: processors/pic.c + $(CPP) -c processors/pic.c -o processors/pic.o $(CXXFLAGS) + +processors/sunplus.o: processors/sunplus.c + $(CPP) -c processors/sunplus.c -o processors/sunplus.o $(CXXFLAGS) + +processors/z80.o: processors/z80.c + $(CPP) -c processors/z80.c -o processors/z80.o $(CXXFLAGS) + +outfiles/intel_seg.o: outfiles/intel_seg.c + $(CPP) -c outfiles/intel_seg.c -o outfiles/intel_seg.o $(CXXFLAGS) + +outfiles/mot_seg.o: outfiles/mot_seg.c + $(CPP) -c outfiles/mot_seg.c -o outfiles/mot_seg.o $(CXXFLAGS) + +outfiles/sunplus_sym.o: outfiles/sunplus_sym.c + $(CPP) -c outfiles/sunplus_sym.c -o outfiles/sunplus_sym.o $(CXXFLAGS) + +outfiles/text_sym.o: outfiles/text_sym.c + $(CPP) -c outfiles/text_sym.c -o outfiles/text_sym.o $(CXXFLAGS) + +outfiles/text_incl.o: outfiles/text_incl.c + $(CPP) -c outfiles/text_incl.c -o outfiles/text_incl.o $(CXXFLAGS) diff --git a/README.md b/README.md index 95b0a79..9c5ab6c 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ This is a copy of the official TPASM sources from [http://www.sqrt.com/](http:// ## Added files * **Makefile.dj2**: Makefile to build TPASM using [DJGPP2](http://www.delorie.com/djgpp/). You will need a DOS/Windows system supporting 16-Bit binaries and LFN (long file names) to build. E.g.: [FreeDOS](http://www.freedos.org/), [DOSBox-LFN](https://sourceforge.net/projects/dosbox-svn-lfn/) or Win9x. -* **tpasm-1.11.dev**: Projectfile for [Dev-Cpp](https://sourceforge.net/projects/orwelldevcpp/) +* **tpasm-1.12.dev**: Projectfile for [Dev-Cpp](https://sourceforge.net/projects/orwelldevcpp/) ## Binaries -The DOS binaries were created with DJGPP, gcc version 8.2.0. +The DOS binaries were created with DJGPP, gcc version 7.2.0. The WIN32 binaries were created using Dev-Cpp 5.11 and TDM-GCC 4.9.2. diff --git a/defines.h b/defines.h index be19298..cfc1b5a 100644 --- a/defines.h +++ b/defines.h @@ -1,4 +1,4 @@ -// Copyright (C) 1999-2012 Core Technologies. +// Copyright (C) 1999-2021 Core Technologies. // // This file is part of tpasm. // @@ -14,7 +14,7 @@ // along with tpasm; see the file "LICENSE.TXT". -#define VERSION "1.11" +#define VERSION "1.12" #define DEFAULT_MAX_PASSES 32 // default maximum number of passes made by the assembler diff --git a/listing.c b/listing.c index de5901f..f5586ba 100644 --- a/listing.c +++ b/listing.c @@ -98,8 +98,13 @@ static void vReportComplaint(WHERE_FROM *whereFrom,bool isError,const char *form // if isError is true, the comlpaint will be reported as an error, // otherwise as a warning { + va_list + argsCopy; + if(isError||displayWarnings) { + va_copy(argsCopy,args); // need copy to use the args multiple times + if(whereFrom) { vReportMessage(whereFrom->file?STNodeName(whereFrom->file):NULL,whereFrom->fileLineNumber,isError?"error ":"warning",format,args); @@ -119,7 +124,7 @@ static void vReportComplaint(WHERE_FROM *whereFrom,bool isError,const char *form { fprintf(listFile,"**** WARNING: "); } - vfprintf(listFile,format,args); + vfprintf(listFile,format,argsCopy); } if(isError) { diff --git a/tpasm-1.11.dev b/tpasm-1.12.dev similarity index 75% rename from tpasm-1.11.dev rename to tpasm-1.12.dev index 29c945c..4d86db0 100644 --- a/tpasm-1.11.dev +++ b/tpasm-1.12.dev @@ -1,10 +1,10 @@ [Project] -FileName=tpasm-1.11.dev +FileName=tpasm-1.12.dev Name=tpasm Type=1 Ver=2 ObjFiles= -Includes=D:\_DEVEL\git\TPASM-build\tpasm1.11 +Includes=E:\_DEVEL\GitHub\TPASM Libs= PrivateResource= ResourceIncludes= @@ -19,7 +19,7 @@ ObjectOutput= LogOutput= LogOutputEnabled=0 OverrideOutput=0 -OverrideOutputName=tpasm-1.11.exe +OverrideOutputName=tpasm-1.12.exe HostApplication= UseCustomMakefile=0 CustomMakefile= @@ -51,7 +51,7 @@ AutoIncBuildNr=0 SyncProduct=1 [Unit18] -FileName=tpasm1.11\processors\68hc11.c +FileName=processors\68hc11.c CompileCpp=1 Folder= Compile=1 @@ -61,7 +61,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit21] -FileName=tpasm1.11\processors\6809.c +FileName=processors\6809.c CompileCpp=1 Folder= Compile=1 @@ -71,7 +71,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit22] -FileName=tpasm1.11\processors\8051.c +FileName=processors\8051.c CompileCpp=1 Folder= Compile=1 @@ -81,7 +81,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit23] -FileName=tpasm1.11\processors\avr.c +FileName=processors\avr.c CompileCpp=1 Folder= Compile=1 @@ -91,7 +91,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit25] -FileName=tpasm1.11\processors\ctxp1.c +FileName=processors\ctxp1.c CompileCpp=1 Folder= Compile=1 @@ -101,7 +101,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit26] -FileName=tpasm1.11\processors\pic.c +FileName=processors\pic.c CompileCpp=1 Folder= Compile=1 @@ -111,7 +111,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit29] -FileName=tpasm1.11\outfiles\intel_seg.c +FileName=outfiles\intel_seg.c CompileCpp=1 Folder= Compile=1 @@ -121,7 +121,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit31] -FileName=tpasm1.11\outfiles\sunplus_sym.c +FileName=outfiles\sunplus_sym.c CompileCpp=1 Folder= Compile=1 @@ -131,7 +131,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit32] -FileName=tpasm1.11\outfiles\text_sym.c +FileName=outfiles\text_sym.c CompileCpp=1 Folder= Compile=1 @@ -141,7 +141,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit1] -FileName=tpasm1.11\globals.c +FileName=globals.c CompileCpp=1 Folder= Compile=1 @@ -151,7 +151,7 @@ OverrideBuildCmd=0 BuildCmd=$(CPP) -c globals.c -o globals.o $(CXXFLAGS) [Unit2] -FileName=tpasm1.11\tpasm.c +FileName=tpasm.c CompileCpp=1 Folder= Compile=1 @@ -161,7 +161,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit3] -FileName=tpasm1.11\memory.c +FileName=memory.c CompileCpp=1 Folder= Compile=1 @@ -171,7 +171,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit4] -FileName=tpasm1.11\files.c +FileName=files.c CompileCpp=1 Folder= Compile=1 @@ -181,7 +181,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit5] -FileName=tpasm1.11\alias.c +FileName=alias.c CompileCpp=1 Folder= Compile=1 @@ -191,7 +191,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit6] -FileName=tpasm1.11\context.c +FileName=context.c CompileCpp=1 Folder= Compile=1 @@ -201,7 +201,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit7] -FileName=tpasm1.11\expression.c +FileName=expression.c CompileCpp=1 Folder= Compile=1 @@ -211,7 +211,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit8] -FileName=tpasm1.11\label.c +FileName=label.c CompileCpp=1 Folder= Compile=1 @@ -221,7 +221,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit9] -FileName=tpasm1.11\listing.c +FileName=listing.c CompileCpp=1 Folder= Compile=1 @@ -231,7 +231,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit10] -FileName=tpasm1.11\macro.c +FileName=macro.c CompileCpp=1 Folder= Compile=1 @@ -241,7 +241,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit11] -FileName=tpasm1.11\parser.c +FileName=parser.c CompileCpp=1 Folder= Compile=1 @@ -251,7 +251,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit12] -FileName=tpasm1.11\pseudo.c +FileName=pseudo.c CompileCpp=1 Folder= Compile=1 @@ -261,7 +261,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit13] -FileName=tpasm1.11\segment.c +FileName=segment.c CompileCpp=1 Folder= Compile=1 @@ -271,7 +271,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit14] -FileName=tpasm1.11\symbols.c +FileName=symbols.c CompileCpp=1 Folder= Compile=1 @@ -281,7 +281,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit15] -FileName=tpasm1.11\outfile.c +FileName=outfile.c CompileCpp=1 Folder= Compile=1 @@ -291,7 +291,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit16] -FileName=tpasm1.11\processors.c +FileName=processors.c CompileCpp=1 Folder= Compile=1 @@ -301,7 +301,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit17] -FileName=tpasm1.11\support.c +FileName=support.c CompileCpp=1 Folder= Compile=1 @@ -311,7 +311,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit19] -FileName=tpasm1.11\processors\6502.c +FileName=processors\6502.c CompileCpp=1 Folder= Compile=1 @@ -321,7 +321,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit20] -FileName=tpasm1.11\processors\6805.c +FileName=processors\6805.c CompileCpp=1 Folder= Compile=1 @@ -331,7 +331,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit24] -FileName=tpasm1.11\processors\c166.c +FileName=processors\c166.c CompileCpp=1 Folder= Compile=1 @@ -341,7 +341,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit27] -FileName=tpasm1.11\processors\sunplus.c +FileName=processors\sunplus.c CompileCpp=1 Folder= Compile=1 @@ -351,7 +351,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit28] -FileName=tpasm1.11\processors\z80.c +FileName=processors\z80.c CompileCpp=1 Folder= Compile=1 @@ -361,7 +361,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit30] -FileName=tpasm1.11\outfiles\mot_seg.c +FileName=outfiles\mot_seg.c CompileCpp=1 Folder= Compile=1 @@ -371,7 +371,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit33] -FileName=tpasm1.11\outfiles\text_incl.c +FileName=outfiles\text_incl.c CompileCpp=1 Folder= Compile=1 diff --git a/tpasm-1.12.layout b/tpasm-1.12.layout new file mode 100644 index 0000000..d3a9ff1 --- /dev/null +++ b/tpasm-1.12.layout @@ -0,0 +1,2 @@ +[Editors] +Order=