opcodes.go (757B)
1 package vm 2 3 const VERSION = 0 4 5 type Opcode uint16 6 7 // VM Opcodes 8 const ( 9 NOOP = 0 10 CATCH = 1 11 CROAK = 2 12 LOAD = 3 13 RELOAD = 4 14 MAP = 5 15 MOVE = 6 16 HALT = 7 17 INCMP = 8 18 MSINK = 9 19 MOUT = 10 20 MNEXT = 11 21 MPREV = 12 22 _MAX = 12 23 ) 24 25 var ( 26 OpcodeString = map[Opcode]string{ 27 NOOP: "NOOP", 28 CATCH: "CATCH", 29 CROAK: "CROAK", 30 LOAD: "LOAD", 31 RELOAD: "RELOAD", 32 MAP: "MAP", 33 MOVE: "MOVE", 34 HALT: "HALT", 35 INCMP: "INCMP", 36 MSINK: "MSINK", 37 MOUT: "MOUT", 38 MNEXT: "MNEXT", 39 MPREV: "MPREV", 40 } 41 42 OpcodeIndex = map[string]Opcode { 43 "NOOP": NOOP, 44 "CATCH": CATCH, 45 "CROAK": CROAK, 46 "LOAD": LOAD, 47 "RELOAD": RELOAD, 48 "MAP": MAP, 49 "MOVE": MOVE, 50 "HALT": HALT, 51 "INCMP": INCMP, 52 "MSINK": MSINK, 53 "MOUT": MOUT, 54 "MNEXT": MNEXT, 55 "MPREV": MPREV, 56 } 57 58 )