Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

jimhall

6
Posts
1
Topics
13
Followers
A member registered Oct 25, 2022 · View creator page →

Creator of

Recent community posts

I'm also part of the FreeDOS Project, so part of my goal was to write this in DOS too. And C was the easiest path for me to do that. :-)

Watch a video of the Toy CPU in action! 

If anyone wants to try entering a program, here's the "A+B=C" program code. You can use the "cheat sheet" that's "taped" to the front of the Toy to figure out the machine language instructions:

0. LOAD
1. 7 ("A")
2. ADD
3. 8 ("B")
4. STORE
5. 9 ("C")
6. STOP
7. 1 (this is "A")
8. 3 (this is "B")
9. 0 (this is "C", will get overwritten)

Thanks for the great comment! I got the original idea for this when I read the Understanding the Digital World textbook, by Brian Kernighan, where he used a Javascript implementation of a similar "Toy" using assembly. (I shared the Linux prototype of my Toy CPU with Brian. He liked it.)

I tried to balance "fun/easy to use" with "programming in machine language." That's a hard balance to make with machine language. :-) I used the Linux prototype in a 100-level course about "how technology works," for our unit on programming. I showed how to enter a "flash the lights" program, then we watched it run. I had my students write a simple program ("A+B=C") in machine language for the Toy, which I entered for them. They said it was hard to do at first, but they got it. And that made learning the "how it works" of programming much easier. I rewrote the "A+B=C" program in assembly, and in higher level programming languages .. the students were much more engaged and directly connected the "A+B=C" assembly program to machine language, and could see how "A+B=C" as a higher level language (like C) could be translated to assembly (and thus into machine language).

That's as far as we got, since it's not a computer science class. :-)

Thanks so much! I'd hoped it would be both educational and fun - glad you found it so.

Hi everyone! I wrote a simulation of a cool retro computer, called the Toy CPU. You use the "front panel" to enter your program as binary opcodes, using a "switches and lights" model. Check out my GitHub project for a full list of the opcodes (there's a cheat sheet "taped" to the front display of the Toy). My GitHub also has several sample programs you can enter into the Toy. Educational and fun!

This is actually an update to an older prototype, but it's completely rewritten from scratch to run as a DOS program in graphical mode.