Versions in this module Expand all Collapse all v1 v1.1.2 Jul 29, 2026 v1.1.1 Jul 26, 2026 v1.1.0 Jul 18, 2026 Changes in this version + var ErrExecutionPaused = vm.ErrExecutionPaused + type EventKind string + const EventException + const EventInstruction + const EventNativeEnter + const EventNativeExit + const EventPublicEnter + const EventPublicExit + type InstrumentationEvent struct + Err error + File string + Instruction Instruction + Kind EventKind + Line int + Name string + Result Cell + State State + type InstrumentationHook func(InstrumentationEvent) error type Runtime + func (r *Runtime) DebugLocation(address Cell) (file string, line int, function string, ok bool) + func (r *Runtime) SetInstrumentationHook(hook InstrumentationHook) + func (r *Runtime) State() State v1.0.0 Jun 30, 2026 Changes in this version + const CellBytes + const FlagBrowse + const FlagCompact + const FlagDebug + const FlagJITCompiled + const FlagNativeRegistered + const FlagNoChecks + const FlagNoDirectNative + const FlagNoRelocation + const FlagRelocated + const FlagSYSREQN + const FlagSleep + const SymbolArray + const SymbolFunction + const SymbolRefArray + const SymbolReference + const SymbolVariable + var ErrInvalidAMX = vm.ErrInvalidAMX + var ErrInvalidInstruction = vm.ErrInvalidInstruction + var ErrInvalidMemoryAccess = vm.ErrInvalidMemoryAccess + var ErrNativeNotDeclared = errors.New("native is not declared by the AMX image") + var ErrNotSleeping = vm.ErrNotSleeping + var ErrPublicIndexOutOfRange = vm.ErrPublicIndexOutOfRange + var ErrUnsupportedCellSize = vm.ErrUnsupportedCellSize + var ErrUnsupportedExecution = vm.ErrUnsupportedExecution + type Cell int32 + func CellFromFloat32(value float32) Cell + func (cell Cell) Float32() float32 + type DebugAutomaton struct + Address uint32 + ID int16 + Name string + type DebugDimension struct + Size uint32 + Tag int16 + type DebugEvent struct + Instruction Instruction + State State + type DebugFile struct + Address uint32 + Name string + type DebugHook func(DebugEvent) error + type DebugInfo struct + Automata []DebugAutomaton + Files []DebugFile + Lines []DebugLine + States []DebugState + Symbols []DebugSymbol + Tags []DebugTag + func (info DebugInfo) FileAt(address uint32) (DebugFile, bool) + func (info DebugInfo) FunctionAt(address uint32) (DebugSymbol, bool) + func (info DebugInfo) LineAt(address uint32) (DebugLine, bool) + type DebugLine struct + Address uint32 + Line int32 + type DebugState struct + Automaton int16 + ID int16 + Name string + type DebugSymbol struct + Address uint32 + Class uint8 + CodeEnd uint32 + CodeStart uint32 + Dimensions []DebugDimension + Ident uint8 + Name string + Tag int16 + type DebugTag struct + ID int16 + Name string + type Info struct + AMXVersion uint8 + CodeSize int + DataSize int + DefinitionSize uint16 + FileVersion uint8 + Flags uint16 + HasMain bool + Name string + NameLength int + StackHeapSize int + type Instruction struct + Offset int32 + Opcode Opcode + Params []Cell + Size int + type Library struct + Index int + Name string + type MemoryInfo struct + CodeBytes int + DataBytes int + StackHeapBytes int + type Native struct + Index int + Name string + Registered bool + type NativeContext interface + CallPublic func(name string, args ...Cell) (Cell, error) + ReadBytes func(addr Cell, size int) ([]byte, error) + ReadCell func(addr Cell) (Cell, error) + ReadString func(addr Cell) (string, error) + WriteBytes func(addr Cell, value []byte) error + WriteCell func(addr Cell, value Cell) error + WriteString func(addr Cell, value string) error + type NativeFunc func(ctx NativeContext, params []Cell) (Cell, error) + type Opcode = vm.Opcode + const OP_ADD + const OP_ADDR_ALT + const OP_ADDR_PRI + const OP_ADD_C + const OP_ALIGN_ALT + const OP_ALIGN_PRI + const OP_AND + const OP_BOUNDS + const OP_BREAK + const OP_CALL + const OP_CALL_PRI + const OP_CASETBL + const OP_CMPS + const OP_CONST + const OP_CONST_ALT + const OP_CONST_PRI + const OP_CONST_S + const OP_DEC + const OP_DEC_ALT + const OP_DEC_I + const OP_DEC_PRI + const OP_DEC_S + const OP_EQ + const OP_EQ_C_ALT + const OP_EQ_C_PRI + const OP_FILE + const OP_FILL + const OP_GEQ + const OP_GRTR + const OP_HALT + const OP_HEAP + const OP_IDXADDR + const OP_IDXADDR_B + const OP_INC + const OP_INC_ALT + const OP_INC_I + const OP_INC_PRI + const OP_INC_S + const OP_INVERT + const OP_JEQ + const OP_JGEQ + const OP_JGRTR + const OP_JLEQ + const OP_JLESS + const OP_JNEQ + const OP_JNZ + const OP_JREL + const OP_JSGEQ + const OP_JSGRTR + const OP_JSLEQ + const OP_JSLESS + const OP_JUMP + const OP_JUMP_PRI + const OP_JZER + const OP_LCTRL + const OP_LEQ + const OP_LESS + const OP_LIDX + const OP_LIDX_B + const OP_LINE + const OP_LOAD_ALT + const OP_LOAD_BOTH + const OP_LOAD_I + const OP_LOAD_PRI + const OP_LOAD_S_ALT + const OP_LOAD_S_BOTH + const OP_LOAD_S_PRI + const OP_LODB_I + const OP_LREF_ALT + const OP_LREF_PRI + const OP_LREF_S_ALT + const OP_LREF_S_PRI + const OP_MOVE_ALT + const OP_MOVE_PRI + const OP_MOVS + const OP_NEG + const OP_NEQ + const OP_NONE + const OP_NOP + const OP_NOT + const OP_NUM_OPCODES + const OP_OR + const OP_POP_ALT + const OP_POP_PRI + const OP_PROC + const OP_PUSH + const OP_PUSH2 + const OP_PUSH2_ADR + const OP_PUSH2_C + const OP_PUSH2_S + const OP_PUSH3 + const OP_PUSH3_ADR + const OP_PUSH3_C + const OP_PUSH3_S + const OP_PUSH4 + const OP_PUSH4_ADR + const OP_PUSH4_C + const OP_PUSH4_S + const OP_PUSH5 + const OP_PUSH5_ADR + const OP_PUSH5_C + const OP_PUSH5_S + const OP_PUSH_ADR + const OP_PUSH_ALT + const OP_PUSH_C + const OP_PUSH_PRI + const OP_PUSH_R + const OP_PUSH_S + const OP_RET + const OP_RETN + const OP_SCTRL + const OP_SDIV + const OP_SDIV_ALT + const OP_SGEQ + const OP_SGRTR + const OP_SHL + const OP_SHL_C_ALT + const OP_SHL_C_PRI + const OP_SHR + const OP_SHR_C_ALT + const OP_SHR_C_PRI + const OP_SIGN_ALT + const OP_SIGN_PRI + const OP_SLEQ + const OP_SLESS + const OP_SMUL + const OP_SMUL_C + const OP_SRANGE + const OP_SREF_ALT + const OP_SREF_PRI + const OP_SREF_S_ALT + const OP_SREF_S_PRI + const OP_SSHR + const OP_STACK + const OP_STOR_ALT + const OP_STOR_I + const OP_STOR_PRI + const OP_STOR_S_ALT + const OP_STOR_S_PRI + const OP_STRB_I + const OP_SUB + const OP_SUB_ALT + const OP_SWAP_ALT + const OP_SWAP_PRI + const OP_SWITCH + const OP_SYMBOL + const OP_SYMTAG + const OP_SYSREQ_C + const OP_SYSREQ_N + const OP_SYSREQ_PRI + const OP_UDIV + const OP_UDIV_ALT + const OP_UMUL + const OP_XCHG + const OP_XOR + const OP_ZERO + const OP_ZERO_ALT + const OP_ZERO_PRI + const OP_ZERO_S + type OpcodeInfo struct + CaseTable bool + Name string + ParamCount int + func OpcodeMetadata(op Opcode) (OpcodeInfo, bool) + type Public struct + Index int + Name string + type PublicVar struct + Address Cell + Index int + Name string + type Runtime struct + func LoadBytes(name string, data []byte) (*Runtime, error) + func LoadFile(path string) (*Runtime, error) + func (r *Runtime) Allot(cells int) (Cell, error) + func (r *Runtime) AllotCells(values []Cell) (Cell, error) + func (r *Runtime) AllotString(value string, packed bool) (Cell, error) + func (r *Runtime) Clone() *Runtime + func (r *Runtime) Close() error + func (r *Runtime) Continue() (Cell, error) + func (r *Runtime) DebugInfo() DebugInfo + func (r *Runtime) Decode() ([]Instruction, error) + func (r *Runtime) ExecMain(args ...Cell) (Cell, error) + func (r *Runtime) ExecPublic(index int, args ...Cell) (Cell, error) + func (r *Runtime) ExecPublicByName(name string, args ...Cell) (Cell, error) + func (r *Runtime) FindNative(name string) (Native, bool) + func (r *Runtime) FindPubVar(name string) (PublicVar, bool) + func (r *Runtime) FindPublic(name string) (Public, bool) + func (r *Runtime) FindTag(id Cell) (Tag, bool) + func (r *Runtime) FindTagByName(name string) (Tag, bool) + func (r *Runtime) Info() Info + func (r *Runtime) Libraries() ([]Library, error) + func (r *Runtime) MemoryInfo() MemoryInfo + func (r *Runtime) Natives() ([]Native, error) + func (r *Runtime) PubVars() ([]PublicVar, error) + func (r *Runtime) Publics() ([]Public, error) + func (r *Runtime) ReadBytes(addr Cell, size int) ([]byte, error) + func (r *Runtime) ReadCell(addr Cell) (Cell, error) + func (r *Runtime) ReadString(addr Cell) (string, error) + func (r *Runtime) RegisterNative(name string, fn NativeFunc) error + func (r *Runtime) RegisterNatives(natives map[string]NativeFunc) error + func (r *Runtime) Release(addr Cell) error + func (r *Runtime) Reset() error + func (r *Runtime) ResetMemory() error + func (r *Runtime) SetDebugHook(hook DebugHook) + func (r *Runtime) SetInstructionLimit(limit int) + func (r *Runtime) SetUserData(tag int64, value any) + func (r *Runtime) Suspended() bool + func (r *Runtime) Tags() ([]Tag, error) + func (r *Runtime) UserData(tag int64) (any, bool) + func (r *Runtime) VM() *vm.VM + func (r *Runtime) WriteBytes(addr Cell, value []byte) error + func (r *Runtime) WriteCell(addr Cell, value Cell) error + func (r *Runtime) WriteString(addr Cell, value string) error + func (r *Runtime) WriteStringN(addr Cell, value string, maxCells int, packed bool) error + type RuntimeError struct + CIP Cell + Code RuntimeErrorCode + Message string + func (e RuntimeError) Error() string + type RuntimeErrorCode string + const RuntimeErrorBounds + const RuntimeErrorDivideByZero + const RuntimeErrorDomain + const RuntimeErrorHalt + const RuntimeErrorSleep + type State struct + ALT Cell + CIP int + FRM Cell + HEA Cell + PRI Cell + STK Cell + STP Cell + type Tag struct + ID Cell + Index int + Name string