This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
buntine (author)
Sun Mar 15 20:12:18 -0700 2009
bolverk /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sat Jan 31 07:03:24 -0800 2009 | |
| |
LANGUAGE_SPEC | Tue Mar 10 06:21:02 -0700 2009 | |
| |
README | Tue Mar 10 22:20:06 -0700 2009 | |
| |
Rakefile | Mon Feb 23 03:53:34 -0800 2009 | |
| |
bolverk.gemspec | Wed Mar 11 15:50:52 -0700 2009 | |
| |
lib/ | Sun Mar 15 20:12:18 -0700 2009 | |
| |
spec/ | Sat Mar 14 23:53:40 -0700 2009 | |
| |
test.rb | Sun Mar 01 22:45:06 -0800 2009 |
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).







