assembunny

package
v0.0.0-...-07010e4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CbResult

type CbResult string
const (
	CbProceed CbResult = "proceed"
	CbQuit    CbResult = "quit"
)

type Computer

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

func NewComputer

func NewComputer(regs []string) *Computer

func (*Computer) DecReg

func (c *Computer) DecReg(reg string)

func (*Computer) Execute

func (c *Computer) Execute(iss []Instruction, outFnc func(out int) CbResult)

func (*Computer) IncReg

func (c *Computer) IncReg(reg string)

func (*Computer) SetReg

func (c *Computer) SetReg(reg string, value int)

func (*Computer) ValueOf

func (c *Computer) ValueOf(reg string) int

type Cpy

type Cpy struct {
	Src string
	Dst string
}

type Dec

type Dec struct {
	Reg string
}

type Inc

type Inc struct {
	Reg string
}

type Instruction

type Instruction interface{}

func ParseInstruction

func ParseInstruction(s string) (Instruction, error)

func ParseInstructions

func ParseInstructions(in string) ([]Instruction, error)

type Jnz

type Jnz struct {
	Cond  string
	Steps string
}

type Out

type Out struct {
	Src string
}

type Register

type Register struct {
	ID    string
	Value int
}

type Tgl

type Tgl struct {
	Dst string
}

Jump to

Keyboard shortcuts

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