README
-
Requirements / Notes
At this point in time, both Javascript and Cookies must be enabled for this interface to work as intended. Sorry!
If you want to check out the engine behind this implementation, check it out here: http://www.github.com/buntine/bolverk.
-
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).
-
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).
-
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.
-
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).