Bolverk: 8-bit Machine Emulator - v0.0.2

A simple processor emulator built for educational purposes. See the README and LANGUAGE SPEC or GO HOME.

LANGUAGE SPECIFICATION

  1. Disclaimer

    The machine language implemented into Bolverk is based largely on the language described in Appendix B of the textbook "Computer Science: An Overview" by J. Glenn Brookshear (ISBN 0-8053-0264-6).

    I have changed and added things wherever I saw fit.

  2. Notes

    Each operand consists of hexadecimal digits. R, S and T represtent registers whereas X and Y represent non-register values (such as a memory cell).

  3. Operations

    Op-Code Operand Description
    1RXYLOAD the register R with the contents of the memory cell whose address is XY.
    2RXYLOAD the resister R with the value XY.
    3RXYSTORE the contents of register R in the memory cell whose address is XY.
    40RSMOVE the contents of register R to register S (acts as a COPY).
    5STRADD the contents of registers R and S as though they were binary numbers and and store the result in register T.
    6STRADD the contents of registers R and S as though they were floating-point numbers and store the result in register T.
    7STROR the contents of registers S and T and store the contents in register R.
    8STRAND the contents of registers S and T and store the contents in register R.
    9STREXCLUSIVE OR (XOR) the contents of registers S and T and store the contents in register R.
    AR0XROTATE the contents of register R to the right, in a circular-motion X times.
    BRXYJUMP to the instruction stored at the memory cell XY if the contents of register R is equal to the contents of register 0. Otherwise, continue onto the next instruction as per normal.
    C000HALT execution and reset the program counter.
    DMXYPRINT the contents of the memory cell whose address is XY to the standard output.

    The M parameter indicates the type of data:

    • 0 => ASCII character
    • 1 => Binary number (as decimal)
    • 2 => Floating-point number

    EMXYPRINT the value represented by XY to the standard output.

    The M parameter indicates the type of data:

    • 0 => ASCII character
    • 1 => Binary number (as decimal)
    • 2 => Floating-point number