--- mixal-1.08.orig/mixal.1 +++ mixal-1.08/mixal.1 @@ -0,0 +1,83 @@ +.TH MIXAL 1 "18 May 2003" "Debian project" "Mixal user's manual" +\" This manual page was put together by Antti-Juhani Kaijanaho on 19990121. +\" It has since been modified by Darius Bacon, Antti-Juhani Kaijanaho, +\" and Vince Mulhollon +\" Use, modify and distribute it as you please. +.SH NAME +mixal \- a load-and-go MIX assembler +.SH SYNOPSIS +.B mixal +[ +.IR file " ..." +] +.SH DESCRIPTION +.B Mixal +is an implementation of the hypothetical +.SM MIX +computer and its assembly language called +.SM MIXAL. +The computer was designed by Donald Knuth for use in his monumental +and yet to be finished book series +.IR "The Art of Computer Programming" . +All programs and all programming exercises in the book are written in the +.SM MIXAL +language. +.PP +This implementation is a load-and-go assembler, meaning that you +provide it with a +.SM MIXAL +program source, which it translates into +.SM MIX +machine code, which it promptly executes by acting as a +.SM MIX +emulator. +.PP +You give +.B Mixal +zero or more +program source files in the command line, which the program +interprets. If you give it no arguments, it expects to find a program +in the standard input stream. After the program has executed, the +final state of the machine registers are printed to the standard +output stream. +.PP +The card punch and line printer devices are connected to the standard +input and output stream, respectively. Console input and output are +connected to standard input and output, and the disk devices are +connected to files named diskN in the current directory, where N is +the device number. Those files are created on demand. +.SH BUGS +This +.SM MIXAL +implementation does not do floating-point. The tape devices are not +implemented. +.SH AUTHOR +This +.SM MIXAL +implementation was designed and written by Darius Bacon, and then +ported to Unixish systems and debugged by Eric S. Raymond. This +version includes corrections to multiplication and division by Larry +Gately. This manual page was written for Debian by Antti-Juhani +Kaijanaho, with changes by Darius Bacon. +.SH "SEE ALSO" +The files +.I /usr/share/doc/mixal/READ.ME +and +.I /usr/share/doc/mixal/NOTES.gz +contain some information about this +.SM MIXAL +implementation. Be sure to read +.IR /usr/share/doc/mixal/README.Debian , +too. +.PP +A description of the +.SM MIX +system +and the +.SM MIXAL +language can be found in Donald E. Knuth's book +.IR "The Art of Computer Programming" , +Volume 1: +.IR "Fundamental Algorithms" ; +3rd Edition (Addison-Wesley 1997). +(Or see the home page at http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html.) --- mixal-1.08.orig/io.c +++ mixal-1.08/io.c @@ -1,4 +1,12 @@ /* MIX simulator, copyright 1994 by Darius Bacon */ + +/* GNU Libc 2.1 fix by Antti-Juhani Kaijanaho on + 1999-05-27: since you can no longer initialize with stdin and + stdout, we don't; instead, we return them in assigned_file. + Apparently that's the only thing that accesses the file attribute + in the devices table, so this is ok. Changes marked with "ajk". + -ajk */ + #include "mix.h" #include "charset.h" #include "io.h" @@ -6,6 +14,7 @@ #include #include +#include /* --- Device tables --- */ @@ -21,9 +30,9 @@ } devices[] = { {tape}, {tape}, {tape}, {tape}, {tape}, {tape}, {tape}, {tape}, {disk}, {disk}, {disk}, {disk}, {disk}, {disk}, {disk}, {disk}, - {card_in, stdin}, - {card_out, stdout}, - {printer, stdout}, + {card_in/*, stdin -ajk*/}, + {card_out/*, stdout -ajk*/}, + {printer/*, stdout -ajk*/}, {console} }; @@ -70,7 +79,15 @@ static FILE *assigned_file(unsigned device) { - return devices[device].file; + /* glibc2.1 fix -ajk */ + switch (devices[device].type) { + case card_in: + return stdin; break; + case card_out: case printer: + return stdout; break; + default: + return devices[device].file; + } } static char *device_filename(Byte device) --- mixal-1.08.orig/io.patch +++ mixal-1.08/io.patch @@ -0,0 +1,53 @@ +--- io.c.orig Thu May 27 20:23:43 1999 ++++ io.c Thu May 27 20:22:17 1999 +@@ -1,4 +1,12 @@ + /* MIX simulator, copyright 1994 by Darius Bacon */ ++ ++/* GNU Libc 2.1 fix by Antti-Juhani Kaijanaho on ++ 1999-05-27: since you can no longer initialize with stdin and ++ stdout, we don't; instead, we return them in assigned_file. ++ Apparently that's the only thing that accesses the file attribute ++ in the devices table, so this is ok. Changes marked with "ajk". ++ -ajk */ ++ + #include "mix.h" + #include "charset.h" + #include "io.h" +@@ -6,6 +14,7 @@ + + #include + #include ++#include + + /* --- Device tables --- */ + +@@ -21,9 +30,9 @@ + } devices[] = { + {tape}, {tape}, {tape}, {tape}, {tape}, {tape}, {tape}, {tape}, + {disk}, {disk}, {disk}, {disk}, {disk}, {disk}, {disk}, {disk}, +- {card_in, stdin}, +- {card_out, stdout}, +- {printer, stdout}, ++ {card_in/*, stdin -ajk*/}, ++ {card_out/*, stdout -ajk*/}, ++ {printer/*, stdout -ajk*/}, + {console} + }; + +@@ -70,7 +79,15 @@ + + static FILE *assigned_file(unsigned device) + { +- return devices[device].file; ++ /* glibc2.1 fix -ajk */ ++ switch (devices[device].type) { ++ case card_in: ++ return stdin; break; ++ case card_out: case printer: ++ return stdout; break; ++ default: ++ return devices[device].file; ++ } + } + + static char *device_filename(Byte device) --- mixal-1.08.orig/Makefile +++ mixal-1.08/Makefile @@ -3,7 +3,11 @@ # Must be changed in the spec file as well. V=1.08 -CFLAGS = -g +# Modified for Debian +CFLAGS = -O2 -Wall +DESTDIR = +BIN = $(DESTDIR)/usr/bin +# End of mods CSRCS = asm.c cell.c charset.c driver.c io.c main.c parse.c run.c symbol.c HSRCS = asm.h cell.h charset.h driver.h io.h mix.h parse.h run.h symbol.h @@ -19,6 +23,10 @@ mixal: $(OBJS) $(CC) $(OBJS) -o mixal +# Modified for Debian +install: mixal + install ./mixal $(BIN) + clean: rm -f *.o mixal ops.inc mnemonic mixal.shar core.mix *.tar.gz *.rpm *~ --- mixal-1.08.orig/debian/changelog +++ mixal-1.08/debian/changelog @@ -0,0 +1,106 @@ +mixal (1.08-11) unstable; urgency=low + + * Added ${misc:Depends} to control + This fixes lintian debhelper-but-no-misc-depends + * Upgraded dh compat from 4 to 8. Updated control and added compat file. + This fixes lintian package-uses-deprecated-debhelper-compat-version + This also cleans up package-lacks-versioned-build-depends-on-debhelper + * Removed DH_COMPAT from rules file. + This fixes lintian debian-rules-sets-DH_COMPAT + * Removed - from $(MAKE) clean line in rules + This fixes lintian debian-rules-ignores-make-clean-error + * Bump standards version from 3.6.2.0 to 3.9.1.0 + * Removed SC macro in manpage + This fixes manpage-has-errors-from-man + * Changed from dh_clean -k to dh_prep + This fixes lintian dh-clean-k-is-deprecated + + -- Vince Mulhollon Thu, 17 Mar 2011 13:01:37 -0500 + +mixal (1.08-10) unstable; urgency=low + + * Update standards version from 3.5.8.0 to 3.6.2.0 + * Debhelper compatibiltiy level from 3 to 4 + + -- Vince Mulhollon Fri, 16 Sep 2005 20:38:46 -0500 + +mixal (1.08-9) unstable; urgency=low + + * Manpage now refers to /usr/share/doc (closes: Bug#182064) + + -- Vince Mulhollon Sun, 18 May 2003 19:18:08 -0500 + +mixal (1.08-8) unstable; urgency=low + + * Fixed W: mixal: postinst-should-not-set-usr-doc-link + * New upstream home page is http://www.accesscom.com/~darius/ + * New upstream email is darius@accesscom.com + * Policy compliant up to 3.5.8.0 + + -- Vince Mulhollon Wed, 4 Dec 2002 19:35:47 -0600 + +mixal (1.08-7) unstable; urgency=low + + * Fix a typo, Similarlly to Similarly (closes: Bug#125138) + * Policy compliance from 3.5.4.0 to 3.5.6.0 + + -- Vince Mulhollon Wed, 19 Dec 2001 18:39:36 -0600 + +mixal (1.08-6) unstable; urgency=low + + * New maintainer. (closes: Bug#68183) + * debhelper-ized the package + * disabled -g gcc flag to remove debugging code + * Policy compliant up to 3.5.4.0 + + -- Vince Mulhollon Thu, 23 May 2001 20:54:22 -0500 + +mixal (1.08-5) unstable; urgency=low + + * debian/{rules,prerm,postinst}: Implement the /usr/doc transition. + + -- Antti-Juhani Kaijanaho Fri, 8 Oct 1999 01:08:11 +0300 + +mixal (1.08-4) unstable; urgency=low + + * Upgraded Standards-Version to 3.0.0.0 with necessary + changes to debian/rules + + -- Antti-Juhani Kaijanaho Thu, 1 Jul 1999 16:00:58 +0300 + +mixal (1.08-3) unstable; urgency=low + + * GNU libc 2.1 fixes. + + -- Antti-Juhani Kaijanaho Thu, 27 May 1999 20:44:16 +0300 + +mixal (1.08-2) unstable; urgency=low + + * Corrected extended description: the disk and console + devices are implemented in this version. + + -- Antti-Juhani Kaijanaho Thu, 4 Feb 1999 17:15:28 +0200 + +mixal (1.08-1) unstable; urgency=low + + * New upstream release + * Updated copyright file. + * Updated the manual page with upstream help. + * Updated debian/rules. + + -- Antti-Juhani Kaijanaho Tue, 2 Feb 1999 15:24:25 +0200 + +mixal (1.06d-1) unstable; urgency=low + + * Initial packaging. + * Wrote a manual page for the `mixal' binary. + * Renamed the binary from `mix' to `mixal' (thanks to + Vincent Renardias for suggesting this name). + * Removed the examples due to copyright concerns. See the + copyright file and README.Debian for more information. + + -- Antti-Juhani Kaijanaho Mon, 25 Jan 1999 23:23:15 +0200 + +Local variables: +mode: debian-changelog +End: --- mixal-1.08.orig/debian/dirs +++ mixal-1.08/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin --- mixal-1.08.orig/debian/docs +++ mixal-1.08/debian/docs @@ -0,0 +1,3 @@ +READ.ME +NOTES + --- mixal-1.08.orig/debian/compat +++ mixal-1.08/debian/compat @@ -0,0 +1 @@ +8 --- mixal-1.08.orig/debian/copyright +++ mixal-1.08/debian/copyright @@ -0,0 +1,48 @@ +New home page is http://www.accesscom.com/~darius/ +New upstream email is darius@accesscom.com + +This package was put together by Antti-Juhani Kaijanaho +. The upstream sources were obtained from +. Upstream +maintainer is Darius Bacon . + +This package does not use pristine source, since the upstream tarball +contained example programs that are taken verbatim from Knuth vol 1. +In Eric Raymond's opinion, including them (and a copy of the relevant +parts of the books, which has been removed from the tarball by +upstream) would be "fair use", but I'm not convinced of that. +Therefore, I've removed the files + mixal/elevator.mix + mixal/mystery.mix + mixal/prime.mix +from the source tarball. If someone has a convincing argument for +including them (for example, an explicit permission from Addison +Wesley Longman), I'll put them back again. But for now, they will +stay out. + + -- Antti-Juhani Kaijanaho Tue, 2 Feb 1999 15:14:00 +0200 + + +The copyright statement (from the file READ.ME) follows: + +This implementation was designed and written by Darius Bacon +, then ported to UNIX and debugged by Eric +S. Raymond . Corrections to multiplication and +division were made by Larry Gately . + +Copyright (c) 1994 by Darius Bacon. + +Permission is granted to anyone to use this software for any +purpose on any computer system, and to redistribute it freely, +subject to the following restrictions: + +1. The author is not responsible for the consequences of use of + this software, no matter how awful, even if they arise + from defects in it. + +2. The origin of this software must not be misrepresented, either + by explicit claim or by omission. + +3. Altered versions must be plainly marked as such, and must not + be misrepresented as being the original software. + --- mixal-1.08.orig/debian/control +++ mixal-1.08/debian/control @@ -0,0 +1,29 @@ +Source: mixal +Section: otherosfs +Priority: extra +Maintainer: Vince Mulhollon +Build-Depends: debhelper (>= 8) +Standards-Version: 3.9.1.0 + +Package: mixal +Architecture: any +Depends: ${shlibs:Depends},${misc:Depends} +Description: A MIX emulator and MIXAL interpreter + Mixal is an implementation of the imaginary computer called + MIX and its assembly language MIXAL, which were invented + by Donald E. Knuth in the 1960's for use in his monumental + and yet unfinished book series "The Art of Computer Programming". + All actual programs and all programming exercises in the series + are written in MIXAL. + . + This package contains a modified version of Darius Bacon's Mixal + implementation. It takes a MIXAL source file, translates it to + MIX machine code and then executes the resulting program, all in + a single run. The result of the assembler step cannot be extracted + to a file. Similarly, one cannot take a precompiled MIX program and + try to execute it in this emulator - only MIXAL source is accepted. + . + The MIX emulator does not support floating-point operations + nor the tape devices described in Knuth's book. This is not fatal, + however, and most of the programs and exercise answers in Knuth's + book can be run in this MIXAL implementation. --- mixal-1.08.orig/debian/rules +++ mixal-1.08/debian/rules @@ -0,0 +1,49 @@ +#!/usr/bin/make -f + +configure: configure-stamp +configure-stamp: + dh_testdir + touch configure-stamp + +build: configure-stamp build-stamp +build-stamp: + dh_testdir + $(MAKE) + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + $(MAKE) clean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + $(MAKE) install DESTDIR=$(CURDIR)/debian/mixal + +binary-indep: build install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs READ.ME NOTES + dh_installexamples + dh_installcron + dh_installman mixal.1 + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- mixal-1.08.orig/debian/README.Debian +++ mixal-1.08/debian/README.Debian @@ -0,0 +1,22 @@ +Notes for users of the Debian packaging of Mixal +================================================ + +The MIXAL interpreter and MIX emulator binary is called `mixal'. Yes, +there is a brief manual page. + +The examples distributed in the upstream package are not included, +since it is not certain whether they can legally be distributed with +this program: they come verbatim from Knuth's book (see below), which +is copyrighted. See the file copyright in this directory for a +detailed explanation of the situation. + +The example programs omitted from this package can be found in Knuth's +book (see below) in Section 2.2.5 (for the elevator simulation), in +Exercise 1.3.2[8] (for the mystery program) and as Program 1.3.2P (for +the primes program). + +You can find a description of the MIX computer and the MIXAL language +in Donald E. Knuth's book The Art of Computer Programming, Volume I +(Fundamental Algorithms), 3rd Ed, Addison-Wesley, 1997, pages 124-163. + + - ajk