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
|
2023-04-01 23:19:12 +02:00
|
|
|
INCMP = 8
|
|
|
|
_MAX = 8
|
2023-03-31 11:52:04 +02:00
|
|
|
)
|
2023-04-02 16:00:56 +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",
|
|
|
|
}
|
|
|
|
)
|