public
Description: A simple 8-bit microprocessor emulation engine, built for educational purposes.
Homepage: http://www.andrewbuntine.com
Clone URL: git://github.com/buntine/bolverk.git
name age message
file .gitignore Sat Jan 31 07:03:24 -0800 2009 Added some comments and a .gitignore file [buntine]
file LANGUAGE_SPEC Tue Mar 10 06:21:02 -0700 2009 Modified README [buntine]
file README Tue Mar 10 22:20:06 -0700 2009 Fixed messup in README [buntine]
file Rakefile Mon Feb 23 03:53:34 -0800 2009 Added gemspec file and setup rake tasks for pac... [buntine]
file bolverk.gemspec Wed Mar 11 15:50:52 -0700 2009 Incremented gem version [buntine]
directory lib/ Sun Mar 15 20:12:18 -0700 2009 Fixed bug in program counter incrementor [buntine]
directory spec/ Sat Mar 14 23:53:40 -0700 2009 Added some basic overflow detection on decimal ... [buntine]
file test.rb Sun Mar 01 22:45:06 -0800 2009 Added test file [buntine]
README
=========================================
===           Bolverk v0.0.3          ===
===         By Andrew Buntine         ===
=========================================

1) Definition

  Bolverk is an emulator for a typical machine language. I have developed it in an attempt to
  better understand the way machines work at a low-level and potentially as an educational tool
  for students who prefer to see a machine language in action in a virtual environment.

  With Bolverk, you can write a machine language program, and then step through the operation one
  "machine cycle" at time. At each point, you can dissect main memory and all registers. This is a
  great way to see how the program effects memory in realtime.

  Programs are written in base-16 (hexadecimal). The language design is based on the one described
  in J. Glenn Brookshears textbook -- Computer Science: An Overview (3rd edition, 1991).

2) Architecture

  - The machine has 16 registers identified in hexadecimal as 0 through to F.
  - Each register can hold one byte (8 bits).
  - Main memory consists of 256 cells.
  - Each memory cell can hold one byte.
  - Memory cells can be referenced in hexadecimal as 00 (00000000) to FF (11111111).

3) Machine Language

  - Machine instructions are 16 bits (two bytes) in length, therefore each instruction requires two memory cells.
  - The first 4 bits make up the op-code. The following 12 bits make up the operand field.
  - See the LANGUAGE_SPEC document for a listing of the available instructions.

2) Storing Integers and Fractions

  To represent signed integers, binary numbers are encoded in Two's Complement Notation.
  Therefore, the range of numbers than can be stored is -128 to 127. This should be sufficient
  for educational purposes.

  Fractions are stored in Floating Point Notation using the following layout: 0 000 0000

    1)    Sign bit.
    2..4) Exponent field, encoded in Excess Four Notation
    5..8) Mantissa field

  It's worth noting that my Floating Point implemenation is very limited as only one byte is
  reserved per number (most systems would use atleast 32 bits). Therefore, round-off errors
  and overflows are going to be rather common unless you are dealing with a very small range
  of numbers (roughly 1/256 to 7 1/2).