move the program startup and cleanup machinery to the front of the program to keep it in system ram

This commit is contained in:
Irmen de Jong
2024-11-05 22:12:25 +01:00
parent a5c7393561
commit 491e5dbcfb
9 changed files with 38 additions and 33 deletions

View File

@@ -46,8 +46,7 @@ class TestScoping: FunSpec({
"""
val result = compileText(C64Target(), false, src, writeAssembly = false)!!
val module = result.compilerAst.toplevelModule
val mainBlock = module.statements.single() as Block
val mainBlock = result.compilerAst.entrypoint.definingBlock
val start = mainBlock.statements.single() as Subroutine
val repeatbody = start.statements.filterIsInstance<RepeatLoop>().single().body
withClue("no vars moved to main block") {
@@ -120,8 +119,7 @@ class TestScoping: FunSpec({
"""
val result = compileText(C64Target(), false, src, writeAssembly = true)!!
val module = result.compilerAst.toplevelModule
val mainBlock = module.statements.single() as Block
val mainBlock = result.compilerAst.entrypoint.definingBlock
val start = mainBlock.statements.single() as Subroutine
val labels = start.statements.filterIsInstance<Label>()
withClue("only one label in subroutine scope") {