Bedrock

Bedrock is a portable 8-bit computer system designed to be easy to use and implement.

For a quick overview of the Bedrock system, read the Introduction to Bedrock article. To see an example of a basic program written for Bedrock, see the {} tutorial. To see the technical details of Bedrock, read the specifications.

For brief examples of advanced programming techniques in Bedrock, see the Examples page.

( A macro for doing something, probably. )
%my-macro 05 02 label ;

@label ( a -- b )
  ADD:02 INC:{'string'} STA:other-label( )
  ( Another @label )
  MUL:05 [00 0100 021 03]
  RETURN


"ABC" 01 02 023

Background

Bedrock originated as a fork of the Uxn virtual machine and Varvara computing stack, with the aim of creating a system with better performance on extremely resource-constrained host systems. It has since diverged in many significant ways, . a simpler core architecture with more capable devices.

Overview

Installation

To write and run a program on Bedrock you’ll need an assembler and an emulator. The assembler is used to convert your source code into a Bedrock program, and the emulator is used to run your Bedrock program.

The bedrock-pc .

Documentation

These documents are intended for people writing programs for the Bedrock system. They’re practical and instructional. Keep them on hand. Print them out and tape them to your wall.

Programmer references

Examples

Format specifications

Specifications

These specifications are intended for people writing a full Bedrock system implementation. They describe the exact behaviour of each component in exhaustive detail.

Core specifications

Auxillary specifications

Assemblers

bedrock-asm

Emulators

Emulators are used for running Bedrock programs on different platforms.

bedrock-pc

bedrock-pc is a Bedrock emulator for Windows and Linux computers, written in Rust. The bedrock-asm assembler is built-in.

Source code can be found at code.benbridle.com/bedrock-pc.

The latest release is available from br-1.0.0-alpha5 as a pre-built Linux executable.

bedrock-nds

bedrock-nds is a Bedrock emulator for the Nintendo DS handheld game console. The program is written in C, using the BlocksDS SDK and libnds.

Source code can be found at code.benbridle.com/bedrock-nds.

REPL

The following bash program will provide a workable REPL environment for testing small pieces of Bedrock code. It assumes that the bedrock-pc emulator is available to the system as br.

#!/bin/bash
while true; do
    read -r -e -p ">>> " SOURCE &&
    echo "${SOURCE} HLT" | br asm | br -d -z=3;
    echo;
done

Development

License