bytecode

package
v0.0.0-...-f3cf089 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Nop = iota

	PushConst
	PopConst

	IAdd // Integer add
	ISub // Integer sub
	IMul // Integer mul
	IDiv // Integer div

	Halt
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytecode

type Bytecode struct {
	// contains filtered or unexported fields
}

func NewBytecode

func NewBytecode() *Bytecode

func (*Bytecode) AddIntegerConst

func (b *Bytecode) AddIntegerConst(value uint64) int

func (*Bytecode) Emit

func (b *Bytecode) Emit(c byte)

func (*Bytecode) GetBuffer

func (b *Bytecode) GetBuffer() []byte

func (*Bytecode) GetConst

func (b *Bytecode) GetConst(slot int) ConstValue

func (*Bytecode) Read

func (b *Bytecode) Read(address int) byte

type ConstInteger

type ConstInteger struct {
	Value uint64
}

type ConstValue

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

type Opcode

type Opcode byte

Jump to

Keyboard shortcuts

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