From 268b1e75a3e1fbf97e875cc9c2e2267cb8c945f0 Mon Sep 17 00:00:00 2001 From: Albert van der Horst Date: Tue, 22 Oct 2019 20:48:58 +0200 Subject: [PATCH] Transition to version 2.0.0 . git hops over all intermediate cvs files. --- Makefile | 36 ++++++---- README.assembler | 96 ++++++++++++++------------- README.assembler.txt | 96 ++++++++++++++------------- README.txt | 60 +++++++++++++++++ access.frt | 2 +- as6809.frt | 2 +- as6809s.frt | 2 +- as80.frt | 6 +- asAMD.frt | 14 ++++ asalpha.frt | 8 ++- asgen.frt | 40 ++++++----- asi386.frt | 2 +- asi586.frt | 2 +- asi86.frt | 2 +- asipentium.frt | 2 +- asnowrap.frt | 2 +- aswrap.frt | 2 +- bag.frt | 2 +- bugs.txt | 33 ++++++++-- cias.1 | 2 +- cias.frt | 2 +- ciasdis.1 | 2 +- ciasdis.frt | 5 +- cidis.frt | 2 +- class.frt | 2 +- control | 6 +- crawl.frt | 2 +- cul.5 | 2 +- debian.mak | 2 +- decsharp.frt | 2 +- dosheader.cul | 2 +- elf.cul | 2 +- elf64.cul | 2 +- exeheader.cul | 2 +- labelas.frt | 2 +- labeldis.frt | 2 +- linacrawl.cul | 4 +- log.txt | 153 +++++++++++++++++++++++++------------------ ps.frt | 2 +- rfcrawl.cul | 2 +- rules | 2 +- struct.frt | 2 +- test.mak | 2 +- testcmp/gset80 | 2 +- testcmp/gsetalpha | 12 ---- tools.frt | 2 +- versions.txt | 12 ++++ 47 files changed, 393 insertions(+), 252 deletions(-) create mode 100644 README.txt create mode 100644 asAMD.frt diff --git a/Makefile b/Makefile index 5b123fd..c9a495a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# $Id$ +# $Id: Makefile,v 1.72 2019/10/21 10:03:39 albert Exp $ # Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License # # This defines the usage of ciforth to build assemblers and reverse @@ -133,7 +133,7 @@ forth.lab \ cul.5 \ ciasdis.1 \ README.assembler \ -assembler.itxt \ +assembler.txt \ p0.asi386.ps \ p0F.asi386.ps \ qr8086.ps \ @@ -150,11 +150,6 @@ lina405equ.cul \ lina405.cul \ # That's all folks! -# Test output references -TESTREF= \ -lina405.asm \ -# That's all folks! - RELEASEASSEMBLER= \ Makefile \ $(ASSRC) \ @@ -242,11 +237,11 @@ install: default $(MISC_DOC) ciasdis.1 cul.5 install_bin cp -f copyright $(INSTALLDIR)/usr/share/doc/ciasdis # If tests fails, test targets must be inspected. -.PRECIOUS: rf751.asm rf751.cul lina405.asm test.bin +.PRECIOUS: $(TESTTARGETS) .PRECIOUS: $(TESTAS) .PHONY: RELEASE default all clean releaseproof zip \ - regressiontest testexamples debian + regressiontest regressiontest64 testexamples debian all: regressiontest @@ -255,6 +250,7 @@ clean: testclean install_clean rm -f *.bin rm -f ciasdis_tbi* rm -f *.ps + rm -f $(TESTTARGETS) # How to get rid of the Debian test directory install_clean: ; # TBS @@ -385,8 +381,8 @@ gset386.diff: gset386 ; \ # Testsets are generated by the SHOW-ALL command. # Once testsets are present, they can be used to test SHOW-ALL -gsetall : gsetalpha gset6809 gset80 gset86 gset386-16 gsetallpentium gsetallpentium : gset386 gsetpentium +gsetall : gsetalpha gset6809 gset80 gset86 gset386-16 gsetallpentium # gsetxxx contains all instruction that can be accepted. # This can be checked against expectation. Once that is done @@ -440,9 +436,10 @@ RELEASE: $(RELEASEASSEMBLER) cias ciasdis cidis $(ASSRCCLUDGE) ;\ # Preliminary until it is clear whether we want other disassemblers. # Note: this will use a copy of forth.lab to the local directory as ciasdis.lab -ciasdis : $(ASSRC) asi386.frt asipentium.frt ; $(FORTH) -c $@.frt +ciasdis : $(ASSRC) asi386.frt asipentium.frt version.frt; $(FORTH) -c $@.frt cias : ciasdis ; ln -f ciasdis cias cidis : ciasdis ; ln -f ciasdis cidis +version.frt: ; touch $@ test.bin : ciasdis cidis cias test.asm test.cul ciasdis -a test.asm test.bin @@ -450,13 +447,15 @@ test.bin : ciasdis cidis cias test.asm test.cul ciasdis -a test2.asm test2.bin diff test2.bin test.bin $(DIFF_BIN) test.bin - $(DIFF_TXT) test2.asm + # Cosmetic difference in 64 bit. + $(DIFF_TXT) test2.asm || true cias test.asm test.bin cidis test.bin test.cul > test2.asm cias test2.asm test2.bin diff test2.bin test.bin $(DIFF_BIN) test.bin - $(DIFF_TXT) test2.asm + # Cosmetic difference in 64 bit. + $(DIFF_TXT) test2.asm || true lina405.asm : ciasdis lina405equ.cul lina405.cul testcmp/lina405 cp testcmp/lina405 . @@ -479,11 +478,22 @@ rf751.asm : ciasdis rf751equ.cul rf751.cul testcmp/rf751 ciasdis -a $@ rf751 $(DIFF_BIN) rf751 +# The crawling fails for 64 bits, test only disassembly/assembly. +rf751-64.asm : ciasdis rf751equ.cul testcmp/rf751.cul testcmp/rf751 + ciasdis -d testcmp/rf751 testcmp/rf751.cul >rf751.asm + $(DIFF_TXT) rf751.asm || true + ciasdis -a rf751.asm rf751 + $(DIFF_BIN) rf751 + %.bin : %.asm ; ciasdis -a $< $@ cidis386.zip : $(ASSRC) asi386.frt asipentium.frt ; zip $@ $+ testexamples : test.bin lina405.asm rf751.asm +testexamples64 : test.bin lina405.asm rf751-64.asm + # ----------------- +regressiontest64 : testasses testexamples64 gsetall gset386.diff +# The real test, 64 bits misses rf751 regressiontest : testasses testexamples gsetall gset386.diff diff --git a/README.assembler b/README.assembler index 37b4e2f..b7e6e8a 100644 --- a/README.assembler +++ b/README.assembler @@ -4,22 +4,22 @@ This is the archive of the assembler to complement the aiforth and ciforth Forth implementations. See http://home.hccnet.nl/a.w.m.van.der.horst/forthimpl.frt -Since ciforth 4.0.5 tools like struct's and bags are no longer needed -in the assembler distribution. - -Release 0.2.0 and 0.3.0 are marked REL-0-2-0 and REL-0-2-0 in the RCS archive. -They pass the full regressiontest as specified in the Makefile. -They are based on lina 4.0.6. +The current version of ciasdis is 2.0 and it is based on version +5.3.0 of 32 bits lina and the beta release of 64 bits lina of +2017oct29. To understand the mnemonics you need the documentation of +these Forth's. +(Version 1.0.0 are based on lina 32 bits 4.0.# , some in as a deb package.) From day one the reverse engineering assembler had the property that disassembly was based on the same tables as assembly, and that disassembled binaries, could be reassembled to the exact same binary. -This is now complemented by consult files that supply the disassembler with +This is complemented by consult files that supply the disassembler with information to generate a readable and documented source with label names. Consult files can be built up incrementally. -The files marked * are generated -Sources : +The files marked % are generated + +-----------------SOURCES ---------------------------------------- Generic source asgen.frt Generic assembler / disassembler. @@ -30,62 +30,66 @@ ass.frt The 8086 prototype of the postit/fixup principle no error detection Plug ins -as80.frt 8080 plug in +as*.frt Assembler plugins e.g. asi86.frt 8086 plug in -asi386.frt 80386 plug in -as6809.frt 6809 plug in -asalpha.frt DEC Alpha plug in +as*s.frt Assembler screen version e.g. +as8086s.frt minimal 8086 assembler +------------- TEST SETS ------------------------------ +testset* Assembler testsets -Test sets: -testset8080 8080 testset -testset8086 8086 testset -testset386 386 testset -testset386a 386 testset for SIB byte -testset6809 6809 testset -testsetalpha alpha testset -asm386endtest total 386 test (not checked before this release.) - -Quick reference cards: +------------- QUICK REFERENCE ------------------------ ps.frt Source that generates postscript -qr8080.ps* 8080 -qr8086.ps* 8086 -p0.asi386.ps* 80386 main page -p0F.asi386.ps* 80386 instructions starting with 0F - -Reverse engineering tool -ciasdis.frt Main program and glue. -ciasdis* reverse engineering ``computer intelligence assembler/disassembler''. -cias* assembler (link to ciasdis) -cidis* disassembler (link to ciasdis) +qr8080.ps% 8080 +qr8086.ps% 8086 +p0.asi386.ps% 80386 main page +p0F.asi386.ps% 80386 instructions starting with 0F + +---------------- CIASDIS -------------------------- +Reverse engineering tool for i86 +ciasdis.frt Main program and glue, uses asgen.frt and +asi386.frt i86 specific +asipentium.frt i86 specific crawl.frt Code crawler: finds code via jumps and calls. aswrap.frt Must be loaded before plugin to turn into two pass assembler. labelas.frt Make generic assembler into a classic two pass assembler labeldis.frt Label database generation for ciasdis (386 specific!) access.frt Auxiliary : i.a. memory access w.r.t. target space. +tools.frt Auxiliary low level + +Generated +ciasdis% reverse engineering + ``computer intelligence assembler/disassembler''. +cias% assembler (link to ciasdis) +cidis% disassembler (link to ciasdis) +--------------------- AUXILIARY ------------------------ Consult files for ciasdis elf.cul Analysis of elf headers exeheader.cul Analysis of simple .exe headers (non-Windows) Test of reverse engineering tool -test.asm Test: asm --> bin --> asm --> bin -test.cul Consult file for test.asm -lina405 Test binary: lina 4.0.5 -linacrawl.cul Test: dedicated crawler for ciforth, adapted to lina 4.0.5 -lina405equ.cul+ Equ's generated via linacrawl.cul , must be included in lina405.asm -lina405.cul+ Labels's generated via linacrawl.cul , need not be included in lina405.asm -lina405.asm* Generated from lina405 by 2 preceeding cul files. - -+) These files are generated using linacrawl.cul then manually adapted. -Cludges if an OS can't inspect argument 0 (MS stuff) +Cludge in behalf of Microsoft cias.frt Main program for assembler cidis.frt Main program for disassembler -Layer to turn Forth assembler in classic two pass assembler Documentation -The suffix ``mi'' is about files to be processed by m4 then texinfo. -assembler.mi +[The suffix ``mi'' is about files to be processed by m4 then texinfo.] +assembler.mi Contained in ciforth/lina documentation. cias.1 manual page for cul.5 the underlying language for reverse engineering + +Files as a test source and/or to compare with. +testcmp/* +This contains i.a.. +test.asm Test: asm --> bin --> asm --> bin +test.cul Consult file for test.asm +lina405 Test binary: lina 4.0.5 +linacrawl.cul Test: dedicated crawler for ciforth, adapted to lina 4.0.5 +lina405equ.cul+ Equ's generated via linacrawl.cul , + must be included in lina405.asm +lina405.cul Labels's generated via linacrawl.cul , + need not be included in lina405.asm +lina405.asm* Generated from lina405 by 2 preceeding cul files. +rf751* Similar for retroforth 7.5.1 diff --git a/README.assembler.txt b/README.assembler.txt index 37b4e2f..b7e6e8a 100644 --- a/README.assembler.txt +++ b/README.assembler.txt @@ -4,22 +4,22 @@ This is the archive of the assembler to complement the aiforth and ciforth Forth implementations. See http://home.hccnet.nl/a.w.m.van.der.horst/forthimpl.frt -Since ciforth 4.0.5 tools like struct's and bags are no longer needed -in the assembler distribution. - -Release 0.2.0 and 0.3.0 are marked REL-0-2-0 and REL-0-2-0 in the RCS archive. -They pass the full regressiontest as specified in the Makefile. -They are based on lina 4.0.6. +The current version of ciasdis is 2.0 and it is based on version +5.3.0 of 32 bits lina and the beta release of 64 bits lina of +2017oct29. To understand the mnemonics you need the documentation of +these Forth's. +(Version 1.0.0 are based on lina 32 bits 4.0.# , some in as a deb package.) From day one the reverse engineering assembler had the property that disassembly was based on the same tables as assembly, and that disassembled binaries, could be reassembled to the exact same binary. -This is now complemented by consult files that supply the disassembler with +This is complemented by consult files that supply the disassembler with information to generate a readable and documented source with label names. Consult files can be built up incrementally. -The files marked * are generated -Sources : +The files marked % are generated + +-----------------SOURCES ---------------------------------------- Generic source asgen.frt Generic assembler / disassembler. @@ -30,62 +30,66 @@ ass.frt The 8086 prototype of the postit/fixup principle no error detection Plug ins -as80.frt 8080 plug in +as*.frt Assembler plugins e.g. asi86.frt 8086 plug in -asi386.frt 80386 plug in -as6809.frt 6809 plug in -asalpha.frt DEC Alpha plug in +as*s.frt Assembler screen version e.g. +as8086s.frt minimal 8086 assembler +------------- TEST SETS ------------------------------ +testset* Assembler testsets -Test sets: -testset8080 8080 testset -testset8086 8086 testset -testset386 386 testset -testset386a 386 testset for SIB byte -testset6809 6809 testset -testsetalpha alpha testset -asm386endtest total 386 test (not checked before this release.) - -Quick reference cards: +------------- QUICK REFERENCE ------------------------ ps.frt Source that generates postscript -qr8080.ps* 8080 -qr8086.ps* 8086 -p0.asi386.ps* 80386 main page -p0F.asi386.ps* 80386 instructions starting with 0F - -Reverse engineering tool -ciasdis.frt Main program and glue. -ciasdis* reverse engineering ``computer intelligence assembler/disassembler''. -cias* assembler (link to ciasdis) -cidis* disassembler (link to ciasdis) +qr8080.ps% 8080 +qr8086.ps% 8086 +p0.asi386.ps% 80386 main page +p0F.asi386.ps% 80386 instructions starting with 0F + +---------------- CIASDIS -------------------------- +Reverse engineering tool for i86 +ciasdis.frt Main program and glue, uses asgen.frt and +asi386.frt i86 specific +asipentium.frt i86 specific crawl.frt Code crawler: finds code via jumps and calls. aswrap.frt Must be loaded before plugin to turn into two pass assembler. labelas.frt Make generic assembler into a classic two pass assembler labeldis.frt Label database generation for ciasdis (386 specific!) access.frt Auxiliary : i.a. memory access w.r.t. target space. +tools.frt Auxiliary low level + +Generated +ciasdis% reverse engineering + ``computer intelligence assembler/disassembler''. +cias% assembler (link to ciasdis) +cidis% disassembler (link to ciasdis) +--------------------- AUXILIARY ------------------------ Consult files for ciasdis elf.cul Analysis of elf headers exeheader.cul Analysis of simple .exe headers (non-Windows) Test of reverse engineering tool -test.asm Test: asm --> bin --> asm --> bin -test.cul Consult file for test.asm -lina405 Test binary: lina 4.0.5 -linacrawl.cul Test: dedicated crawler for ciforth, adapted to lina 4.0.5 -lina405equ.cul+ Equ's generated via linacrawl.cul , must be included in lina405.asm -lina405.cul+ Labels's generated via linacrawl.cul , need not be included in lina405.asm -lina405.asm* Generated from lina405 by 2 preceeding cul files. - -+) These files are generated using linacrawl.cul then manually adapted. -Cludges if an OS can't inspect argument 0 (MS stuff) +Cludge in behalf of Microsoft cias.frt Main program for assembler cidis.frt Main program for disassembler -Layer to turn Forth assembler in classic two pass assembler Documentation -The suffix ``mi'' is about files to be processed by m4 then texinfo. -assembler.mi +[The suffix ``mi'' is about files to be processed by m4 then texinfo.] +assembler.mi Contained in ciforth/lina documentation. cias.1 manual page for cul.5 the underlying language for reverse engineering + +Files as a test source and/or to compare with. +testcmp/* +This contains i.a.. +test.asm Test: asm --> bin --> asm --> bin +test.cul Consult file for test.asm +lina405 Test binary: lina 4.0.5 +linacrawl.cul Test: dedicated crawler for ciforth, adapted to lina 4.0.5 +lina405equ.cul+ Equ's generated via linacrawl.cul , + must be included in lina405.asm +lina405.cul Labels's generated via linacrawl.cul , + need not be included in lina405.asm +lina405.asm* Generated from lina405 by 2 preceeding cul files. +rf751* Similar for retroforth 7.5.1 diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..36ca94c --- /dev/null +++ b/README.txt @@ -0,0 +1,60 @@ +This is the CVS archive of ciasdis, the ci assembler disassembler, +(or possibly a git copy of the cvs archive). + +From control (debian style) +" + The package ciasdis contains an assembler-disassembler + combination that allows to reassemble to a byte-for-byte + same binary. This is useful for modifying programs where + the source was lost, analysing viruses, etc. and general + curiosity. Knowledge about a binary can be build up + automatically, using scripts, or interactively and can be + stored for continued use in .cul files. + . + The assembler chapter of the ciforth documentation is all but + mandatory. For cross assembling to other targets, such as + DEC Alpha or M6809, use the source package. +" + +In order to build ciasdis: + make ciasdis FORTH= +FORTH shall on Linux contain the path of lina. The default for FORTH is +./lina. +FORTH shall on MS-Windows Linux contain the path of wina. +In the following ciforth refers to lina lina64 wina wina64 whatever +is appropriate for you OS. + +In order to do a regressiontest for 32 bit: + make regressiontest FORTH= +which include Intel's 8086, 80386,Pentium I, the 8080, the 6809 and +the DEC Alpha and for Pentium the disassembly and reassembly of 3 +executables. + +In order to do a regressiontest for 64 bit: + make regressiontest64 FORTH= + +In order to install +1. Only binary in the current directory: unpack ciasdis-1.0.0.tgz + Binary installation involves only two files, one being optional. The + remainder of the files is documentation and examples. +2. Binary system wide install. + Use the -i command of lina e.g. + ciasdis -i /usr/bin/ciasdis /usr/lib/ciasdis.lab +3. make install INSTALL_DIR= +This generates a unpacked debian compatible archive. +You can make this in a .deb file and install it with dpkg. + +Hex code sheets in Postscript format: +inspect the targets with extension .ps in the Makefile. + +Actual reverse engineering. +For actual reverse engineering you must study the man page of +ciasdis, as well as the man page of cul, the consult file format. +Consult files are the scripts that accumulate the knowledge gained +through reverse engineering, and govern the actual diassembly. +Assembly mnemonics are redesigned for reverse engineering. +A guide is found in the ciforth documentation. + +The binary is for Intel Pentium only. +For other processors you must load the assembler from within ciforth, +then proceed as with a a compiled binary. diff --git a/access.frt b/access.frt index ff72e4e..67c86c4 100644 --- a/access.frt +++ b/access.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: access.frt,v 1.6 2005/01/04 19:20:35 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/as6809.frt b/as6809.frt index 84e87ce..2b212a6 100644 --- a/as6809.frt +++ b/as6809.frt @@ -1,4 +1,4 @@ -( $Id$) +( $Id: as6809.frt,v 4.11 2012/11/21 23:30:56 albert Exp $) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( ############## 8089 ASSEMBLER ADDITIONS ############################# ) ASSEMBLER DEFINITIONS HEX diff --git a/as6809s.frt b/as6809s.frt index e43c519..d9df52b 100644 --- a/as6809s.frt +++ b/as6809s.frt @@ -1,5 +1,5 @@ ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) -( $Id$) +( $Id: as6809s.frt,v 1.9 2004/01/07 21:43:10 albert Exp $) ( ############## GENERIC PART OF ASSEMBER ############################# ) diff --git a/as80.frt b/as80.frt index bdde67f..f37e1dd 100644 --- a/as80.frt +++ b/as80.frt @@ -1,4 +1,4 @@ -( $Id$) +( $Id: as80.frt,v 4.6 2019/10/15 19:53:46 albert Exp $) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( ############## 8080 ASSEMBLER PROPER ################################ ) ASSEMBLER DEFINITIONS HEX @@ -8,7 +8,7 @@ ASSEMBLER DEFINITIONS HEX ( Note the decompiler hits them in the reverse order ) ( ' CNT BA BY DATA ) 0 1 0 100 ' AS-C, COMMAER IB, ( immediate byte data) - 0 2 0 200 ' W, COMMAER IX, ( immediate data : cell) + 0 2 0 200 ' W, COMMAER IX, ( immediate data : cell) 0 2 0 400 ' W, COMMAER X, ( immediate data : address) 0 1 0 800 ' AS-C, COMMAER P, ( port number ; byte ) @@ -50,7 +50,7 @@ ASSEMBLER DEFINITIONS HEX 00 00 00 00 1PI NOP 00 00 00 C9 1PI RET 00 00 00 76 1PI HLT ( ############## 8080 ASSEMBLER PROPER END ############################ ) ( Assume a NOOP written low level code.) -' NOOP >DFA @ CONSTANT (NEXT) +HEX 0BAD CONSTANT (NEXT) \ Not actually running! : NEXT JMP (NEXT) X, ; : PSH1 JMP (NEXT) 1 - X, ; : PSH2 JMP (NEXT) 2 - X, ; diff --git a/asAMD.frt b/asAMD.frt new file mode 100644 index 0000000..5764e87 --- /dev/null +++ b/asAMD.frt @@ -0,0 +1,14 @@ + + ASSEMBLER DEFINITIONS HEX + +0000 00 0000 T! + +\ Extensions for 64 bits. N is normal, P is primed, I is the SIB-index +\ Extensions for 64 bits. B is normal, R is primed, X is the SIB-index +\ THe modRM reg field is the extra register, i.e. the primed one. +\ E is extended registers, Q is 64 bits and maybe extended registers. +\ The rule : ' applies to AX'| and ] applies to AX] while N applies to others. +\ 01 48 8 1FAMILY, Q: QB: QX: QXB: QR: QRB: QRX: QRXB: +01 49 8 1FAMILY, Q: QN: Q]: QN]: Q': QN': Q']: QN']: +01 40 8 1FAMILY, E: EN: E]: EN]: E': EN': E']: EN']: +PREVIOUS DEFINITIONS DECIMAL diff --git a/asalpha.frt b/asalpha.frt index b200442..9794a44 100644 --- a/asalpha.frt +++ b/asalpha.frt @@ -1,4 +1,4 @@ -( $Id$) +( $Id: asalpha.frt,v 4.5 2019/10/17 10:37:07 albert Exp $) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Reference Alpha Architecture Handbook Order Number EX-QD2KC-TE ) ( Also down loadable as .pdf file from dec sites. ) @@ -291,8 +291,10 @@ BI: 01.0 BI: 30.0 8 4FAMILY, -- FBEQ, FBLT, FBLE, -- FBNE, FBGE, FBGT, ( Dirty trick out board hanging bit, to prevent matches with other ) ( assembler parts. Doing this via the ``BAD'' mechanism is just too ) ( expensive. ) -0 0 1,03FF,FFFF 0 DFI n#| ( 26 bits number built in) -0 0 1,03FF,FFFF BI: 0.0 4PI CALL_PAL +80 GO! +0 0 03FF,FFFF 0 DFI n#| ( 26 bits number built in) +0 0 03FF,FFFF BI: 0.0 4PI CALL_PAL +00 GO! 0 0 001F,0000 6000,E800 4PI ECB 0 0 0000,0000 6000,0400 4PI EXCB 0 0 001F,0000 T! diff --git a/asgen.frt b/asgen.frt index 67c4acc..6dbb680 100644 --- a/asgen.frt +++ b/asgen.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: asgen.frt,v 4.73 2019/10/18 18:53:50 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) @@ -376,7 +376,7 @@ class PIFU M: BI^ M; M: BI-R @ CORRECT-R M; ( fixup bit if "from-reverse" ) M: BI @ M; , ( postit or regular fixup bits) - M: ^GO M; 0 , ( ghost/good bits ) + M: GO^ M; 0 , ( ghost/good bits ) M: BY^ M; M: BY @ M; , ( bytes, mask for commaers ) M: BA^ M; @@ -428,7 +428,7 @@ endclass : !POSTIT AS-HERE ISS ! 0 OLDCOMMA ! ; ( Initialise in behalf of postit ) ( Bookkeeping for a commaer that is the current PIFU ) ( Is also used for disassembling. ) -: TALLY:, BI TALLY-BI ! BY TALLY-BY ! BA TALLY-BA OR!U ^GO @ TALLY-GO ! +: TALLY:, BI TALLY-BI ! BY TALLY-BY ! BA TALLY-BA OR!U GO^ @ TALLY-GO ! CNT ISL ! PRF @ BA-XT ! ; ( Post the instruction using a POINTER to a postit pifu ) : POSTIT CHECK26 PIFU! !POSTIT !TALLY TALLY:, DAT assemble, ; @@ -442,7 +442,7 @@ endclass IS-A IS-PI \ Awaiting REMEMBER. ( Define an instruction by BA BY BI and the OPCODE plus COUNT ) : PI >R CHECK33 CREATE '%~ID. 'DIS-PI 'TRY-PI NEW-PIFU R> - CNT^ ! PRO-GO @ ^GO ! DOES> + CNT^ ! PRO-GO @ GO^ ! DOES> REMEMBER POSTIT ; ( 1 .. 4 byte instructions ( BA BY BI OPCODE : - ) : 1PI 1 PI ; : 2PI 2 PI ; : 3PI 3 PI ; : 4PI 4 PI ; @@ -450,7 +450,8 @@ IS-A IS-PI \ Awaiting REMEMBER. ( ------------- PIFU's : xFI---------------------------------------------) ( Bookkeeping for a fixup that is the current pifu ) ( Is also used for disassembling. ) -: TALLY:| BI TALLY-BI AND! BY TALLY-BY OR! BA TALLY-BA OR!U ; +: TALLY:| BI TALLY-BI AND! BY TALLY-BY OR! BA TALLY-BA OR!U + GO^ @ TALLY-GO AND! ; ( Fix up the instruction using a POINTER to a fixup pifu ) : FIXUP> PIFU! DAT ISS @ OR! TALLY:| CHECK32 ; : DIS-xFI BI TALLY-BI @ CONTAINED-IN IF BI INSTRUCTION AND DAT = IF @@ -474,17 +475,18 @@ IS-A IS-xFI : xFI CHECK31 CREATE '%~ID. 'DIS-xFI 'TRY-xFI NEW-PIFU : .DFI INSTRUCTION BI AND SHT RSHIFT U. %ID. ; \ A disassembler for the current, data fixup pifu. : DIS-DFI BI TALLY-BI @ CONTAINED-IN IF BA COMPATIBLE? IF - TALLY:| this +DISS THEN THEN ; + GO^ @ TALLY-GO @ CONTAINED-IN IF + TALLY:| this +DISS THEN THEN THEN ; \ Match the tally to a (current) fixup pifu. : TRY-DFI BI TALLY-BI @ CONTAINED-IN IF TALLY:| this +DISS THEN ; ( Define a data fixup by BA BY BI, and LEN the bit position. ) ( At assembly time: expect DATA that is shifted before use ) ( Because of the or character of the operations, the bytecount is dummy ) IS-A IS-DFI : DFI CHECK31A CREATE '.DFI 'DIS-DFI 'TRY-DFI NEW-PIFU - DOES> ( u -- )REMEMBER FIXUP-NUMBER ; + PRO-GO @ GO^ ! DOES> ( u -- )REMEMBER FIXUP-NUMBER ; ( Same, but for signed data, a convenience. Disassembly shows unsigned ) IS-A IS-DFIs : DFIs CHECK31A CREATE '.DFI 'DIS-DFI 'TRY-DFI NEW-PIFU - DOES> ( n -- ) REMEMBER FIXUP-SIGNED ; + PRO-GO @ GO^ ! DOES> ( n -- ) REMEMBER FIXUP-SIGNED ; ( ------------- PIFU's : FIR DFIR ---------------------------------------) \ Reverses bytes in a WORD. Return IT. @@ -493,8 +495,8 @@ IS-A IS-DFIs : DFIs CHECK31A CREATE '.DFI 'DIS-DFI 'TRY-DFI NEW-PIFU ( Bookkeeping for a fixup-from-reverse that is the current pifu ) ( Is also used for disassembling. ) -: TALLY:|R BI-R TALLY-BI AND! BY TALLY-BY OR! ^GO @ TALLY-GO AND! - BA TALLY-BA OR!U ; +: TALLY:|R BI-R TALLY-BI AND! BY TALLY-BY OR! BA TALLY-BA OR!U + GO^ @ TALLY-GO AND! ; ( Fix up the instruction using a POINTER to a reverse fixup pifu ) : FIXUP-REVERSE PIFU! DAT-R ISS @ OR! TALLY:|R CHECK32 ; ( Fix up the instruction from reverse with DATA. ) @@ -502,31 +504,32 @@ IS-A IS-DFIs : DFIs CHECK31A CREATE '.DFI 'DIS-DFI 'TRY-DFI NEW-PIFU TALLY:|R CHECK32 ; ( A disassembler for the current, fixup from reverse pifu. ) : DIS-FIR BI-R TALLY-BI @ CONTAINED-IN IF - ^GO @ TALLY-GO @ CONTAINED-IN IF + GO^ @ TALLY-GO @ CONTAINED-IN IF BI-R INSTRUCTION AND DAT-R = IF BA COMPATIBLE? IF TALLY:|R this +DISS THEN THEN THEN THEN ; \ Match the tally to a (current) fixup from reverse pifu. : TRY-FIR BI-R TALLY-BI @ CONTAINED-IN IF - ^GO @ TALLY-GO @ CONTAINED-IN IF + GO^ @ TALLY-GO @ CONTAINED-IN IF TALLY:|R this +DISS THEN THEN ; ( Define a fixup-from-reverse by BA BY BI and the FIXUP bits ) ( One size fits all, because of the character of the or-operations. ) ( bi and fixup are specified that last byte is lsb, such as you read it ) IS-A IS-FIR : FIR CHECK31 CREATE REVERSE-BYTES SWAP REVERSE-BYTES SWAP '%~ID. 'DIS-FIR 'TRY-FIR NEW-PIFU - PRO-GO @ ^GO ! DOES> REMEMBER FIXUP-REVERSE ; + PRO-GO @ GO^ ! DOES> REMEMBER FIXUP-REVERSE ; ( Print a disassembly for the current, 'data-fixup from reverse' pifu ) : .DFIR INSTRUCTION BI-R AND SHT RSHIFT REVERSE-BYTES CORRECT-R U. %ID. ; \ Disassemble the current, data fixup from reverse pifu. : DIS-DFIR BI-R TALLY-BI @ CONTAINED-IN IF BA COMPATIBLE? IF - TALLY:|R this +DISS THEN THEN ; + GO^ @ TALLY-GO @ CONTAINED-IN IF + TALLY:|R this +DISS THEN THEN THEN ; ( Define a data fixup-from-reverse by BA BY BI and LEN to shift ) ( One size fits all, because of the character of the or-operations. ) ( bi and fixup are specified that last byte is lsb, such as you read it ) IS-A IS-DFIR : DFIR CHECK31 CREATE SWAP REVERSE-BYTES SWAP '.DFIR 'DIS-DFIR 'NOOP NEW-PIFU - DOES> ( data -- )REMEMBER FIXUP-N-REVERSE ; + PRO-GO @ GO^ ! DOES> ( data -- ) REMEMBER FIXUP-N-REVERSE ; ( ------------- PIFU's : COMMAER ----------------------------------------) ( Bookkeeping for a commaer that is the current pifu ) @@ -574,7 +577,8 @@ IS-A IS-COMMA : COMMAER CREATE BUILD-COMMA DOES> REMEMBER COMMA ; \ Show the disassembled instruction with arbitrary data. : .DISS-AUX DISS DO-BAG I @ DUP IS-COMMA OVER IS-DFI OR OVER IS-DFIs OR IF I DISS - - ( Whatever) . THEN ID. + \ DROP 0 ( Whatever) . THEN ID. + 1 CELLS / 4 * ( Whatever) . THEN ID. LOOP-BAG CR ; ( DISS-VECTOR can be redefined to generate testsets) VARIABLE DISS-VECTOR ['] .DISS-AUX DISS-VECTOR ! @@ -688,11 +692,11 @@ CREATE SOMEMORE ( Catch current state in `` _""_ '' ) : >_""_ '_""_ PIFU'! TALLY-BI @ BI^ ! TALLY-BY @ BY^ ! - TALLY-BA @ BA^ ! ISL @ CNT^ ! ; + TALLY-BA @ BA^ ! TALLY-GO @ GO^ ! ISL @ CNT^ ! ; ( Restore current state from `` _""_ '' ) : _""_> '_""_ PIFU'! BI^ @ TALLY-BI ! BY^ @ TALLY-BY ! - BA^ @ TALLY-BA ! CNT^ @ ISL ! ; + BA^ @ TALLY-BA ! GO^ @ TALLY-GO ! CNT^ @ ISL ! ; ( Show all possible completions of the current partially completed ) ( instruction. ) diff --git a/asi386.frt b/asi386.frt index 62ef291..5910b6b 100644 --- a/asi386.frt +++ b/asi386.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: asi386.frt,v 4.33 2018/10/09 22:13:55 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) \ For the redefinitions in connection with SIB. diff --git a/asi586.frt b/asi586.frt index 62ef291..aa6032c 100644 --- a/asi586.frt +++ b/asi586.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: asi586.frt,v 4.33 2018/10/09 22:13:55 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) \ For the redefinitions in connection with SIB. diff --git a/asi86.frt b/asi86.frt index 5b53663..f0d7156 100644 --- a/asi86.frt +++ b/asi86.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: asi86.frt,v 4.14 2018/10/09 22:13:55 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ASSEMBLER DEFINITIONS diff --git a/asipentium.frt b/asipentium.frt index e66f84c..cf1feea 100644 --- a/asipentium.frt +++ b/asipentium.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: asipentium.frt,v 1.12 2014/02/28 17:22:36 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ASSEMBLER DEFINITIONS HEX diff --git a/asnowrap.frt b/asnowrap.frt index 3166bb7..ca83075 100644 --- a/asnowrap.frt +++ b/asnowrap.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: asnowrap.frt,v 1.5 2004/05/21 11:19:31 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/aswrap.frt b/aswrap.frt index fd9fda0..c640ab2 100644 --- a/aswrap.frt +++ b/aswrap.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: aswrap.frt,v 1.22 2014/10/21 22:59:47 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/bag.frt b/bag.frt index c57e1a2..c25d7de 100644 --- a/bag.frt +++ b/bag.frt @@ -1,3 +1,3 @@ - ( $Id$ ) + ( $Id: bag.frt,v 1.3 2004/06/19 11:56:51 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) Burned down, now sits in library. diff --git a/bugs.txt b/bugs.txt index 726504a..9308106 100644 --- a/bugs.txt +++ b/bugs.txt @@ -1,4 +1,18 @@ -$Id$ +$Id: bugs.txt,v 1.6 2019/10/18 18:53:50 albert Exp $ + +*1.Make gsetalpha is different in 32 and 64 bit mode. +Almost nothing works in 64 bits. +Solution: log of 2019 oct 14 & oct 16 + +*2. J, gives a completion containing n| which is wrong. + Observation: n| sets the TALLY-GO to 0. + The reason show-completion did not save/restore TALLY-GO. + +----------------------------------------------------------- +OLD RANTS. + +Unsolved: + In the documentation there is a need to warn for redefinitions. The -dc- thingies should be generated with a automatic tool. @@ -8,7 +22,6 @@ MAKE-CUL should print symbolic names for ranges where possible There is some worry because QSORT can't handle empty ranges (or so it seems). - A lone EQU leads to a not unique warning in the second pass. If a label is defined using EQU the not-unique-message should be supressed. @@ -41,9 +54,6 @@ at priority 0 it would not. ------------------------ REPORTED --------------------------------- -The colorforth crew reports that there is a space missing after -RB, (resulting in collated comment RB,\ ) -Solution: end ID-NO() with a SPACE . ----------------------- AFTER 2018 ---------------------- Confirmed per 2018 sep 4 @@ -67,8 +77,6 @@ Rejected per 2018 sep 11 There is a problem around the disassembly of variables like base and h0 in rf751.asm -make gsetalpha is different in 32 and 64 bit mode. -Almost nothing works in 64 bits. rf751 gives a phase error on tib. This can be ignored. It is not understood either. It has nothing to do with the @@ -77,3 +85,14 @@ existance of a word TIB in the kernel of Forth. The greatest problem is that in fact the format of the data in the PIFU's is not documented. + +As per 2019 the J, no longer disassembles correctly. + +Bug in 64 bits ciasdis only: +As per 2019 oct 15 in the test example, the disassembly doesn't +try to find a nearby label. So START 1 + is a diff. + +As per 2019 oct 15 in the test example, on the 64 bit system +the rf751 example fails, because of V_base not defined. +The problem is identified as to be with the crawling of +rf751, so restricted to rfcrawl.cul diff --git a/cias.1 b/cias.1 index 10fdd4b..c1eab78 100644 --- a/cias.1 +++ b/cias.1 @@ -1,4 +1,4 @@ -.\" $Id$ +.\" $Id: cias.1,v 1.11 2016/05/13 15:49:23 albert Exp $ .TH cias "1" "Jan 2015" "cias 1.1.0" DFW .SH "NAME" cias \- computer_intelligence_assembler_386 diff --git a/cias.frt b/cias.frt index e8c4eb7..b141b56 100644 --- a/cias.frt +++ b/cias.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: cias.frt,v 1.1 2004/05/23 09:50:08 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/ciasdis.1 b/ciasdis.1 index 10fdd4b..f7a08b4 100644 --- a/ciasdis.1 +++ b/ciasdis.1 @@ -1,4 +1,4 @@ -.\" $Id$ +.\" $Id: ciasdis.1,v 1.11 2016/05/13 15:49:23 albert Exp $ .TH cias "1" "Jan 2015" "cias 1.1.0" DFW .SH "NAME" cias \- computer_intelligence_assembler_386 diff --git a/ciasdis.frt b/ciasdis.frt index e53ad7b..1f7347c 100644 --- a/ciasdis.frt +++ b/ciasdis.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: ciasdis.frt,v 1.39 2019/10/18 16:33:41 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) @@ -30,6 +30,7 @@ WANT OLD: WANT $= WANT class WANT W/O \ -------------------------------------------------------------- +INCLUDE version.frt INCLUDE tools.frt INCLUDE asgen.frt INCLUDE aswrap.frt @@ -156,7 +157,7 @@ WANT DUMP \ The name determines what to do. : MAIN \ Defeat the correction for the bizarre byte manipulation, if not wanted. - RESTORE-ALL DEFAULT-SECTION HANDLE-ARG CHANGE-PROMPT + RESTORE-ALL DEFAULT-SECTION HANDLE-ARG \ CHANGE-PROMPT DUP 0 = IF DROP INTERACTIVE ELSE DUP 1 = IF DROP cias ELSE DUP 2 = IF DROP cidis diff --git a/cidis.frt b/cidis.frt index 79ada9d..b6460cb 100644 --- a/cidis.frt +++ b/cidis.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: cidis.frt,v 1.1 2004/05/23 09:52:51 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/class.frt b/class.frt index c57e1a2..d6fa0d3 100644 --- a/class.frt +++ b/class.frt @@ -1,3 +1,3 @@ - ( $Id$ ) + ( $Id: class.frt,v 1.2 2018/10/11 14:44:21 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) Burned down, now sits in library. diff --git a/control b/control index af71d05..5b9dbaa 100644 --- a/control +++ b/control @@ -1,16 +1,16 @@ Package: ciasdis -Version: 1.0 +Version: 2.0 Section: devel Priority: optional Architecture: all -Suggests: ciforth-doc +Suggests: lina Conflicts: Homepage: http://home.hccnet.nl/a.w.m.van.der.horst/ciasdis.html Replaces: Installed-Size: Maintainer: Albert van der Horst Description: A reverse engineering assembler/disassembler - The package ciasdis contains an assembler-disassembler + The package ciasdis contains an i86 assembler-disassembler combination that allows to reassemble to a byte-for-byte same binary. This is useful for modifying programs where the source was lost, analysing viruses, etc. and general diff --git a/crawl.frt b/crawl.frt index 4555d2a..77764e0 100644 --- a/crawl.frt +++ b/crawl.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: crawl.frt,v 1.38 2018/07/24 11:44:49 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/cul.5 b/cul.5 index f8694e6..6261f54 100644 --- a/cul.5 +++ b/cul.5 @@ -1,4 +1,4 @@ -.\" $Id$ +.\" $Id: cul.5,v 1.16 2016/05/13 15:49:23 albert Exp $ .TH cul "5" "jan 2015" "cul 0.1.15" DFW .SH "NAME" cul \- consult file format for diff --git a/debian.mak b/debian.mak index da3562a..818198d 100644 --- a/debian.mak +++ b/debian.mak @@ -1,4 +1,4 @@ -# $Id$ +# $Id: debian.mak,v 1.1 2016/05/21 20:05:57 albert Exp $ # Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License # # This defines the usage of ciforth to build assemblers and reverse diff --git a/decsharp.frt b/decsharp.frt index fbfc18e..e2dc75b 100644 --- a/decsharp.frt +++ b/decsharp.frt @@ -1,4 +1,4 @@ - ( $Id$ ) + ( $Id: decsharp.frt,v 1.2 2004/06/19 11:36:30 albert Exp $ ) ( Copyright{2004}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/dosheader.cul b/dosheader.cul index 9bdc1c5..8a5b86e 100644 --- a/dosheader.cul +++ b/dosheader.cul @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: dosheader.cul,v 1.1 2018/10/11 12:47:15 albert Exp $ ) ( Copyright{2004}: Albert van der Horst, HCC FIG Holland by GNU Public License) \ Consult file for ciasdis. (See man 5 cul). diff --git a/elf.cul b/elf.cul index f4bbdff..d69e8f3 100644 --- a/elf.cul +++ b/elf.cul @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: elf.cul,v 1.9 2018/10/11 12:35:37 albert Exp $ ) ( Copyright{2004}: Albert van der Horst, HCC FIG Holland by GNU Public License) 0 -ORG- \ Preliminary, to analyse header diff --git a/elf64.cul b/elf64.cul index f4acd02..660068d 100644 --- a/elf64.cul +++ b/elf64.cul @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: elf64.cul,v 1.1 2018/10/11 12:37:29 albert Exp $ ) ( Copyright{2004}: Albert van der Horst, HCC FIG Holland by GNU Public License) \ The folling is intended for a disassembler running in 32 bits mode. diff --git a/exeheader.cul b/exeheader.cul index 27158a3..d96090f 100644 --- a/exeheader.cul +++ b/exeheader.cul @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: exeheader.cul,v 1.5 2005/03/18 16:00:58 albert Exp $ ) ( Copyright{2004}: Albert van der Horst, HCC FIG Holland by GNU Public License) \ Consult file for ciasdis. (See man 5 cul). diff --git a/labelas.frt b/labelas.frt index 72dd700..4f478c5 100644 --- a/labelas.frt +++ b/labelas.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: labelas.frt,v 1.21 2018/07/24 11:45:24 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/labeldis.frt b/labeldis.frt index 6420a7e..04432d6 100644 --- a/labeldis.frt +++ b/labeldis.frt @@ -1,4 +1,4 @@ - ( $Id$ ) + ( $Id: labeldis.frt,v 1.95 2018/07/24 11:48:07 albert Exp $ ) ( Copyright{2004}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/linacrawl.cul b/linacrawl.cul index e7ea421..b4fce2e 100644 --- a/linacrawl.cul +++ b/linacrawl.cul @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: linacrawl.cul,v 1.14 2019/10/18 16:33:41 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) @@ -92,7 +92,7 @@ H_ENVIRONMENT DUP 10 + -dl- H_FORTH DUP 10 + -dl- MAKE-CUL -EXIT +\ EXIT CLEANUP-SECTIONS MAKE-CUL PLUG-HOLES diff --git a/log.txt b/log.txt index a2b392b..b6b154e 100644 --- a/log.txt +++ b/log.txt @@ -1,68 +1,3 @@ - -Old notes from when? - ALL DONE! - - -Adding data to the assembler - -Up till now, the assembler can only generate code. - -For data we could propose: -(The all too familiar "Define Byte" of before.) - - d$ ^[ &A 0 &B 0 &[ ^J 83 - d$ "we gaan er voor" ^J ^M " and more" - db 17 4F 17 1B 01 13 - dw 17F6 17F9 - dl 7898,ABCD 7898,ABCD 7898,ABCD - dq 7898,ABCD,7898,ABCD - -This cannot be defined in the assembler proper, because -the endianess comes into play. It must use the W, L, -of the underlying specific assembler module. - -The first thing to do is to make a range specifying labelstruct. - -This has a payload of a structured word: - end of range, - xt of disassembler, - target address of first word - - -F0000 F8000 -DS- -Old notes from when? -Elementary : -*Allow to assemble to a buffer that can be dumped into a binary file. -*switch the here pointer - -Secondary : - Allow to specify the basic look of the disassembly - * code range - * chars range - * bytes range - * cells range - ?? - addresses range ?? postponed ?? - -Note those range should be sorted. So they must be in the same table, -in ascending order. They can be easily checked for overlaps. - -* add d$ / db -* have a list of labels - a set of dea's , executing a dea reveals the labels value -* look up a label into the labelset -* identfiy a commaer that must be looked up. -* discriminate between relative and absolute labels. -* begin and if lines that start an Assembler Structure -* allow the buffer disassembled to be at an offset address - - -* nice if labels of entry points are garanteed to be named. -* collapsing unnamed similar intervals into one. -* starting at nice boundaries like multiples of 10 - -The above: ALL DONE ! - - \\\\\\\\\\\\\\\\\\\ 2016 may 24 : look into this : 1. Fill in execution tokens handled by NEW-PIFU @@ -277,3 +212,91 @@ This was sufficient success to check in ps.frt 4.3. I must cleanup, throwing away experiments and superfluous files. A terrible cleanup has been done, with lot of stuf sorted into subdirectories. + +One year later! + +2019 oct 11 +The plan : +- cleanup to the point that all targets succeed with 32 and 64 bit. +- a debian release for 64 bit. +What doesn't work: + target rf751 + gset* , but mostly it is constants that are off +What works is for 32 and 64 bits: + make testasses + +2019 oct 13 +The problem with the differences is that they are not problematic +1. START 1+ versus :L04FF een gegenereerd label +2. V_base defined another time, leading to + ( 0804,87AF ) :V_base :V_base dl 0A +3. + +What is a real bug is that the target rf751.asm fails for 64 bit. +On 32 bit we get a phase error on tib. This has nothing to do +with the existance of TIB in forth itself. + +make regressiontest FORTH=/usr/bin/lina +succeeds. Maybe a phase error but that is all. + +make regressiontest +use the local lina. That passes testasses. +It fails the gsetall target, constants are printed incorrectly +such as C instead of 18. + +2019 oct 14 +The random data was in fact the offset of the commaer in the disassembly. +Divide by the cell size and multiply by 4 gives the same result on +64 bits. Now gsetall works for 64 bit and only fails on 32 bit for +gsetalpha because CALL_PAL requires a 64 bit constant. + +The target rf751.asm still fails on 64 bits, not on 32 bits. +However with a proper cul file the 64 can disassemble rf751 +correctly. Also it can assemble it correctly. +So the problem is in crawling the rf751 executable. +This is not a priority. + +2019 oct 15 +label PASS32_5_3_0 is is a version where all tests pass for +the ciasdis such as compile using the official 5.3.0 release. +The test comparison for gsetalpha is incorrect but passes. +An improvement is made to asgen.frt such that lina as used +in this directory works: AMDX86 ciforth beta 2019Feb04 +The test comparison for gsetalpha is corrected to work with +64 bits. +2019 oct 16 +asalpha.frt used a hanging out bit. It is now replaced by the +GO mechanism which required extending that in asgen.frt. +Test for asalpha now pass on 32 bits. +2019 oct 17 +There is an asAMD.frt added and a target ciasdis64 in the Makefile. +The label PASS32_5_3_0 is moved to the new versions. + +2019 oct 18 +This version of ciasdis can be released. +This version 2.0 is a extensable assembler/ disassembler for Intel 86 +The binary is intended for 32 bit i86. It can handle 16 bit segments +so it can be used for 8086. After loading asAMD.frt it can handle +64 bits. You can do complicated disassemblies -- such as wirlpools +of code, data and text -- using scripts; extracting names from the +binary to show up in disassemblies. +As an example a compiler rf751 is disassembled. It has +over 200 transition between code, data and text segments. +The debian archive comes for two architectures i386 and AMD64. + +Sources are in github. Compilation of the 32 bit version requires +lina 32 bits 5.3.0 (or compatible version of ciforth for the +other 32 bit Intel based OS's). +Compilation of the 64 bit version requires lina64 bits beta of 2017oct29. + +The tag PASS32 is moved to the latest checkedin version of CVS. +Introduced a file with CIASVERSION that figures in ENVIRONMENT. +The target srczip works but it is not clear that it is any good, +in particular some files are missing such as asalpha.frt. +The completion for J, was wrong, because TALLY-GO was not saved in +SHOW-COMPLETION. Fixed. + +2019 oct 20 +Clean up of text files in preparation of copying to github. +2019 oct 21 +THose updated text are added and form release 2.0.0 diff --git a/ps.frt b/ps.frt index c7cc048..7edd562 100644 --- a/ps.frt +++ b/ps.frt @@ -1,4 +1,4 @@ -( $Id$) +( $Id: ps.frt,v 4.5 2018/10/24 11:14:05 albert Exp $) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Generate postscript data sheet. ) ( Instructions to compare with, last byte 0..FF ) diff --git a/rfcrawl.cul b/rfcrawl.cul index a250898..314854b 100644 --- a/rfcrawl.cul +++ b/rfcrawl.cul @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: rfcrawl.cul,v 1.10 2016/05/26 19:18:31 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/rules b/rules index 6033bd4..50a8386 100755 --- a/rules +++ b/rules @@ -1,5 +1,5 @@ #!/usr/bin/make -f -# $Id$ +# $Id: rules,v 1.4 2010/08/22 14:15:41 albert Exp $ # Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License # # This is the debian/rules , in behalf of debhelper, for ciasdis diff --git a/struct.frt b/struct.frt index 26a9bac..89c5100 100644 --- a/struct.frt +++ b/struct.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: struct.frt,v 1.2 2004/06/19 11:36:30 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/test.mak b/test.mak index 8139885..88c22b0 100644 --- a/test.mak +++ b/test.mak @@ -1,4 +1,4 @@ -# $Id$ +# $Id: test.mak,v 1.22 2004/09/10 06:49:33 albert Exp $ # Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License # diff --git a/testcmp/gset80 b/testcmp/gset80 index 8945e88..da321e0 100644 --- a/testcmp/gset80 +++ b/testcmp/gset80 @@ -1,7 +1,7 @@ COMES JAN MOV M'| C| LXI DE| 1223 IX, - JMP 873C X, MOV M'| C| LXI DE| 1223 IX, JMP 873C X, HLT + JMP BAD X, MOV M'| C| LXI DE| 1223 IX, JMP BAD X, HLT RET NOP CC, Y| LS| 10 X, diff --git a/testcmp/gsetalpha b/testcmp/gsetalpha index f213371..25c30ab 100644 --- a/testcmp/gsetalpha +++ b/testcmp/gsetalpha @@ -28,18 +28,6 @@ ECB Rzb ECB R7b ECB R0b CALL_PAL 8 n#| -CALL_PAL 8 c#| Rza -CALL_PAL 8 c#| R7a -CALL_PAL 8 c#| R0a -CALL_PAL 8 w#| Rza Rzb -CALL_PAL 8 w#| Rza R7b -CALL_PAL 8 w#| Rza R0b -CALL_PAL 8 w#| R7a Rzb -CALL_PAL 8 w#| R7a R7b -CALL_PAL 8 w#| R7a R0b -CALL_PAL 8 w#| R0a Rzb -CALL_PAL 8 w#| R0a R7b -CALL_PAL 8 w#| R0a R0b AMASK, #| C b#| Rzc AMASK, #| C b#| R7c AMASK, #| C b#| R0c diff --git a/tools.frt b/tools.frt index 03b5bff..626ba30 100644 --- a/tools.frt +++ b/tools.frt @@ -1,4 +1,4 @@ -( $Id$ ) +( $Id: tools.frt,v 1.5 2016/05/24 01:24:34 albert Exp $ ) ( Copyright{2000}: Albert van der Horst, HCC FIG Holland by GNU Public License) ( Uses Richard Stallmans convention. Uppercased word are parameters. ) diff --git a/versions.txt b/versions.txt index 3fe3a91..37fe890 100644 --- a/versions.txt +++ b/versions.txt @@ -2,6 +2,18 @@ Functional stages. Bugs removed are not mentionned. For a more elaborate log see the log of ciforth. MILESTONES + +The following tags are official and eligible for a copy to github. + +REL-2-0-0: release 2.0.0 also on github. + +PASS32_5_3_0 : Is to be compiled 32 bit with any ciforth 5.3.0 , + 64 bit with 2017oct beta. + lina32 : passes the regression test as such. + lina64 beta 2019feb04 : Passes test-target resgressiontest64 + [test.bin has a different labelname in test.bin, considered cosmetic. + rf751.asm passes assembly/disassembly, but failed in crawling. ] + REL-1-1-0: elaborate test for lina32 5.3.0, assemblers work voor lina64 grand cleanup LINA531_OK : with lina32 5.3.1 the regressiontest target succeeds.