fixup for memoryslabs

This commit is contained in:
Irmen de Jong
2022-08-21 19:57:52 +02:00
parent 80b630a1e4
commit a182b13e5a
5 changed files with 69 additions and 23 deletions
@@ -49,6 +49,7 @@ class AssemblyProgram(override val name: String, private val allocations: Variab
is VmCodeLabel -> write("_" + line.name.joinToString(".") + ":\n")
is VmCodeInlineAsm -> {
val asm = line.assembly.replace("""\{[a-zA-Z\d_\.]+\}""".toRegex()) { matchResult ->
// "{ X }" -> address of X
val name = matchResult.value.substring(1, matchResult.value.length-1).split('.')
allocations.get(name).toString() }
write(asm+"\n")