| 1 | This page describes a current approximation of Lorito's ops. It is expected to converge with the eventual implementation as the number of edits increases. |
| 2 | |
| 3 | === Control Flow (5 ops) === |
| 4 | * noop - do nothing |
| 5 | * call - call a sub (or an object method or vtable function) |
| 6 | * end - halt the interpreter cleanly |
| 7 | * goto - unconditional branch |
| 8 | * if - conditional branch |
| 9 | |
| 10 | === Math (14 ops) === |
| 11 | * add_[in] - add two registers of the same type |
| 12 | * sub_[in] - subtract two registers |
| 13 | * mul_[in] - multiply two registers |
| 14 | * div_[in] - divide two registers |
| 15 | * mod_[in] - take the mod of a register |
| 16 | * and - bitwise and of an int |
| 17 | * or - bitwise or of an int |
| 18 | * not - bitwise not of an int |
| 19 | * xor - bitwise exclusive or of an int |
| 20 | |
| 21 | === Comparison (6 ops) === |
| 22 | * iseq_[in] - compute equality between two registers of the same type |
| 23 | * isgt_[in] - a >= b |
| 24 | * isge_[in] - a > b |
| 25 | |
| 26 | === Values (12 ops) === |
| 27 | * set_[ins]_[ins] - copy/coerce registers between primitive types |
| 28 | * load_const_[ins] - load a constant into a register |
| 29 | |
| 30 | === Objects (8 ops) === |
| 31 | * box - turn an int, float or string into an object |
| 32 | * new - create a new object |
| 33 | * new_[insp] - create a new object with an argument |
| 34 | * getattr - retrieve an object attribute's value |
| 35 | * setattr - set an object attribute's value |
| 36 | |
| 37 | === Other (1 op) === |
| 38 | * loadlib - load a (dll/so, pbc or HLL?) library |
| 39 | |
| 40 | === I/O (3 ops, bootstrapping only) === |
| 41 | * read - read from stdin* |
| 42 | * write - write to stdout* |
| 43 | * gripe - write to stderr* |
| 44 | |
| 45 | * read, write and gripe are only intended for use during Lorito's implementation phase. Once Lorito matures, these ops will become methods on a FileHandle. |