Control Flow (5 ops) NOOP do nothing CALL call sub, method, or vtable func END halt interpreter cleanly GOTO IF Value (12 ops) The Value, Math, Comparison and Object ops are designed to minimize op proliferation. Apart from type coercion via coerce_[ins]_[ins], all ops require that each of their arguments be of the same type. I = int N = number S = string COERCE_[T]_[T] A B coerce registers between primitive types (objects will provide the same functionality via vtable functions) LOAD_CONST_[T] A K R(A) := K load a constant SET_[T] A B R(A) := R(B) copy contents of B into A (same type required) Math (14 ops) ADD_[in] A B C R(A) := R(B) + R(C) SUB_[in] A B C R(A) := R(B) - R(C) MUL_[in] A B C R(A) := R(B) * R(C) DIV_[in] A B C R(A) := R(B) / R(C) MOD_[in] A B C R(A) := R(B) % R(C) AND A B C R(A) := R(B) & R(C) OR A B C R(A) := R(B) | R(C) NOT A B C R(A) := R(B) ~ R(C) XOR A B C R(A) := R(B) ^ R(C) Comparison (2 ops) CMP_[in] A B C R(A) = R(B) cmp R(C) (same type required) Objects (5 ops) NEW A R(A) := new PerlThing() create a new obj NEW_[ip] A B R(A) := new PerlThing(R(B)) create with init GET_ATTR A B C R(A) := R(B).$!(R(C)) get an object attribute's value SET_ATTR A B C R(A).$!(R(B)) := R(C) set an object attribute's value Other (1 op) LOADLIB A load(R(A)) load an HLL(?) library I/O (4 ops, bootstrapping only) These four ops are only intended for use during Lorito's implementation phase. Once Lorito matures to the point where we have a fixed set of ops and have tools that can generate Lorito, we expect these ops to become methods on a FileHandle. READ A R(A) := STDIN.nextChar() read from stdin WRITE A STDOUT.write(R(A)) write to stdout SAY A STDOUT.writeln(R(A)) write + "\n" GRIPE A STDERR.write(R(A)) write to stderr