Questions tagged [mmix]

MMIX is the next generation version of Don Knuth's famous MIX assembly language. MMIX has a syntax modelled around modern RISC machines, but with none of the idiosyncrasies that are part of all real assembly languages. Thus MMIX is ideal for theoretical investigations around computer science algorithms, data structures, and their complexity. MMIX comes with an assembler and simulator. There are even FPGA implementations of the underlying hardware!

MMIX is the next generation version of Don Knuth's famous MIX assembly language. MMIX has a syntax modelled around modern RISC machines, but with none of the idiosyncrasies that are part of all real assembly languages. Thus MMIX is ideal for theoretical investigations around computer science algorithms, data structures, and their complexity. MMIX comes with an assembler and simulator. There are even FPGA implementations of the underlying hardware!

19 questions
6
votes
2 answers

How can I get started using Donald Knuth's MIX/MMIX assembler?

I'd like to be able to learn MIX/MMIX, but I don't know the toolchain that one would use to write it. I've used uVision in the past for ARM assembler related things, does such an equivalent exist for MIX/MMIX?
user916367
5
votes
1 answer

How do the tries work that are used in the mmo object format's symbol tables?

I try to understand, how the mmo object file format works, which is used for Don Knuth's educational MMIX architecture. I have not bought MMIXware, so I have to guess most of the details from the literate source files of the assembler and…
fuz
  • 88,405
  • 25
  • 200
  • 352
5
votes
2 answers

MIX or MMIX - what is the best

Hi my first question … I start reading ‘The Art of Computer Programming’. I know it’s hard. First I decide to lean the language of book – I start with MIX. I made some exercises and I think I can manages with programs in the book. But the problem is…
next_for
  • 55
  • 1
  • 5
5
votes
1 answer

Inspect register contents during mmix interactive mode

I want to know how I can use mmix in interactive mode to display the contents of registers whenever I ask to see them. For example, I have a simple mmix program: % Compute D=4A-2B+16C %LABEL OPCode Operands Comments LOC…
NickO
  • 731
  • 1
  • 6
  • 20
3
votes
2 answers

Printing a number contained in a register

I'm learning MMIX so I tried making a simple program to add one to itself and print the result. Unfortunately it doesn't print anything. Here is my program: n IS $4 y IS $3 t IS $255 LOC #100 Main SET n,1 %let n = 1 ADD y,n,1…
Robert
  • 51
  • 2
3
votes
1 answer

How to compile Rust for MMIX

Is it possible to compile Rust for the MMIX architecture? From what I understand about the Rust compiler (which is admittedly not a whole lot) it uses LLVM as a backend; coming from a C and gcc background, I know that gcc can produce MMIX…
Cole Reynolds
  • 413
  • 4
  • 7
2
votes
1 answer

Why we should reserve a global register in MMIX?

What does "GREG @" in this code do? I know it reserves a global register, but why do we need it here? LOC Data_Segment GREG @ Y OCTA 0 x IS $1 buf1 IS $2 buf2 IS $3 LOC #100 …
2
votes
2 answers

Printf problem with gcc on mmix

I have compiled the gcc 4.6.0 for mmix according to http://www.bitrange.com/mmix/install.html. After I try their simple hello world, or any other call to printf with more than the first string, only the first string gets printed. E.g. lada@:~/f/c>…
2
votes
1 answer

Trying to find the Knuth discussion of quotient and remainder

I seem to recall once reading in one of the tAOCP fascicles Knuth's discussion of calculating the integer quotient and remainder. My memory is that he claims it is not possible to calculate one without the other, and that he believed the results…
Jim Newton
  • 594
  • 3
  • 16
2
votes
2 answers

How to link multiple assembler files for MMIX

Assume, I wrote a small lib implementing something "fprint"-likely. The book that teaches me MMIX (Das MMIX-Buch, german) always copies the whole lib into the new program, but I dislike this approach. Is there any way to assemble the library into…
fuz
  • 88,405
  • 25
  • 200
  • 352
2
votes
1 answer

Purpose to set to 0 least significant bits in MMIX assembly with memory operations?

In the documentation to MMIX machine mmix-doc page 3 paragraph 4: We use the notation to stand for a number consisting of consecutive bytes starting at location . (The notation means that the least significant t bits of k are set to 0,…
1
vote
0 answers

MMIX: questions on dynamic trap

I have some questions on MMIX's interrupt. The definition of the special register rK is "interrupt mask register". But it seems it treat different event differently. for I/O bits(let's call ** bit: This is a normal case. When an external…
wuxb
  • 2,572
  • 1
  • 21
  • 30
1
vote
0 answers

setjmp and longjmp implementation in mmix

I've written an implementation of setjmp and longjmp in MMIX (assuming no name mangling). I also hand-assembled it. Are there any mistakes anyone can spot? // Memory stack pointer is stored in $254. // jmp_buf is rO, next address after…
1
vote
1 answer

MMIX changing characters in input

I have an assignment where I have to take an input in MMIX and return the exact same thing, with the exception that all spaces must be newlines. I've been trying for about 2 days now and have figured out how to take input and how to output it to…
1
vote
1 answer

Mmix NEG and NEGU opcodes

According to NEG and NEGU definitions, NEG $X,Y,$Z (negate signed): s($X) := Y - s($Z). NEGU $X,Y,$Z (negate unsigned): u($X) := (Y - u($Z)) mod 2^64. Let's suppose $Z = s(-1) or u(2^64 - 1). Then the first opcode is going to put value 1 into the…
Minor Threat
  • 2,025
  • 1
  • 18
  • 32
1
2