asm

package
v0.0.0-...-600cb72 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package asm provides assembly generators for the govm.

Index

Constants

View Source
const (
	// No argument given
	ARG_NONE = iota
	// Register argument
	ARG_REGISTER
	// Address argument
	ARG_ADDRESS
	// Immediate argument
	ARG_IMMEDIATE
)

Variables

This section is empty.

Functions

func Assemble

func Assemble(code string) []byte

Assemble generates bytecode from GOVM ASM.

func CleanCode

func CleanCode(code string) []string

CleanCode remove comments, trim lines etc.

func ParseNumber

func ParseNumber(str string) uint16

ParseNumber converts a hex-, octal- or decimal number into a word.

func ParseString

func ParseString(str string) []uint16

ParseString converts a string into a utf-16 encoded slice of words.

Types

type PointerReference

type PointerReference struct {
	Name      string
	Line, Arg int
}

PointerReference represents a assembler reference to a point in memory.

func ParseCommand

func ParseCommand(args []string, line int) ([]uint16, []PointerReference)

ParseCommand parses a specific command and returns a word representation and a slice of pointers.

Jump to

Keyboard shortcuts

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