1
0
mirror of https://github.com/zellyn/go6502.git synced 2024-11-19 03:04:46 +00:00
go6502/asm/flavors/merlin/merlin.go
2014-05-01 08:23:26 -07:00

35 lines
737 B
Go
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package merlin
import (
"errors"
"github.com/zellyn/go6502/asm/context"
"github.com/zellyn/go6502/asm/inst"
"github.com/zellyn/go6502/asm/lines"
)
// Merlin implements the Merlin-compatible assembler flavor.
// See http://en.wikipedia.org/wiki/Merlin_(assembler) and
// http://www.apple-iigs.info/doc/fichiers/merlin816.pdf
type Merlin struct {
context.SimpleContext
}
func New() *Merlin {
return &Merlin{}
}
// Parse an entire instruction, or return an appropriate error.
func (a *Merlin) ParseInstr(line lines.Line) (inst.I, error) {
return inst.I{}, nil
}
func (a *Merlin) Zero() (uint16, error) {
return 0, errors.New("Division by zero.")
}
func (a *Merlin) DefaultOrigin() (uint16, error) {
return 0x8000, nil
}