fix superfluous usage of addressOf()

This commit is contained in:
Irmen de Jong
2022-09-15 23:08:41 +02:00
parent 7294ec9a3c
commit 0e831d4b92
13 changed files with 211 additions and 193 deletions
@@ -48,10 +48,12 @@ 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 ->
// need to replace &X by address of X. TODO: this actually needs to be done by the vm assembler/loader. Then this can be omitted
val name = matchResult.value.substring(1, matchResult.value.length).split('.')
allocations.get(name).toString() }
// TODO do we have to replace variable names by their allocated address???
val asm = line.assembly
// val asm = line.assembly.replace("""&[a-zA-Z\d_\.]+""".toRegex()) { matchResult ->
// // need to replace &X by address of X. TODO: this actually needs to be done by the vm assembler/loader. Then this can be omitted
// val name = matchResult.value.substring(1, matchResult.value.length).split('.')
// allocations.get(name).toString() }
write(asm+"\n")
}
is VmCodeInlineBinary -> {