mirror of
https://github.com/zellyn/go6502.git
synced 2025-04-10 22:37:08 +00:00
working on assembling applesoft
This commit is contained in:
parent
47de551af3
commit
f2bf37843b
@ -78,7 +78,6 @@ func (a *Assembler) Load(filename string) error {
|
||||
return in.Errorf(`error calling macro "%s": %v`, m.Name, err)
|
||||
}
|
||||
lineSources = append([]lines.LineSource{subLs}, lineSources...)
|
||||
continue // no need to append
|
||||
case inst.TypeIfdef:
|
||||
if len(in.Exprs) == 0 {
|
||||
panic(fmt.Sprintf("Ifdef got parsed with no expression: %s", line))
|
||||
@ -106,7 +105,6 @@ func (a *Assembler) Load(filename string) error {
|
||||
return in.Errorf("error including file: %v", err)
|
||||
}
|
||||
lineSources = append([]lines.LineSource{subLs}, lineSources...)
|
||||
continue // no need to append
|
||||
case inst.TypeTarget:
|
||||
return in.Errorf("target not (yet) implemented: %s", line)
|
||||
case inst.TypeSegment:
|
||||
|
@ -543,6 +543,7 @@ func (a *SCMA) parseTerm(in inst.I, lp *lines.Parse) (*expr.E, error) {
|
||||
}
|
||||
ex.Op = expr.OpLeaf
|
||||
ex.Val = uint16(c)
|
||||
lp.Consume("'") // optional closing quote
|
||||
lp.Ignore()
|
||||
return top, nil
|
||||
}
|
||||
|
@ -120,6 +120,8 @@ func TestSimpleCommonFunctions(t *testing.T) {
|
||||
{ss, `>SAM AB,$12,"A B","A, B, "" C"`,
|
||||
`{call SAM {"AB", "$12", "A B", "A, B, \" C"}}`, ""},
|
||||
{ss, " LDX #']+$80", "{LDX/imm (lsb (+ $005d $0080))}", "a2dd"},
|
||||
|
||||
{ss, " CMP #';'+1", "{CMP/imm (lsb (+ $003b $0001))}", "c93c"},
|
||||
}
|
||||
|
||||
// TODO(zellyn): Add tests for finalization of four SCMA directives:
|
||||
|
Loading…
x
Reference in New Issue
Block a user