opcode

package
v1.7.0-dev-20191004 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 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 PackAPIIndexFunctionID added in v1.2.0

func PackAPIIndexFunctionID(index uint8, id uint16) uint32

PackAPIIndexFunctionID packs the API index and the function ID together.

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

func (Add) String added in v1.2.0

func (c Add) String() string

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

func (Call) String added in v1.2.0

func (c Call) String() string

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

func (Clone) String added in v1.2.0

func (c Clone) String() string

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

func (Copy) String added in v1.2.0

func (c Copy) String() string

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

func (Extend) String added in v1.2.0

func (c Extend) String() string

type JumpLabel added in v1.6.0

type JumpLabel struct {
	Label uint32 // 26 bit jump label.
}

JumpLabel represents the JumpLabel virtual machine opcode.

func (JumpLabel) Encode added in v1.6.0

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

func (JumpLabel) String added in v1.6.0

func (c JumpLabel) String() string

type JumpNZ added in v1.6.0

type JumpNZ struct {
	Label uint32 // 26 bit jump label.
}

JumpNZ represents the JumpNZ virtual machine opcode.

func (JumpNZ) Encode added in v1.6.0

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

func (JumpNZ) String added in v1.6.0

func (c JumpNZ) String() string

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

func (Label) String added in v1.2.0

func (c Label) String() string

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

func (Load) String added in v1.2.0

func (c Load) String() string

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

func (LoadC) String added in v1.2.0

func (c LoadC) String() string

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

func (LoadV) String added in v1.2.0

func (c LoadV) String() string

type Notification added in v1.6.0

type Notification struct{}

Notification represents the NOTIFICATION virtual machine opcode.

func (Notification) Encode added in v1.6.0

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

func (Notification) String added in v1.6.0

func (c Notification) String() string

type Opcode added in v1.2.0

type Opcode interface {
	// contains filtered or unexported methods
}

Opcode represents a single opcode used by GAPIR.

func Decode

func Decode(r binary.Reader) (Opcode, error)

Decode returns the opcode decoded from decoder d.

func Disassemble

func Disassemble(r io.Reader, byteOrder device.Endian) ([]Opcode, error)

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

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

func (Pop) String added in v1.2.0

func (c Pop) String() string

type Post

type Post struct{}

Post represents the POST virtual machine opcode.

func (Post) Encode

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

func (Post) String added in v1.2.0

func (c Post) String() string

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

func (PushI) String added in v1.2.0

func (c PushI) String() string

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

func (Resource) String added in v1.2.0

func (c Resource) String() string

type Store

type Store struct{}

Store represents the STORE virtual machine opcode.

func (Store) Encode

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

func (Store) String added in v1.2.0

func (c Store) String() string

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

func (StoreV) String added in v1.2.0

func (c StoreV) String() string

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

func (Strcpy) String added in v1.2.0

func (c Strcpy) String() string

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

func (SwitchThread) String added in v1.2.0

func (c SwitchThread) String() string

Jump to

Keyboard shortcuts

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