1
0
mirror of https://github.com/zellyn/go6502.git synced 2024-11-05 07:04:41 +00:00
go6502/asm/flavors/as65/as65.go
2014-08-19 08:22:34 -07:00

50 lines
1014 B
Go

package as65
import (
"errors"
"github.com/zellyn/go6502/asm/context"
"github.com/zellyn/go6502/asm/inst"
"github.com/zellyn/go6502/asm/lines"
)
// AS65 implements the AS65-compatible assembler flavor.
// See http://www.kingswood-consulting.co.uk/assemblers/
type AS65 struct {
context.SimpleContext
}
func New() *AS65 {
return &AS65{}
}
// Parse an entire instruction, or return an appropriate error.
func (a *AS65) ParseInstr(line lines.Line, quick bool) (inst.I, error) {
return inst.I{}, nil
}
func (a *AS65) Zero() (uint16, error) {
return 0, errors.New("Division by zero.")
}
func (a *AS65) DefaultOrigin() uint16 {
return 0
}
func (a *AS65) ReplaceMacroArgs(line string, args []string, kwargs map[string]string) (string, error) {
panic("AS65.ReplaceMacroArgs not implemented yet.")
}
func (a *AS65) IsNewParentLabel(label string) bool {
return label != "" && label[0] != '.'
}
func (a *AS65) LocalMacroLabels() bool {
return false
}
func (a *AS65) String() string {
return "as65"
}