opcode

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2017 License: Apache-2.0 Imports: 6 Imported by: 14

Documentation

Overview

Package opcode holds all the opcodes that are to be interpreted by the replay virtual machine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r binary.Reader) (interface{}, error)

Decode returns the opcode decoded from decoder d.

func Disassemble

func Disassemble(r io.Reader, byteOrder device.Endian) ([]interface{}, error)

Disassemble disassembles and returns the stream of encoded Opcodes from r, stopping once an EOF is reached.

Types

type Add

type Add struct {
	Count uint32 // Number of top value stack elements to pop and sum.
}

Add represents the ADD virtual machine opcode.

func (Add) Encode

func (c Add) Encode(w binary.Writer) error

type Call

type Call struct {
	PushReturn bool   // Should the return value be pushed onto the stack?
	ApiIndex   uint8  // The index of the API this call belongs to.
	FunctionID uint16 // The function identifier to call.
}

Call represents the CALL virtual machine opcode.

func (Call) Encode

func (c Call) Encode(w binary.Writer) error

type Clone

type Clone struct {
	Index uint32 // Index of element from top of stack to clone.
}

Clone represents the CLONE virtual machine opcode.

func (Clone) Encode

func (c Clone) Encode(w binary.Writer) error

type Copy

type Copy struct {
	Count uint32 // Number of bytes to copy.
}

Copy represents the COPY virtual machine opcode.

func (Copy) Encode

func (c Copy) Encode(w binary.Writer) error

type Extend

type Extend struct {
	Value uint32 // 26 bit value to extend the top of the stack by.
}

Extend represents the EXTEND virtual machine opcode.

func (Extend) Encode

func (c Extend) Encode(w binary.Writer) error

type Label

type Label struct {
	Value uint32 // 26 bit label name.
}

Label represents the LABEL virtual machine opcode.

func (Label) Encode

func (c Label) Encode(w binary.Writer) error

type Load

type Load struct {
	DataType protocol.Type // The value types to load.
}

Load represents the LOAD virtual machine opcode.

func (Load) Encode

func (c Load) Encode(w binary.Writer) error

type LoadC

type LoadC struct {
	DataType protocol.Type // The value type to load.
	Address  uint32        // The pointer to the value in constant address-space.
}

LoadC represents the LOAD_C virtual machine opcode.

func (LoadC) Encode

func (c LoadC) Encode(w binary.Writer) error

type LoadV

type LoadV struct {
	DataType protocol.Type // The value type to load.
	Address  uint32        // The pointer to the value in volatile address-space.
}

LoadV represents the LOAD_V virtual machine opcode.

func (LoadV) Encode

func (c LoadV) Encode(w binary.Writer) error

type Pop

type Pop struct {
	Count uint32 // Number of elements to pop from the top of the stack.
}

Pop represents the POP virtual machine opcode.

func (Pop) Encode

func (c Pop) Encode(w binary.Writer) error

type Post

type Post struct{}

Post represents the POST virtual machine opcode.

func (Post) Encode

func (c Post) Encode(w binary.Writer) error

type PushI

type PushI struct {
	DataType protocol.Type // The value type to push.
	Value    uint32        // The value to push packed into the low 20 bits.
}

PushI represents the PUSH_I virtual machine opcode.

func (PushI) Encode

func (c PushI) Encode(w binary.Writer) error

type Resource

type Resource struct {
	ID uint32 // The index of the resource identifier.
}

Resource represents the RESOURCE virtual machine opcode.

func (Resource) Encode

func (c Resource) Encode(w binary.Writer) error

type Store

type Store struct{}

Store represents the STORE virtual machine opcode.

func (Store) Encode

func (c Store) Encode(w binary.Writer) error

type StoreV

type StoreV struct {
	Address uint32 // Pointer in volatile address-space.
}

StoreV represents the STORE_V virtual machine opcode.

func (StoreV) Encode

func (c StoreV) Encode(w binary.Writer) error

type Strcpy

type Strcpy struct {
	MaxSize uint32 // Maximum size in bytes to copy.
}

Strcpy represents the STRCPY virtual machine opcode.

func (Strcpy) Encode

func (c Strcpy) Encode(w binary.Writer) error

type SwitchThread added in v0.5.0

type SwitchThread struct {
	Index uint32 // 26 bit thread index.
}

SwitchThread represents the SwitchThread virtual machine opcode.

func (SwitchThread) Encode added in v0.5.0

func (c SwitchThread) Encode(w binary.Writer) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL