r/java • • Jul 25 '25

MTMC: 16-bit Educational Computer from HTMX creator

https://mtmc.cs.montana.edu

The creator of HTMX, Carson Gross, happens to be a professor at Montana State University. He and I share a belief that modern computers are too fast, too powerful, and too complex for students to fully understand how the system works.

Enter the MTMC-16, a simulated 16-bit RISC computer with 4KB of RAM, a command line, 4 color display, gamepad, CPU status with Das Blinkenlights, built-in assembly editor with autocomplete, and so much more!

Ships with Unix utilities and a few games like Snake, Conway's Game of Life, and Hunt the Wumpus!

(My favorite life pattern is life /data/galaxy.cells. Feel free to make your own patterns!)

62 Upvotes

14 comments sorted by

View all comments

5

u/TheRealUprightMan Jul 25 '25

This is a great idea! So many new people seem to have no idea how a computer works because they have only had access to high level, abstract libraries that do all the work. And I have used many of the systems listed, like PDP-11.

Even a RPi is a full fledged PC strapped with layers of code. Same goes for Arduino. Code these days feels incredibly bloated as a result. I wonder how many modern coders have seen the XOR trick to swap values without a temp variable? Hell, back in college in a mainframe assembly class, a test question was to zero a variable in a register. I did an XOR with itself and got it wrong! Even after explaining how it zeros the variable (the teacher didn't get it! A college teacher! Seriously!!) and that XOR is one of the simplest and fastest operations a CPU can do, she told me that its not as readable and "self documenting" as her accepted answer and refused to give me credit - it was the only question I got wrong. I told her she was using the wrong language. We use assembler for raw speed, not documentation! You don't have to wonder why I dropped out of college!

Some of the older systems could do some really amazing tricks to achieve speed, and modern programmers are missing out! I actually wrote my final project for an 8086 assembler class on an 8Mhz 68K (Atari ST) running a software emulator of an 8086 (PC Ditto)! My project did more graphics than anyone else's but ran about 10 times faster (simple tic-tac-toe game) because I was forced to shave every last cpu cycle just to make it run. Wish I still had that code! Even using BIOS for graphics (other people used direct screen writes) mine was still faster. Seeing it run on the computer lab's new 486 machines was amazing!

Fun story. I knew the teacher got the idea from War Games. So, it asks 1 or 2 players. After a minute or so, he finally asks "What happens if you put 0 for number of players?" He took the bait! Yeah, it played itself! You could hold down 0 and it would just play itself over and over. Instant A+. 🀣

This would be an ideal system to do that sort of low level experimenting with! You truly can't appreciate how slow a 68000 emulates an 8086 through pure software, no hypervisor, no MMU for address translation, all software (with reverse endian integers).

Sometimes, its the difficulties and hardships that we need to overcome that lead to the best solutions.

3

u/thewiirocks Jul 25 '25

πŸ‘†This guy gets it 😁

2

u/mjdau Jul 26 '25

You, good person, are a Real Programmer, worthy of Mel.

https://en.wikipedia.org/wiki/The_Story_of_Mel

1

u/TheRealUprightMan Jul 26 '25

I was a very weird child. 🀣