Board Thread:Program Announcements/@comment-9531161-20150117071441

So this isn't a Petit Computer program, but it's related to Petit Computer in that you can program on it using a simplified language. It's a tiny computer simulator: the computer has a small amount of RAM, no hard drive, and the only IO devices are a small screen and 8 buttons. However, Petit Computer uses BASIC, an easy to understand langauge. I'm using a specialized version of assembly, and one with only 14 instructions at that, so the programming difficulty will be quite a bit higher.

The simulator gives you direct access to the video buffer, so you can directly write values to video memory and have it show up on screen. The screen is a 32x32 monochrome display, so the buffer is 128 bytes, or 32 4-byte memory addresses. Each bit in video memory represents a pixel: 1 is on, 0 is off. Yuck, right?

The video buffer represents the first 32 elements of RAM, which is a total of 260K, or 65536 4-byte memory addresses. In actuality, each address of memory holds 64 bits, so if this becomes a problem, I can fix it down to 32.

If you've used assembly before, you might be used to working with registers and load/store instructions. Tiny Computer ONLY has RAM, so there's no load and store instructions. Instead, instructions like add/sub/mul/div work with immediates and direct memory access. If you need indirection (pointers), you can "dereference" a memory location using * (much like dereferencing a pointer). Doesn't this just sound wonderfully fun?! (sarcasm)

To make things a bit easier, I also provide macro support. Macros are simple text replacement, but they can be very powerful if used correctly. Since you're in control of ALL memory (there's absolutely no memory partitioning or management of any kind), it might be a good idea to use macros to name sections of memory and stuff.

If you're a really big programming nerd who's looking for something a little different, why not try it out? I mean it's completely pointless, but sometimes the restrictions of a low-level language can be fun.

...sometimes.

There's a small help document at the bottom of the page which showcases the various instructions. I'll also have an example program up somewhere (eventually).

https://dl.dropboxusercontent.com/u/4753340/tiny%20computer/index.html 