change syntax of address-of in p8virt code to &X, instead of {X}

This commit is contained in:
Irmen de Jong
2022-09-13 23:28:52 +02:00
parent 7dd14955c1
commit e34bab9585
7 changed files with 34 additions and 35 deletions
@@ -48,9 +48,9 @@ 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 // TODO USE &X instead for address of X????
val name = matchResult.value.substring(1, matchResult.value.length-1).split('.')
val asm = line.assembly.replace("""&[a-zA-Z\d_\.]+""".toRegex()) { matchResult ->
// "&X" -> address of X
val name = matchResult.value.substring(1, matchResult.value.length).split('.')
allocations.get(name).toString() }
write(asm+"\n")
}