1
0
mirror of https://github.com/zellyn/go6502.git synced 2024-06-24 15:29:40 +00:00

working on assembling applesoft

This commit is contained in:
Zellyn Hunter 2014-05-15 16:56:39 -07:00
parent 47de551af3
commit f2bf37843b
3 changed files with 3 additions and 2 deletions

View File

@ -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:

View File

@ -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
}

View File

@ -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: