vise/vm/opcodes.go

59 lines
757 B
Go
Raw Permalink Normal View History

2023-03-31 11:52:04 +02:00
package vm
const VERSION = 0
2023-04-02 13:12:06 +02:00
type Opcode uint16
2023-04-02 00:42:34 +02:00
// VM Opcodes
2023-03-31 11:52:04 +02:00
const (
2023-04-02 13:20:35 +02:00
NOOP = 0
2023-04-01 22:25:20 +02:00
CATCH = 1
CROAK = 2
LOAD = 3
RELOAD = 4
MAP = 5
MOVE = 6
HALT = 7
INCMP = 8
MSIZE = 9
MOUT = 10
MNEXT = 11
MPREV = 12
2023-04-08 10:31:32 +02:00
_MAX = 12
2023-03-31 11:52:04 +02:00
)
var (
OpcodeString = map[Opcode]string{
NOOP: "NOOP",
CATCH: "CATCH",
CROAK: "CROAK",
LOAD: "LOAD",
RELOAD: "RELOAD",
MAP: "MAP",
MOVE: "MOVE",
HALT: "HALT",
INCMP: "INCMP",
MSIZE: "MSIZE",
MOUT: "MOUT",
MNEXT: "MNEXT",
MPREV: "MPREV",
}
2023-04-04 11:38:01 +02:00
OpcodeIndex = map[string]Opcode {
"NOOP": NOOP,
"CATCH": CATCH,
"CROAK": CROAK,
"LOAD": LOAD,
"RELOAD": RELOAD,
"MAP": MAP,
"MOVE": MOVE,
"HALT": HALT,
"INCMP": INCMP,
"MSIZE": MSIZE,
"MOUT": MOUT,
"MNEXT": MNEXT,
"MPREV": MPREV,
2023-04-04 11:38:01 +02:00
}
)