assembler

package
v0.0.0-...-c42c46a Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AsterixSymbolToken lexer.TokenIdentifier = lexer.LastStdLiteral + iota
	EqualsSymbolToken
	LeftParenthesis
	RightParenthesis
	CommaToken
	PeriodToken
	LabelToken
	IdentifierToken
	HashToken
	MnemonicToken
	MinusToken
	PlusToken
	DivideSymbolToken
	SemiColonToken
)

Variables

View Source
var KeywordTokens = map[string]lexer.TokenIdentifier{}

KeywordTokens defines keyword to token mappings

View Source
var OperatorTokens = map[string]lexer.TokenIdentifier{}

SymbolTokens defines single delimeter runes to token mappings

Functions

func ReduceBytes

func ReduceBytes(value any, noOfBytes int) any

func ToLittleEndianBytes

func ToLittleEndianBytes[T constraints.Integer](value T) ([]byte, error)

func ValuesToLittleEndianBytes

func ValuesToLittleEndianBytes(operandValues []any) ([]byte, error)

Types

type AddressingMode

type AddressingMode struct {
	AddressingMode cpu.AddressingModeType
	Identifier     string
	Operands       []byte
}

type AssembledData

type AssembledData struct {
	StartAddress uint16
	Data         []byte
}

type Assembler

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

func New

func New(opcodes []*cpu.OpCodeDef) *Assembler

func (*Assembler) Assemble

func (a *Assembler) Assemble(r io.Reader) ([]AssembledData, error)

type AssemblerTokens

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

func NewAssemblerTokens

func NewAssemblerTokens(tokens []*lexer.Token) *AssemblerTokens

func (*AssemblerTokens) Next

func (at *AssemblerTokens) Next() *lexer.Token

func (*AssemblerTokens) Peek

func (at *AssemblerTokens) Peek() *lexer.Token

type Instruction

type Instruction struct {
	Opcode     int
	Definition *cpu.OpCodeDef
}

type ParsedInstruction

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

Jump to

Keyboard shortcuts

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