├── .gitignore ├── Makefile ├── README.md ├── config11 ├── Makefile ├── config11.c └── config11.txt ├── converters ├── Makefile ├── asc │ ├── Makefile │ ├── asc.c │ └── asc.txt ├── cosy │ ├── Makefile │ ├── cosy.c │ └── cosy.txt ├── decsys │ ├── Makefile │ └── decsys.c ├── dtos8cvt │ ├── Makefile │ ├── dtos8cvt.c │ └── dtos8cvt.txt ├── fsio │ ├── Changes │ ├── Makefile │ ├── declib.c │ ├── declib.h │ ├── dos11.c │ ├── dos11.h │ ├── dosmt.c │ ├── dosmt.h │ ├── fsio-dos11.1 │ ├── fsio-dosmt.1 │ ├── fsio-os8.1 │ ├── fsio-rt11.1 │ ├── fsio.1 │ ├── fsio.c │ ├── fsio.h │ ├── fsio.txt │ ├── fsioSimh.txt │ ├── local.c │ ├── os8.c │ ├── os8.h │ ├── rt11.c │ ├── rt11.h │ ├── tape.c │ └── tape.h ├── gt7cvt │ ├── Makefile │ └── gt7cvt.c ├── hpconvert │ ├── Makefile │ └── hpconvert.c ├── indent │ ├── Makefile │ └── indent.c ├── littcvt │ ├── Makefile │ └── littcvt.c ├── m8376 │ ├── Makefile │ └── m8376.c ├── mksimtape │ ├── Makefile │ ├── mksimtape.c │ └── mksimtape.txt ├── mt2tpc │ ├── Makefile │ └── mt2tpc.c ├── mtcvt23 │ ├── Makefile │ ├── mtcvtv23.c │ └── mtcvtv23.txt ├── mtcvtfix │ ├── Makefile │ └── mtcvtfix.c ├── mtcvtodd │ ├── Makefile │ └── mtcvtodd.c ├── noff │ ├── Makefile │ └── noff.c ├── sfmtcvt │ ├── Makefile │ └── sfmtcvt.c ├── strrem │ ├── Makefile │ └── strrem.c ├── strsub │ ├── Makefile │ └── strsub.c ├── tar2mt │ ├── Makefile │ ├── tar2mt.c │ └── tar2mt.txt ├── tp512cvt │ ├── Makefile │ └── tp512cvt.c └── tpc2mt │ ├── Makefile │ └── tpc2mt.c ├── crossassemblers ├── Makefile ├── hpasm │ ├── Makefile │ └── hpasm.c ├── macro1 │ ├── Makefile │ └── macro1.c ├── macro11 │ ├── .indent.pro │ ├── CHANGES │ ├── LICENSE │ ├── Makefile │ ├── README │ ├── TODO │ ├── assemble.c │ ├── assemble.h │ ├── assemble_aux.c │ ├── assemble_aux.h │ ├── assemble_globals.c │ ├── assemble_globals.h │ ├── dumpobj.c │ ├── dumpobj.dsp │ ├── extree.c │ ├── extree.h │ ├── listing.c │ ├── listing.h │ ├── macro11.c │ ├── macro11.dsp │ ├── macro11.dsw │ ├── macro11.h │ ├── macros.c │ ├── macros.h │ ├── make-git-info │ ├── mlb-rsx.c │ ├── mlb.c │ ├── mlb.h │ ├── object.c │ ├── object.h │ ├── parse.c │ ├── parse.h │ ├── rad50.c │ ├── rad50.h │ ├── rept_irpc.c │ ├── rept_irpc.h │ ├── stream2.c │ ├── stream2.h │ ├── symbols.c │ ├── symbols.h │ ├── tests │ │ ├── RunTests │ │ ├── incl.mac │ │ ├── test-asciz.lst.ok │ │ ├── test-asciz.mac │ │ ├── test-backpatch.lst.ok │ │ ├── test-backpatch.mac │ │ ├── test-bsl-mac-arg.lst.ok │ │ ├── test-bsl-mac-arg.mac │ │ ├── test-complex-reloc.mac │ │ ├── test-complex-reloc.objd.ok │ │ ├── test-endm.lst.ok │ │ ├── test-endm.mac │ │ ├── test-impword.lst.ok │ │ ├── test-impword.mac │ │ ├── test-include.lst.ok │ │ ├── test-include.mac │ │ ├── test-jmp.lst.ok │ │ ├── test-jmp.mac │ │ ├── test-locals.lst.ok │ │ ├── test-locals.mac │ │ ├── test-macro-comma.lst.ok │ │ ├── test-macro-comma.mac │ │ ├── test-prec.lst.ok │ │ ├── test-prec.mac │ │ ├── test-psect.mac │ │ ├── test-rad50.lst.ok │ │ ├── test-rad50.mac │ │ ├── test-undef.lst.ok │ │ ├── test-undef.mac │ │ ├── test-word-comma.lst.ok │ │ └── test-word-comma.mac │ ├── tools │ │ ├── checker.pl │ │ └── varrec.c │ ├── util.c │ └── util.h ├── macro7 │ ├── Makefile │ └── macro7.c └── macro8x │ ├── Makefile │ └── macro8x.c ├── extracters ├── Makefile ├── backup │ ├── backup.c │ ├── backup.h │ └── backup.txt ├── ckabstape │ ├── Makefile │ └── ckabstape.c ├── cpytap │ ├── Makefile │ ├── cpytap.c │ ├── cpytap.txt │ ├── defs.h │ ├── tap.h │ ├── tapeio.c │ └── tapeio.h ├── dbtap │ ├── Makefile │ ├── dbtap.c │ ├── dbtap.txt │ ├── defs.h │ ├── dos11.c │ ├── dos11.h │ ├── tap.h │ ├── tapeio.c │ └── tapeio.h ├── mmdir │ ├── Makefile │ └── mmdir.c ├── mtdump │ ├── Makefile │ ├── mtdump.c │ └── mtdump.txt ├── ods2 │ ├── Makefile │ ├── access.c │ ├── access.h │ ├── access.h.bak │ ├── build.com │ ├── cache.c │ ├── cache.c.bak │ ├── cache.h │ ├── descrip.h │ ├── device.c │ ├── direct.c │ ├── direct.h │ ├── fibdef.h │ ├── ods2.c │ ├── ods2.c.bak │ ├── ods2_readme.txt │ ├── phyio.h │ ├── phynt.c │ ├── phyos2.c │ ├── phyvms.c │ ├── rms.c │ ├── rms.h │ ├── ssdef.h │ ├── vmstime.c │ └── vmstime.h ├── rawcopy │ ├── Makefile │ ├── RawCopy.c │ └── RawCopy.txt ├── rawtap │ ├── Makefile │ ├── defs.h │ ├── rawtap.c │ ├── rawtap.txt │ ├── tap.h │ ├── tapeio.c │ └── tapeio.h ├── rstsflx │ ├── BUGS │ ├── HISTORY │ ├── LICENSE │ ├── Makefile │ ├── Makefile.dos │ ├── README │ ├── absio.h │ ├── borabsio.c │ ├── diskio.c │ ├── diskio.h │ ├── djabsio.c │ ├── doalloc.c │ ├── doalloc.h │ ├── doclean.c │ ├── doclean.h │ ├── docomp.c │ ├── docomp.h │ ├── dodelete.c │ ├── dodelete.h │ ├── dodir.c │ ├── dodir.h │ ├── dodump.c │ ├── dodump.h │ ├── doget.c │ ├── doget.h │ ├── dohook.c │ ├── dohook.h │ ├── doident.c │ ├── doident.h │ ├── doinit.c │ ├── doinit.h │ ├── dolist.c │ ├── dolist.h │ ├── doprot.c │ ├── doprot.h │ ├── doput.c │ ├── doput.h │ ├── dorename.c │ ├── dorename.h │ ├── dorts.c │ ├── dorts.h │ ├── dosabsio.c │ ├── dosabsio.h │ ├── dosrxio.c │ ├── dotype.c │ ├── dotype.h │ ├── fdprm │ ├── fileio.c │ ├── fileio.h │ ├── filename.c │ ├── filename.h │ ├── fip.c │ ├── fip.h │ ├── fldef.h │ ├── flx.doc │ ├── flx.h │ ├── flx.pdf │ ├── linuxabsio.c │ ├── platform.h │ ├── rstsflx.c │ ├── rstsflx.h │ ├── rtime.c │ ├── rtime.h │ ├── scancmd.c │ ├── scancmd.h │ ├── silfmt.h │ ├── unxabsio.c │ └── version.h ├── sdsdump │ ├── Makefile │ └── sdsdump.c └── tpdump │ ├── Makefile │ └── tpdump.c └── putr ├── putr.com ├── putr.txt └── readme.txt /.gitignore: -------------------------------------------------------------------------------- 1 | \#* 2 | *~ 3 | *.bak 4 | *.d 5 | *.dep 6 | *.o 7 | *.obj 8 | *.exe 9 | *.user 10 | *.pch 11 | *.ncb 12 | *.suo 13 | *.swp 14 | [Dd]ebug*/ 15 | [Rr]elease*/ 16 | config11/config11 17 | converters/asc/asc 18 | converters/cosy/cosy 19 | converters/decsys/decsys 20 | converters/dtos8cvt/dtos8cvt 21 | converters/fsio/fsio 22 | converters/gt7cvt/gt7cvt 23 | converters/hpconvert/hpconvert 24 | converters/indent/indent 25 | converters/littcvt/littcvt 26 | converters/m8376/m8376 27 | converters/mksimtape/mksimtape 28 | converters/mt2tpc/mt2tpc 29 | converters/mtcvt23/mtcvtv23 30 | converters/mtcvtfix/mtcvtfix 31 | converters/mtcvtodd/mtcvtodd 32 | converters/noff/noff 33 | converters/sfmtcvt/sfmtcvt 34 | converters/strrem/strrem 35 | converters/strsub/strsub 36 | converters/tar2mt/tar2mt 37 | converters/tp512cvt/tp512cvt 38 | converters/tpc2mt/tpc2mt 39 | crossassemblers/hpasm/hpasm 40 | crossassemblers/macro1/macro1 41 | crossassemblers/macro11/macro11 42 | crossassemblers/macro11/dumpobj 43 | crossassemblers/macro11/git-info.h 44 | crossassemblers/macro7/macro7 45 | crossassemblers/macro8x/macro8x 46 | extracters/ckabstape/ckabstape 47 | extracters/cpytap/cpytap 48 | extracters/dbtap/dbtap 49 | extracters/mmdir/mmdir 50 | extracters/mtdump/mtdump 51 | extracters/rawcopy/RawCopy 52 | extracters/rawtap/rawtap 53 | extracters/rstsflx/flx 54 | extracters/sdsdump/sdsdump 55 | extracters/tpdump/tpdump 56 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | SUBDIRS=config11 converters crossassemblers extracters 9 | 10 | .PHONY: all clean install uninstall 11 | 12 | # Omitted: putr: has no sources. 13 | all: 14 | for subdir in $(SUBDIRS); do \ 15 | $(MAKE) -C $$subdir CFLAGS="$(CFLAGS)" BIN="$(BIN)" INSTALL="$(INSTALL)" CC="$(CC)"; \ 16 | done 17 | 18 | clean install uninstall: 19 | for subdir in $(SUBDIRS); do \ 20 | $(MAKE) -C $$subdir CFLAGS="$(CFLAGS)" BIN="$(BIN)" INSTALL="$(INSTALL)" CC="$(CC)" $@; \ 21 | done 22 | -------------------------------------------------------------------------------- /config11/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=config11 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /config11/config11.txt: -------------------------------------------------------------------------------- 1 | Config11 is a program for calculating the floating address space layout of 2 | a PDP-11 or VAX. 3 | 4 | Config11 is an interactive program. When started, it repeatedly asks for 5 | the names of controllers and the numbers of instances: 6 | 7 | > config11 8 | Name: UDA50 9 | Number: 2 10 | Name: DZ11 11 | Number: 2 12 | Name: 13 | 14 | To end input, simply type ENTER to the NAME: prompt. Config11 will then 15 | print out the complete floating address table for the known Unibus and 16 | Qbus devices. 17 | 18 | -------------------------------------------------------------------------------- /converters/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | SUBDIRS=asc cosy decsys dtos8cvt fsio gt7cvt hpconvert indent littcvt m8376 \ 9 | mksimtape mt2tpc mtcvt23 mtcvtfix mtcvtodd noff sfmtcvt strrem strsub \ 10 | tar2mt tp512cvt tpc2mt 11 | 12 | .PHONY: all clean install uninstall 13 | 14 | all: 15 | for subdir in $(SUBDIRS); do \ 16 | $(MAKE) -C $$subdir CFLAGS="$(CFLAGS)" BIN="$(BIN)" INSTALL="$(INSTALL)" CC="$(CC)"; \ 17 | done 18 | 19 | clean install uninstall: 20 | for subdir in $(SUBDIRS); do \ 21 | $(MAKE) -C $$subdir CFLAGS="$(CFLAGS)" BIN="$(BIN)" INSTALL="$(INSTALL)" CC="$(CC)" $@; \ 22 | done 23 | -------------------------------------------------------------------------------- /converters/asc/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=asc 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/asc/asc.txt: -------------------------------------------------------------------------------- 1 | ASC is a simple utility for converting text files (delimited with 2 | \r, \n, or \r\n) to Windows format (\r\n delimited), Unix format 3 | (\n delimited) or Mac format (\r delimited). 4 | 5 | ASC is invoked from a DOS prompt with the command: 6 | 7 | > ASC {-m|u|w} file1 file2 ... 8 | 9 | The optional switch specifies Mac processing (-m), Unix processing 10 | (-u), or Windows processing (-w). If no switch is specified, Windows 11 | processing is performed. 12 | 13 | Each file is processed in turn. If the file is name.ext, the converted 14 | file is name.new. 15 | -------------------------------------------------------------------------------- /converters/cosy/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if don't suit 2 | # your environment 3 | TOOL=cosy 4 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 5 | BIN=/usr/local/bin 6 | INSTALL=install 7 | CC=gcc 8 | 9 | $(TOOL): $(TOOL).c 10 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 11 | 12 | .PHONY: clean install uninstall 13 | 14 | clean: 15 | rm -f $(TOOL) 16 | 17 | install: $(TOOL) 18 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 19 | 20 | uninstall: 21 | rm -f $(BIN)/$(TOOL) 22 | -------------------------------------------------------------------------------- /converters/cosy/cosy.txt: -------------------------------------------------------------------------------- 1 | cosy manipulates files in the CDC1700 COSY format (note this is different from 2 | the CDC3000 series COSY format). COSY is a format used for containing card 3 | images as ASCII files using run length encoding of 3 or more spaces to reduce 4 | the amount of space required. Multiple card decks may be present in a single 5 | COSY file. File naming in the host environment makes use of the deck name 6 | which is optionally present in the CSY/ cards. For decompression, if a deck 7 | name is present, the host file will be named "deck_" otherwise it 8 | will be named "nnnnn.deck" where nnnnn is the position number of the deck 9 | within the COSY file. On compression, source files named "deck_" 10 | will result in the CSY/ deckname being filled in otherwise an empty name wil 11 | be used. 12 | 13 | To compress a COSY format file: 14 | 15 | cosy -c file ... 16 | 17 | To decompress a COSY format file: 18 | 19 | cosy -d 20 | 21 | When decompressing a COSY format file, CSY/ and END/ card images are removed 22 | from the output. On compression, a CSY/ card image is inserted at the start 23 | of the output and a END/ card is appended to the output. The resulting 24 | compressed file will be padded, with NULLs, to be a multiple of 384 bytes. 25 | -------------------------------------------------------------------------------- /converters/decsys/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=decsys 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/decsys/decsys.c: -------------------------------------------------------------------------------- 1 | /* This program converts a decimal listing to a DECtape file 2 | 3 | Copyright (c) 1993-2003, Robert M. Supnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of Robert M Supnik shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from Robert M Supnik. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | int main (int argc, char *argv[]) 33 | { 34 | int i, j, k, word; 35 | char *ppos, oname[256]; 36 | int fill[256] = { 0 }; 37 | FILE *ifile, *ofile; 38 | 39 | if ((argc < 2) || (argv[0] == NULL)) { 40 | printf ("Usage is: verb file [file...]\n"); 41 | exit (0); } 42 | 43 | for (i = 1; i < argc; i++) { 44 | strcpy (oname, argv[i]); 45 | if (ppos = strrchr (oname, '.')) strcpy (ppos, ".dtp"); 46 | else strcat (oname, ".dtp"); 47 | ifile = fopen (argv[i], "r"); 48 | if (ifile == NULL) { 49 | printf ("Error opening file: %s\n", argv[i]); 50 | exit (0); } 51 | ofile = fopen (oname, "wb"); 52 | if (ofile == NULL) { 53 | printf ("Error opening file: %s\n", oname); 54 | exit (0); } 55 | 56 | printf ("Processing file %s\n", argv[i]); 57 | fwrite (fill, sizeof (int), 256, ofile); 58 | for (j = 0;; j++) { 59 | k = fscanf (ifile, "%d", &word); 60 | if (k == EOF) break; 61 | // printf ("%06o\n", word); 62 | fwrite (&word, sizeof (int), 1, ofile); 63 | } 64 | fclose (ifile); 65 | fclose (ofile); 66 | } 67 | 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /converters/dtos8cvt/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=dtos8cvt 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/dtos8cvt/dtos8cvt.c: -------------------------------------------------------------------------------- 1 | /* This program converts an OS8 DECtape image to simulator format 2 | 3 | Copyright (c) 1993-2001, Robert M. Supnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of Robert M Supnik shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from Robert M Supnik. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #define BLKSIZ 129 32 | int main (int argc, char *argv[]) 33 | { 34 | int i, k; 35 | unsigned short buf[BLKSIZ]; 36 | char *ppos, oname[256]; 37 | FILE *ifile, *ofile; 38 | 39 | if ((argc < 2) || (argv[0] == NULL)) { 40 | printf ("Usage is: verb file [file...]\n"); 41 | exit (0); } 42 | 43 | for (i = 1; i < argc; i++) { 44 | strcpy (oname, argv[i]); 45 | if (ppos = strrchr (oname, '.')) strcpy (ppos, ".dt8"); 46 | else strcat (oname, ".dt8"); 47 | ifile = fopen (argv[i], "rb"); 48 | if (ifile == NULL) { 49 | printf ("Error opening file: %s\n", argv[i]); 50 | exit (0); } 51 | ofile = fopen (oname, "wb"); 52 | if (ofile == NULL) { 53 | printf ("Error opening file: %s\n", oname); 54 | exit (0); } 55 | 56 | printf ("Processing file %s\n", argv[i]); 57 | for (;;) { 58 | k = fread (buf, sizeof (short), BLKSIZ - 1, ifile); 59 | if (k == 0) break; 60 | for ( ; k < BLKSIZ; k++) buf[k] = 0; 61 | fwrite (buf, sizeof (short), BLKSIZ, ofile); 62 | } 63 | fclose (ifile); 64 | fclose (ofile); 65 | } 66 | 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /converters/dtos8cvt/dtos8cvt.txt: -------------------------------------------------------------------------------- 1 | dtos8cvt converts a PDP-8 DECtape image from OS/8 format to simulator format. 2 | 3 | OS/8 only uses 128 words out of 129 in a PDP-8 DECtape block. The simulator 4 | requires all 129 words, in order to simulate the actions of the hardware, and 5 | to deal with oddball software systems such as the PDP-8 Disk Monitor. 6 | 7 | dtos8cvt is invoked by 8 | 9 | dtos8cvt file1 file2 file3... 10 | 11 | Each file in turn is converted from OS/8 format to simulator format. The 12 | input file can have any extension; the converted file will have a .dt8 13 | extension. -------------------------------------------------------------------------------- /converters/fsio/Changes: -------------------------------------------------------------------------------- 1 | Changes Since Alpha Release: 2 | 3 | 1. mount: Fix memory leak when file system verification fails 4 | 5 | 2. dos11: Fix hang when parsing wildcard programmer number 6 | 7 | 3. Migrate to using GNU readline library for command line editing etc 8 | 9 | 4. local: Fix buffering so that local "type" command works 10 | 11 | 5. Add DOS-11 magtape support using file system type "dosmt" 12 | 13 | 6. newfs: Remove -a switch. Replace with "-t type" switch to allow more 14 | flexibility. The equivalent of "-a" is now "-t rl02". 15 | 16 | 12-Jun-19 17 | 18 | - Added support for sector interleave on RX01/RX02 drives 19 | 20 | - Now supports creating RX01-sized container files 21 | - Now works with RTFLX on TOPS-10 with RX02-sized container files 22 | (documentation updated) 23 | 24 | 25-Jun-19 25 | 26 | - Added support for OS/8 file systems on RX01, RX02 and RK05 drives using 27 | file system type "os8" 28 | 29 | - Added support for creating RT-11 file systems with additional space 30 | allocated to each directory entry 31 | 32 | 9-Jan-20 33 | 34 | - Merged change from tvrusso to fix compilation on FreeBSD 35 | 36 | -------------------------------------------------------------------------------- /converters/fsio/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 2 | #CFLAGS=-g -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 3 | DEFINES=-DDEBUG 4 | BIN=/usr/local/bin 5 | MAN=/usr/local/man/man1 6 | INSTALL=install 7 | CC=gcc 8 | 9 | EXECUTABLE=fsio 10 | SOURCES=fsio.c declib.c tape.c dos11.c rt11.c dosmt.c local.c os8.c 11 | INCLUDES=fsio.h declib.h tape.h dos11.h rt11.h dosmt.h os8.h 12 | LIBS=-lreadline 13 | MANPAGE=fsio.1 14 | MANPAGE_DOS=fsio-dos11.1 15 | MANPAGE_RT=fsio-rt11.1 16 | MANPAGE_DOSMT=fsio-dosmt.1 17 | MANPAGE_OS8=fsio-os8.1 18 | ARCHIVE=fsio.tgz 19 | 20 | RELEASEFILES=$(BIN)/$(EXECUTABLE) 21 | RELEASEFILES+=$(MAN)/$(MANPAGE) 22 | RELEASEFILES+=$(MAN)/$(MANPAGE_DOS) 23 | RELEASEFILES+=$(MAN)/$(MANPAGE_RT) 24 | RELEASEFILES+=$(MAN)/$(MANPAGE_DOSMT) 25 | RELEASEFILES+=$(MAN)/$(MANPAGE_OS8) 26 | RELEASEFILES+=./fsio.txt ./fsioSimh.txt 27 | 28 | $(EXECUTABLE): $(SOURCES) $(INCLUDES) Makefile 29 | $(CC) $(CFLAGS) $(DEFINES) -o $(EXECUTABLE) $(SOURCES) $(LIBS) 30 | 31 | .phony: clean install uninstall 32 | 33 | clean: 34 | rm -f $(EXECUTABLE) 35 | 36 | install: $(EXECUTABLE) $(MANPAGE) $(MANPAGE_DOS) $(MANPAGE_RT) 37 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(EXECUTABLE) $(BIN) 38 | mkdir -p $(MAN) 39 | $(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE) $(MAN) 40 | $(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE_DOS) $(MAN) 41 | $(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE_RT) $(MAN) 42 | $(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE_DOSMT) $(MAN) 43 | $(INSTALL) -p -m u=r,g=r,o=r $(MANPAGE_OS8) $(MAN) 44 | 45 | uninstall: 46 | rm -f $(BIN)/$(EXECUTABLE) 47 | rm -f $(MAN)/$(MANPAGE) 48 | rm -f $(MAN)/$(MANPAGE_DOS) 49 | rm -f $(MAN)/$(MANPAGE_RT) 50 | rm -f $(MAN)/$(MANPAGE_DOSMT) 51 | rm -f $(MAN)/$(MANPAGE_OS8) 52 | 53 | # This assumes that fsio has been "installed" on the current system 54 | archive: $(RELEASEFILES) 55 | tar czvPf $(ARCHIVE) $(RELEASEFILES) 56 | -------------------------------------------------------------------------------- /converters/fsio/declib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 John Forecast. All Rights Reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY JOHN FORECAST "AS IS" AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 20 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | #ifndef __DECLIB_H__ 29 | #define __DECLIB_H__ 30 | 31 | extern char rad50[]; 32 | extern char *month[]; 33 | extern char *Ascii[]; 34 | 35 | extern void r50Asc(uint16_t, char *); 36 | extern void r50AscNoSpace(uint16_t, char *); 37 | extern uint16_t ascR50(char *); 38 | extern char *dos11Date(uint16_t, char *); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /converters/fsio/fsio-dos11.1: -------------------------------------------------------------------------------- 1 | .TH FSIO-DOS11 1 "Jun 21,2019" "FFS I/O - DOS-11" 2 | .SH NAME 3 | fsio-dos11 \- Foreign File System I/O - DOS-11 4 | .br 5 | .SH DESCRIPTION 6 | \fBfsio\fP allows access to DOS-11 file systems using the file system type 7 | "\fIdos11\fP" 8 | .br 9 | .SH WILDCARD CHARACTERS 10 | The wildcard character \fI'*'\fP may be used to match filename, extension, 11 | group number and user number. Wildcard characters are only valid with the 12 | \fIdir\fP command. 13 | .br 14 | .SH NEWFS OPERATION 15 | \fInewfs\fP creates a blank RK05 image (2.5MB, 4800 blocks) with no UFD 16 | entries. 17 | .SH SET OPERATION 18 | The following \fIset\fP commands are supported: 19 | .br 20 | .TP 21 | .B "\fIuic\fP [group,user]" 22 | Sets the default UIC for file access (was [1,1] after mount). 23 | .br 24 | .RS 25 | .RS 26 | .B "\fIgroup\fP \- Group number (octal 1 - 377)" 27 | .br 28 | .B "\fIuser\fP \- User number (octal 1 - 377)" 29 | .br 30 | .RE 31 | .RE 32 | .TP 33 | .B "\fIufd\fP [group,user]" 34 | Creates an empty UFD and sets default UIC for file access. 35 | .br 36 | .RS 37 | .RS 38 | .B "\fIgroup\fP \- Group number (octal 1 - 377)" 39 | .br 40 | .B "\fIuser\fP \- User number (octal 1 - 377)" 41 | .br 42 | .RE 43 | .RE 44 | .SH SEE ALSO 45 | .BR fsio (1), 46 | .BR fsio-rt11 (1) 47 | .BR fsio-dosmt (1) 48 | .BR fsio-os8 (1) 49 | .SH AUTHOR 50 | John Forecast, 51 | .br 52 | -------------------------------------------------------------------------------- /converters/fsio/fsio-os8.1: -------------------------------------------------------------------------------- 1 | .TH FSIO-OS8 1 "Sep 218,2019" "FFS I/O - OS/8" 2 | .SH NAME 3 | fsio-os8 \- Foreign File System I/O - OS/8 4 | .br 5 | .SH DESCRIPTION 6 | \fBfsio\fP allows access to OS/8 file systems using the file system type 7 | "\fIos8\fP" 8 | .br 9 | .SH OS/8 PHYSICAL DISKS 10 | OS/8 uses a file system block size of 256 words and OS/8 devices are limited 11 | to 4095 blocks. Blocks 0 through 6 are reserved so the largest possible file 12 | is 4088 blocks long (1046528 words). Larger devices, for example the RK05, 13 | place multiple file systems on each physical device. 14 | 15 | .br 16 | OS/8 does not write any type of signature on the device and each device type 17 | has it's own partitioning scheme so the \fImount\fP command must use the 18 | "\fI-f type\fP switch so that \fBfsio\fP can determine the file system 19 | layout. \fBfsio\fP uses a set of heuristics to verify the integrity of 20 | the OS/8 file system(s) but it is quite possible for a random disk to pass 21 | these tests and later crash \fBfsio\fP. 22 | .SH MOUNT OPERATION 23 | \fImount\fP requires the "\fI-f type\fP" switch so that it can determine the 24 | type of the underlying disk (See NEWFS OPERATION below for details). 25 | .SH NEWFS OPERATION 26 | \fInewfs\fP creates an RK05 disk image with 2 file systems. If the 27 | "\fI-f type\fP" switch is present a different container file will be created 28 | depending on the type of the device specified: 29 | .br 30 | .RS 31 | .TP 32 | \fIrk05\fP \- RK05 image (2 file systems, 3248 blocks each) 33 | .br 34 | .TP 35 | \fIrx01\fP \- RX01 image (single file system, 494 blocks) 36 | .br 37 | .TP 38 | \fIrx02\fP \- RX02 image (single file system, 988 blocks) 39 | .br 40 | .RE 41 | 42 | Note that in order to use RX02 media the OS/8 system must have the device 43 | extensions kit installed. 44 | .br 45 | 46 | The "\fI-e extra\fP" switch, where "extra" is a number in the range 0 - 63, 47 | may be used to create file systems with "extra" additional information words 48 | available to each directory entry. By default, \fInewfs\fP will create file 49 | systems with 1 additional information word which will be used to hold the 50 | file creation date. If you do not want any additional information words 51 | use "\fI-e 0\fP". 52 | .br 53 | .SH SET OPERATION 54 | The following \fIset\fP commands are supported: 55 | .br 56 | .TP 57 | .B "\fIyear\fP n" 58 | .br 59 | 60 | All subsequent OS/8 file creations will include a creation date (if the file 61 | system was created with at least 1 additional information word). The date used 62 | will be the month and day of the month for today with the year "n" (where "n" 63 | is in the range 0 - 7). 64 | .br 65 | .TP 66 | .B "\fIyear\fP none" 67 | .br 68 | 69 | All subsequent OS/8 file creations will include a zero creation date (if the 70 | file system was created with at least 1 additional information word). This is 71 | the default state after mount. 72 | .br 73 | .SH SEE ALSO 74 | .BR fsio (1) 75 | .BR fsio-dos11 (1) 76 | .BR fsio-dosmt (1) 77 | .BR fsio-rt11 (1) 78 | .SH AUTHOR 79 | John Forecast, 80 | .br 81 | -------------------------------------------------------------------------------- /converters/gt7cvt/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=gt7cvt 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/hpconvert/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=hpconvert 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/indent/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=indent 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/littcvt/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=littcvt 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/littcvt/littcvt.c: -------------------------------------------------------------------------------- 1 | /* This program removes the 4 header bytes from a Litt tape 2 | 3 | Copyright (c) 1993-1999, Robert M. Supnik, Compaq Computer Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | ROBERT M SUPNIK, OR COMPAQ COMPUTER CORPORATION, BE LIABLE FOR ANY CLAIM, 19 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 21 | USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | Except as contained in this notice, the name of Robert M Supnik, or Compaq 24 | Computer Corporation, shall not be used in advertising or otherwise to 25 | promote the sale, use or other dealings in this Software without prior 26 | written authorization from both the author and Compaq Computer Corporation. 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #define FLPSIZ 65536 34 | int main (int argc, char *argv[]) 35 | { 36 | int i, k, bc; 37 | unsigned char buf[FLPSIZ]; 38 | char *ppos, oname[256]; 39 | FILE *ifile, *ofile; 40 | 41 | if ((argc < 2) || (argv[0] == NULL)) { 42 | printf ("Usage is: verb file [file...]\n"); 43 | exit (0); } 44 | 45 | for (i = 1; i < argc; i++) { 46 | strcpy (oname, argv[i]); 47 | if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new"); 48 | else strcat (oname, ".new"); 49 | ifile = fopen (argv[i], "rb"); 50 | if (ifile == NULL) { 51 | printf ("Error opening file: %s\n", argv[i]); 52 | exit (0); } 53 | ofile = fopen (oname, "wb"); 54 | if (ofile == NULL) { 55 | printf ("Error opening file: %s\n", oname); 56 | exit (0); } 57 | 58 | printf ("Processing file %s\n", argv[i]); 59 | fread (&bc, sizeof (int), 1, ifile); 60 | for (;;) { 61 | k = fread (buf, sizeof (char), FLPSIZ, ifile); 62 | if (k == 0) break; 63 | fwrite (buf, sizeof (char), k, ofile); } 64 | fclose (ifile); 65 | fclose (ofile); 66 | } 67 | 68 | exit (0); 69 | } 70 | -------------------------------------------------------------------------------- /converters/m8376/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=m8376 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/m8376/m8376.c: -------------------------------------------------------------------------------- 1 | /* This program assembles 8 PROM files into a 32bit binary file 2 | 3 | Copyright (c) 1993-2001, Robert M. Supnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of Robert M Supnik shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from Robert M Supnik. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | static const int fnum[8] = { 60, 58, 74, 73, 90, 89, 106, 105 }; 33 | 34 | int main (int argc, char *argv[]) 35 | { 36 | FILE *fi[8], *outf; 37 | char fname[256]; 38 | int c, i, j; 39 | unsigned int wd[1024]; 40 | 41 | for (i = 0; i < 8; i++) { 42 | sprintf (fname, "C:\\temp\\m8376\\m8376e%03d.bin", fnum[i]); 43 | fi[i] = fopen (fname, "rb"); 44 | if (fi[i] == NULL) { 45 | printf ("Can't open file %s\n", fname); 46 | return 0; 47 | } 48 | } 49 | 50 | for (i = 0; i < 1024; i++) { 51 | wd[i] = 0; 52 | for (j = 7; j >=0; j--) { 53 | c = fgetc (fi[j]); 54 | if (c == EOF) { 55 | printf ("Premature end of file on file %d\n", i); 56 | return 0; 57 | } 58 | wd[i] = (wd[i] << 4) | (c & 0xF); 59 | } 60 | } 61 | 62 | for (i = 0; i < 8; i++) fclose (fi[i]); 63 | outf = fopen ("c:\\prom.bin", "wb"); 64 | if (outf == NULL) { 65 | printf ("Can't open output file\n"); 66 | return 0; 67 | } 68 | fwrite (wd, 1024, sizeof (int), outf); 69 | fclose (outf); 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /converters/mksimtape/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=mksimtape 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/mksimtape/mksimtape.txt: -------------------------------------------------------------------------------- 1 | mksimtape 2 | --------- 3 | 4 | This program generates a SIMH-compatible tape image file, from one or 5 | more input files. It should be easily compiled using any reasonable C 6 | compiler, for example: 7 | 8 | cc -o mksimtape mksimtape.c 9 | 10 | Once compiled, it is run by giving it the names of the files to be 11 | written to the image, in the same order that they should be written. The 12 | tape image is written to standard output, so a typical use might be 13 | this: 14 | 15 | mksimtape file1 file2 file3 > tape.out 16 | 17 | Each 'file' on the tape is written with a block size of 10240 bytes, 18 | unless otherwise specified. To use a particular block size for a file, 19 | append it to the end of the filename, separated by a colon, viz.: 20 | 21 | mksimtape file1:512 file2 file3 > tape.out 22 | 23 | This would write 'file1' with a block size of 512 bytes; 'file2' and 24 | 'file3' would still be written with a block size of 10240 bytes. 25 | 26 | Bob Eager 27 | bob@eager.cx 28 | 29 | -------------------------------------------------------------------------------- /converters/mt2tpc/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=mt2tpc 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/mtcvt23/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=mtcvtv23 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/mtcvt23/mtcvtv23.txt: -------------------------------------------------------------------------------- 1 | mtcvtv23 converts a tape images in .tpc format to .tap format. 2 | 3 | .tpc format tape images have the format 4 | 5 | 2 byte record length 1 6 | record 1 7 | 2 byte record length 2 8 | record 2 9 | : 10 | 2 bytes = 0000 for end of file 11 | 12 | and so on. This is the format produced by various UNIX utilities 13 | for dumping tape images. 14 | 15 | .tap format tape images have the format 16 | 17 | 4 byte record length 1 18 | record 1 19 | repeat of 4 byte record length 1 20 | 4 byte record length 2 21 | record 2 22 | repeat of 4 byte record length 2 23 | : 24 | 4 bytes = 00000000 for end of file 25 | 26 | and so on. This is the tape format expected by simh, Tim Stark's TS10, 27 | and John Wilson's E11. 28 | 29 | mtcvtv23 is invoked by 30 | 31 | mtcvtv23 file1 file2 file3... 32 | 33 | Each file in turn is converted from .tpc format to .tap format. The 34 | input file can have any extension; the converted file will have a .tap 35 | extension. -------------------------------------------------------------------------------- /converters/mtcvtfix/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=mtcvtfix 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/mtcvtodd/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=mtcvtodd 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/noff/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=noff 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/noff/noff.c: -------------------------------------------------------------------------------- 1 | /* This program strips FF from a source listing 2 | 3 | Copyright (c) 2005, Robert M. Supnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of Robert M Supnik shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from Robert M Supnik. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | int main (int argc, char *argv[]) 34 | { 35 | int i, c, ffc; 36 | char *ppos, oline[256], oname[256]; 37 | FILE *ifile, *ofile; 38 | 39 | if ((argc < 2) || (argv[0] == NULL)) { 40 | printf ("Usage is: asc file [file...]\n"); 41 | exit (0); } 42 | 43 | for (i = 1; i < argc; i++) { 44 | strcpy (oname, argv[i]); 45 | if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new"); 46 | else strcat (oname, ".new"); 47 | ifile = fopen (argv[i], "ra"); 48 | if (ifile == NULL) { 49 | printf ("Error opening file: %s\n", argv[i]); 50 | exit (0); } 51 | ofile = fopen (oname, "wa"); 52 | if (ofile == NULL) { 53 | printf ("Error opening file: %s\n", oname); 54 | exit (0); } 55 | 56 | printf ("Processing file %s\n", argv[i]); 57 | for (ffc = 0; (c = fgetc (ifile)) != EOF; ) { 58 | if (c == '\f') ffc++; 59 | else fputc (c, ofile); 60 | } 61 | if (ffc) printf ("Form feeds removed: %d\n", ffc); 62 | fclose (ifile); 63 | fclose (ofile); 64 | } 65 | return 0; 66 | } 67 | -------------------------------------------------------------------------------- /converters/sfmtcvt/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=sfmtcvt 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/strrem/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=strrem 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/strrem/strrem.c: -------------------------------------------------------------------------------- 1 | /* This program removes a string 2 | 3 | Copyright (c) 1993-2001, Robert M. Supnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of Robert M Supnik shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from Robert M Supnik. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | const char *srem = "e-drive\\"; 33 | 34 | int main (int argc, char *argv[]) 35 | { 36 | int i, slen; 37 | char *ppos, *fpos, *tpos, oname[256], line[256]; 38 | FILE *ifile, *ofile; 39 | 40 | if ((argc < 2) || (argv[0] == NULL)) { 41 | printf ("Usage is: strrem file [file...]\n"); 42 | exit (0); } 43 | 44 | slen = strlen (srem); 45 | for (i = 1; i < argc; i++) { 46 | strcpy (oname, argv[i]); 47 | if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new"); 48 | else strcat (oname, ".new"); 49 | ifile = fopen (argv[i], "r"); 50 | if (ifile == NULL) { 51 | printf ("Error opening file: %s\n", argv[i]); 52 | exit (0); } 53 | ofile = fopen (oname, "w"); 54 | if (ofile == NULL) { 55 | printf ("Error opening file: %s\n", oname); 56 | exit (0); } 57 | 58 | printf ("Processing file %s\n", argv[i]); 59 | while (fgets (line, 255, ifile) != NULL) { 60 | tpos = strstr (line, srem); 61 | if (tpos) { 62 | fpos = tpos + slen; 63 | while (*fpos) *tpos++ = *fpos++; 64 | *tpos = 0; 65 | } 66 | fputs (line, ofile); 67 | } 68 | fclose (ifile); 69 | fclose (ofile); 70 | } 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /converters/strsub/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=strsub 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/strsub/strsub.c: -------------------------------------------------------------------------------- 1 | /* This program removes a string 2 | 3 | Copyright (c) 1993-2001, Robert M. Supnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of Robert M Supnik shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from Robert M Supnik. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | int main (int argc, char *argv[]) 33 | { 34 | int i, rmvlen; 35 | char *ppos, *fpos, *tpos, *rmv, *ins, oname[256], line[256]; 36 | FILE *ifile, *ofile; 37 | 38 | if ((argc < 4) || (argv[0] == NULL)) { 39 | printf ("Usage is: strsub s1 s2 file [file...]\n"); 40 | exit (0); } 41 | 42 | rmv = argv[1]; 43 | rmvlen = strlen (rmv); 44 | ins = argv[2]; 45 | for (i = 3; i < argc; i++) { 46 | strcpy (oname, argv[i]); 47 | if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new"); 48 | else strcat (oname, ".new"); 49 | ifile = fopen (argv[i], "r"); 50 | if (ifile == NULL) { 51 | printf ("Error opening file: %s\n", argv[i]); 52 | exit (0); } 53 | ofile = fopen (oname, "w"); 54 | if (ofile == NULL) { 55 | printf ("Error opening file: %s\n", oname); 56 | exit (0); } 57 | 58 | printf ("Processing file %s\n", argv[i]); 59 | while (fgets (line, 255, ifile) != NULL) { 60 | tpos = strstr (line, rmv); 61 | if (tpos) { 62 | *tpos = 0; 63 | fputs (line, ofile); 64 | fputs (ins, ofile); 65 | fpos = tpos + rmvlen; 66 | fputs (fpos, ofile); 67 | } 68 | else fputs (line, ofile); 69 | } 70 | fclose (ifile); 71 | fclose (ofile); 72 | } 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /converters/tar2mt/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=tar2mt 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/tar2mt/tar2mt.txt: -------------------------------------------------------------------------------- 1 | tar2mt converts a tar file to a simh .tap tape image. 2 | 3 | .tap format tape images have the format 4 | 5 | 4 byte record length 1 6 | record 1 7 | repeat of 4 byte record length 1 8 | 4 byte record length 2 9 | record 2 10 | repeat of 4 byte record length 2 11 | : 12 | 4 bytes = 00000000 for end of file 13 | 14 | and so on. This is the tape format expected by simh, Tim Stark's TS10, 15 | and John Wilson's E11. 16 | 17 | tar2mt is invoked by 18 | 19 | tar2mt {-b blocksize} file1 file2 file3... 20 | 21 | blocksize defaults to 8192. 22 | 23 | Each file in turn is converted from a tar file to a .tap tape image. The 24 | input file can have any extension; the converted file will have a .tap 25 | extension. -------------------------------------------------------------------------------- /converters/tp512cvt/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=tp512cvt 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /converters/tp512cvt/tp512cvt.c: -------------------------------------------------------------------------------- 1 | /* This program converts a tp data file to a simulated 512B blocked magtape 2 | 3 | Copyright (c) 1993-2003, Robert M. Supnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of Robert M Supnik shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from Robert M Supnik. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #define BLKSIZ 512 32 | int main (int argc, char *argv[]) 33 | { 34 | int i, k; 35 | unsigned char buf[BLKSIZ]; 36 | unsigned char tef[4] = { 0, 0, 0, 0 }; 37 | unsigned char twc[4] = { 0, 2, 0, 0 }; 38 | char *ppos, oname[256]; 39 | FILE *ifile, *ofile; 40 | 41 | if ((argc < 2) || (argv[0] == NULL)) { 42 | printf ("Usage is: verb file [file...]\n"); 43 | exit (0); } 44 | 45 | for (i = 1; i < argc; i++) { 46 | strcpy (oname, argv[i]); 47 | if (ppos = strrchr (oname, '.')) strcpy (ppos, ".tap"); 48 | else strcat (oname, ".tap"); 49 | ifile = fopen (argv[i], "rb"); 50 | if (ifile == NULL) { 51 | printf ("Error opening file: %s\n", argv[i]); 52 | exit (0); } 53 | ofile = fopen (oname, "wb"); 54 | if (ofile == NULL) { 55 | printf ("Error opening file: %s\n", oname); 56 | exit (0); } 57 | 58 | printf ("Processing file %s\n", argv[i]); 59 | for (;;) { 60 | k = fread (buf, sizeof (char), BLKSIZ, ifile); 61 | if (k == 0) break; 62 | if (k != BLKSIZ) { 63 | printf ("Short block, size = %d\n", k); 64 | for ( ; k < BLKSIZ; k++) buf[k] = 0; } 65 | fwrite (twc, sizeof (char), 4, ofile); 66 | fwrite (buf, sizeof (char), BLKSIZ, ofile); 67 | fwrite (twc, sizeof (char), 4, ofile); 68 | } 69 | fwrite (tef, sizeof (char), 4, ofile); 70 | fwrite (tef, sizeof (char), 4, ofile); 71 | fclose (ifile); 72 | fclose (ofile); 73 | } 74 | 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /converters/tpc2mt/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=tpc2mt 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /crossassemblers/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | SUBDIRS=hpasm macro1 macro11 macro7 macro8x 9 | 10 | .PHONY: all clean install uninstall 11 | 12 | # Omitted: macro11: needs more complicated Makefiles. 13 | all: 14 | for subdir in $(SUBDIRS); do \ 15 | $(MAKE) -C $$subdir CFLAGS="$(CFLAGS)" BIN="$(BIN)" INSTALL="$(INSTALL)" CC="$(CC)"; \ 16 | done 17 | 18 | clean install uninstall: 19 | for subdir in $(SUBDIRS); do \ 20 | $(MAKE) -C $$subdir CFLAGS="$(CFLAGS)" BIN="$(BIN)" INSTALL="$(INSTALL)" CC="$(CC)" $@; \ 21 | done 22 | -------------------------------------------------------------------------------- /crossassemblers/hpasm/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=hpasm 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /crossassemblers/macro1/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=macro1 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /crossassemblers/macro11/.indent.pro: -------------------------------------------------------------------------------- 1 | --blank-lines-after-commas 2 | --blank-lines-after-declarations 3 | --blank-lines-after-procedures 4 | --braces-on-if-line 5 | --braces-on-struct-decl-line 6 | --break-before-boolean-operator 7 | --break-function-decl-args 8 | --break-function-decl-args-end 9 | --case-indentation0 10 | --comment-indentation40 11 | --continuation-indentation8 12 | --continue-at-parentheses 13 | --cuddle-do-while 14 | --cuddle-else 15 | --declaration-indentation16 16 | --dont-break-procedure-type 17 | --dont-format-comments 18 | --indent-level4 19 | --honour-newlines 20 | --leave-optional-blank-lines 21 | --line-comments-indentation0 22 | --line-length112 23 | --no-blank-lines-before-block-comments 24 | --no-space-after-function-call-names 25 | --no-tabs 26 | --paren-indentation4 27 | --space-special-semicolon 28 | --tab-size8 29 | -T ADDR_MODE 30 | -T ARG 31 | -T BUFFER 32 | -T EX_TREE 33 | -T FILE 34 | -T MACRO 35 | -T MACRO_STREAM 36 | -T MLB 37 | -T MLBENT 38 | -T STACK 39 | -T STREAM 40 | -T SECTION 41 | -T SYMBOL 42 | -T SYMBOL_ITER 43 | -T SYMBOL_TABLE 44 | -T TEXT_COMPLEX 45 | -T TEXT_RLD 46 | -------------------------------------------------------------------------------- /crossassemblers/macro11/CHANGES: -------------------------------------------------------------------------------- 1 | 09.11.2015: Rhialto 2 | version 0.4: 3 | - Fixed various bugs. The most notable was extensive use- 4 | after-free in the expression tree, which crashed on NetBSD but 5 | apparently not on other systems. 6 | - Lots of changes to make this MACRO11 more like the MACRO11 of 7 | RSX-11M+ 4.6. I used Kermit-11 source files for comparison. 8 | "The Manual" I'm refering to is 9 | AA-KX10A-TC_PDP-11_MACRO-11_Reference_Manual_May88.pdf at 10 | www.bitsavers.org/pdf/dec/pdp11/rsx11/RSX11Mplus_V4.x/4a/ and 11 | I use an installed system to double-check. 12 | 13 | ----------- Joerg Hoppe's entries ------------------ 14 | 15 | 19.4.2009: JH 16 | version 0.3 17 | - bugfix: Illegal labels and illegal opcodes are processed as 18 | "implied .WORD" directives. 19 | Expression errors in "do_word()" did not process any input character, 20 | so parser did go into an endless loop. 21 | - Switchable syntax extensions with -yxx options: 22 | symbol len can be adjusted with "-ysl" command line option. 23 | "-yus" option allows underscore "_" char in symbols. 24 | This was needed to process code generated by my favorite disassembler. 25 | - command line help added (-h option) 26 | 27 | 17.4.2009: JH 28 | version 0.3 29 | - ".INCLUDE" re-enabled 30 | - refactoring: big 6000+ lines "macro11.c" split into 10 modules. 31 | 32 | 15.4.2009: JH 33 | Begin rework by Joerg Hoppe (j_hoppe@t-online.de) 34 | All my changes are marked with "/*JH: .. */" comments 35 | 36 | 37 | ----------- Richard Krebiehls entries ------------------ 38 | 39 | 40 | 15-July-2001 41 | version 0.2 42 | removed references to snprintf from dumpobj.c and 43 | mlb.c for portability 44 | fixed a type cast warning in dumpobj.c compare_gsdlines 45 | Removed strcasecmp from macro11.c for portability 46 | Removed references to wnewmem.c from makefile (isn't needed) 47 | makefile more compatible with non-gnu make and compiler 48 | main prints version 0.2 49 | 50 | 14-July-2001 51 | First release, version 0.1. 52 | -------------------------------------------------------------------------------- /crossassemblers/macro11/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2001, Richard Krehbiel 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | o Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | o Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | o Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 24 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 25 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 26 | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 28 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 29 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 30 | DAMAGE. 31 | -------------------------------------------------------------------------------- /crossassemblers/macro11/Makefile: -------------------------------------------------------------------------------- 1 | ##### 2 | # 3 | # Makefile for macro11 and dumpobj 4 | # 5 | 6 | WARNS ?= -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 7 | CFLAGS ?= -O -ggdb -std=gnu99 $(WARNS) 8 | 9 | MACRO11_SRCS = macro11.c \ 10 | assemble.c assemble_globals.c assemble_aux.c \ 11 | extree.c listing.c macros.c parse.c rept_irpc.c symbols.c \ 12 | mlb-rsx.c object.c stream2.c util.c rad50.c 13 | 14 | MACRO11_OBJS = $(MACRO11_SRCS:.c=.o) 15 | 16 | DUMPOBJ_SRCS = dumpobj.c rad50.c 17 | 18 | DUMPOBJ_OBJS = $(DUMPOBJ_SRCS:.c=.o) 19 | 20 | ALL_SRCS = $(MACRO11_SRCS) $(DUMPOBJ_SRCS) 21 | 22 | all: macro11 dumpobj 23 | 24 | tags: macro11 dumpobj 25 | ctags *.c *.h 26 | 27 | macro11: git-info.h $(MACRO11_OBJS) Makefile 28 | $(CC) $(CFLAGS) -o macro11 $(MACRO11_OBJS) -lm 29 | 30 | dumpobj: $(DUMPOBJ_OBJS) Makefile 31 | $(CC) $(CFLAGS) -o dumpobj $(DUMPOBJ_OBJS) 32 | 33 | $(MACRO11_OBJS): Makefile 34 | $(DUMPOBJ_OBJS): Makefile 35 | 36 | git-info.h: 37 | ./make-git-info 38 | 39 | # Bootstrap dependency on the git header file, which otherwise 40 | # gets generated too late. 41 | macro11.o: git-info.h 42 | 43 | clean: 44 | -rm -f $(MACRO11_OBJS) $(DUMPOBJ_OBJS) macro11 dumpobj 45 | -rm -f *.d 46 | -rm -f git-info.h 47 | 48 | # Since the only tests we have so far are for crashes, 49 | # just try to assemble. Later, we will need expected/actual tests. 50 | 51 | # Test that all options requiring a value bail out if it's not present. 52 | argtests: macro11 53 | @ for OPT in -e -d -m -p -o -l -ysl ; do \ 54 | ./macro11 foo.mac $$OPT 2> /dev/null; \ 55 | if (( $$? == 1 )); then echo PASS; else echo FAIL; fi; \ 56 | echo " $$OPT missing value"; \ 57 | ./macro11 foo.mac $$OPT -v 2> /dev/null; \ 58 | if (( $$? == 1 )); then echo PASS; else echo FAIL; fi; \ 59 | echo " $$OPT fol. by option"; \ 60 | done 61 | @ ./macro11 foo.mac $$OPT -x -v 2> /dev/null; \ 62 | if (( $$? == 1 )); then echo PASS; else echo FAIL; fi; \ 63 | echo " -x must be the last option" 64 | 65 | tests: macro11 argtests 66 | @ ACTUAL=`./macro11 tests/test-undef.mac 2>&1`; \ 67 | if [ "tests/test-undef.mac:1: ***ERROR MACRO .TTYOU not found" == "$$ACTUAL" ]; then echo PASS; else echo FAIL; fi; \ 68 | echo " test-undef.mac" 69 | 70 | # Automatic dependency generation 71 | 72 | ifneq ($(MAKECMDGOALS),clean) 73 | -include $(ALL_SRCS:.c=.d) 74 | endif 75 | 76 | # Make .d files as side effect of compiling .c to .o 77 | %.d %.o: %.c 78 | $(CC) $(CFLAGS) -c -o $*.o $< 79 | @set -e; rm -f $*.d; \ 80 | $(CC) -MM $(CPPFLAGS) $< > $@.$$$$; \ 81 | sed 's,\($*\)\.o[ :]*,\1.o \1.d : ,g' < $@.$$$$ > $*.d; \ 82 | rm -f $@.$$$$ 83 | -------------------------------------------------------------------------------- /crossassemblers/macro11/assemble.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ASSEMBLE__H 3 | #define ASSEMBLE__H 4 | 5 | 6 | #include "stream2.h" 7 | #include "object.h" 8 | 9 | 10 | 11 | #define DOT (current_pc->value) /* Handy reference to the current location */ 12 | 13 | int assemble_stack( 14 | STACK *stack, 15 | TEXT_RLD *tr); 16 | int get_next_lsb( 17 | void); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /crossassemblers/macro11/assemble_aux.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ASSEMBLE_AUX__H 3 | #define ASSEMBLE_AUX__H 4 | 5 | #include "stream2.h" 6 | #include "object.h" 7 | #include "extree.h" 8 | 9 | #define NO_REG 0777 10 | 11 | 12 | typedef struct addr_mode { 13 | unsigned type; /* The bits that represent the addressing mode */ 14 | /* bits 0:2 are register number */ 15 | /* bit 3 is indirect */ 16 | /* bits 4:6 are mode, where 0=Rn, 1=(Rn)+, 17 | 2=-(Rn), 3=offset(Rn) */ 18 | int rel; /* the addressing mode is PC-relative */ 19 | EX_TREE *offset; /* Expression giving the offset */ 20 | } ADDR_MODE; 21 | 22 | void push_cond( 23 | int ok, 24 | STREAM *str); 25 | void pop_cond( 26 | int to); 27 | 28 | int express_sym_offset( 29 | EX_TREE *value, 30 | SYMBOL **sym, 31 | unsigned *offset); 32 | 33 | void change_dot( 34 | TEXT_RLD *tr, 35 | int size); 36 | 37 | int store_word( 38 | STREAM *str, 39 | TEXT_RLD *tr, 40 | int size, 41 | unsigned word); 42 | int store_limits( 43 | STREAM *str, 44 | TEXT_RLD *tr); 45 | void store_value( 46 | STACK *stack, 47 | TEXT_RLD *tr, 48 | int size, 49 | EX_TREE *value); 50 | 51 | int do_word( 52 | STACK *stack, 53 | TEXT_RLD *tr, 54 | char *cp, 55 | int size); 56 | 57 | SECTION *new_section( 58 | void); 59 | void go_section( 60 | TEXT_RLD *tr, 61 | SECTION *sect); 62 | 63 | void free_addr_mode( 64 | ADDR_MODE *mode); 65 | 66 | int eval_defined( 67 | EX_TREE *value); 68 | int eval_undefined( 69 | EX_TREE *value); 70 | 71 | 72 | void mode_extension( 73 | TEXT_RLD *tr, 74 | ADDR_MODE *mode, 75 | STREAM *str); 76 | int check_branch( 77 | STACK *stack, 78 | unsigned offset, 79 | int min, 80 | int max); 81 | unsigned get_register( 82 | EX_TREE *expr); 83 | 84 | void write_globals( 85 | FILE *obj); 86 | void migrate_implicit( 87 | void); 88 | 89 | 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /crossassemblers/macro11/extree.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EXTREE__H 3 | #define EXTREE__H 4 | 5 | #include "symbols.h" 6 | 7 | typedef struct ex_tree { 8 | enum ex_type { EX_LIT = 1, 9 | /* Expression is a literal value */ 10 | EX_SYM = 2, 11 | /* Expression has a symbol reference */ 12 | EX_UNDEFINED_SYM = 3, 13 | /* Expression is undefined sym reference */ 14 | EX_TEMP_SYM = 4, 15 | /* Expression is temp sym reference */ 16 | 17 | EX_COM = 5, 18 | /* One's complement */ 19 | EX_NEG = 6, 20 | /* Negate */ 21 | EX_ERR = 7, 22 | /* Expression with an error */ 23 | 24 | EX_ADD = 8, 25 | /* Add */ 26 | EX_SUB = 9, 27 | /* Subtract */ 28 | EX_MUL = 10, 29 | /* Multiply */ 30 | EX_DIV = 11, 31 | /* Divide */ 32 | EX_AND = 12, 33 | /* bitwise and */ 34 | EX_OR = 13 /* bitwise or */ 35 | } type; 36 | 37 | char *cp; /* points to end of parsed expression */ 38 | 39 | union { 40 | struct { 41 | struct ex_tree *left, 42 | *right; /* Left, right children */ 43 | } child; 44 | unsigned lit; /* Literal value */ 45 | SYMBOL *symbol; /* Symbol reference */ 46 | } data; 47 | } EX_TREE; 48 | 49 | 50 | EX_TREE *new_ex_tree( 51 | void); 52 | void free_tree( 53 | EX_TREE *tp); 54 | 55 | EX_TREE *new_ex_lit( 56 | unsigned value); 57 | EX_TREE *ex_err( 58 | EX_TREE *tp, 59 | char *cp); 60 | EX_TREE *new_ex_bin( 61 | int type, 62 | EX_TREE *left, 63 | EX_TREE *right); 64 | 65 | EX_TREE *evaluate( 66 | EX_TREE *tp, 67 | int undef); 68 | 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /crossassemblers/macro11/listing.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef LISTING__H 3 | #define LISTING__H 4 | 5 | #include "stream2.h" 6 | 7 | /* 8 | format of a listing line 9 | Interestingly, no instances of this struct are ever created. 10 | It lives to be a way to layout the format of a list line. 11 | I wonder if I should have bothered. 12 | */ 13 | 14 | typedef struct lstformat { 15 | char flag[2]; /* Error flags */ 16 | char line_number[6]; /* Line number */ 17 | char pc[8]; /* Location */ 18 | char words[8][3]; /* three instruction words */ 19 | char source[1]; /* source line */ 20 | } LSTFORMAT; 21 | 22 | 23 | /* GLOBAL VARIABLES */ 24 | #ifndef LISTING__C 25 | extern int list_md; /* option to list macro/rept definition = yes */ 26 | 27 | extern int list_me; /* option to list macro/rept expansion = yes */ 28 | 29 | extern int list_bex; /* option to show binary */ 30 | 31 | extern int list_level; /* Listing control level. .LIST 32 | increments; .NLIST decrements */ 33 | 34 | extern FILE *lstfile; 35 | 36 | extern int list_pass_0; /* Also list what happens during the first pass */ 37 | 38 | #endif 39 | 40 | 41 | void list_word( 42 | STREAM *str, 43 | unsigned addr, 44 | unsigned value, 45 | int size, 46 | char *flags); 47 | 48 | void list_value( 49 | STREAM *str, 50 | unsigned word); 51 | 52 | void list_location( 53 | STREAM *str, 54 | unsigned word); 55 | 56 | void list_source( 57 | STREAM *str, 58 | char *cp); 59 | 60 | void list_flush( 61 | void); 62 | 63 | void report( 64 | STREAM *str, 65 | char *fmt, 66 | ...); 67 | 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /crossassemblers/macro11/macro11.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "dumpobj"=.\dumpobj.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | begin source code control 11 | "$/macro11", BAAAAAAA 12 | . 13 | end source code control 14 | }}} 15 | 16 | Package=<4> 17 | {{{ 18 | }}} 19 | 20 | ############################################################################### 21 | 22 | Project: "macro11"=.\macro11.dsp - Package Owner=<4> 23 | 24 | Package=<5> 25 | {{{ 26 | begin source code control 27 | "$/macro11", BAAAAAAA 28 | . 29 | end source code control 30 | }}} 31 | 32 | Package=<4> 33 | {{{ 34 | }}} 35 | 36 | ############################################################################### 37 | 38 | Global: 39 | 40 | Package=<5> 41 | {{{ 42 | begin source code control 43 | "$/macro11", BAAAAAAA 44 | . 45 | end source code control 46 | }}} 47 | 48 | Package=<3> 49 | {{{ 50 | }}} 51 | 52 | ############################################################################### 53 | 54 | -------------------------------------------------------------------------------- /crossassemblers/macro11/macro11.h: -------------------------------------------------------------------------------- 1 | #ifndef MACRO11_H 2 | #define MACRO11_H 3 | 4 | #include "git-info.h" 5 | 6 | #define BASE_VERSION "0.4" 7 | 8 | #if defined(GIT_VERSION) 9 | #define VERSIONSTR BASE_VERSION" ("GIT_VERSION"\n\t"GIT_AUTHOR_DATE")" 10 | #else 11 | #define VERSIONSTR BASE_VERSION" (21 June 2015)" 12 | /*#define VERSIONSTR "0.3 (April 21, 2009)" */ 13 | /*#define VERSIONSTR "0.2 July 15, 2001" */ 14 | #endif 15 | 16 | 17 | /* 18 | Copyright (c) 2001, Richard Krehbiel 19 | All rights reserved. 20 | 21 | Redistribution and use in source and binary forms, with or without 22 | modification, are permitted provided that the following conditions are 23 | met: 24 | 25 | o Redistributions of source code must retain the above copyright 26 | notice, this list of conditions and the following disclaimer. 27 | 28 | o Redistributions in binary form must reproduce the above copyright 29 | notice, this list of conditions and the following disclaimer in the 30 | documentation and/or other materials provided with the distribution. 31 | 32 | o Neither the name of the copyright holder nor the names of its 33 | contributors may be used to endorse or promote products derived from 34 | this software without specific prior written permission. 35 | 36 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 37 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 38 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 39 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 40 | HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 41 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 42 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 43 | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 45 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 46 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 47 | DAMAGE. 48 | */ 49 | 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /crossassemblers/macro11/macros.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MACROS__H 3 | #define MACROS__H 4 | 5 | /* Arguments given to macros or .IRP/.IRPC blocks */ 6 | 7 | #include "symbols.h" 8 | #include "stream2.h" 9 | 10 | 11 | typedef struct arg { 12 | struct arg *next; /* Pointer in arg list */ 13 | int locsym; /* Whether arg represents an optional 14 | local symbol */ 15 | char *label; /* Argument name */ 16 | char *value; /* Default or active substitution */ 17 | } ARG; 18 | 19 | /* A MACRO is a superstructure surrounding a SYMBOL. */ 20 | 21 | typedef struct macro { 22 | SYMBOL sym; /* Surrounds a symbol, contains the macro 23 | name */ 24 | ARG *args; /* The argument list */ 25 | BUFFER *text; /* The macro text */ 26 | } MACRO; 27 | 28 | typedef struct macro_stream { 29 | BUFFER_STREAM bstr; /* Base class: buffer stream */ 30 | int nargs; /* Add number-of-macro-arguments */ 31 | int cond; /* Add saved conditional stack */ 32 | } MACRO_STREAM; 33 | 34 | 35 | #ifndef MACROS__C 36 | extern STREAM_VTBL macro_stream_vtbl; 37 | #endif 38 | 39 | MACRO *new_macro( 40 | char *label); 41 | void free_macro( 42 | MACRO *mac); 43 | 44 | MACRO *defmacro( 45 | char *cp, 46 | STACK *stack, 47 | int called); 48 | 49 | STREAM *expandmacro( 50 | STREAM *refstr, 51 | MACRO *mac, 52 | char *cp); 53 | 54 | ARG *new_arg( 55 | void); 56 | 57 | void read_body( 58 | STACK *stack, 59 | BUFFER *gb, 60 | char *name, 61 | int called); 62 | char *getstring_macarg( 63 | STREAM *refstr, 64 | char *cp, 65 | char **endp); 66 | BUFFER *subst_args( 67 | BUFFER *text, 68 | ARG *args); 69 | 70 | 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /crossassemblers/macro11/make-git-info: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | desc=$(git describe --tags) 4 | 5 | if [ "$desc" = "" ] 6 | then 7 | echo "#undef GIT_VERSION" > new-git-info.h 8 | else 9 | auth=$(git log -n 1 "--pretty=format:%an <%ae> %aD") 10 | 11 | echo "#define GIT_VERSION "'"'"$desc"'"' >new-git-info.h 12 | echo "#define GIT_AUTHOR_DATE "'"'"$auth"'"' >>new-git-info.h 13 | fi 14 | 15 | # move-if-different 16 | if diff new-git-info.h git-info.h >/dev/null 2>&1 17 | then 18 | rm new-git-info.h 19 | else 20 | mv new-git-info.h git-info.h 21 | fi 22 | -------------------------------------------------------------------------------- /crossassemblers/macro11/mlb.h: -------------------------------------------------------------------------------- 1 | #ifndef MLB_H 2 | #define MLB_H 3 | 4 | /* 5 | 6 | Copyright (c) 2001, Richard Krehbiel 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions are 11 | met: 12 | 13 | o Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | o Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | o Neither the name of the copyright holder nor the names of its 21 | contributors may be used to endorse or promote products derived from 22 | this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 31 | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 33 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 34 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 35 | DAMAGE. 36 | 37 | */ 38 | 39 | #include "stream2.h" 40 | 41 | /* Routines to open and read entries from a macro library */ 42 | 43 | typedef struct mlbent { 44 | char *label; 45 | unsigned long position; 46 | int length; 47 | } MLBENT; 48 | 49 | typedef struct mlb { 50 | FILE *fp; 51 | MLBENT *directory; 52 | int nentries; 53 | int is_objlib; /* is really an object library */ 54 | } MLB; 55 | 56 | extern MLB *mlb_open( 57 | char *name, 58 | int allow_object_library); 59 | extern BUFFER *mlb_entry( 60 | MLB *mlb, 61 | char *name); 62 | extern void mlb_close( 63 | MLB *mlb); 64 | extern void mlb_extract( 65 | MLB *mlb); 66 | 67 | #endif /* MLB_H */ 68 | -------------------------------------------------------------------------------- /crossassemblers/macro11/parse.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PARSE__H 3 | #define PARSE__H 4 | 5 | #include "symbols.h" 6 | #include "assemble_aux.h" /* ADDR_MODE */ 7 | 8 | 9 | // is char 'c' part of a symbol? 10 | #define issym(c) (isalpha(c) || isdigit(c) \ 11 | || (c) == '.' || (c) == '$' \ 12 | || (symbol_allow_underscores && (c) == '_')) 13 | 14 | 15 | char *skipwhite( 16 | char *cp); 17 | char *skipdelim( 18 | char *cp); 19 | char *skipdelim_comma( 20 | char *cp, 21 | int *comma); 22 | 23 | SYMBOL *get_op( 24 | char *cp, 25 | char **endp); 26 | char *getstring( 27 | char *cp, 28 | char **endp); 29 | char *getstring_fn( 30 | char *cp, 31 | char **endp); 32 | char *get_symbol( 33 | char *cp, 34 | char **endp, 35 | int *islocal); 36 | int get_mode( 37 | char *cp, 38 | char **endp, 39 | ADDR_MODE *mode); 40 | 41 | EX_TREE *parse_expr( 42 | char *cp, 43 | int undef); 44 | EX_TREE *parse_unary_expr( 45 | char *cp, 46 | int undef); 47 | int parse_float( 48 | char *cp, 49 | char **endp, 50 | int size, 51 | unsigned *flt); 52 | 53 | int brackrange( 54 | char *cp, 55 | int *start, 56 | int *length, 57 | char **endp); 58 | 59 | 60 | 61 | 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /crossassemblers/macro11/rad50.h: -------------------------------------------------------------------------------- 1 | #ifndef RAD50_H 2 | #define RAD50_H 3 | 4 | /* 5 | Copyright (c) 2001, Richard Krehbiel 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are 10 | met: 11 | 12 | o Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | 15 | o Redistributions in binary form must reproduce the above copyright 16 | notice, this list of conditions and the following disclaimer in the 17 | documentation and/or other materials provided with the distribution. 18 | 19 | o Neither the name of the copyright holder nor the names of its 20 | contributors may be used to endorse or promote products derived from 21 | this software without specific prior written permission. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 29 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 30 | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 32 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 33 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 34 | DAMAGE. 35 | */ 36 | 37 | extern unsigned rad50( 38 | char *cp, 39 | char **endp); 40 | 41 | extern void rad50x2( 42 | char *cp, 43 | unsigned *rp); 44 | 45 | extern void unrad50( 46 | unsigned word, 47 | char *cp); 48 | 49 | int ascii2rad50( 50 | char c); 51 | 52 | unsigned packrad50word( 53 | char *cp, 54 | int len); 55 | 56 | #endif /* RAD50_H */ 57 | -------------------------------------------------------------------------------- /crossassemblers/macro11/rept_irpc.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef REPT_IRPC__H 3 | #define REPT_IRPC__H 4 | 5 | #include "stream2.h" 6 | 7 | 8 | #ifndef REPT_IRPC__C 9 | extern STREAM_VTBL rept_stream_vtbl; 10 | extern STREAM_VTBL irp_stream_vtbl; 11 | extern STREAM_VTBL irpc_stream_vtbl; 12 | #endif 13 | 14 | STREAM *expand_rept( 15 | STACK *stack, 16 | char *cp); 17 | 18 | STREAM *expand_irp( 19 | STACK *stack, 20 | char *cp); 21 | 22 | STREAM *expand_irpc( 23 | STACK *stack, 24 | char *cp); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/RunTests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Run some regression test cases. 4 | # 5 | # If there is a .lst.ok file, it compares the listing. 6 | # If there is a .objd.ok file, it compares the result of dumpobj. 7 | # 8 | 9 | TESTS="test-asciz \ 10 | test-backpatch \ 11 | test-bsl-mac-arg \ 12 | test-complex-reloc \ 13 | test-endm \ 14 | test-impword \ 15 | test-include \ 16 | test-jmp \ 17 | test-locals \ 18 | test-macro-comma \ 19 | test-prec \ 20 | test-psect \ 21 | test-rad50 \ 22 | test-undef \ 23 | test-word-comma" 24 | 25 | for t in $TESTS 26 | do 27 | ../macro11 -l "$t".lst -o "$t".obj "$t".mac 2>/dev/null 28 | 29 | if [ -e "$t".lst.ok ] 30 | then 31 | diff -u "$t".lst.ok "$t".lst 32 | fi 33 | 34 | if [ -e "$t".objd.ok ] 35 | then 36 | ../dumpobj "$t".obj >"$t".objd 37 | diff -u "$t".objd.ok "$t".objd 38 | fi 39 | done 40 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/incl.mac: -------------------------------------------------------------------------------- 1 | ;;;;; 2 | ; 3 | ; file to be included 4 | 5 | .word 1 ; to show it is included 6 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-asciz.mac: -------------------------------------------------------------------------------- 1 | ;;;;; 2 | ; 3 | ; Test delimiters of .ASCII and .ASCIZ 4 | 5 | CR = 13. 6 | LF = 10. 7 | SOH = 1 8 | 9 | .asciz // ; 2 bytes and a string 10 | .asciz // ; only a string 11 | .asciz || ; the same string 12 | .ascii ; 3 bytes 13 | 14 | .asciz ;ABC;/DEF/ ; ABCDEF, not recommended practice 15 | .asciz /ABC/;DEF; ; ABC, not recommended practice 16 | .asciz /ABC/=DEF= ; ABCDEF, not recommended practice 17 | .asciz =DEF= ; syntax error: assignment 18 | .asciz =###= ; syntax error: assignment 19 | .asciz :SOH: ; syntax error: colon not allowed 20 | .asciz :###: ; syntax error: colon not allowed 21 | .asciz ^###^ ; previous versions of this macro11 22 | ; used ^/.../ quoting as an extension; however this should be ^...^. 23 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-backpatch.lst.ok: -------------------------------------------------------------------------------- 1 | 1 ;;;; 2 | 2 ; 3 | 3 ; Test backpatching (seen in Kermit sources). 4 | 4 5 | 5 000000 .psect modinf ,ro,d,lcl,rel,con 6 | 6 7 | 7 000000 label = . 8 | 8 000000 .blkb 50 ; create some data 9 | 9 10 | 10 000050 050 051 052 .byte 50,51,52 ; and some more 11 | 11 .save ; we're at 53 now 12 | 12 000053 .psect modinf 13 | 13 000006 . = label + 6 14 | 14 000006 000006 .word 6 ; stored at 6 15 | 15 000053 .restore ; . gets restored to 53 16 | 16 000053 053 .byte 53 17 | 17 18 | 17 19 | 20 | 21 | Symbol table 22 | 23 | . ******R 002 LABEL 000000R 002 24 | 25 | 26 | Program sections: 27 | 28 | . ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV) 29 | 000000 001 (RW,I,LCL,REL,CON,NOSAV) 30 | MODINF 000054 002 (RO,D,LCL,REL,CON,NOSAV) 31 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-backpatch.mac: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ; 3 | ; Test backpatching (seen in Kermit sources). 4 | 5 | .psect modinf ,ro,d,lcl,rel,con 6 | 7 | label = . 8 | .blkb 50 ; create some data 9 | 10 | .byte 50,51,52 ; and some more 11 | .save ; we're at 53 now 12 | .psect modinf 13 | . = label + 6 14 | .word 6 ; stored at 6 15 | .restore ; . gets restored to 53 16 | .byte 53 17 | 18 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-bsl-mac-arg.mac: -------------------------------------------------------------------------------- 1 | .list me 2 | .macro test x 3 | .blkb x ; test some directive that wants an expression 4 | .endm 5 | 6 | size = 10 7 | foo = 2 8 | 9 | ; likes: 10 | 11 | test size ; not replaced by "10" 12 | test \size ; replaced by "10" 13 | test \ ; ditto 14 | test \ ; replaced by "12" 15 | test ^/size + foo/ ; arg is "size + foo", not "12" 16 | 17 | ; dislikes: 18 | 19 | test <\size> ; parameter is \size, which might be ok for 20 | ; macros where the argument is used differently. 21 | test size + foo ; gets split at the space 22 | test /size + foo/ ; gets split at the space 23 | test \/size + foo/ ; invalid expression with division operator 24 | test \^/size + foo/ ; original dislikes this, but we accept it. 25 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-complex-reloc.mac: -------------------------------------------------------------------------------- 1 | ; test complex relocations 2 | 3 | ; .globl IE.ITS,IE.MON ; implicit 4 | mov #-IE.ITS, space 5 | 6 | space: .word IE.ITS ; the only simple relocation 7 | .word -IE.ITS ; all others are complex relocations 8 | .word ^C 9 | .word IE.ITS + IE.MON 10 | .word IE.ITS - IE.MON 11 | .word IE.ITS * IE.MON 12 | .word IE.ITS / IE.MON 13 | .word IE.ITS & IE.MON 14 | .word IE.ITS ! IE.MON 15 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-complex-reloc.objd.ok: -------------------------------------------------------------------------------- 1 | GSD: 2 | GLOBAL IE.ITS=0 REF ABS flags=100 3 | GLOBAL IE.MON=0 REF ABS flags=100 4 | MODNAME .MAIN.=0 flags=0 5 | PSECT =30 CON RW REL LCL I flags=40 6 | PSECT . ABS.=0 OVR RW ABS GBL I flags=104 7 | XFER . ABS.=1 flags=10 8 | ENDGSD 9 | RLD 10 | Location counter definition +0 11 | TEXT ADDR=0 LEN=30 12 | 000000: 012767 000000 000000 000000 ........ 13 | 000010: 000000 000000 000000 000000 ........ 14 | 000020: 000000 000000 000000 000000 ........ 15 | RLD 16 | Complex 2=IE.ITS neg store 17 | Global 6=IE.ITS 18 | Complex 10=IE.ITS neg store 19 | Complex 12=IE.ITS ^C store 20 | Complex 14=IE.ITS IE.MON + store 21 | Complex 16=IE.ITS IE.MON - store 22 | Complex 20=IE.ITS IE.MON * store 23 | Complex 22=IE.ITS IE.MON / store 24 | Complex 24=IE.ITS IE.MON & store 25 | Complex 26=IE.ITS IE.MON ! store 26 | ENDMOD 27 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-endm.mac: -------------------------------------------------------------------------------- 1 | ;;;;; 2 | ; 3 | ; Test nested macros and name on .ENDM 4 | ; 5 | 6 | .macro M1 7 | .word 1 8 | .endm M1 ; ok 9 | 10 | M1 11 | 12 | .macro M2 13 | .word 2 14 | .macro M3 15 | .word 3 16 | .endm M3 ; ok 17 | .endm M2 ; ok 18 | 19 | M2 20 | M3 21 | 22 | .macro M4 23 | .word 4 24 | .macro M4 25 | .endm M4 ; ok 26 | .endm M4 ; ok 27 | 28 | M4 29 | M4 ; should be empty now 30 | 31 | .macro M5 32 | .word 5 33 | .macro M5 34 | .endm notM5 ; wrong; detected when M5 is expanded 35 | .endm M5 ; ok 36 | 37 | M5 38 | M5 39 | 40 | .macro M6 41 | .endm notM6 ; wrong 42 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-impword.lst.ok: -------------------------------------------------------------------------------- 1 | 1 ;;;;; 2 | 2 ; 3 | 3 ; Test the implied .word construction 4 | 4 ; 5 | 5 6 | 6 000000 000003 start: 3 7 | 7 000002 000000' start 8 | 8 ; The following could be a macro which by accident is not defined 9 | 9 ; which takes arguments that don't parse as expressions. 10 | test-impword.mac:10: ***ERROR Invalid expression in .WORD 11 | 10 000004 000000G macro 8-BIT,1,2,3 12 | 11 ; The following can by accident be parsed as an expression. 13 | 12 000006 000000G 150007 000001 macro 7-BIT,1,2,3 14 | 000014 000002 000003 15 | 12 16 | 17 | 18 | Symbol table 19 | 20 | . ******R 001 MACRO =****** GX START 000000R 001 21 | 22 | 23 | Program sections: 24 | 25 | . ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV) 26 | 000020 001 (RW,I,LCL,REL,CON,NOSAV) 27 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-impword.mac: -------------------------------------------------------------------------------- 1 | ;;;;; 2 | ; 3 | ; Test the implied .word construction 4 | ; 5 | 6 | start: 3 7 | start 8 | ; The following could be a macro which by accident is not defined 9 | ; which takes arguments that don't parse as expressions. 10 | macro 8-BIT,1,2,3 11 | ; The following can by accident be parsed as an expression. 12 | macro 7-BIT,1,2,3 13 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-include.mac: -------------------------------------------------------------------------------- 1 | ;;;;; 2 | ; 3 | ; Test some delimiters for the .INCLUDE directive 4 | ; 5 | 6 | .include "incl.mac" 7 | .include /incl.mac/ 8 | .include \incl.mac\ 9 | .include ?incl.mac? 10 | .include >incl.mac> 11 | 12 | ; these are errors: (in MACRO V05.05, some terminate the assembler) 13 | 14 | .include 15 | .include ; bracketed strings are an extension 43 | .word ^r< AD> ; bracketed strings are an extension 44 | .word ^r< D> ; bracketed strings are an extension 45 | .word ^r ; bracketed strings are an extension 46 | .word ^r ; bracketed strings are an extension 47 | .word ^R50. ; 157614 there is no whitespace in between. 48 | .word ^f 1.5 ; 040140 49 | 50 | ;;;;; 51 | ; 52 | ; Test bracketing 53 | ; 54 | .word 1 + < 2 * 3 > ; 1 + 6 = 7 55 | .word 1 + ^! 2 * 3 ! ; 1 + 6 = 7 56 | .word 1 + ^/ 2 * 3 / ; 1 + 6 = 7 57 | .word 1 + ^$ 2 * 3 $ ; 1 + 6 = 7 58 | .word 1 + ^* 2 * 3 * ; Invalid expression 59 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-psect.mac: -------------------------------------------------------------------------------- 1 | ;;;;; 2 | ; 3 | ; Contrary to what the manual says, flags in .PSECT directives 4 | ; are merged. They do not need to be identical every time. 5 | ; 6 | 7 | .psect $pdata 8 | .iif P1, .psect $pdata ,ro,d,lcl,rel,con 9 | .psect $PDATA ,D 10 | 11 | ; and ends up with 12 | ; $PDATA 000000 002 (RO,D,LCL,REL,CON) 13 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-rad50.lst.ok: -------------------------------------------------------------------------------- 1 | 1 ;;;;; 2 | 2 ; 3 | 3 ; Test .rad50 directive 4 | 4 ; 5 | 5 ; 6 | 6 ; 0 space 7 | 7 ; 01-32 A-Z 8 | 8 ; 33 $ 9 | 9 ; 34 . 10 | 10 ; 35 (undefined) 11 | 11 ; 36-47 0-9 12 | 12 ; 13 | 13 ; radix-50 value: ((C1 * 50) + C2) * 50) + C3 ; everything octal of course 14 | 14 ; example: ABC => ((1*50)+2)*50+3 = 3223 15 | 15 16 | 16 000000 003223 .rad50 /ABC/ ; Packs ABC into one word 17 | 17 000002 003223 .rad50 ^ABC^ ; Packs ABC into one word 18 | 18 000004 003220 .rad50 /AB/ ; Packs AB (SPACE) into one word 19 | 19 000006 003223 014400 .rad50 /ABCD/ ; Packs ABC into first word and 20 | 20 ; D (SPACE) (SPACE) into second word. 21 | 21 000012 003223 014716 .rad50 /ABCDEF/ ; Packs ABC into first word, DEF into 22 | 22 ; second word. 23 | 23 000016 003255 .rad50 /AB/<35> ; stores 3255 in one word 24 | test-rad50.mac:24: ***ERROR invalid character '?' 25 | test-rad50.mac:24: ***ERROR invalid character '!' 26 | test-rad50.mac:24: ***ERROR invalid character '=' 27 | 24 000020 000000 .rad50 /?!=/ ; invalid characters 28 | test-rad50.mac:25: ***ERROR invalid character value 50 29 | test-rad50.mac:25: ***ERROR invalid character value 37777777777 30 | 25 000022 000000 .rad50 <0><50><-1> ; invalid characters 31 | 26 000001 CHR1=1 32 | 27 000002 CHR2=2 33 | 28 000003 CHR3=3 34 | 29 000024 003223 .RAD50 <1><2><3> ; Equivalent to .RAD50 /ABC/ 35 | 30 000026 003223 .RAD50 ; Equivalent to .RAD50 /ABC/ 36 | 30 37 | 38 | 39 | Symbol table 40 | 41 | . ******R 001 CHR1 =000001 CHR2 =000002 CHR3 =000003 42 | 43 | 44 | Program sections: 45 | 46 | . ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV) 47 | 000030 001 (RW,I,LCL,REL,CON,NOSAV) 48 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-rad50.mac: -------------------------------------------------------------------------------- 1 | ;;;;; 2 | ; 3 | ; Test .rad50 directive 4 | ; 5 | ; 6 | ; 0 space 7 | ; 01-32 A-Z 8 | ; 33 $ 9 | ; 34 . 10 | ; 35 (undefined) 11 | ; 36-47 0-9 12 | ; 13 | ; radix-50 value: ((C1 * 50) + C2) * 50) + C3 ; everything octal of course 14 | ; example: ABC => ((1*50)+2)*50+3 = 3223 15 | 16 | .rad50 /ABC/ ; Packs ABC into one word 17 | .rad50 ^ABC^ ; Packs ABC into one word 18 | .rad50 /AB/ ; Packs AB (SPACE) into one word 19 | .rad50 /ABCD/ ; Packs ABC into first word and 20 | ; D (SPACE) (SPACE) into second word. 21 | .rad50 /ABCDEF/ ; Packs ABC into first word, DEF into 22 | ; second word. 23 | .rad50 /AB/<35> ; stores 3255 in one word 24 | .rad50 /?!=/ ; invalid characters 25 | .rad50 <0><50><-1> ; invalid characters 26 | CHR1=1 27 | CHR2=2 28 | CHR3=3 29 | .RAD50 <1><2><3> ; Equivalent to .RAD50 /ABC/ 30 | .RAD50 ; Equivalent to .RAD50 /ABC/ 31 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-undef.lst.ok: -------------------------------------------------------------------------------- 1 | test-undef.mac:1: ***ERROR MACRO .TTYOU not found 2 | 1 .MCALL .TTYOUT 3 | 1 4 | 5 | 6 | Symbol table 7 | 8 | . ******R 001 9 | 10 | 11 | Program sections: 12 | 13 | . ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV) 14 | 000000 001 (RW,I,LCL,REL,CON,NOSAV) 15 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-undef.mac: -------------------------------------------------------------------------------- 1 | .MCALL .TTYOUT 2 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-word-comma.lst.ok: -------------------------------------------------------------------------------- 1 | 1 2 | 2 000000 000123 start: .word 123 ; 1 word 3 | 3 000002 000000 .word ; 1 word 4 | 4 000004 000001 000000 .word 1, ; 2 words 5 | 5 000010 000000 000002 .word ,2 ; 2 words 6 | 6 000014 000000 000000 .word , ; 2 words 7 | 7 000020 000000 000000 000000 .word ,, ; 3 words 8 | 8 000026 000001 000000 000000 .word 1,, ; 3 words 9 | 9 000034 000000 000000 000003 .word ,,3 ; 3 words 10 | 10 000042 000001 000000 000003 .word 1,,3 ; 3 words 11 | 11 000050 000001 000002 000003 .word 1,2,3 ; 3 words 12 | 12 13 | 12 14 | 15 | 16 | Symbol table 17 | 18 | . ******R 001 START 000000R 001 19 | 20 | 21 | Program sections: 22 | 23 | . ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV) 24 | 000056 001 (RW,I,LCL,REL,CON,NOSAV) 25 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tests/test-word-comma.mac: -------------------------------------------------------------------------------- 1 | 2 | start: .word 123 ; 1 word 3 | .word ; 1 word 4 | .word 1, ; 2 words 5 | .word ,2 ; 2 words 6 | .word , ; 2 words 7 | .word ,, ; 3 words 8 | .word 1,, ; 3 words 9 | .word ,,3 ; 3 words 10 | .word 1,,3 ; 3 words 11 | .word 1,2,3 ; 3 words 12 | 13 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tools/checker.pl: -------------------------------------------------------------------------------- 1 | #!/usr/pkg/bin/perl 2 | # 3 | # Checker script - checks if a bunch of macro11 object files have 4 | # undefined symbols left over. 5 | # 6 | # Uses the dumpobj tool to parse the object files. 7 | # 8 | use strict; 9 | #use Data::Dumper; 10 | 11 | my %symtab; 12 | 13 | # Symbols are stored in the symbol table. 14 | # They have 2 fields: 15 | # - a list of definitions (hopefully 1 entry long) 16 | # - a list of references 17 | 18 | sub read_object_file { 19 | my $fn = shift; 20 | 21 | if ($fn =~ /\.def$/i) { 22 | open OBJ, "<", $fn; 23 | } else { 24 | open OBJ, "dumpobj '".$fn."' |"; 25 | } 26 | 27 | my $gsd = 0; 28 | my $line = ; 29 | 30 | while (defined $line) { 31 | # print $line; 32 | if ($line =~ /^GSD:/) { 33 | $gsd = 1; 34 | # print "gsd = 1\n"; 35 | } elsif ($line =~ /^ENDGSD/) { 36 | $gsd = 0; 37 | # print "gsd = 0\n"; 38 | } elsif ($gsd) { 39 | #print $line; 40 | # GLOBAL AT$CDT=0 REF ABS flags=100 41 | if ($line =~ /GLOBAL ([A-Z0-9.\$]*)=[0-9]* (.*)/) { 42 | my $symbol = $1; 43 | my $flags = $2; 44 | 45 | #print "flags: $flags\n"; 46 | my $key = 'refs'; 47 | if ($flags =~ /\bDEF\b/) { 48 | $key = 'defs'; 49 | } 50 | 51 | if (!defined $symtab{$symbol}) { 52 | $symtab{$symbol} = { 53 | 'defs' => [], 54 | 'refs' => [] 55 | }; 56 | } 57 | 58 | push @{$symtab{$symbol}->{$key}}, $fn; 59 | } 60 | } 61 | $line = ; 62 | } 63 | 64 | close OBJ; 65 | } 66 | 67 | # Read all object files 68 | 69 | foreach my $fn (@ARGV) { 70 | read_object_file($fn); 71 | 72 | # print Dumper(\%symtab); 73 | } 74 | 75 | # Check which symbols have no definition 76 | 77 | print "Symbols with no definition:\n"; 78 | my $undefs = 0; 79 | 80 | foreach my $key (sort keys %symtab) { 81 | #print $key, " : ", Dumper($entry); 82 | my $entry = %symtab{$key}; 83 | 84 | my @defs = @{$entry->{defs}}; 85 | #print (@defs), "\n"; 86 | #print scalar(@defs), "\n"; 87 | 88 | if (scalar(@defs) == 0) { 89 | $undefs++; 90 | print $key, ":"; 91 | for my $ref (@{$entry->{refs}}) { 92 | print " ", $ref; 93 | } 94 | print "\n"; 95 | } 96 | } 97 | 98 | if ($undefs == 0) { 99 | print "(none)\n"; 100 | } 101 | -------------------------------------------------------------------------------- /crossassemblers/macro11/tools/varrec.c: -------------------------------------------------------------------------------- 1 | /* 2 | * A little tool to convert files with variable records to byte streams. 3 | * 4 | * Each record consist of 2 bytes of length (little endian) followed by 5 | * that number of data bytes. 6 | * 7 | * If the length is odd, there is a padding byte. This byte does not have 8 | * to be 0. 9 | */ 10 | #include 11 | 12 | int main(int argc, char **argv) 13 | { 14 | while (!feof(stdin)) { 15 | int count, savecount; 16 | unsigned char ch; 17 | 18 | ch = getchar(); 19 | count = ch; 20 | ch = getchar(); 21 | count += ch << 8; 22 | 23 | savecount = count; 24 | 25 | while (count-- > 0) { 26 | ch = getchar(); 27 | putchar(ch); 28 | } 29 | 30 | if (savecount & 1) { 31 | getchar(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /crossassemblers/macro11/util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL__H 2 | #define UTIL__H 3 | 4 | /* 5 | 6 | Copyright (c) 2001, Richard Krehbiel 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions are 11 | met: 12 | 13 | o Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | o Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | o Neither the name of the copyright holder nor the names of its 21 | contributors may be used to endorse or promote products derived from 22 | this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 31 | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 33 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 34 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 35 | DAMAGE. 36 | 37 | */ 38 | 39 | #include "stream2.h" 40 | 41 | char *my_ultoa( 42 | unsigned long val, 43 | char *buf, 44 | unsigned int base); 45 | char *my_ltoa( 46 | long val, 47 | char *buf, 48 | unsigned int base); 49 | void my_searchenv( 50 | char *name, 51 | char *envname, 52 | char *hitfile, 53 | int hitlen); 54 | 55 | /* Cover a few platform-dependencies */ 56 | 57 | #ifdef WIN32 58 | typedef unsigned __int64 ulong64; 59 | 60 | #define strdup _strdup 61 | #define putenv _putenv 62 | #define PATHSEP ";" 63 | #else 64 | typedef unsigned long long ulong64; 65 | 66 | #define PATHSEP ":" 67 | #endif 68 | 69 | 70 | #define FALSE 0 /* Everybody needs FALSE and TRUE */ 71 | #define TRUE 1 72 | 73 | 74 | /* EOL says whether a char* is pointing at the end of a line */ 75 | #define EOL(c) (!(c) || (c) == '\n' || (c) == ';') 76 | 77 | #define SIZEOF_MEMBER(s, m) (sizeof((s *)0)->m) 78 | 79 | void upcase( 80 | char *str); 81 | 82 | void downcase( 83 | char *str); 84 | 85 | void padto( 86 | char *str, 87 | int to); 88 | 89 | void *memcheck( 90 | void *ptr); 91 | 92 | 93 | #endif /* UTIL__H */ 94 | -------------------------------------------------------------------------------- /crossassemblers/macro7/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=macro7 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /crossassemblers/macro8x/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=macro8x 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /extracters/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | SUBDIRS=backup ckabstape cpytap dbtap mmdir mtdump ods2 rawcopy rawtap rstsflx sdsdump tpdump 9 | 10 | .PHONY: all clean install uninstall 11 | 12 | # Omitted: backup, ods2: need more complicated Makefiles. 13 | all: 14 | for subdir in $(SUBDIRS); do \ 15 | $(MAKE) -C $$subdir CFLAGS="$(CFLAGS)" BIN="$(BIN)" INSTALL="$(INSTALL)" CC="$(CC)"; \ 16 | done 17 | 18 | clean install uninstall: 19 | for subdir in $(SUBDIRS); do \ 20 | $(MAKE) -C $$subdir CFLAGS="$(CFLAGS)" BIN="$(BIN)" INSTALL="$(INSTALL)" CC="$(CC)" $@; \ 21 | done 22 | -------------------------------------------------------------------------------- /extracters/ckabstape/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=ckabstape 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /extracters/cpytap/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if don't suit 2 | # your environment 3 | TOOL=cpytap 4 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 5 | BIN=/usr/local/bin 6 | INSTALL=install 7 | CC=gcc 8 | 9 | $(TOOL): $(TOOL).c tapeio.c tapeio.h tap.h defs.h 10 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c tapeio.c $(LDLIBS) 11 | 12 | .PHONY: clean install uninstall 13 | 14 | clean: 15 | rm -f $(TOOL) 16 | 17 | install: $(TOOL) 18 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 19 | 20 | uninstall: 21 | rm -f $(BIN)/$(TOOL) 22 | -------------------------------------------------------------------------------- /extracters/cpytap/cpytap.txt: -------------------------------------------------------------------------------- 1 | cpytap manipulates a .tap magtape container file used by SIMH. It copies an 2 | existing .tap file to a newly created .tap while modifying its file level 3 | contents. While performing the copy, individual files may be skipped or 4 | replaced and new files may be inserted at specified positions or appended 5 | after the last source file has been copied. For files which are copied between 6 | the source and destination tapes, the internal record structure of each file 7 | is maintained. Replacement or inserted/appended files may only be written 8 | with a specified maximum record size. 9 | 10 | cpytap is invoked by: 11 | 12 | cpytap src dst [-r len] [-I n,file] [-R n,file] [-S n] [-A file] 13 | 14 | Where: 15 | 16 | -r len Max record size to be used when writing new files to the 17 | destination tape. (1 <= len <= 65536, default 10240). 18 | There may be multiple "-r" switches on the command line. 19 | When a "-r" switch is specified, it takes effect on all 20 | following editing commands. 21 | 22 | -I n,file Insert the specified file before file n of the source tape 23 | 24 | -R n,file Replace file n of the source tape with the specified file 25 | 26 | -S n Skip file n of the source tape 27 | 28 | -A file Append the specified fie after all the files on the source 29 | tape have been copied to the destination tape. 30 | 31 | Files on the source tape are numbered 1 - n. 32 | 33 | When multiple -I commands reference the same source tape file or there are 34 | multiple -A commands, the files will be written to the destination tape in 35 | the order specified on the command line. If a -R command and a -I command 36 | reference the same source tape file, the -R file will be written first 37 | followed by the -I file(s). 38 | 39 | The editing control tables are pre-built into the executable. Edit commands 40 | may be issued for files 1 - 100, subsequent files will just be copied from 41 | source to destination. There may be up to 20 -I commands for each source tape 42 | file and up to 20 -A commands. 43 | -------------------------------------------------------------------------------- /extracters/cpytap/defs.h: -------------------------------------------------------------------------------- 1 | /* defs.h: Common definitions 2 | 3 | Copyright (c) 2015, John Forecast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | JOHN FORECAST BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of John Forecast shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from John Forecast. 25 | 26 | */ 27 | 28 | #ifndef __DEFS_H__ 29 | #define __DEFS_H__ 30 | #if defined(VMS) 31 | #include 32 | #else 33 | typedef signed char int8; 34 | typedef signed short int16; 35 | typedef signed int int32; 36 | typedef unsigned char uint8; 37 | typedef unsigned short uint16; 38 | typedef unsigned int uint32; 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /extracters/cpytap/tap.h: -------------------------------------------------------------------------------- 1 | /* tap.h: simh tape representation definitions 2 | 3 | Copyright (c) 2015, John Forecast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | JOHN FORECAST BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of John Forecast shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from John Forecast. 25 | 26 | */ 27 | 28 | /* 29 | * Metadata markers 30 | */ 31 | #define ST_EOM 0xFFFFFFFF /* end of medium */ 32 | #define ST_GAP 0xFFFFFFFE /* erase gap */ 33 | #define ST_TM 0x00000000 /* tape mark */ 34 | 35 | /* 36 | * Record length field layout 37 | */ 38 | #define ST_ERROR 0x80000000 /* record contains an error */ 39 | #define ST_MBZ 0x7F000000 /* must be zero */ 40 | #define ST_LENGTH 0x00FFFFFF /* record length */ 41 | 42 | /* 43 | * Data in the .tap containe file is rounded up to an even number of bytes 44 | */ 45 | #define RECLEN(c) (((c) + 1) & ~1) 46 | 47 | /* 48 | * The maximum record length supported by this code is 64K. 49 | */ 50 | #define MAXRCLNT 65536 51 | -------------------------------------------------------------------------------- /extracters/cpytap/tapeio.h: -------------------------------------------------------------------------------- 1 | /* tapeio.h: Tape I/O definitions 2 | 3 | Copyright (c) 2015, John Forecast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | JOHN FORECAST BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of John Forecast shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from John Forecast. 25 | 26 | */ 27 | 28 | #include "tap.h" 29 | #include "defs.h" 30 | 31 | /* 32 | * Tape open status return codes 33 | */ 34 | #define TIO_SUCCESS 0 /* operation successful */ 35 | #define TIO_ERROR -1 /* error record seen */ 36 | #define TIO_CORRUPT -2 /* tape format is corrupt */ 37 | #define TIO_OPENFAIL -3 /* open operation failed */ 38 | #define TIO_CREATEFAIL -4 /* create operation failed */ 39 | #define TIO_IOERROR -5 /* I/O error */ 40 | 41 | /* 42 | * Tape open/close routines. 43 | */ 44 | extern int OpenTapeForRead(FILE **, char *); 45 | extern int OpenTapeForWrite(FILE **, char *); 46 | extern int OpenTapeForAppend(FILE **, char *); 47 | extern void CloseTape(FILE *); 48 | 49 | /* 50 | * Tape I/O routines. 51 | */ 52 | uint32 ReadTapeRecord(FILE *, void *, int); 53 | uint32 ReadTapeRecordLength(FILE *); 54 | int WriteTapeRecord(FILE *, void *, int); 55 | unsigned int SkipToNextTapeMark(FILE *); 56 | int WriteTapeMark(FILE *, int); 57 | 58 | /* 59 | * Buffered I/O routines 60 | */ 61 | void initTapeBuffering(int); 62 | int flushTapeBuffering(FILE *); 63 | int writeTapeBuffering(FILE *, char); 64 | -------------------------------------------------------------------------------- /extracters/dbtap/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if don't suit 2 | # your environment 3 | TOOL=dbtap 4 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 5 | BIN=/usr/local/bin 6 | INSTALL=install 7 | CC=gcc 8 | 9 | $(TOOL): $(TOOL).c tapeio.c dos11.c tapeio.h dos11.h tap.h defs.h 10 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c tapeio.c dos11.c $(LDLIBS) 11 | 12 | .PHONY: clean install uninstall 13 | 14 | clean: 15 | rm -f $(TOOL) 16 | 17 | install: $(TOOL) 18 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 19 | 20 | uninstall: 21 | rm -f $(BIN)/$(TOOL) 22 | -------------------------------------------------------------------------------- /extracters/dbtap/dbtap.txt: -------------------------------------------------------------------------------- 1 | dbtap manipulates .tap magtape container files used by SIMH and written in 2 | DOS/BATCH-11 file format. dbtap is invoked by: 3 | 4 | dbtap -lcae [-r len -A -E -S -P pg,pj] container [...] 5 | 6 | To list the contents of one or more container files: 7 | 8 | dbtap -l container ... 9 | 10 | To create a new container file and append file(s): 11 | 12 | dbtap -c [-r len -A -S -P pg,pj] container file ... 13 | 14 | To append file(s) to an existing container: 15 | 16 | dbtap -a [-r len -A -S -P pg,pj] container file ... 17 | 18 | To extract file(s) from container(s): 19 | 20 | dbtap -e [-A -E] container ... 21 | 22 | Switches: 23 | 24 | -r len Specify max tape record size when writing. 25 | (512 <= len <= 65536). 26 | 27 | -A By default, files are transferred in Binary mode. This switch 28 | is used to specify file extensions which should be transferred 29 | in Ascii mode (e.g. ".MAC:.BAT" or ".MAC,.BAT"). 30 | 31 | -E Include prog,proj in filename when extracting. 32 | (e.g. FILE_ggg_jjj.EXT"). 33 | 34 | -S DOS/BATCH-11 uses 6+3 (name+extension) for filenames including 35 | on magtape. Over time, the magtape definition changed to 36 | allow 9+3 filenames by adding an extra word to the filename 37 | record. By default, this program uses the 9+3 format but 38 | the -S switch may be used to force 6+3 filenames when writing 39 | to tape. 40 | 41 | -P pg,pj Specify prog,proj number when writing to tape. Numbers are in 42 | octal. Default is [1,1]. 43 | 44 | -------------------------------------------------------------------------------- /extracters/dbtap/defs.h: -------------------------------------------------------------------------------- 1 | /* defs.h: Common definitions 2 | 3 | Copyright (c) 2015, John Forecast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | JOHN FORECAST BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of John Forecast shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from John Forecast. 25 | 26 | */ 27 | 28 | #ifndef __DEFS_H__ 29 | #define __DEFS_H__ 30 | #if defined(VMS) 31 | #include 32 | #else 33 | typedef signed char int8; 34 | typedef signed short int16; 35 | typedef signed int int32; 36 | typedef unsigned char uint8; 37 | typedef unsigned short uint16; 38 | typedef unsigned int uint32; 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /extracters/dbtap/dos11.h: -------------------------------------------------------------------------------- 1 | /* dos11.h: DOS/BATCH-11 tape file format definitions 2 | 3 | Copyright (c) 2015, John Forecast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | JOHN FORECAST BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of John Forecast shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from John Forecast. 25 | 26 | */ 27 | 28 | #include "defs.h" 29 | 30 | /* 31 | * Actual file header as used in DOS/BATCH-11. 32 | */ 33 | struct dos11hdr1 { 34 | uint16 fname[2]; /* first 6 chars of filename (RAD50) */ 35 | uint16 ext; /* 3 letter file extension (RAD50) */ 36 | uint8 proj; /* project # (octal) */ 37 | uint8 prog; /* programmer # (octal) */ 38 | uint16 prot; /* protection code (octal) */ 39 | uint16 date; /* (year-1970) * 1000 + day of year */ 40 | }; 41 | 42 | /* 43 | * File header as seen on many archive tapes. 44 | */ 45 | struct dos11hdr2 { 46 | uint16 fname[2]; /* first 6 chars of filename (RAD50) */ 47 | uint16 ext; /* 3 letter file extension (RAD50) */ 48 | uint8 proj; /* project # (octal) */ 49 | uint8 prog; /* programmer # (octal) */ 50 | uint16 prot; /* protection code (octal) */ 51 | uint16 date; /* (year-1970) * 1000 + day of year */ 52 | uint16 fname3; /* optional, letters 7 - 9 of name */ 53 | }; 54 | 55 | /* 56 | * DOS/BATCH-11 processing functions 57 | */ 58 | int appendFile(char *, char *, uint8, uint8, int, int); 59 | void extractFiles(char *, int); 60 | void listDirectory(void); 61 | -------------------------------------------------------------------------------- /extracters/dbtap/tap.h: -------------------------------------------------------------------------------- 1 | /* tap.h: simh tape representation definitions 2 | 3 | Copyright (c) 2015, John Forecast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | JOHN FORECAST BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of John Forecast shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from John Forecast. 25 | 26 | */ 27 | 28 | /* 29 | * Metadata markers 30 | */ 31 | #define ST_EOM 0xFFFFFFFF /* end of medium */ 32 | #define ST_GAP 0xFFFFFFFE /* erase gap */ 33 | #define ST_TM 0x00000000 /* tape mark */ 34 | 35 | /* 36 | * Record length field layout 37 | */ 38 | #define ST_ERROR 0x80000000 /* record contains an error */ 39 | #define ST_MBZ 0x7F000000 /* must be zero */ 40 | #define ST_LENGTH 0x00FFFFFF /* record length */ 41 | 42 | /* 43 | * Data in the .tap containe file is rounded up to an even number of bytes 44 | */ 45 | #define RECLEN(c) (((c) + 1) & ~1) 46 | 47 | /* 48 | * The maximum record length supported by this code is 64K. 49 | */ 50 | #define MAXRCLNT 65536 51 | -------------------------------------------------------------------------------- /extracters/dbtap/tapeio.h: -------------------------------------------------------------------------------- 1 | /* tapeio.h: Tape I/O definitions 2 | 3 | Copyright (c) 2015, John Forecast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | JOHN FORECAST BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of John Forecast shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from John Forecast. 25 | 26 | */ 27 | 28 | #include "tap.h" 29 | #include "defs.h" 30 | 31 | /* 32 | * Tape open status return codes 33 | */ 34 | #define TIO_SUCCESS 0 /* operation successful */ 35 | #define TIO_ERROR -1 /* error record seen */ 36 | #define TIO_CORRUPT -2 /* tape format is corrupt */ 37 | #define TIO_OPENFAIL -3 /* open operation failed */ 38 | #define TIO_CREATEFAIL -4 /* create operation failed */ 39 | #define TIO_IOERROR -5 /* I/O error */ 40 | 41 | /* 42 | * Tape open/close routines. 43 | */ 44 | extern int OpenTapeForRead(char *); 45 | extern int OpenTapeForWrite(char *); 46 | extern int OpenTapeForAppend(char *); 47 | extern void CloseTape(void); 48 | 49 | /* 50 | * Tape I/O routines. 51 | */ 52 | uint32 ReadTapeRecord(void *, int); 53 | uint32 ReadTapeRecordLength(void); 54 | int WriteTapeRecord(void *, int); 55 | int WriteTapeMark(int); 56 | 57 | /* 58 | * Buffered I/O routines 59 | */ 60 | void initTapeBuffering(int); 61 | int flushTapeBuffering(void); 62 | int writeTapeBuffering(char); 63 | -------------------------------------------------------------------------------- /extracters/mmdir/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=mmdir 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /extracters/mtdump/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=mtdump 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /extracters/mtdump/mtdump.txt: -------------------------------------------------------------------------------- 1 | mtdump dumps the record structure of a tape image file in SIMH, E11, TPC, or 2 | P7B format. mtdump is invoked by 3 | 4 | mtdump {-secp} file1 file2 file3... 5 | 6 | where -s specifies SIMH format, -e E11 format, -c TPC format, and -p P7B 7 | format. The default is SIMH format. Output is to stdout, unless redirected. 8 | 9 | SIMH format is as follows: 10 | 11 | 4 byte record length 1 12 | record 1 13 | repeat of 4 byte record length 1 14 | 4 byte record length 2 15 | record 2 16 | repeat of 4 byte record length 2 17 | : 18 | 4 bytes = 00000000 for end of file 19 | 20 | and so on. Records are padded to even byte length. 21 | 22 | E11 format is similar to SIMH format, but odd length records are not padded 23 | to even length. 24 | 25 | TPC format is as follows: 26 | 27 | 2 byte record length 1 28 | record 1 29 | 2 byte record length 2 30 | record 2 31 | : 32 | 2 bytes = 0000 for end of file 33 | 34 | and so on. Records are padded to even byte length. 35 | 36 | P7B format is confined to 7 track tapes, as follows: 37 | 38 | start of record + first 6b character and parity 39 | : 40 | last character 41 | start of record + first 6b character and parity 42 | 43 | and so on. A P7B tape must have a dummy "last record" with a start of 44 | record indicator. A tape mark is indicated by a character of 317 (start 45 | of record, character 17, wrong parity for odd parity, reserved character 46 | for even parity). 47 | 48 | mmdir is a variant of mtdump that dumps the directory structure of an 49 | Interdata MMD (multimedia diagnostic) tape. The tape must be in SMIH 50 | format. 51 | -------------------------------------------------------------------------------- /extracters/ods2/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=ods2 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c access.c cache.c device.c direct.c phynt.c rms.c vmstime.c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c access.c cache.c device.c direct.c phynt.c rms.c vmstime.c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /extracters/ods2/build.com: -------------------------------------------------------------------------------- 1 | $ gccflag := 'cc' 2 | $ if f$extract(0,3,gccflag).nes."GCC" then gccflag="" 3 | $ 4 | $ if gccflag.nes."" 5 | $ then p1="/optim=level=3/warn=all"+p1 6 | $ else p1="/warn=enabl=(defunct,obsolescent,questcode,uninit,unused)"+p1 7 | $ endif 8 | $ 9 | $ default=f$parse(f$environment("PROCEDURE"),,,"DEVICE","SYNTAX_ONLY")+ - 10 | f$parse(f$environment("PROCEDURE"),,,"DIRECTORY","SYNTAX_ONLY") 11 | $ set def 'default' 12 | $ 13 | $ call cc ods2 'p1' 14 | $ call cc rms 'p1' 15 | $ call cc direct 'p1' 16 | $ call cc access 'p1' 17 | $ call cc device 'p1' 18 | $ call cc cache 'p1' 19 | $ call cc phyvms 'p1' 20 | $ call cc vmstime 'p1' 21 | $ 22 | $ write sys$error "''f$time()' Linking..." 23 | $ if gccflag.nes."" 24 | $ then library = ",vaxcrtl.tmp/option" 25 | $ create vaxcrtl.tmp 26 | sys$share:vaxcrtl/share 27 | $ endif 28 | $ link 'p2' ods2,rms,direct,access,device,cache,phyvms,vmstime 'library' 29 | $ write sys$error "''f$time()' Done" 30 | $ exit 31 | $ 32 | $cc: subroutine 33 | $ if f$search(p1+".obj;").nes."" then if f$cvtime(f$file(p1+".obj;","CDT")).ges.f$cvtime(f$file(p1+".c;","CDT")) then exit 34 | $ write sys$error "''f$time()' Compiling ''p1'..." 35 | $ cc 'p2' 'p1' 36 | $ exit 37 | $ endsubroutine 38 | -------------------------------------------------------------------------------- /extracters/ods2/cache.h: -------------------------------------------------------------------------------- 1 | /* Cache.h v1.2 Definitions for cache routines */ 2 | 3 | /* 4 | This is part of ODS2 written by Paul Nankervis, 5 | email address: Paulnank@au1.ibm.com 6 | 7 | ODS2 is distributed freely for all members of the 8 | VMS community to use. However all derived works 9 | must maintain comments in their source to acknowledge 10 | the contibution of the original author. 11 | */ 12 | 13 | #ifndef CACHE_WRITE 14 | 15 | #define CACHE_WRITE 1 16 | #define CACHE_MODIFIED 2 17 | 18 | struct CACHE { 19 | struct CACHE **parent; 20 | struct CACHE *left; 21 | struct CACHE *right; 22 | struct CACHE *nxtcache; 23 | struct CACHE *lstcache; 24 | struct CACHE *(*objmanager) (struct CACHE * cacheobj); 25 | unsigned keyval; 26 | unsigned status; 27 | int refcount; 28 | }; 29 | 30 | void cacheshow(void); 31 | void cachedump(void); 32 | void cacheprint(struct CACHE *cacheobj,int level); 33 | void cacheflush(void); 34 | int cacherefcount(struct CACHE *cacheobj); 35 | void cachedeltree(struct CACHE *cacheobj); 36 | void cachetouch(struct CACHE *cacheobj); 37 | unsigned cacheuntouch(struct CACHE *cacheobj,unsigned reuse,unsigned modflg); 38 | struct CACHE *cachefree(struct CACHE *cacheobj); 39 | struct CACHE *cachedelete(struct CACHE *cacheobj); 40 | struct CACHE *cachemake(struct CACHE **parent,unsigned length); 41 | void *cachesearch(void **root,unsigned keyval,unsigned keylen,void *key, 42 | int (*cmpfunc) (unsigned keylen,void *key,void *node), 43 | unsigned *createsize); 44 | #endif 45 | -------------------------------------------------------------------------------- /extracters/ods2/descrip.h: -------------------------------------------------------------------------------- 1 | /* Descrip.h v1.2 Definitions for descriptors */ 2 | 3 | /* 4 | This is part of ODS2 written by Paul Nankervis, 5 | email address: Paulnank@au1.ibm.com 6 | 7 | ODS2 is distributed freely for all members of the 8 | VMS community to use. However all derived works 9 | must maintain comments in their source to acknowledge 10 | the contibution of the original author. 11 | */ 12 | 13 | 14 | #if defined(VMS) && !defined(__GNUC__) 15 | 16 | #include 17 | 18 | #else 19 | 20 | #ifndef DSC$K_DTYPE_T 21 | #define DSC$K_DTYPE_T 0 22 | #define DSC$K_CLASS_S 0 23 | 24 | struct dsc$descriptor { 25 | unsigned short dsc$w_length; 26 | unsigned char dsc$w_type; 27 | unsigned char dsc$w_class; 28 | char *dsc$a_pointer; 29 | }; 30 | 31 | #define $DESCRIPTOR(string,name) struct dsc$descriptor name = {sizeof(sring)-1,0,0,string}; 32 | 33 | #endif 34 | #endif 35 | -------------------------------------------------------------------------------- /extracters/ods2/device.c: -------------------------------------------------------------------------------- 1 | /* Device.c v1.2 Module to remember and find devices...*/ 2 | 3 | /* 4 | This is part of ODS2 written by Paul Nankervis, 5 | email address: Paulnank@au1.ibm.com 6 | 7 | ODS2 is distributed freely for all members of the 8 | VMS community to use. However all derived works 9 | must maintain comments in their source to acknowledge 10 | the contibution of the original author. 11 | */ 12 | 13 | /* Should have mechanism to return actual device name... */ 14 | 15 | /* This module is simple enough - it just keeps track of 16 | device names and initialization... */ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "ssdef.h" 23 | #include "access.h" 24 | #include "phyio.h" 25 | 26 | 27 | int devcmp(unsigned keylen,void *key,void *node) 28 | { 29 | register struct DEV *devnode = (struct DEV *) node; 30 | register int cmp = keylen - devnode->devlen; 31 | if (cmp == 0) { 32 | register unsigned len = keylen; 33 | register char *keynam = (char *) key; 34 | register char *devnam = devnode->devnam; 35 | while (len-- > 0) { 36 | cmp = toupper(*keynam++) - toupper(*devnam++); 37 | if (cmp != 0) break; 38 | } 39 | } 40 | return cmp; 41 | } 42 | 43 | struct DEV *dev_root = NULL; 44 | 45 | unsigned device_lookup(unsigned devlen,char *devnam, 46 | int create,struct DEV **retdev) 47 | { 48 | register struct DEV *dev; 49 | register unsigned sts,devsiz = 0; 50 | unsigned devcreate = 0; 51 | while (devsiz < devlen) { 52 | if (devnam[devsiz] == ':') break; 53 | devsiz++; 54 | } 55 | if (create) devcreate = sizeof(struct DEV) + devsiz + 2; 56 | dev = (struct DEV *) cachesearch((void **) &dev_root,0,devsiz, 57 | (void *) devnam,devcmp,&devcreate); 58 | if (dev == NULL) { 59 | if (create) { 60 | sts = SS$_INSFMEM; 61 | } else { 62 | sts = SS$_NOSUCHDEV; 63 | } 64 | } else { 65 | struct phyio_info info; 66 | *retdev = dev; 67 | if (create && (devcreate == 0)) { 68 | memcpy(dev->devnam,devnam,devsiz); 69 | memcpy(dev->devnam + devsiz,":",2); 70 | dev->devlen = devsiz; 71 | sts = phyio_init(devsiz + 1,dev->devnam,&dev->handle,&info); 72 | if (sts & 1) { 73 | dev->status = info.status; 74 | dev->sectors = info.sectors; 75 | dev->sectorsize = info.sectorsize; 76 | } else { 77 | cacheuntouch((struct CACHE *) dev,0,0); 78 | cachefree((struct CACHE *) dev); 79 | } 80 | } else { 81 | sts = 1; 82 | } 83 | } 84 | return sts; 85 | } 86 | -------------------------------------------------------------------------------- /extracters/ods2/direct.h: -------------------------------------------------------------------------------- 1 | /* Direct.h v1.2 Definitions for directory access routines */ 2 | 3 | /* 4 | This is part of ODS2 written by Paul Nankervis, 5 | email address: Paulnank@au1.ibm.com 6 | 7 | ODS2 is distributed freely for all members of the 8 | VMS community to use. However all derived works 9 | must maintain comments in their source to acknowledge 10 | the contibution of the original author. 11 | */ 12 | 13 | 14 | 15 | struct dir$rec { 16 | u_word dir$size; 17 | u_word dir$verlimit; 18 | u_byte dir$flags; 19 | u_byte dir$namecount; 20 | char dir$name[1]; 21 | }; 22 | 23 | struct dir$ent { 24 | u_word dir$version; 25 | struct fiddef dir$fid; 26 | }; 27 | 28 | 29 | unsigned direct(struct VCB *vcb,struct dsc$descriptor * fibdsc, 30 | struct dsc$descriptor *filedsc,unsigned short *reslen, 31 | struct dsc$descriptor *resdsc,unsigned action); 32 | -------------------------------------------------------------------------------- /extracters/ods2/fibdef.h: -------------------------------------------------------------------------------- 1 | /* Fibdef.h v1.2 Definition of 'struct fibdef' */ 2 | 3 | /* 4 | This is part of ODS2 written by Paul Nankervis, 5 | email address: Paulnank@au1.ibm.com 6 | 7 | ODS2 is distributed freely for all members of the 8 | VMS community to use. However all derived works 9 | must maintain comments in their source to acknowledge 10 | the contibution of the original author. 11 | */ 12 | 13 | 14 | #if defined(VMS) && !defined(__GNUC__) 15 | 16 | #include 17 | 18 | #else 19 | 20 | #define FIB$M_WILD 0x100 21 | 22 | struct fibdef { 23 | unsigned fib$l_acctl; 24 | unsigned short fib$w_fid_num; 25 | unsigned short fib$w_fid_seq; 26 | unsigned char fib$b_fid_rvn; 27 | unsigned char fib$b_fid_nmx; 28 | unsigned short fib$w_did_num; 29 | unsigned short fib$w_did_seq; 30 | unsigned char fib$b_did_rvn; 31 | unsigned char fib$b_did_nmx; 32 | unsigned fib$l_wcc; 33 | unsigned fib$w_nmctl; 34 | unsigned fib$l_exsz; 35 | unsigned fib$w_exctl; 36 | }; 37 | #endif 38 | -------------------------------------------------------------------------------- /extracters/ods2/phyio.h: -------------------------------------------------------------------------------- 1 | /* Phy.h v1.2 Definition of Physical I/O routines */ 2 | 3 | /* 4 | This is part of ODS2 written by Paul Nankervis, 5 | email address: Paulnank@au1.ibm.com 6 | 7 | ODS2 is distributed freely for all members of the 8 | VMS community to use. However all derived works 9 | must maintain comments in their source to acknowledge 10 | the contibution of the original author. 11 | */ 12 | 13 | /* To set up physical I/O for a new system a group of phyio 14 | routines need to be set up. They are:- 15 | phyio_show() which doesn't need to do anything - but 16 | it would generally print some statistics 17 | about the other phyio calls. 18 | phyio_init() to prepare a device for use by future 19 | read/write calls. The device name would usually 20 | map to a local device - for example rra: to /dev/rra 21 | on a Unix system. The call needs to return a handle 22 | (channel, file handle, reference number...) for 23 | future reference, and optionally some device 24 | information. 25 | phyio_read() will return a specified number of bytes into a 26 | buffer from the start of a 512 byte block on the 27 | device referred to by the handle. 28 | phyio_write() will write a number of bytes out to a 512 byte block 29 | address on a device. 30 | 31 | */ 32 | 33 | #define PHYIO_READONLY 1 34 | 35 | struct phyio_info { 36 | unsigned status; 37 | unsigned sectors; 38 | unsigned sectorsize; 39 | }; 40 | 41 | void phyio_show(void); 42 | unsigned phyio_init(int devlen,char *devnam,unsigned *handle,struct phyio_info *info); 43 | unsigned phyio_read(unsigned handle,unsigned block,unsigned length,char *buffer); 44 | unsigned phyio_write(unsigned handle,unsigned block,unsigned length,char *buffer); 45 | -------------------------------------------------------------------------------- /extracters/ods2/phyvms.c: -------------------------------------------------------------------------------- 1 | /* PHYVMS.C v1.2 Physical I/O module for VMS */ 2 | 3 | /* 4 | This is part of ODS2 written by Paul Nankervis, 5 | email address: Paulnank@au1.ibm.com 6 | 7 | ODS2 is distributed freely for all members of the 8 | VMS community to use. However all derived works 9 | must maintain comments in their source to acknowledge 10 | the contibution of the original author. 11 | */ 12 | 13 | /* How come VMS is so much easier to do physical I/O on than 14 | those other ^%$@*! systems? I can't believe that they have 15 | different command sets for different device types, and can 16 | even have different command sets depending on what mode they 17 | are called from! Sigh. */ 18 | 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #ifdef __GNUC__ 27 | unsigned sys$assign(); 28 | unsigned sys$qiow(); 29 | unsigned sys$dassgn(); 30 | #else 31 | #include 32 | #endif 33 | 34 | #include "phyio.h" 35 | 36 | #define chk(sts) {register chksts; if (((chksts = sts) & 1) == 0) lib$stop(chksts);} 37 | 38 | unsigned init_count = 0; 39 | unsigned read_count = 0; 40 | unsigned write_count = 0; 41 | 42 | void phyio_show(void) 43 | { 44 | printf("PHYIO_SHOW Initializations: %d Reads: %d Writes: %d\n", 45 | init_count,read_count,write_count); 46 | } 47 | 48 | 49 | unsigned phyio_init(int devlen,char *devnam,unsigned *handle,struct phyio_info *info) 50 | { 51 | struct dsc$descriptor devdsc; 52 | devdsc.dsc$w_length = devlen; 53 | devdsc.dsc$a_pointer = devnam; 54 | init_count++; 55 | info->status = 0; /* We don't know anything about this device! */ 56 | info->sectors = 0; 57 | info->sectorsize = 0; 58 | *handle = 0; 59 | return sys$assign(&devdsc,handle,0,0,0,0); 60 | } 61 | 62 | 63 | unsigned phyio_close(unsigned handle) 64 | { 65 | return sys$dassgn(handle); 66 | } 67 | 68 | 69 | unsigned phyio_read(unsigned handle,unsigned block,unsigned length,char *buffer) 70 | { 71 | #ifdef DEBUG 72 | printf("Phyio read block: %d into %x (%d bytes)\n",block,buffer,length); 73 | #endif 74 | read_count++; 75 | return sys$qiow(1,handle,IO$_READLBLK,NULL,0,0,buffer,length,block,0,0,0); 76 | } 77 | 78 | 79 | unsigned phyio_write(unsigned handle,unsigned block,unsigned length,char *buffer) 80 | { 81 | #ifdef DEBUG 82 | printf("Phyio write block: %d from %x (%d bytes)\n",block,buffer,length); 83 | #endif 84 | write_count++; 85 | printf("Phyio write block: %d from %x (%d bytes)\n",block,buffer,length); 86 | return sys$qiow(1,handle,IO$_WRITELBLK,NULL,0,0,buffer,length,block,0,0,0); 87 | } 88 | -------------------------------------------------------------------------------- /extracters/ods2/ssdef.h: -------------------------------------------------------------------------------- 1 | /* Ssdef.h v1.2 System status definitions */ 2 | 3 | /* 4 | This is part of ODS2 written by Paul Nankervis, 5 | email address: Paulnank@au1.ibm.com 6 | 7 | ODS2 is distributed freely for all members of the 8 | VMS community to use. However all derived works 9 | must maintain comments in their source to acknowledge 10 | the contibution of the original author. 11 | */ 12 | 13 | 14 | #ifdef VMS 15 | 16 | #include 17 | 18 | #else 19 | 20 | #define SS$_NORMAL 1 21 | #define SS$_WASCLR 1 22 | #define SS$_WASSET 9 23 | #define SS$_ABORT 44 24 | #define SS$_DEVNOTMOUNT 124 25 | #define SS$_ILLEFC 236 26 | #define SS$_INSFMEM 292 27 | #define SS$_DATACHECK 92 28 | #define SS$_BUGCHECK 676 29 | #define SS$_DUPLICATE 148 30 | #define SS$_BADPARAM 20 31 | #define SS$_IVCHAN 316 32 | #define SS$_NOIOCHAN 436 33 | #define SS$_PARITY 500 34 | #define SS$_WRITLCK 604 35 | #define SS$_DEVNOTALLOC 2136 36 | #define SS$_DUPFILENAME 2152 37 | #define SS$_NOSUCHDEV 2312 38 | #define SS$_NOSUCHFILE 2320 39 | #define SS$_BADFILENAME 2072 40 | #define SS$_BADIRECTORY 2088 41 | #define SS$_ENDOFFILE 2160 42 | #define SS$_FILELOCKED 2216 43 | #define SS$_NOMOREFILES 2352 44 | #define SS$_NOSUCHVOL 3882 45 | #define SS$_NOTINSTALL 8212 46 | #define SS$_DEVNOTDISM 8628 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /extracters/ods2/vmstime.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | VMSTIME.H v1.1 4 | 5 | Author: Paul Nankervis 6 | 7 | Please send bug reports to PaulNank@au1.ibm.com 8 | 9 | */ 10 | 11 | 12 | #ifndef __VMSTIME__ 13 | #define __VMSTIME__ loaded 14 | 15 | #include "descrip.h" 16 | 17 | 18 | struct TIME { 19 | unsigned char time[8]; /* Structure of time */ 20 | }; /* Look out Einstein!! :-) */ 21 | 22 | #define lib$add_times lib_add_times 23 | #define lib$addx lib_addx 24 | #define lib$cvt_vectim lib_cvt_vectim 25 | #define lib$day lib_day 26 | #define lib$day_of_week lib_day_of_week 27 | #define lib$mult_delta_time lib_mult_delta_time 28 | #define lib$sub_times lib_sub_times 29 | #define lib$subx lib_subx 30 | #define sys$asctim sys_asctim 31 | #define sys$bintim sys_bintim 32 | #define sys$gettim sys_gettim 33 | #define sys$numtim sys_numtim 34 | 35 | 36 | unsigned sys_gettim(struct TIME *timadr); 37 | unsigned lib_cvt_vectim(unsigned short timbuf[7],struct TIME *timadr); 38 | unsigned lib_day(int *days,struct TIME *timadr,int *day_time); 39 | unsigned sys_numtim(unsigned short timbuf[7],struct TIME *timadr); 40 | unsigned sys_bintim(struct dsc$descriptor *timbuf,struct TIME *timadr); 41 | unsigned sys_asctim(unsigned short *timlen,struct dsc$descriptor *timbuf, 42 | struct TIME *timadr,unsigned cvtflg); 43 | unsigned lib_day_of_week(struct TIME *timadr,unsigned *weekday); 44 | unsigned lib_addx(void *addant,void *addee,void *result,int *lenadd); 45 | unsigned lib_subx(void *subant,void *subee,void *result,int *lenadd); 46 | unsigned lib_add_times(struct TIME *time1,struct TIME *time2, 47 | struct TIME *result); 48 | unsigned lib_sub_times(struct TIME *time1,struct TIME *time2, 49 | struct TIME *result); 50 | unsigned lib_mult_delta_time(int *multiple,struct TIME *timadr); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /extracters/rawcopy/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=RawCopy 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /extracters/rawcopy/RawCopy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static 7 | char buf[1024*1024]; 8 | 9 | int main(int argc, char **argv) 10 | { 11 | FILE *fin, *fout; 12 | size_t bytesread, readsize = sizeof(buf), totalbytes = 0; 13 | 14 | if (argc < 3) 15 | { 16 | fprintf(stderr, "Usage: RawCopy \n"); 17 | fprintf(stderr, "On Win32 environments, RAW devices have names for the format:\n"); 18 | fprintf(stderr," CD Drives \\\\.\\CdRom0\n"); 19 | fprintf(stderr," Hard Drives \\\\.\\PhysicalDrive0\n"); 20 | exit(0); 21 | } 22 | if (NULL == (fin = fopen(argv[1], "rb"))) 23 | { 24 | fprintf(stderr, "Error Opening '%s' for input: %s\n", argv[1], strerror(errno)); 25 | exit(errno); 26 | } 27 | if (NULL == (fout = fopen(argv[2], "wb"))) 28 | { 29 | fprintf(stderr, "Error Opening '%s' for output: %s\n", argv[2], strerror(errno)); 30 | exit(errno); 31 | } 32 | fprintf(stderr, "Copying '%s' to '%s'\n", argv[1], argv[2]); 33 | while (0 != (bytesread = fread(buf, 1, readsize, fin))) 34 | { 35 | if (bytesread != fwrite(buf, 1, bytesread, fout)) 36 | { 37 | fprintf(stderr, "Error Writing '%s': %s\n", argv[2], strerror(errno)); 38 | break; 39 | } 40 | else 41 | totalbytes += bytesread; 42 | if (0 == (totalbytes%(1024*1024))) 43 | fprintf(stderr, "%6dMB Copied...\r", totalbytes/(1024*1024)); 44 | } 45 | fprintf(stderr, "\n"); 46 | fprintf(stderr, "Total Data: %6.2f MBytes (%d bytes)\n", totalbytes/(1024.0*1024.0), totalbytes); 47 | fclose(fin); 48 | fclose(fout); 49 | exit(0); 50 | } 51 | -------------------------------------------------------------------------------- /extracters/rawcopy/RawCopy.txt: -------------------------------------------------------------------------------- 1 | The attached program will make an ISO compatible CD Image on both Intel 2 | Linux and Windows XP systems. 3 | 4 | It works with the VMS Hobbyist CD, and the result is bootable. It works 5 | with all the other data CD's that I tried as well. 6 | 7 | The same exe works on Windows 2000, with one odd exception. It will 8 | simply copy a CD image from any CD which has an ISO9660 file system on it, 9 | but it fails to recognize a non-zero size for the \\.\CdRom0 device on these 10 | systems when the Hobbist CD is installed. 11 | 12 | Meanwhile, this raw data copy operation is the "right" thing for this problem. 13 | The raw copy result provides a disk image that the simulator can access. 14 | On many platforms, the simulator could access the device directly just as 15 | this program does. 16 | 17 | - Mark Pizzolato 18 | -------------------------------------------------------------------------------- /extracters/rawtap/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if don't suit 2 | # your environment 3 | TOOL=rawtap 4 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 5 | BIN=/usr/local/bin 6 | INSTALL=install 7 | CC=gcc 8 | 9 | $(TOOL): $(TOOL).c tapeio.c tapeio.h tap.h defs.h 10 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c tapeio.c $(LDLIBS) 11 | 12 | .PHONY: clean install uninstall 13 | 14 | clean: 15 | rm -f $(TOOL) 16 | 17 | install: $(TOOL) 18 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 19 | 20 | uninstall: 21 | rm -f $(BIN)/$(TOOL) 22 | -------------------------------------------------------------------------------- /extracters/rawtap/defs.h: -------------------------------------------------------------------------------- 1 | /* defs.h: Common definitions 2 | 3 | Copyright (c) 2017, John Forecast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | JOHN FORECAST BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of John Forecast shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from John Forecast. 25 | 26 | */ 27 | 28 | #ifndef __DEFS_H__ 29 | #define __DEFS_H__ 30 | #if defined(VMS) 31 | #include 32 | #else 33 | typedef signed char int8; 34 | typedef signed short int16; 35 | typedef signed int int32; 36 | typedef unsigned char uint8; 37 | typedef unsigned short uint16; 38 | typedef unsigned int uint32; 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /extracters/rawtap/rawtap.txt: -------------------------------------------------------------------------------- 1 | rawtap manipulates .tap magtape container files used by SIMH. rawtap is 2 | invoked by: 3 | 4 | rawtap -cae container [-r len] [...] 5 | 6 | To create a new container file and append file(s): 7 | 8 | rawtap -c container [-r len] file ... 9 | 10 | To append file(s) to an existing container file: 11 | 12 | rawtap -a container [-r len] file ... 13 | 14 | To extract files from container file(s): 15 | 16 | rawtap -e container ... 17 | 18 | Switches: 19 | 20 | -r len Specify max tape record size when writing to tape. 21 | (1 <= len <= 65536). The new record size applies to all 22 | following files on the command line. There may be multiple 23 | "-r len" on the command line if the record size needs to be 24 | different across multiple files. 25 | -------------------------------------------------------------------------------- /extracters/rawtap/tap.h: -------------------------------------------------------------------------------- 1 | /* tap.h: simh tape representation definitions 2 | 3 | Copyright (c) 2017, John Forecast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | JOHN FORECAST BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of John Forecast shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from John Forecast. 25 | 26 | */ 27 | 28 | /* 29 | * Metadata markers 30 | */ 31 | #define ST_EOM 0xFFFFFFFF /* end of medium */ 32 | #define ST_GAP 0xFFFFFFFE /* erase gap */ 33 | #define ST_TM 0x00000000 /* tape mark */ 34 | 35 | /* 36 | * Record length field layout 37 | */ 38 | #define ST_ERROR 0x80000000 /* record contains an error */ 39 | #define ST_MBZ 0x7F000000 /* must be zero */ 40 | #define ST_LENGTH 0x00FFFFFF /* record length */ 41 | 42 | /* 43 | * Data in the .tap container file is rounded up to an even number of bytes 44 | */ 45 | #define RECLEN(c) (((c) + 1) & ~1) 46 | 47 | /* 48 | * The maximum record length supported by this code is 64K. 49 | */ 50 | #define MAXRCLNT 65536 51 | -------------------------------------------------------------------------------- /extracters/rawtap/tapeio.h: -------------------------------------------------------------------------------- 1 | /* tapeio.h: Tape I/O definitions 2 | 3 | Copyright (c) 2017, John Forecast 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | JOHN FORECAST BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Except as contained in this notice, the name of John Forecast shall not 23 | be used in advertising or otherwise to promote the sale, use or other dealings 24 | in this Software without prior written authorization from John Forecast. 25 | 26 | */ 27 | 28 | #include "tap.h" 29 | #include "defs.h" 30 | 31 | /* 32 | * Tape open status return codes 33 | */ 34 | #define TIO_SUCCESS 0 /* operation successful */ 35 | #define TIO_ERROR -1 /* error record seen */ 36 | #define TIO_CORRUPT -2 /* tape format is corrupt */ 37 | #define TIO_OPENFAIL -3 /* open operation failed */ 38 | #define TIO_CREATEFAIL -4 /* create operation failed */ 39 | #define TIO_IOERROR -5 /* I/O error */ 40 | 41 | /* 42 | * Tape open/close routines. 43 | */ 44 | extern int OpenTapeForRead(char *); 45 | extern int OpenTapeForWrite(char *); 46 | extern int OpenTapeForAppend(char *); 47 | extern void CloseTape(void); 48 | 49 | /* 50 | * Tape I/O routines. 51 | */ 52 | uint32 ReadTapeRecord(void *, int); 53 | uint32 ReadTapeRecordLength(void); 54 | int WriteTapeRecord(void *, int); 55 | int WriteTapeMark(int); 56 | 57 | /* 58 | * Buffered I/O routines 59 | */ 60 | void initTapeBuffering(int); 61 | int flushTapeBuffering(void); 62 | int writeTapeBuffering(char); 63 | -------------------------------------------------------------------------------- /extracters/rstsflx/BUGS: -------------------------------------------------------------------------------- 1 | open bugs: 2 | - delete does not honor priv (erase on delete) bit 3 | - no readline support in dos 4 | - filename completion does host file system completion, which is usually 5 | the wrong thing 6 | - "put" should pre-extend the output file if in binary copy mode. 7 | - need error checking on I/O 8 | -------------------------------------------------------------------------------- /extracters/rstsflx/HISTORY: -------------------------------------------------------------------------------- 1 | Changes for V2.6: 2 | 16.04.27 A couple of bugfixes. Changed license to BSD. 3 | 4 | Changes for V2.5: 5 | 00.08.24 Readline support for DOS now appears to be working, 6 | thanks to a newer version of DJGPP. It needs to 7 | be checked out a bit more, though, and there 8 | still seem to be some oddities. 9 | 10 | Changes for V2.4: 11 | 00.01.16 Added upper limit check on INIT to hook command so 12 | we don't try to hook an INIT that extends into the 13 | space needed for the bootstrap. This duplicates 14 | a check that exists in hook.sav. 15 | 00.01.18 Have "clean" display current dir and filename 16 | even if not -verbose, but all on a single line. 17 | 00.01.23 Fix calculation of RE count in fileseek, which was 18 | causing disk block out of range errors sometimes. 19 | 20 | Changes for V2.3: 21 | 00.01.02 Fixed eof calculation for RMS fixed files (-rf switch) 22 | Added support for RX50 format 5.25 inch floppy access 23 | in Linux. Added code to get size for raw disks 24 | under Linux, so the -Size switch is no longer needed. 25 | Changed date display format to use 4 digit years, and 26 | fix some Y2K bugs. :-( 27 | 00.01.04 Fixed an elusive malloc bug. 28 | 00.01.08 Fixed RX50 I/O. 29 | 30 | Changes for V2.2: 31 | 99.12.02 Bugfix in RMS mode "get" for 32 bit int targets. 32 | Use fgets instead of gets in scancmd. 33 | 34 | Changes for V2.0: 35 | 36 | - bugfix in protect command: allow file protection code changes even 37 | if P bit is set (as RSTS does) 38 | 39 | - bugfix in rename: disallow rename/replace if new file name == old 40 | name (previous code would delete the file and then crash) 41 | 42 | - bugfix in hook command for environments with 32-bit integers 43 | 44 | - fix platform.h so it may work better in Alphas (not tested for lack 45 | of hardware) 46 | 47 | - change abort handler to use setjmp/longjmp so failure no longer 48 | exits but goes back to command prompt if in prompting mode 49 | 50 | - added -noprotect as synonym for -unprotect 51 | 52 | - bugfix in list -summary: print correct ppns in per-directory summary 53 | line. 54 | 55 | - added clean (rebuild) 56 | 57 | - added -odt and -offset to hook command. 58 | 59 | - bugfix in hook command to set clustersize (for disks whose 60 | clustersize is not always the same) 61 | 62 | - bugfix in quota update if doing multiple directories since start of 63 | program 64 | 65 | - allow [n,*] and [*,*] for gfd and mfd in get and dump commands 66 | 67 | - use GNU readline package, with command line recall including history 68 | file. 69 | -------------------------------------------------------------------------------- /extracters/rstsflx/LICENSE: -------------------------------------------------------------------------------- 1 | License for RSTSFLX 2 | -------------------- 3 | 4 | Copyright (c) 1994-2016, Paul Koning. 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | 1. Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | 14 | 2. Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | 18 | 3. Neither the name of the copyright holder nor the names of its 19 | contributors may be used to endorse or promote products derived from 20 | this software without specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 26 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 28 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /extracters/rstsflx/Makefile: -------------------------------------------------------------------------------- 1 | # *** NOTE *** 2 | # This makefile is set up for Linux. It will need some (small) changes to 3 | # build under something else. See notes in comments below, marked with *** 4 | 5 | VERSION = 2.5 6 | 7 | # objects 8 | OBJS=\ 9 | rstsflx.o \ 10 | fip.o \ 11 | rtime.o \ 12 | filename.o \ 13 | doget.o \ 14 | dolist.o \ 15 | doalloc.o \ 16 | docomp.o \ 17 | dotype.o \ 18 | doput.o \ 19 | dodump.o \ 20 | dodelete.o \ 21 | dorename.o \ 22 | dorts.o \ 23 | doprot.o \ 24 | dodir.o \ 25 | doident.o \ 26 | doinit.o \ 27 | dohook.o \ 28 | scancmd.o \ 29 | doclean.o \ 30 | fileio.o \ 31 | diskio.o \ 32 | absio.o 33 | 34 | # Flags and the like 35 | 36 | # *** change the two lines below as needed for your C compiler. 37 | CC ?= gcc 38 | OPTIMIZE ?= -O2 -g2 39 | LDFLAGS ?= -g2 40 | 41 | DEFINES = 42 | CFLAGS = $(OPTIMIZE) $(DEFINES) $(EXTRAFLAGS) 43 | 44 | KITNAME = flx-$(VERSION) 45 | DIR = flx 46 | 47 | # Rules 48 | 49 | S = $(OBJS:.o=.c) 50 | SRCS = $(S:absio.c=unxabsio.c) 51 | 52 | # *** comment out or delete this first rule if not building on DOS 53 | #flx.exe: flx 54 | # strip flx 55 | # coff2exe -s /djgpp/bin/go32.exe flx 56 | 57 | flx: $(OBJS) 58 | $(CC) $(LDFLAGS) -o flx $(OBJS) $(EXTRAOBJS) -lreadline -lncurses $(EXTRAFLAGS) 59 | 60 | # *** the rule below builds absio.o. You need to use as source file 61 | # *** an appropriate file; in Unix that's probably unxabsio.c but check 62 | # *** the source file to be sure. 63 | 64 | absio.o: unxabsio.c 65 | $(CC) -c -o absio.o $(CFLAGS) $< 66 | 67 | # general build rule for all other object files: 68 | .c.o: 69 | $(CC) -c $(CFLAGS) $< 70 | 71 | kit: 72 | rm -f *~ 73 | cd ..; tar cvzf $(KITNAME).tar.gz \ 74 | $(DIR)/README $(DIR)/COPYING $(DIR)/BUGS $(DIR)/HISTORY \ 75 | $(DIR)/Makefile* $(DIR)/*.c $(DIR)/*.h \ 76 | $(DIR)/*.doc $(DIR)/*.pdf $(DIR)/fdprm 77 | 78 | clean: 79 | rm -f *.o flx flx.exe flx.dep 80 | 81 | 82 | flx.dep: 83 | gcc -MM $(SRCS) > flx.dep 84 | 85 | # the one below is created by make depend 86 | include flx.dep 87 | -------------------------------------------------------------------------------- /extracters/rstsflx/Makefile.dos: -------------------------------------------------------------------------------- 1 | # *** NOTE *** 2 | # This makefile is set up for DOS (DJGPP). It will need some (small) 3 | # changes to build under Unix. See notes in comments below, marked with *** 4 | 5 | # sources 6 | # *** note the first one, that's the absolute I/O source module. Change 7 | # *** this to the one appropriate for your OS, for example unxabsio.c 8 | # *** in the case of Unix. 9 | 10 | SRCS=\ 11 | djabsio.c \ 12 | rstsflx.c \ 13 | fip.c \ 14 | rtime.c \ 15 | filename.c \ 16 | doget.c \ 17 | dolist.c \ 18 | doalloc.c \ 19 | docomp.c \ 20 | dotype.c \ 21 | doput.c \ 22 | dodump.c \ 23 | dodelete.c \ 24 | dorename.c \ 25 | dorts.c \ 26 | doprot.c \ 27 | dodir.c \ 28 | doident.c \ 29 | doinit.c \ 30 | dohook.c \ 31 | scancmd.c \ 32 | fileio.c \ 33 | diskio.c 34 | 35 | # prototype header files (none for rstsflx.c and scancmd.c) 36 | PROTOS=\ 37 | rstsflx.h \ 38 | platform.h \ 39 | fip.h \ 40 | rtime.h \ 41 | filename.h \ 42 | doget.h \ 43 | dolist.h \ 44 | doalloc.h \ 45 | docomp.h \ 46 | dotype.h \ 47 | doput.h \ 48 | dodump.h \ 49 | dodelete.h \ 50 | dorename.h \ 51 | dorts.h \ 52 | doprot.h \ 53 | dodir.h \ 54 | doident.h \ 55 | doinit.h \ 56 | doinit.h \ 57 | scancmd.h \ 58 | fileio.h \ 59 | diskio.h 60 | 61 | # objects 62 | OBJS=\ 63 | rstsflx.o \ 64 | fip.o \ 65 | rtime.o \ 66 | filename.o \ 67 | doget.o \ 68 | dolist.o \ 69 | doalloc.o \ 70 | docomp.o \ 71 | dotype.o \ 72 | doput.o \ 73 | dodump.o \ 74 | dodelete.o \ 75 | dorename.o \ 76 | dorts.o \ 77 | doprot.o \ 78 | dodir.o \ 79 | doident.o \ 80 | doinit.o \ 81 | dohook.o \ 82 | scancmd.o \ 83 | doclean.o \ 84 | fileio.o \ 85 | diskio.o \ 86 | absio.o 87 | 88 | # Flags and the like 89 | 90 | # *** change the three lines below as needed for your C compiler. 91 | CC= gcc 92 | CFLAGS= -O3 -Wall 93 | LFLAGS= 94 | 95 | # Rules 96 | 97 | # *** comment out or delete this first rule if not building on DOS 98 | #flx.exe: flx 99 | # strip flx 100 | # coff2exe flx 101 | 102 | flx.exe: $(OBJS) 103 | $(CC) -o flx.exe $(OBJS) -lreadline $(LFLAGS) 104 | 105 | # *** the rule below builds absio.o. You need to use as source file 106 | # *** an appropriate file; in Unix that's probably unxabsio.c but check 107 | # *** the source file to be sure. 108 | 109 | absio.o: djabsio.c 110 | $(CC) -c -o absio.o $(CFLAGS) $< 111 | 112 | # general build rule for all other object files: 113 | .c.o: 114 | $(CC) -c $(CFLAGS) $< 115 | 116 | kit: 117 | tar cvzf ../flx.tar.gz flx.exe \ 118 | Makefile* *.c *.h *.doc *.ps *.txt *.html \ 119 | README COPYING BUGS HISTORY 120 | zip ../flx.zip flx.exe \ 121 | Makefile* *.c *.h *.doc *.ps *.txt *.html \ 122 | README COPYING BUGS HISTORY 123 | 124 | clean: 125 | del *.o 126 | del flx 127 | del flx.exe 128 | 129 | depend: 130 | gcc -MM *.c > flx.dep 131 | 132 | # the one below is created by make depend 133 | include flx.dep 134 | -------------------------------------------------------------------------------- /extracters/rstsflx/README: -------------------------------------------------------------------------------- 1 | README file for FLX 1/11/2000 2 | 3 | What you have here is the set of sources needed to build FLX, a 4 | Makefile to do it, and documentation (in PostScript and the source in 5 | MS Word format). 6 | 7 | Note on the Makefile: it has been used both with Mips Ultrix "cc" and 8 | with gcc (with DOS and with Linux), but "make proto" only works with 9 | cc since gcc doesn't support the -protoi switch. Don't worry about 10 | that unless you change the sources in a way that affects the procedure 11 | prototype declarations. (If you do, edit the .h file of the same name 12 | as the .c file to reflect the changed prototypes.) 13 | 14 | As far as I know, everything that's described in flx.ps should work. 15 | Let me know if you find problems. (I'll admit that I haven't tested 16 | all the cases. For example, RDS0.0 support has had limited testing. 17 | And I don't have a "large" disk to test large DCS support!) 18 | 19 | I've had very little feedback on this program. If you use it, even 20 | if you have no comments on it, I'd appreciate a short note. And of 21 | course if you do have comments, bug reports, or suggestions, then 22 | definitely let me know! 23 | 24 | paul koning 25 | ni1d@arrl.net 26 | -------------------------------------------------------------------------------- /extracters/rstsflx/absio.h: -------------------------------------------------------------------------------- 1 | extern void absname (const char *rname); 2 | extern int absopen (const char *rname, const char *mode); 3 | extern void absseek (long block); 4 | extern long absread (long sec, long count, void *buffer); 5 | extern long abswrite (long sec, long count, void *buffer); 6 | extern void absclose (void); 7 | -------------------------------------------------------------------------------- /extracters/rstsflx/borabsio.c: -------------------------------------------------------------------------------- 1 | /* absread and abswrite services for use with Borland C implementation 2 | * 3 | * Paul Koning 95.01.17 Dummy module (no absio in TC++ for Windows) 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include "flx.h" 10 | #include "absio.h" 11 | 12 | /* this routine is called to scan a supplied container file/device 13 | * name. If the name refers to a real disk, then absflag is set 14 | * and rsize is set to the device size. Otherwise, no action is taken. 15 | */ 16 | 17 | void absname (const char *rname) 18 | { 19 | if (rname[strlen(rname) - 1] == ':') { /* device name alone */ 20 | printf ("Absolute I/O not supported\n"); 21 | } 22 | } 23 | 24 | int absopen (const char *rname, const char *mode) 25 | { 26 | return (1); /* should never get here... */ 27 | } 28 | 29 | void absseek (long block) { } /* nothing to do */ 30 | 31 | void absclose () { } /* nothing to do */ 32 | 33 | long absread (long sec, long count, void *buffer) 34 | { 35 | return (0); /* should never get here... */ 36 | } 37 | 38 | long abswrite (long sec, long count, void *buffer) 39 | { 40 | return (0); /* should never get here... */ 41 | } 42 | 43 | -------------------------------------------------------------------------------- /extracters/rstsflx/diskio.h: -------------------------------------------------------------------------------- 1 | extern void getsize (const char *name, long *tsize, long *rsize, int *dec166); 2 | extern long adjsize (long size); 3 | extern void setrname(void); 4 | extern void ropen(const char * mode); 5 | extern void rseek(long block); 6 | extern void rread(long block , long size , void * buffer); 7 | extern void rwrite(long block , long size , void * buffer); 8 | extern void rclose(void); 9 | -------------------------------------------------------------------------------- /extracters/rstsflx/doalloc.c: -------------------------------------------------------------------------------- 1 | /* handler for the "allocation" command */ 2 | 3 | #include 4 | #include 5 | 6 | #include "flx.h" 7 | #include "fldef.h" 8 | #include "doalloc.h" 9 | #include "fip.h" 10 | 11 | void doalloc (int argc, char **argv) /* show allocated clusters */ 12 | { 13 | byte *s; 14 | int bit, szb; 15 | long first, used, unused, biggest, size; 16 | long n; 17 | 18 | rmount (); /* mount the disk R/O */ 19 | findsat (); /* look up satt.sys */ 20 | s = sattbufp; 21 | szb = (diskblocks - dcs) / pcs; /* satt bits actually used */ 22 | bit = 1; 23 | n = 0; /* start looking at PCN = 0 */ 24 | used = unused = biggest = 0; /* nothing used, nor unused */ 25 | if (sw.bswitch == NULL) printf ("\nFree pack cluster number ranges:\n"); 26 | for (;;) { 27 | for ( ; n < szb; n++) { 28 | if (bit > 0x80) { 29 | bit = 1; 30 | s++; 31 | } 32 | if ((*s & bit) == 0) break; 33 | used++; /* count allocated clusters */ 34 | bit <<= 1; 35 | } 36 | if (n == szb) break; 37 | first = n; 38 | for ( ; n < szb; n++) { 39 | if (bit > 0x80) { 40 | bit = 1; 41 | s++; 42 | } 43 | if (*s & bit) break; 44 | unused++; /* count free clusters */ 45 | bit <<= 1; 46 | } 47 | size = (n - first) * pcs; 48 | if (size > biggest) biggest = size; 49 | if (sw.bswitch == NULL) { 50 | printf ("%6ld - %-6ld (%ld blocks)\n", first, n - 1, size); 51 | } 52 | } 53 | printf ("Blocks used: %ld, free: %ld, max contiguous free: %ld\n", 54 | used * pcs, unused * pcs, biggest); 55 | free (sattbufp); /* release the satt memory copy */ 56 | rumount (); /* done with the disk */ 57 | } 58 | 59 | -------------------------------------------------------------------------------- /extracters/rstsflx/doalloc.h: -------------------------------------------------------------------------------- 1 | extern void doalloc(int argc , char ** argv); 2 | -------------------------------------------------------------------------------- /extracters/rstsflx/doclean.h: -------------------------------------------------------------------------------- 1 | extern void doclean (int argc , char ** argv); 2 | -------------------------------------------------------------------------------- /extracters/rstsflx/docomp.c: -------------------------------------------------------------------------------- 1 | /* handler for the "compress" command */ 2 | 3 | #include 4 | #include 5 | 6 | #include "flx.h" 7 | #include "fldef.h" 8 | #include "docomp.h" 9 | #include "diskio.h" 10 | #include "fip.h" 11 | 12 | void docomp (int argc, char **argv) /* zero unused clusters */ 13 | { 14 | byte *s; 15 | int bit, szb; 16 | long first, size, iosize; 17 | long n; 18 | 19 | rmountrw (); /* mount the disk R/W */ 20 | memset (iobuf, 0, iobufsize); /* clear out I/O buffer */ 21 | s = sattbufp; 22 | szb = (diskblocks - dcs) / pcs; /* satt bits actually used */ 23 | bit = 1; 24 | n = 0; /* start looking at PCN = 0 */ 25 | for (;;) { 26 | for ( ; n < szb; n++) { /* scan past allocated clusters */ 27 | if (bit > 0x80) { 28 | bit = 1; 29 | s++; 30 | } 31 | if ((*s & bit) == 0) break; 32 | bit <<= 1; 33 | } 34 | if (n == szb) break; 35 | first = n; 36 | for ( ; n < szb; n++) { /* find length of free area */ 37 | if (bit > 0x80) { 38 | bit = 1; 39 | s++; 40 | } 41 | if (*s & bit) break; 42 | bit <<= 1; 43 | } 44 | size = (n - first) * pcs; 45 | first = pcntolbn(first); /* get starting lbn */ 46 | if (sw.verbose != NULL) { 47 | printf ("clearing %ld..%ld\015", first, first + size - 1); 48 | fflush (stdout); 49 | } 50 | for (;;) { 51 | iosize = size * BLKSIZE; 52 | if (iosize > iobufsize) iosize = iobufsize; 53 | rwrite (first, iosize, iobuf); 54 | size -= iobufsize / BLKSIZE; 55 | if (size <= 0) break; 56 | first += iobufsize / BLKSIZE; 57 | } 58 | } 59 | if (sw.verbose != NULL) printf ("\n"); 60 | rumountrw (); /* done with the disk */ 61 | } 62 | 63 | -------------------------------------------------------------------------------- /extracters/rstsflx/docomp.h: -------------------------------------------------------------------------------- 1 | extern void docomp(int argc , char ** argv); 2 | -------------------------------------------------------------------------------- /extracters/rstsflx/dodelete.c: -------------------------------------------------------------------------------- 1 | /* handler for the "delete" command */ 2 | 3 | #include 4 | 5 | #include "flx.h" 6 | #include "fldef.h" 7 | #include "dodelete.h" 8 | #include "fip.h" 9 | #include "filename.h" 10 | #include "fileio.h" 11 | #include "scancmd.h" 12 | 13 | void dodel2 (firqb *f) 14 | { 15 | if (protfile (f)) return; /* quit if protected file */ 16 | delfile (f); /* now really delete the file */ 17 | if (sw.verbose != NULL) { 18 | printcurname (f); 19 | printf (" deleted\n"); 20 | } 21 | } 22 | 23 | void dodelete (int argc, char **argv) 24 | { 25 | rmountrw (); /* mount r/w */ 26 | dofiles (argc, argv, dodel2, NOTNULL); 27 | rumountrw (); /* done with r/w */ 28 | } 29 | -------------------------------------------------------------------------------- /extracters/rstsflx/dodelete.h: -------------------------------------------------------------------------------- 1 | extern void dodel2(firqb * f); 2 | /* Prototype include a typedef name. 3 | It should be moved after the typedef declaration */ 4 | extern void dodelete(int argc , char ** argv); 5 | -------------------------------------------------------------------------------- /extracters/rstsflx/dodir.h: -------------------------------------------------------------------------------- 1 | extern void domkdir(int argc , char ** argv); 2 | extern void dormdir(int argc , char ** argv); 3 | -------------------------------------------------------------------------------- /extracters/rstsflx/dodump.h: -------------------------------------------------------------------------------- 1 | extern void dodump(int argc , char ** argv); 2 | -------------------------------------------------------------------------------- /extracters/rstsflx/doget.h: -------------------------------------------------------------------------------- 1 | extern void doget(int argc , char ** argv); 2 | -------------------------------------------------------------------------------- /extracters/rstsflx/dohook.h: -------------------------------------------------------------------------------- 1 | extern long findsym(const char * sym); 2 | extern void setptr(long blk , long size , void * buf); 3 | extern int silchk(firqb * f , savsilindex * x); 4 | /* Prototype include a typedef name. 5 | It should be moved after the typedef declaration */ 6 | extern void readfile(firqb * f , long count , void * buf); 7 | /* Prototype include a typedef name. 8 | It should be moved after the typedef declaration */ 9 | extern void * getdata(firqb * f , long address); 10 | /* Prototype include a typedef name. 11 | It should be moved after the typedef declaration */ 12 | extern void cleanup(void); 13 | extern void dohook(int argc , char ** argv); 14 | -------------------------------------------------------------------------------- /extracters/rstsflx/doident.c: -------------------------------------------------------------------------------- 1 | /* handler for the "identify" command */ 2 | 3 | #include 4 | 5 | #include "flx.h" 6 | #include "fldef.h" 7 | #include "doident.h" 8 | #include "fip.h" 9 | #include "rtime.h" 10 | 11 | void doident (int argc, char **argv) /* show pack id data */ 12 | { 13 | packlabel *p; 14 | char rdate[DATELEN]; 15 | char rtime[RTIMELEN]; 16 | 17 | rmount (); /* mount the disk R/O */ 18 | readdcn (1); /* get the pack label */ 19 | p = use(packlabel,0); 20 | if (p->fill1 == -1 21 | && (pcs >= dcs) 22 | && ((pcs & (-pcs)) == pcs)) { 23 | printf ("RSTS disk on %s -- \"%s\"\n", rname, pname); 24 | printf (" Device clustersize: %d\n", dcs); 25 | printf (" Pack clustersize: %d\n", pcs); 26 | if (dcs > 1) 27 | printf (" Device size: %ld (%ld DCNs)\n", 28 | diskblocks, diskblocks / dcs); 29 | else printf (" Device size: %ld\n", diskblocks); 30 | printf (" Revision level: %d.%d\n", plevel >> 8, plevel & 0377); 31 | if (plevel >= RDS12) { 32 | cvtdate (p->mntdat, rdate); 33 | cvttime (p->mnttim, rtime); 34 | printf (" Last mount date: %s\n", rdate); 35 | printf (" Last mount time: %s\n", rtime); 36 | } 37 | printf (" Pack flags: "); 38 | if (p->pstat & uc_mnt) printf (" Dirty"); 39 | if (p->pstat & uc_pri) printf (" Private/system"); 40 | else printf (" Public"); 41 | if (p->pstat & uc_ro) printf (" Read-only"); 42 | if (p->pstat & uc_dlw) printf (" DLW"); 43 | if (p->pstat & uc_top) printf (" NFF"); 44 | printf ("\n"); 45 | } else printf ("Disk on %s does not appear to be a RSTS format disk\n", rname); 46 | rumount (); /* done with disk */ 47 | } 48 | 49 | -------------------------------------------------------------------------------- /extracters/rstsflx/doident.h: -------------------------------------------------------------------------------- 1 | extern void doident(int argc , char ** argv); 2 | -------------------------------------------------------------------------------- /extracters/rstsflx/doinit.h: -------------------------------------------------------------------------------- 1 | extern int getclusize(void); 2 | extern void doinit(int argc , char * argv[]); 3 | -------------------------------------------------------------------------------- /extracters/rstsflx/dolist.h: -------------------------------------------------------------------------------- 1 | extern void dolist(int argc , char ** argv); 2 | -------------------------------------------------------------------------------- /extracters/rstsflx/doprot.c: -------------------------------------------------------------------------------- 1 | /* handler for the "prot" command */ 2 | 3 | #include 4 | 5 | #include "flx.h" 6 | #include "fldef.h" 7 | #include "doprot.h" 8 | #include "fip.h" 9 | #include "filename.h" 10 | #include "fileio.h" 11 | #include "scancmd.h" 12 | 13 | void doprot2 (firqb *f) 14 | { 15 | ufdne *n; 16 | 17 | readlk (f->nlink); /* read the NE for this file */ 18 | n = use(ufdne,k); 19 | if (sw.prot != NULL) { 20 | n->ustat |= us_nok; /* set no-kill bit */ 21 | if (sw.verbose != NULL) { 22 | printcurname (f); 23 | printf (" marked no-delete\n"); 24 | } 25 | } else if (sw.unprot != NULL) { 26 | n->ustat &= ~us_nok; /* clear no-kill bit */ 27 | if (sw.verbose != NULL) { 28 | printcurname (f); 29 | printf (" no longer marked marked no-delete\n"); 30 | } 31 | } else { 32 | if ((f->flags & f_prot) == 0) { 33 | printf ("File "); 34 | printcurname (f); 35 | printf (" not changed, no protection specified\n"); 36 | return; 37 | } 38 | n->uprot = f->newprot; 39 | if (sw.verbose != NULL) { 40 | printf ("File "); 41 | printcurname (f); 42 | printf (" protection changed to <%d>\n", f->newprot); 43 | } 44 | } 45 | MARKF; 46 | upddlw (f); 47 | } 48 | 49 | void doprot (int argc, char **argv) 50 | { 51 | rmountrw (); /* mount the disk */ 52 | dofiles (argc, argv, doprot2, NOTNULL); 53 | rumountrw (); /* done with disk */ 54 | } 55 | -------------------------------------------------------------------------------- /extracters/rstsflx/doprot.h: -------------------------------------------------------------------------------- 1 | extern void doprot2(firqb * f); 2 | /* Prototype include a typedef name. 3 | It should be moved after the typedef declaration */ 4 | extern void doprot(int argc , char ** argv); 5 | -------------------------------------------------------------------------------- /extracters/rstsflx/doput.h: -------------------------------------------------------------------------------- 1 | extern void doput(int argc , char ** argv); 2 | -------------------------------------------------------------------------------- /extracters/rstsflx/dorename.c: -------------------------------------------------------------------------------- 1 | /* handler for the "rename" command */ 2 | 3 | #include 4 | #include 5 | 6 | #include "flx.h" 7 | #include "fldef.h" 8 | #include "dorename.h" 9 | #include "fip.h" 10 | #include "filename.h" 11 | #include "fileio.h" 12 | #include "scancmd.h" 13 | 14 | firqb newf; /* new name */ 15 | 16 | void renamefile (firqb *f) 17 | { 18 | ufdne *n; 19 | firqb tmpf; 20 | word saveprev, savenext; 21 | 22 | if (protfile (f)) return; /* quit if file protected */ 23 | mergename (f->cname, &newf, FALSE); 24 | readlk2 (0); /* read UFD label */ 25 | saveprev = prevlink; /* save current scan pointers */ 26 | savenext = nextlink; 27 | prevlink = 0; /* start there */ 28 | nextlink = use(ufdlabel,0)->ulnk; /* and initialize scan */ 29 | memcpy (&tmpf, &newf, sizeof (firqb)); 30 | memcpy (tmpf.name, newf.cname, NAMELEN); 31 | if (nextfileindir (&tmpf)) /* file exists... */ 32 | { 33 | if (f->nlink == tmpf.nlink) 34 | { 35 | printf ("New name matches old name "); 36 | printcurname (f); 37 | printf ("\n"); 38 | return; 39 | } 40 | if (protfile (&tmpf)) return; /* protected file, skip */ 41 | if (sw.replace == NULL) 42 | { 43 | printf ("Cannot rename "); 44 | printcurname (f); 45 | printf (" to %s -- file already exists\n", tmpf.name); 46 | return; 47 | } 48 | delfile (&tmpf); /* now really delete the file */ 49 | } 50 | prevlink = saveprev; /* restore pointers */ 51 | nextlink = savenext; 52 | readlk (f->nlink); /* read the NE */ 53 | n = use(ufdne,k); 54 | cvtnameexttor50 (newf.cname, n->unam); /* write new RAD50 name into NE */ 55 | MARKF; 56 | upddlw (f); 57 | if (sw.verbose != NULL) 58 | { 59 | printcurname (f); 60 | printf (" renamed to %s\n", newf.cname); 61 | } 62 | } 63 | 64 | void dorename (int argc, char **argv) 65 | { 66 | char *newname; 67 | int j; 68 | 69 | if (--argc < 1) 70 | { 71 | printf ("Usage: %s rename file ... newname\n", progname); 72 | return; 73 | } 74 | newf.flags = 0; /* clear parse flags */ 75 | newname = argv[argc]; /* save name pointer */ 76 | if (*parsenameext (newname, &newf) != '\0') 77 | { 78 | printf ("Invalid new name %s\n", newname); 79 | return; 80 | } 81 | if ((newf.flags & f_name) == 0) 82 | { 83 | for (j = 0; j < 6; j++) newf.name[j] = '?'; 84 | newf.flags |= f_name | f_namw; 85 | } 86 | if ((newf.flags & f_ext) == 0) 87 | { 88 | newf.name[7] = '?'; 89 | newf.name[8] = '?'; 90 | newf.name[9] = '?'; 91 | newf.flags |= f_ext | f_extw; 92 | } 93 | rmountrw (); /* mount the disk */ 94 | dofiles (argc, argv, renamefile, NOTNULL); 95 | rumountrw (); /* done with disk */ 96 | } 97 | -------------------------------------------------------------------------------- /extracters/rstsflx/dorename.h: -------------------------------------------------------------------------------- 1 | extern void renamefile(firqb * f); 2 | /* Prototype include a typedef name. 3 | It should be moved after the typedef declaration */ 4 | extern void dorename(int argc , char ** argv); 5 | -------------------------------------------------------------------------------- /extracters/rstsflx/dorts.c: -------------------------------------------------------------------------------- 1 | /* handler for the "rts" command */ 2 | 3 | #include 4 | 5 | #include "flx.h" 6 | #include "fldef.h" 7 | #include "dorts.h" 8 | #include "fip.h" 9 | #include "filename.h" 10 | #include "fileio.h" 11 | #include "scancmd.h" 12 | 13 | char *rtsname; /* new rts in ascii */ 14 | word16 rtsr50[2]; /* and in rad50 */ 15 | 16 | void rtsfile (firqb *f) 17 | { 18 | ufdae *a; 19 | 20 | if (protfile (f)) return; /* quit if file protected */ 21 | readlk (f->alink); /* read the AE */ 22 | a = use(ufdae,k); 23 | if (a->urts[0] == 0 && a->urts[1] != 0) { 24 | printcurname (f); 25 | printf (" is a large file\n"); 26 | return; 27 | } 28 | a->urts[0] = rtsr50[0]; 29 | a->urts[1] = rtsr50[1]; 30 | MARKF; 31 | upddlw (f); 32 | if (sw.verbose != NULL) { 33 | printcurname (f); 34 | printf (" rts changed to %s\n", rtsname); 35 | } 36 | } 37 | 38 | void dorts (int argc, char **argv) 39 | { 40 | firqb rtsf; 41 | 42 | if (--argc < 1) { 43 | printf ("Usage: %s rts file ... rts\n", progname); 44 | return; 45 | } 46 | rtsf.flags = 0; /* clear parse flags */ 47 | rtsname = argv[argc]; /* save name pointer */ 48 | if (*parsename (rtsname, &rtsf) != '\0' || rtsf.flags != f_name) { 49 | printf ("Invalid rts name %s\n", rtsname); 50 | return; 51 | } 52 | cvtnametor50 (rtsf.name, rtsr50); 53 | rmountrw (); /* mount the disk */ 54 | dofiles (argc, argv, rtsfile, NOTNULL); 55 | rumountrw (); /* done with disk */ 56 | } 57 | -------------------------------------------------------------------------------- /extracters/rstsflx/dorts.h: -------------------------------------------------------------------------------- 1 | extern void rtsfile(firqb * f); 2 | /* Prototype include a typedef name. 3 | It should be moved after the typedef declaration */ 4 | extern void dorts(int argc , char ** argv); 5 | -------------------------------------------------------------------------------- /extracters/rstsflx/dosabsio.h: -------------------------------------------------------------------------------- 1 | extern int absread (int drive, int sec, int count, void *buffer); 2 | extern int abswrite (int drive, int sec, int count, void *buffer); 3 | extern int disksize (int drive); 4 | -------------------------------------------------------------------------------- /extracters/rstsflx/dotype.c: -------------------------------------------------------------------------------- 1 | /* handler for the "type" command */ 2 | 3 | #include 4 | 5 | #include "flx.h" 6 | #include "fldef.h" 7 | #include "dotype.h" 8 | #include "fip.h" 9 | #include "filename.h" 10 | #include "fileio.h" 11 | #include "scancmd.h" 12 | 13 | void typefile (firqb *f) 14 | { 15 | if (sw.verbose != NULL) { 16 | printf ("\n----- "); 17 | printcurname (f); 18 | printf (" -----\n"); 19 | } 20 | getfile (stdout, f, FALSE); /* put it on stdout */ 21 | } 22 | 23 | void dotype (int argc, char **argv) 24 | { 25 | rmount (); /* mount the disk */ 26 | dofiles (argc, argv, typefile, NOTNULL); 27 | rumount (); /* done with disk */ 28 | } 29 | -------------------------------------------------------------------------------- /extracters/rstsflx/dotype.h: -------------------------------------------------------------------------------- 1 | extern void typefile(firqb * f); 2 | /* Prototype include a typedef name. 3 | It should be moved after the typedef declaration */ 4 | extern void dotype(int argc , char ** argv); 5 | -------------------------------------------------------------------------------- /extracters/rstsflx/fdprm: -------------------------------------------------------------------------------- 1 | # /etc/fdprm - floppy disk parameter table 2 | 3 | # Common disk formats. Names are of the form 4 | # actual media capacity/maximum drive capacity 5 | # (Note: although 5.25" HD drives can format disks at 1.44M, they're listed 6 | # as 1200 because that's the common maximum size.) 7 | 8 | # size sec/t hds trk stre gap rate spec1 fmt_gap 9 | 360/360 720 9 2 40 0 0x2A 0x02 0xDF 0x50 10 | 1200/1200 2400 15 2 80 0 0x1B 0x00 0xDF 0x54 11 | 360/720 720 9 2 40 1 0x2A 0x02 0xDF 0x50 12 | 720/720 1440 9 2 80 0 0x2A 0x02 0xDF 0x50 13 | 720/1440 1440 9 2 80 0 0x2A 0x02 0xDF 0x50 14 | 360/1200 720 9 2 40 1 0x23 0x01 0xDF 0x50 15 | 720/1200 1440 9 2 80 0 0x23 0x01 0xDF 0x50 16 | 1440/1440 2880 18 2 80 0 0x1B 0x00 0xCF 0x6C 17 | 18 | # Non-standard disk formats: 19 | 20 | # BEWARE: They're incomplete and possibly incorrect. The only reason why 21 | # they are in this file is to show how such formats are added. 22 | 23 | 1440/1200 2880 18 2 80 0 ???? ???? ???? ???? # ????? 24 | 1680/1440 3360 21 2 80 0 0x0C 0x00 0xCF 0x6C # ????? 25 | 26 | # Add user-specific formats here 27 | cbm1581 1600 10 2 80 2 0x2A 0x02 0xDF 0x2E 28 | 800/720 1600 10 2 80 0 0x2A 0x02 0xDF 0x2E 29 | rx50 800 10 1 80 0 0x23 0x01 0xDF 0x50 30 | -------------------------------------------------------------------------------- /extracters/rstsflx/fileio.h: -------------------------------------------------------------------------------- 1 | extern long seqio(firqb * f , long iolen , iohandler io , void * buffer); 2 | /* Prototype include a typedef name. 3 | It should be moved after the typedef declaration */ 4 | extern void openfile(firqb * f); 5 | /* Prototype include a typedef name. 6 | It should be moved after the typedef declaration */ 7 | extern void initrandom(firqb * f); 8 | /* Prototype include a typedef name. 9 | It should be moved after the typedef declaration */ 10 | extern void fileseek(firqb * f , long vbn); 11 | /* Prototype include a typedef name. 12 | It should be moved after the typedef declaration */ 13 | extern long getfile(FILE * to , firqb * f , int binary); 14 | /* Prototype include a typedef name. 15 | It should be moved after the typedef declaration */ 16 | extern long extfile(firqb * f , long blocks); 17 | /* Prototype include a typedef name. 18 | It should be moved after the typedef declaration */ 19 | extern long writefile(firqb * f , long count); 20 | /* Prototype include a typedef name. 21 | It should be moved after the typedef declaration */ 22 | extern long putfile(FILE * from , firqb * f , int binary); 23 | /* Prototype include a typedef name. 24 | It should be moved after the typedef declaration */ 25 | extern int textfile(char * name); 26 | -------------------------------------------------------------------------------- /extracters/rstsflx/filename.h: -------------------------------------------------------------------------------- 1 | extern const char * parsename(const char * p , firqb * out); 2 | /* Prototype include a typedef name. 3 | It should be moved after the typedef declaration */ 4 | extern const char * parsenameext(const char * p , firqb * out); 5 | /* Prototype include a typedef name. 6 | It should be moved after the typedef declaration */ 7 | extern int parse(const char * p , firqb * out); 8 | /* Prototype include a typedef name. 9 | It should be moved after the typedef declaration */ 10 | extern char * r50toascii(word16 r50 , char * string , int space); 11 | /* Prototype include a typedef name. 12 | It should be moved after the typedef declaration */ 13 | extern char * r50toascii2(word16 r50[] , char * string , int space); 14 | /* Prototype include a typedef name. 15 | It should be moved after the typedef declaration */ 16 | extern void r50filename(word16 r50[] , char * name , int space); 17 | /* Prototype include a typedef name. 18 | It should be moved after the typedef declaration */ 19 | extern void printfqbppn(const firqb * f); 20 | /* Prototype include a typedef name. 21 | It should be moved after the typedef declaration */ 22 | extern void printfqbname(const firqb * f); 23 | /* Prototype include a typedef name. 24 | It should be moved after the typedef declaration */ 25 | extern void printcurname(const firqb * f); 26 | /* Prototype include a typedef name. 27 | It should be moved after the typedef declaration */ 28 | extern void mergename(char * iname , firqb * oname , int tree); 29 | /* Prototype include a typedef name. 30 | It should be moved after the typedef declaration */ 31 | extern word cvtr50(const char * in); 32 | /* Prototype include a typedef name. 33 | It should be moved after the typedef declaration */ 34 | extern void cvtnametor50(const char * in , word16 * out); 35 | /* Prototype include a typedef name. 36 | It should be moved after the typedef declaration */ 37 | extern void cvtnameexttor50(const char * in , word16 * out); 38 | /* Prototype include a typedef name. 39 | It should be moved after the typedef declaration */ 40 | -------------------------------------------------------------------------------- /extracters/rstsflx/flx.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simh/simtools/2d9a2d96caa013428f8d0686e26a4f0164c889bf/extracters/rstsflx/flx.doc -------------------------------------------------------------------------------- /extracters/rstsflx/flx.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simh/simtools/2d9a2d96caa013428f8d0686e26a4f0164c889bf/extracters/rstsflx/flx.pdf -------------------------------------------------------------------------------- /extracters/rstsflx/platform.h: -------------------------------------------------------------------------------- 1 | /* Platform specific typedefs 2 | * 3 | * This file defines data types used for accessing external data, 4 | * i.e., stuff that is a specific size. You may need to edit this 5 | * to make the field sizes work right for a particular platform. 6 | * (Likely cases are noted below.) 7 | */ 8 | 9 | /* We'll try to figure out the sizes automatically. If this doesn't 10 | * work right, define SHORTSIZE, LONGSIZE, and INTSIZE to equal the 11 | * size (in bytes) of "short int", "long int" and "int" respectively. 12 | */ 13 | 14 | #include 15 | 16 | #ifndef SHORTSIZE 17 | #if (SHRT_MAX == 0x7fff) 18 | #define SHORTSIZE 2 19 | #else 20 | #error "Please define SHORTSIZE" 21 | #endif 22 | #endif 23 | 24 | #ifndef INTSIZE 25 | #if (INT_MAX == 0x7fff) 26 | #define INTSIZE 2 27 | #else 28 | #if (INT_MAX == 0x7fffffff) 29 | #define INTSIZE 4 30 | #else 31 | #error "Please define INTSIZE" 32 | #endif 33 | #endif 34 | #endif 35 | 36 | #ifndef LONGSIZE 37 | #if (LONG_MAX == 0x7fffffff) 38 | #define LONGSIZE 4 39 | #else 40 | #if (LONG_MAX == 0x7fffffffffffffff) 41 | #define LONGSIZE 8 42 | #else 43 | #error "Please define LONGSIZE" 44 | #endif 45 | #endif 46 | #endif 47 | 48 | #if (SHORTSIZE == 2) 49 | typedef unsigned short int word16; 50 | typedef short int int16; 51 | #else 52 | #error "can't typedef 16-bit integers..." 53 | #endif 54 | 55 | #if (LONGSIZE == 4) 56 | typedef unsigned long int lword32; 57 | typedef long int long32; 58 | #else 59 | #if (INTSIZE == 4) 60 | typedef unsigned int lword32; 61 | typedef int long32; 62 | #else 63 | #error "can't typedef 32-bit integers..." 64 | #endif 65 | #endif 66 | -------------------------------------------------------------------------------- /extracters/rstsflx/rstsflx.h: -------------------------------------------------------------------------------- 1 | extern void doabort(int status , const char * srcfile , int srcline) 2 | __attribute__ ((noreturn)); 3 | extern int main(int argc , char **argv); 4 | -------------------------------------------------------------------------------- /extracters/rstsflx/rtime.c: -------------------------------------------------------------------------------- 1 | /* subroutines to handle RSTS date/time */ 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "flx.h" 8 | #include "rtime.h" 9 | #include "fldef.h" 10 | 11 | static const char months[12][4] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", 12 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; 13 | static int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 14 | 15 | char *cvtdate (word date, char *buf) 16 | { 17 | long day, yr; 18 | int mon; 19 | 20 | if (date == 0) { /* no date present */ 21 | memcpy (buf, " none ", DATELEN); 22 | return (buf + DATELEN - 1); /* point to terminator */ 23 | } 24 | yr = (long)date / 1000 + 1970; 25 | day = date % 1000; 26 | if (yr & 3) days[1] = 28; 27 | else days[1] = 29; /* check for leap year */ 28 | for (mon = 0; mon < 12; mon++) { 29 | if (day <= days[mon]) break; 30 | day -= days[mon]; 31 | } 32 | sprintf (buf, "%2ld-%3s-%04ld", day, months[mon], yr); 33 | return (buf + DATELEN - 1); /* point to terminator */ 34 | } 35 | 36 | char *cvttime (word time, char *buf) 37 | { 38 | int hour, min; 39 | char m; 40 | 41 | time &= at_msk; /* mask out any flags */ 42 | if (time == 0) { /* no time present */ 43 | memcpy (buf, " none ", RTIMELEN); 44 | return (buf + RTIMELEN - 1); /* point to terminator */ 45 | } 46 | time = 1440 - time; /* now time since midnight */ 47 | hour = time / 60; 48 | min = time % 60; 49 | if (hour >= 12) { 50 | hour -= 12; 51 | m = 'p'; 52 | } else m = 'a'; 53 | if (hour == 0) hour = 12; 54 | sprintf (buf, "%2d:%02d %1cm", hour, min, m); 55 | return (buf + RTIMELEN - 1); /* point to terminator */ 56 | } 57 | 58 | word curdate () /* current date in rsts form */ 59 | { 60 | struct tm *tmb; 61 | time_t now; 62 | 63 | time (&now); 64 | tmb = localtime (&now); 65 | return ((tmb->tm_year - 70) * 1000 + tmb->tm_yday + 1); 66 | } 67 | 68 | word curtime () /* current time in rsts form */ 69 | { 70 | struct tm *tmb; 71 | time_t now; 72 | 73 | time (&now); 74 | tmb = localtime (&now); 75 | return (1440 - (tmb->tm_hour * 60 + tmb->tm_min)); 76 | } 77 | -------------------------------------------------------------------------------- /extracters/rstsflx/rtime.h: -------------------------------------------------------------------------------- 1 | extern char * cvtdate(word date , char * buf); 2 | /* Prototype include a typedef name. 3 | It should be moved after the typedef declaration */ 4 | extern char * cvttime(word time , char * buf); 5 | /* Prototype include a typedef name. 6 | It should be moved after the typedef declaration */ 7 | extern word curdate(void); 8 | /* Prototype include a typedef name. 9 | It should be moved after the typedef declaration */ 10 | extern word curtime(void); 11 | /* Prototype include a typedef name. 12 | It should be moved after the typedef declaration */ 13 | -------------------------------------------------------------------------------- /extracters/rstsflx/scancmd.h: -------------------------------------------------------------------------------- 1 | extern char doquery (void (*printfile)(void *), void *name); 2 | extern void dodisk (int argc, char **argv); 3 | extern void dofiles(int argc , char **argv , commandaction action , int nullflag); 4 | /* Prototype include a typedef name. 5 | It should be moved after the typedef declaration */ 6 | extern void doexit(int argc , char **argv); 7 | extern commandhandler scanargs(int argc , char **argv); 8 | /* Prototype include a typedef name. 9 | It should be moved after the typedef declaration */ 10 | extern void initialize_readline (void); 11 | extern char *stripwhite (char *string); 12 | -------------------------------------------------------------------------------- /extracters/rstsflx/version.h: -------------------------------------------------------------------------------- 1 | #define IDENT "v2.6" /* program version number */ 2 | -------------------------------------------------------------------------------- /extracters/sdsdump/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=sdsdump 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /extracters/tpdump/Makefile: -------------------------------------------------------------------------------- 1 | # all of these can be over-ridden on the "make" command line if they don't suit your environment. 2 | TOOL=tpdump 3 | CFLAGS=-O2 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow 4 | BIN=/usr/local/bin 5 | INSTALL=install 6 | CC=gcc 7 | 8 | $(TOOL): $(TOOL).c 9 | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(TOOL) $(TOOL).c $(LDLIBS) 10 | 11 | .PHONY: clean install uninstall 12 | 13 | clean: 14 | rm -f $(TOOL) 15 | 16 | install: $(TOOL) 17 | $(INSTALL) -p -m u=rx,g=rx,o=rx $(TOOL) $(BIN) 18 | 19 | uninstall: 20 | rm -f $(BIN)/$(TOOL) 21 | -------------------------------------------------------------------------------- /putr/putr.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simh/simtools/2d9a2d96caa013428f8d0686e26a4f0164c889bf/putr/putr.com -------------------------------------------------------------------------------- /putr/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains PUTR.COM V2.01, a program for accessing DEC file 2 | systems from DOS PCs. 3 | 4 | Supported file systems: 5 | DOS/BATCH (both disks and DECtapes) 6 | Files-11 (read only) 7 | OS/8 8 | RSTS/E 9 | RT-11 10 | TSS/8.24 DECtape (PUTR.SAV format) 11 | TSS/8.24 system disk (read only) 12 | XXDP+ 13 | 14 | Supported media: 15 | disk image files (can apply/remove interleave for floppy image files) 16 | RX33, RX50 floppies in 1.2MB drive 17 | RX01/02/03 workalike floppies in 1.2MB drive 18 | RX23, RX24, RX26 disks in 3.5" 720KB/1.44MB/2.88MB drive 19 | RX01 real floppies in 8" drive with appropriate controller 20 | TU58 drives plugged into PC COM port 21 | SCSI disks through ASPI driver 22 | CD-ROM 23 | (Catweasel/ISA driver is unfinished and therefore undocumented) 24 | 25 | The program accepts a subset of the usual DOS commands, but allows you to 26 | MOUNT non-DOS disks (with a fake drive letter or "ddu:" style name). Once 27 | you've mounted a foreign disk, you can "log in" to it just like a DOS disk, 28 | and TYPE, COPY (including COPY /B), DIR etc. will work (no RENAME yet, sorry). 29 | 30 | The program's basic point of pride is the fact that you can mount more than 31 | one foreign disk at once, and they may be from different operating systems, 32 | so you can copy file between foreign file systems w/o the intermediate step 33 | of copying them into a DOS directory and back out again (especially handy if 34 | space is tight and/or your files have dates before 01/01/1980). 35 | 36 | By the way, whatever your stinking web browser may tell you, "putr.doc" is 37 | a plain ASCII file! This shouldn't be a problem when accessing this server 38 | via HTTP, because the server's MIME types file has this set up properly. 39 | 40 | John Wilson wilson@dbit.com 05-Sep-2001 41 | --------------------------------------------------------------------------------