wrap with rts

This commit is contained in:
Mark Canlas 2020-08-21 05:06:09 -04:00
parent 72c3aa4292
commit dc6d521c68
2 changed files with 14 additions and 1 deletions

View File

@ -14,6 +14,8 @@ trait AsmSyntax {
f(ctx)
ctx.push(RTS)
Subroutine(s, ctx.toFragment, ctx.getJumps)
}

View File

@ -67,9 +67,20 @@ class Easy6502Spec extends AnyFlatSpec with should.Matchers {
}
"snake" should "compile" in {
val initSnake =
sub("initSnake") { implicit a =>
registers.X.incr
}
val generateApplePosition =
sub("generateApplePosition") { implicit a =>
registers.X.incr
}
val init =
sub("init") { implicit a =>
registers.X.incr
jump(initSnake)
jump(generateApplePosition)
}
val readKeys =