New demo for FPGA-Elf: dice

I needed a demo program for the FPGA-Elf that was at least a little more interesting than simply counting, so I wrote a dice program.  When you press the input button, it simulates rolling a pair of six-sided dice.  Perfect for playing board games.  The program is 49 bytes long, so it is somewhat tedious to toggle in, but not completely awful.  It’s almost certainly possible to do it in fewer bytes, but I’m not going to try to optimize it right now.

For anyone with an Elf that cares to try it, the code (starting at address zero) is:

F8 00 B1 B2 B3 F8 80 A1
F8 81 A2 F8 82 A3 F8 60
52 F8 06 53 3F 14 02 FC
F0 52 3A 28 F8 60 52 03
FC FF 53 3A 28 F8 06 53
02 E3 F1 E1 51 64 21 30
14
This entry was posted in FPGA, RetroChallenge. Bookmark the permalink.

2 Responses to New demo for FPGA-Elf: dice

  1. Gilbert says:

    I found the javascript elf simulator and managed to figure out how to operate the switches to enter and review the machine code. Sure enough, when I flip the run on and off, I get dice output!

    Very cool. Not quite as cool as a real elf or a fpga elf, but still a very fun intro to a machine and CPU I never used

    But wow, that is some tedious program entry and editing!

  2. Eric says:

    Thanks Gilbert! It’s good to know that the demo works on another kind of Elf. I may build myself one of the original kind in the future for comparison.

Leave a Reply