Skip to content
/ mmix Public

playing with mmix - the polyunsaturated computer

Notifications You must be signed in to change notification settings

slg74/mmix

Repository files navigation

mmix

mmix in C

knuth

To generate a simple test program:         
% echo "48 01 00 01 48 02 00 02 20 03 01 02" > test_program.hex  

% xxd -r -p test_program.hex test_program  

% hexdump test_program
0000000 0148 0100 0248 0200 0320 0201          
000000c

test_program has SETH and ADD MMIX instructions:
SETH $1,#0001   // Set $1 to 1
SETH $2,#0002   // Set $2 to 2
ADD $3,$1,$2    // Add $1 and $2, store result in $3

in hexidecimal, these instructions are represented as:
48 01 00 01   // SETH $1,#0001
48 02 00 02   // SETH $2,#0002
20 03 01 02   // ADD $3,$1,$2


To run:  
# make && ./mmix test_program  

mmix

About

playing with mmix - the polyunsaturated computer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published