diff --git a/Makefile b/Makefile index 93fc9dd..6f83d34 100644 --- a/Makefile +++ b/Makefile @@ -181,10 +181,9 @@ ci86.lina.labtest \ # That's all folks! # 4.0 ### Version : an official release 4.0 -# Left out : beta, revision number is taken from rcs e.g. 3.154 -# Normally VERSION is passed via the command line. -VERSION=test -DATE=2030 # To get the newest version +# Left out : beta, revision number is taken from current date. +# For a release VERSION is passed via the command line as e.g. 5.3 +VERSION=`date +%Y%b%d` # M4_DEBUG=--debug=V # deperado debugging. RELEASELINA32 = \ @@ -219,21 +218,25 @@ $(EXAMPLESRC) \ #ci86.lina64.fas \ # That's all folks! +VERSION:;echo 'define({M4_VERSION},{'${VERSION}'})' >VERSION + TEMPFILE=/tmp/ciforthscratch # How to generate a Forth executable. %: %.frt ; $(FORTH) -c $^ # Define NASM as *the* assembler generating bin files. -%.bin:%.asm - nasm -fbin $< -o $@ -l $*.lst +%.bin:%.asm ; nasm -fbin $< -o $@ -l $*.lst + +# Define fasm as an alternative for generating bin files. +%:%.fas ; fasm $< -m256000 +#%.exe: ci86.%.fas ; fasm $+ -m256000 # mina.cfg and alone.cfg are present (at least via RCS) # allow to generate ci86.mina.bin etc. ci86.%.rawdoc ci86.%.rawtest : ci86.%.asm ; -VERSION : ; echo 'define({M4_VERSION},$(VERSION))' >VERSION ci86.%.asm : %.cfg VERSION nasm.m4 ci86.gnr cat $+ | $(M4) $(M4_DEBUG) - > $(TEMPFILE) @@ -289,9 +292,6 @@ lina64: ci86.lina64.fas ; fasm $+ -m256000; mv ${<:.fas=} $@ lina: glina64 ; $< -g 8000 $@ wina.exe: ci86.wina.fas ; fasm $+ -m256000 ; mv ${<:.fas=}.exe $@ -# Put include type of dependancies here -$(TARGETS:%=%.cfg) : $(INGREDIENTS) ; if [ -f $@ ] ; then touch $@ ; else cvs update $@ ; fi - # Some of these targets make no sense and will fail all: $(TARGETS:%=ci86.%.asm) $(TARGETS:%=ci86.%.msm) $(BINTARGETS:%=ci86.%.bin) \ $(LINUXFORTHS) $(OTHERTARGETS) @@ -306,14 +306,6 @@ cleanall: clean testclean ; \ rm -f *.aux *.log *.ps *.toc *.pdf ; \ rm -f *.zip *gz -# FIXME, RCS is now in use. -# Until then this target must not be used. -RCSCLEAN: ;\ - ln -s $(CVSROOT)/ciforth RCS - ln -f Makefile makefile - rcsclean - rm RCS - release : strip zip msdos32.zip msdos.zip lina.zip #Install it. To be run as root diff --git a/ci86.gnr b/ci86.gnr index 4415aa1..c2a7aec 100644 --- a/ci86.gnr +++ b/ci86.gnr @@ -103,8 +103,14 @@ _ENDCOMMENT _C{ ########################################################################################} _C{ PREPARATION (no code)} _C{ ########################################################################################} +dnl It doesn't make sense to have duplicate code for 16/32/64 bits +dnl where m4 can handle it this easily. +dnl 16 bits was default for the startup code, now overrule. dnl 16 bits is default for the boot code. _BITS16_({include(width16.m4)}) +_BITS32_({include(width32.m4)},{dnl}) +_BITS64_({include(width64.m4)},{dnl}) + FIGREL EQU 5 _C{ FIG RELEASE #} FIGREV EQU 0 _C{ FIG REVISION #} @@ -365,31 +371,31 @@ _C dd 0,0,0,0,0 kernel_table: - _ExitProcess@4 dd rva _ExitProcess - CreateFile dd rva _CreateFileA - _CreateProcessA@40 dd rva _CreateProcess - _ReadFile@20 dd rva _ReadFile - _WriteFile@20 dd rva _WriteFile - CloseHandle dd rva _CloseHandle - SetFilePointer dd rva _SetFilePointer - _GetCommandLineA@0 dd rva _GetCommandLineA - GetEnvironmentVariable dd rva _GetEnvironmentVariable - _DeleteFileA@4 dd rva _DeleteFileA - _GetConsoleMode@8 dd rva _GetConsoleMode - _GetProcAddress@8 dd rva _GetProcAddress - _GetStdHandle@4 dd rva _GetStdHandle - _LoadLibraryA@4 dd rva _LoadLibraryA - _GetLastError@0 dd rva _GetLastError - _PeekConsoleInputA@16 dd rva _PeekConsoleInputA - _ReadConsoleA@20 dd rva _ReadConsoleA - GetTickCount dd rva _GetTickCount - GetSystemTime dd rva _GetSystemTime - GlobalMemoryStatus dd rva _GlobalMemoryStatus - _SetConsoleMode@8 dd rva _SetConsoleMode - _Sleep@4 dd rva _Sleep - dd 0 - - kernel_name db 'KERNEL32.DLL',0 + _ExitProcess@4 DC rva _ExitProcess + CreateFile DC rva _CreateFileA + _CreateProcessA@40 DC rva _CreateProcess + _ReadFile@20 DC rva _ReadFile + _WriteFile@20 DC rva _WriteFile + CloseHandle DC rva _CloseHandle + SetFilePointer DC rva _SetFilePointer + _GetCommandLineA@0 DC rva _GetCommandLineA + GetEnvironmentVariable DC rva _GetEnvironmentVariable + _DeleteFileA@4 DC rva _DeleteFileA + _GetConsoleMode@8 DC rva _GetConsoleMode + _GetProcAddress@8 DC rva _GetProcAddress + _GetStdHandle@4 DC rva _GetStdHandle + _LoadLibraryA@4 DC rva _LoadLibraryA + _GetLastError@0 DC rva _GetLastError + _PeekConsoleInputA@16 DC rva _PeekConsoleInputA + _ReadConsoleA@20 DC rva _ReadConsoleA + GetTickCount DC rva _GetTickCount + GetSystemTime DC rva _GetSystemTime + GlobalMemoryStatus DC rva _GlobalMemoryStatus + _SetConsoleMode@8 DC rva _SetConsoleMode + _Sleep@4 DC rva _Sleep + DC 0 + + kernel_name db _BITS64_({'KERNEL32.DLL'})_BITS32_({'KERNEL32.DLL'}),0 _ExitProcess dw 0 db 'ExitProcess',0 @@ -1124,13 +1130,6 @@ ENDDPMI: _C{ ######################### DPMI END ###############################################################} })_C{}_END_({_HOSTED_DPMI_}) -dnl It doesn't make sense to have duplicate code for 16/32/64 bits -dnl where m4 can handle it this easily. -dnl 16 bits was default for the startup code, now overrule. -_BITS32_({SET_32_BIT_MODE _C Assembler directive},{dnl}) -_BITS32_({include(width32.m4)},{dnl}) -_BITS64_({SET_64_BIT_MODE _C Assembler directive},{dnl}) -_BITS64_({include(width64.m4)},{dnl}) _SWITCH_({ CLI _C{ Wait for stacks to be setup.} @@ -1672,7 +1671,7 @@ _REAL_({ _C _C{ If M4_VERSION exists and contains a . it is an official release} define({M4_VERSION2}, ifelse( index(M4_VERSION,.), -1, -{{{beta $RCSfile$ $Revision$}}}, +{beta M4_VERSION}, M4_VERSION))dnl _C worddoc({ENVIRONMENTS},{VERSION},{version}, {--- sc},{CI}, @@ -8783,7 +8782,7 @@ _C worddoc( {INPUT},{SET-MODE},{set_mode},{u --- },{}, {Set the mode of standard input to forthvar({u}), as defined in MS-WINDOWS forthemph({GetConsoleMode}) function from -forthemph({KERNEL32.DLL}). +forthemph({_BITS64_({KERNEL32.DLL})_BITS32_({KERNEL32.DLL})}) }, {{GET-MODE},{KEY?}}, {}, enddoc) _HEADER({SET-MODE},{SETMODE},{DOCOL}) @@ -8795,7 +8794,7 @@ _C worddoc( {INPUT},{GET-MODE},{get_mode},{ --- u },{}, {Get the mode of standard input to forthvar({u}), as defined in MS-WINDOWS forthemph({GetConsoleMode}) function from -forthemph({KERNEL32.DLL}). +forthemph({_BITS64_({KERNEL32.DLL})_BITS32_({KERNEL32.DLL})}). }, {{SET-MODE},{KEY?}}, {}, enddoc) _C diff --git a/fasm.m4 b/fasm.m4 index 5fd1c20..f5d12a7 100644 --- a/fasm.m4 +++ b/fasm.m4 @@ -27,9 +27,9 @@ define({_HEADER_ASM},{; _DLL_( {; fasm forth.asm forth ; fasm generates executable, no separate linking. - FORMAT PE console + _BITS32_({FORMAT PE console})_BITS64_({ FORMAT PE64 console}) ; - INCLUDE 'include/win32a.inc' ; ASCII windows definitions. + INCLUDE _BITS32_({'include/win32a.inc'})_BITS64_({'include/win64a.inc'}) ; ASCII windows definitions. define({_BSS_},{})dnl define({_TEXT_}, { section '.text' code executable readable writable})dnl })_C{}_END_({ _DLL_}) diff --git a/howto.txt b/howto.txt index ee44100..3a0997a 100644 --- a/howto.txt +++ b/howto.txt @@ -62,6 +62,12 @@ How to create a distribution : make clean rm VERSION + +AN OFFICIAL RELEASE IS GENERATED BY PASSING A VERSION MACRO +WITH A DECIMAL POINT TO make. + +Other VERSION or no VERSION means it is a beta. + Release generic version, official make zip VERSION=4.0 Result in ciforth-4.0.tar.gz @@ -71,12 +77,12 @@ How to create a distribution : Result in ciforth-3d286.tar.gz (not yet) Or use $V. - Release Linux version, official - make lina.zip VERSION=4.0 + Release Linux version, official (same for LINA64ZIP) + make LINA32ZIP VERSION=4.0 Result in lina-4.0.tar.gz Release Linux version, beta - make lina.zip VERSION=3d286 + make LINA32ZIP VERSION=3d286 Result in lina-3d286.tar.gz Or use $V. diff --git a/logforth.txt b/logforth.txt index 838ba88..be6eab2 100644 --- a/logforth.txt +++ b/logforth.txt @@ -14053,6 +14053,12 @@ The tests that compare against a version in the cvs archive are akward. Introduced testcmp subdirectory to contain those files. Marked everything as LASTCVS +2017 jan 14 +Even testwina works, however a symbolic link must be made to +the include directory from fasm. An exciting possibility is to use +the include directory from fasmw. That may make a 64 bit version of +wina work. + - Greg Egan Schild's ladder. diff --git a/setenv b/setenv index 18b90f0..6cc87f6 100644 --- a/setenv +++ b/setenv @@ -31,7 +31,4 @@ O=/mnt/dosc/dfw/tforth/test/system/okay DATE='"2010/04/05 15:00:00"' export b c d x C f p l a A s t R O FD I M DATE pat export CVSROOT=:pserver:albert@sparc:/usr/local/cvsroot -unalias cvs -alias cvs='cvs -d$CVSROOT' -cvs -d$CVSROOT login -V=`cvs log -r $f | grep -w revision| sed -e 's/revision /beta-/'` +V='2017jan15' diff --git a/test.mak b/test.mak index 40afb75..5bc3da3 100644 --- a/test.mak +++ b/test.mak @@ -194,7 +194,7 @@ testlina32 : $(TESTLINA32) ci86.lina32.rawtest lina32 forth.lab.lina tsuite.frt m4 $(TESTLINA32) >$(TEMPFILE) sed $(TEMPFILE) -e '/Split here for test/,$$d' >$@.1 sed $(TEMPFILE) -e '1,/Split here for test/d' >$@.2 - ./lina32 <$@.1 2>&1| grep -v RCSfile >$@.3 + ./lina32 <$@.1 2>&1| grep -v beta >$@.3 diff -b -B $@.2 $@.3 || true ln -sf forth.lab.lina forth.lab ./lina32 -a &1 |cat >tsuite32.out @@ -209,7 +209,7 @@ testlina64 : $(TESTLINA64) ci86.lina64.rawtest lina64 forth.lab.lina tsuite.frt m4 $(TESTLINA64) >$(TEMPFILE) sed $(TEMPFILE) -e '/Split here for test/,$$d' >$@.1 sed $(TEMPFILE) -e '1,/Split here for test/d' >$@.2 - ./lina64 <$@.1 2>&1| grep -v RCSfile >$@.3 + ./lina64 <$@.1 2>&1| grep -v beta >$@.3 diff -b -B $@.2 $@.3 || true ln -sf forth.lab.lina forth.lab ./lina64 -a &1 |cat >tsuite64.out @@ -228,7 +228,7 @@ testwina : ci86.wina.rawtest test.m4 wina.exe forth.lab.wina tsuite.frt ; sed $(TEMPFILE) -e '1,/Split here for test/d' >$@.2 rm $(TEMPFILE) wine wina.exe <$@.1 2>&1|\ - grep -v RCSfile |\ + grep -v beta |\ sed -e 's/.*wina.exe/wina.exe/' >$@.3 diff -b -B $@.2 $@.3 || true cp -f forth.lab.wina forth.lab @@ -246,7 +246,7 @@ testlina64.tar : $(TESTLINA64) ci86.lina64.rawtest ci86.lina64.fas forth.lab.lin m4 $(TESTLINA64) >$(TEMPFILE) sed $(TEMPFILE) -e '/Split here for test/,$$d' >testlina64.1 sed $(TEMPFILE) -e '1,/Split here for test/d' >testlina64.2 - echo "lina64 &1| grep -v RCSfile >testlina64.3 ">>testlina64 + echo "lina64 &1| grep -v beta >testlina64.3 ">>testlina64 echo "diff -b -B testlina64.2 testlina64.3 || true ">>testlina64 echo "lina64 -a &1 |cat >tsuite.tmp ">>testlina64 echo "diff -bBw tsuite.tmp tsuite64.out || true ">>testlina64 @@ -258,7 +258,7 @@ testlinux : $(TESTLINUX) ci86.linux.rawtest ciforthc forth.lab ; m4 $(TESTLINUX) >$(TEMPFILE) sed $(TEMPFILE) -e '/Split here for test/,$$d' >$@.1 sed $(TEMPFILE) -e '1,/Split here for test/d' >$@.2 - ciforthc <$@.1 | grep -v RCSfile >$@.3 + ciforthc <$@.1 | grep -v beta >$@.3 diff -b -B $@.2 $@.3 || true rm $(TEMPFILE) diff --git a/toblock.c b/toblock.c index 395fb6f..af5ed88 100644 --- a/toblock.c +++ b/toblock.c @@ -1,6 +1,7 @@ /* $Id$ */ -/* Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License */ +/* Copyright(2017): Albert van der Horst, HCC FIG Holland by GNU Public License */ #include +#include #include #define CPL 64 diff --git a/width32.m4 b/width32.m4 index e32cc89..7c14244 100644 --- a/width32.m4 +++ b/width32.m4 @@ -1,5 +1,7 @@ dnl $Id$ M4 file to handle the develish FIG headers. -dnl Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License +dnl Copyright(2017): Albert van der Horst, HCC FIG Holland by GNU Public License +dnl None of the following makes sense unless 32 bit mode +SET_32_BIT_MODE _C Assembler directive divert(-1) define({CELL_M4},LONG)dnl define({CWORD},{DWORD})dnl diff --git a/width64.m4 b/width64.m4 index 93ea231..41b8d8f 100644 --- a/width64.m4 +++ b/width64.m4 @@ -1,5 +1,7 @@ dnl $Id$ M4 file to handle the develish FIG headers. dnl Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License +dnl None of the following makes sense unless 64 bit mode +SET_64_BIT_MODE _C Assembler directive divert(-1) define({CELL_M4},{QUAD})dnl define({CWORD},{QWORD})dnl