User manual

This is the full user manual for the Bedrock computer system.

This manual is aimed at people who are learning about or writing programs for the Bedrock system. For people who are implementing the system from scratch, the specification will provide more relevant information.

Overview

Bedrock is a portable 8-bit computer system that can run on a wide variety of computer architectures and form factors. The Bedrock system is straightforward to implement and use, and the simplicity and stability of the system allows programs to continue to work forever without modifications or maintenance.

Programs are distributed as binary files, with each program being no larger than 64 kilobytes.

Sections

The user manual is divided into multiple pages for readability.

  • Architecture manual
    The architecture manual documents the core architecture of the Bedrock system. It describes how programs are loaded and interpreted, and how devices are connected to the system.
  • Instruction set manual
    The instruction set manual documents the instruction set of the Bedrock processor. It describes the effects of every instruction that can be used in a program, and shows examples of how they can be used.
  • Assembler manual
    The assembler manual documents the assembler language used by the Bedrock assembler. It describes the purpose of each language element, including how each one assembles into a program, and shows examples of how they can be used.

Device manuals

Devices are not guaranteed to be available on all Bedrock systems. Refer to the individual instruction manual of your Bedrock system to see which devices are available, or check the connected devices port of the system device.

  • System device
    The system device provides information about the system and allows the system to wait for events.
  • Memory device
    The memory device provides access to up to 16 megabytes of additional working memory.
  • Math device
    The math device provides access to multiplication, division, and coordinate space conversion operations.
  • Clock device
    The clock device provides access to the current date and time, and to four high-resolution countdown timers.
  • Input device
    The input device provides access to input from a mouse, keyboard, and four gamepads.
  • Screen device
    The screen device provides access to a 16 colour screen with two layers.
  • Tone device
    The tone device has not been designed yet.
  • Sampler device
    The sampler device has not been designed yet.
  • Stream device
    The stream device provides communication with standard terminal streams and the internet.
  • File device
    The file device provides access to a heirarchical filesystem.
  • Clipboard device
    The clipboard device provides access to the shared system clipboard and a drag-and-drop interface.
  • Registry device
    The registry device provides access to a persistent key-value data store.

Reference tables

  • Instruction set reference
    The instruction set reference is a table that lists the stack signature of each instruction variant.
  • Device port reference
    The device port reference is a table that lists the name and description of every device port.

Terminology

Byte

A byte is an 8 bit value, written as a pair of hexadecimal digits.

Bedrock generally treats bytes as unsigned values, where the values 00 to FF represent the positive numbers 0 to 255. Some devices will treat bytes as signed values, where the values 00 to 7F represent the positive numbers 0 to 127 and the values FF to 80 represent the negative numbers -1 to -128.

Double

A double (or ‘double-width value’) is a 16 bit value stored as a pair of bytes, with the first byte representing the higher bits and the second byte representing the lower bits (big-endian byte order). The bytes making up a double are treated like any other byte when stored in memory or on the stack, and can be freely broken apart and recombined.

Bedrock generally treats doubles as unsigned values, where the values 0000 to FFFF represent the positive numbers 0 to 65535. Some devices will treat doubles as signed values, where the values 0000 to 7FFF represent the positive numbers 0 to 32767 and the values FFFF to 8000 represent the negative numbers -1 to -32768.

Port group

A port group is a group of device ports that acts as a single larger port, and is used to access a larger value. Ports belonging to a group have the name ‘grouped’ in the port table, and are owned by the previous port in the table.

Port alias

A port alias is a device port that acts as a copy of the previous port in the port table. Port aliases have the name ‘aliased’ in the port table.