Zack's Software Computer

v8.0

This web app can best be thought of as an emulator for my own theoretical computer. It's not meant to be a guide to how computer hardware works.

It's got sprites, a background tilemap, 16 colours, and is programmable in Assembly.

Changes:

Core
  • RAM is now filled with random values on boot, to mimic reality
  • Added "Hardware" RNG with a shift register, it's value is located at #F102. A new number is generated per command.
  • Added New instructions: INC, DEC, CLEQ, CLNE, CLGT, CLLT, CLGE, CLLE, and CLEAR
  • Removed PRINT instruction, it's now handled in software. Set the B register to the address of the string and CALL PrintString
Assembly
  • Labels and variables from ROM can be accessed in the user program, most notably PrintString, and RNG
  • Added Call-If instructions, which are just like Branch-If instructions except it's a CALL instead of a GOTO
BASIC
IDE

Specs

  • 16-bit
  • 36KB RAM
  • 8KB VRAM
  • 20KB ROM
  • 62 tiles
  • 128 sprites
  • Big-endian

Memory Layout

Shadow registers (when you read or write to this area it will go to the register instead.)

#0 - Program Counter

#2 - A

#4 - B

#6 - C

#8 - F

#E - X scroll

#F - Y scroll

#10 - #100 - CPU Stack


RAM | #100 - #5000

High level language area (BASIC or Assembly)


VRAM | #5000 - #5FFF

#5000 - #501F - palette

#5020 - #561F - tiles

#5620 - #581F - background tilemap

#5820 - #5FFC - sprites

#5FFC - text colour

#5FFE - background colour


ROM | #6000 - #6FFF

This area is reserved for the BIOS.



RAM | #7000 - #8FFF

User RAM.


RAM | #B000 - #F000

Low level language area (machine code) kept separate so it doesn't overwrite.


Reserved/IO | #F000 - #FFFF

#F200 - Current key pressed on the keyboard

#FFFE - kill switch (when branched or jumped to, the computer will stop executing.)

Loading Programs

LOAD will prompt for a text file, the language it expects is based on whether you're in ALMOND, BRAZIL, or Raw Binary Mode

; creates a comment, whether it's in-line or at the start.

A tab between the command and argument instead of a space is supported.

Example

Zack's IDE

I've built an IDE to make writing programs easier.

The Run button will automatically change the mode before importing the program.

Type "help" to bring up the full list of commands.

Graphics Mode

Graphics Mode is enabled when your program runs

Tiles

Each 16x16 tile is stored in 64-word chunks starting at #5020

There's enough room to store 128 tiles.

Each digit of hex corrosponds to the colour for that pixel, so each word makes 4 pixels.

I've built a tile editor to make creating and exporting them easier.

Tilemap

The screen is made up of a tilemap, 21 tiles across, and 12 tiles down.

Starting at #5620, each tile is a byte, the first bit is the flipX flag, and the rest of the byte indicates the tile.

Sprites

Each sprite is 2 words, starting at #5820. The first byte is the tile, the second byte is Y, the third byte + first half of fourth byte is X, and the last nibble is Flags.

in hex: TTYY XXXF
T - Tile
F - Flags

There is enough room for 128 sprites.