AttoVM logo

AttoVM / 2OPM

2OPM

2OPM is our simplified alternative to official x86-64 assembly. 2OPM (`two-operand pseudo MIPS') is inspired by MIPS assembly and re-names the x86-64 operations and registers to match those of MIPS. It introduces register swap operations automatically in a few instances in which x86-64 has special hardwired registers (e.g., mul) but otherwise tries to map each 2OPM instruction to a single machine instruction.

AttoVM

AttoVM implements the object oriented language AttoL. It provides the following facilities for students to experiment with and extend:

AttoL source language example

AttoVM executes AttoL programs. Below is an example of a short AttoL program that illustrates language support for classes, initialisers, literal arrays, strings, dynamic dispatch, and loops:
class C(int x) {
    int s = x;
    int size() {
        return s;
    }
}

obj counters = [[], C(1), "foo"];
int i = 0;
while (i < counters.size()) {
    print(counters[i].size());
    i := i + 1;
}
  

Source code for Linux and OS X