Skip to content

Commit

Permalink
TPASM V1.12 from http://www.sqrt.com/
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilu committed Feb 18, 2022
1 parent 198fd05 commit 35ff071
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 118 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.o
RELEASE/
*.exe
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 = \
Expand Down
17 changes: 8 additions & 9 deletions Makefile.dj2
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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)
Expand Down
191 changes: 124 additions & 67 deletions Makefile.win
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 2 additions & 2 deletions defines.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 1999-2012 Core Technologies.
// Copyright (C) 1999-2021 Core Technologies.
//
// This file is part of tpasm.
//
Expand All @@ -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

Expand Down
7 changes: 6 additions & 1 deletion listing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
{
Expand Down
Loading

0 comments on commit 35ff071

Please sign in to comment.