mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2025-02-08 14:30:34 +00:00
wrap with rts
This commit is contained in:
parent
72c3aa4292
commit
dc6d521c68
@ -14,6 +14,8 @@ trait AsmSyntax {
|
|||||||
|
|
||||||
f(ctx)
|
f(ctx)
|
||||||
|
|
||||||
|
ctx.push(RTS)
|
||||||
|
|
||||||
Subroutine(s, ctx.toFragment, ctx.getJumps)
|
Subroutine(s, ctx.toFragment, ctx.getJumps)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,9 +67,20 @@ class Easy6502Spec extends AnyFlatSpec with should.Matchers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
"snake" should "compile" in {
|
"snake" should "compile" in {
|
||||||
|
val initSnake =
|
||||||
|
sub("initSnake") { implicit a =>
|
||||||
|
registers.X.incr
|
||||||
|
}
|
||||||
|
|
||||||
|
val generateApplePosition =
|
||||||
|
sub("generateApplePosition") { implicit a =>
|
||||||
|
registers.X.incr
|
||||||
|
}
|
||||||
|
|
||||||
val init =
|
val init =
|
||||||
sub("init") { implicit a =>
|
sub("init") { implicit a =>
|
||||||
registers.X.incr
|
jump(initSnake)
|
||||||
|
jump(generateApplePosition)
|
||||||
}
|
}
|
||||||
|
|
||||||
val readKeys =
|
val readKeys =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user