Giter Site home page Giter Site logo

ascherer / mmix Goto Github PK

View Code? Open in Web Editor NEW
37.0 9.0 6.0 1023 KB

MMIX 2009 – a RISC computer for the third millennium

Home Page: http://www-cs-faculty.stanford.edu/~knuth/mmix.html

Makefile 0.24% Assembly 10.44% Roff 0.17% CWeb 89.15%
mmix cweb dek knuth

mmix's Introduction

MMIX 2009

A RISC Computer for the Third Millennium

“Thirty years have passed since the MIX computer was designed [in 1969], and computer architecture has been converging during those years towards a rather different style of machine. Therefore it is time to replace MIX with a new computer that contains even less saturated fat than its predecessor.” — The successor MMIX was developed and published by Donald E. Knuth in 1999. The fully documented source code is available from the MMIX home and in the book MMIXware: A RISC Computer for the Third Millennium published by Springer-Verlag in 1999. (This book contains several chapters with additional information not available in the electronic distribution.)

Prerequisites

The source code of MMIX is written in accordance with the rules of the Literate Programming philosophy, so you need to make sure that your computer supports the CWEB system. The CWEB sources are available for anonymous ftp from Stanford University. Bootstrapping CWEB on Unix systems is elementary and documented in the CWEB distribution; pre-compiled binary executables of the CWEB tools for Win32 systems are available from www.literateprogramming.com.

Getting Started

Details of this software can be found in the README file.

Why have yet another project here?

DEK has passed the baton of development to the group behind “MMIX home”. Besides several “official” releases from DEK in the form of gzipped tarballs, they provide their working sources through a Web-accessible repository.

The present project on Github is a separate effort and holds all releases by DEK from 1999 to 2023 in the master branch. Much more interesting is the local branch; it provides further improvements to the MMIX sources plus a “specfile” mmix.spec for building installable packages for rpm and deb based Linux distributions with the help of the rpmbuild and debbuild utilities respectively.

Major features added

  • Fix compiler warnings (gcc -W -Wall -O) with a set of changefiles
  • Advanced build script mmix.spec for rpm and deb packaging
  • Modified Makefile for target optimization
  • Use C99/C++ types bool, uint8_t and uint32_t
  • New in 2023: Completely updated module structure with new header files
  • New in 2023: Purge ARGS macro in preparation for C2x

Postscript

Recently it has come to my attention that the local modifications are used in the Cygwin port of MMIXware.

mmix's People

Contributors

ascherer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmix's Issues

Typos

  • \bull ports (default 1), number of processes that can simultaneous
    should be simultaneously.

  • mmix/mmix-sim.w

    Line 250 in b32eba1

    on that file. It returns 0 if the file was opened successfully; otherwise
    should add an it.

  • The triple operator ?: is formatted inconsistently for Fopen and Fseek in section 4 of mmix-sim.w, i.e., there are several spaces (\ ) missing.

  • Also in section 4 of mmix-sim.w, purge two commas in displayed lines.

  • The tricky sequence in section 6 of mmix-sim.w should purge two extra spaces.

  • Section 59 of mmix-sim.w: list of lists and built into.

  • #define rQ 16 in section 12 of mmmix.w repeats the same line form mmix-pipe.h.

Update to C99

In mmixal.w, replace typedef bool with <stdbool.h>.

Emacs mode

Great to see all the activity in this repo!

Last year I made an emacs mode, mmix-mode. Might be useful in combination with your compiler.

Reseach problems

At various places in the MMIX sources, Don Knuth asks the interested reader to make significant changes for advanced system features:

  • Unicode support using wchar for Char (MMOTYPE§27, MMIXAL§§{7,30})
  • octa as single 64-bit integer, e.g., using uint64_t instead of the current struct with two tetras (ILP64 interface) (MMIX-ARITH§1)
  • Graphical interface (MMIX-SIM§1)

Time permitting, I'll try to look up the relevant sections in the codes.

§51 of mmix-pipe.w typeset badly

Indentation of §51 is completely wrong. Compare §50 right above.

Affected sections are §48, §51, §83, §107.

Fix: Replace forced break @/ with soft break @|.

Roll back the 'shared library' idea.

The copy test case produces a floating point exception 8 on MacOS. Analysis shows that there are several external relationships from mmix-io.w to both mmix-sim.w and mmix-pipe.w (mmgetchars, mmputchars, stdin_chr, ...) and back (mmix_fopen, mmix_fwrite, mmix_fputs, etc.). The former is the main module for mmix, the latter for mmmix.

ATTOW, it seems impossible to create a working mmix.so shared object containing mmix-pipe.o (in order to resolve external dependencies from mmix-io.o et al.) and simultaneously link this to mmix-sim.o (in order to create mmix).

Miraculously, the shared object approach seems to work on Linux. However, the code base does not support this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.