bytecode_values

package
v0.0.0-...-d96f53a Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int

func Int(n uint8) int

func Uint8

func Uint8(n int8) uint8

Types

type Inst

type Inst struct {
	Op            Op
	Dst, Lhs, Rhs uint8
}

func Inst16

func Inst16(op Op, dst uint8, src int16) Inst

func (Inst) Src

func (i Inst) Src() int

type Op

type Op uint8

type Prog

type Prog struct {
	IP    int
	Code  []Inst
	Vars  []r.Value
	Outer *Prog
}

func BytecodeSum

func BytecodeSum(N int) *Prog
  bytecode version of:

	func sum(n int) int {
		total := 0
		for i := 1; i <= n; i++ {
			total += i
		}
		return total
	}

func (*Prog) Exec

func (p *Prog) Exec(IP int) []r.Value

Jump to

Keyboard shortcuts

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