mirror of
https://github.com/irmen/prog8.git
synced 2026-04-19 20:16:51 +00:00
working on address-of
This commit is contained in:
@@ -49,7 +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
|
||||
// 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")
|
||||
|
||||
Reference in New Issue
Block a user