mirror of
https://github.com/irmen/prog8.git
synced 2024-12-22 18:30:01 +00:00
fix ast source gen for romsub
This commit is contained in:
parent
9f84aa5fb2
commit
178e60bba0
@ -1716,7 +1716,7 @@ class IRCodeGen(
|
||||
)
|
||||
irBlock += IRAsmSubroutine(
|
||||
child.name,
|
||||
child.address,
|
||||
null,
|
||||
child.clobbers,
|
||||
child.parameters.map { IRAsmSubroutine.IRAsmParam(it.first, it.second.type) }, // note: the name of the asmsub param is not used here anymore
|
||||
child.returns.map { IRAsmSubroutine.IRAsmParam(it.first, it.second)},
|
||||
|
@ -180,7 +180,11 @@ class AstToSourceTextConverter(val output: (text: String) -> Unit, val program:
|
||||
if(subroutine.inline)
|
||||
output("inline ")
|
||||
if(subroutine.isAsmSubroutine) {
|
||||
output("asmsub ${subroutine.name} (")
|
||||
if(subroutine.asmAddress!=null) {
|
||||
output("romsub ${subroutine.asmAddress.toHex()} = ${subroutine.name} (")
|
||||
}
|
||||
else
|
||||
output("asmsub ${subroutine.name} (")
|
||||
for(param in subroutine.parameters.zip(subroutine.asmParameterRegisters)) {
|
||||
val reg =
|
||||
when {
|
||||
@ -227,9 +231,7 @@ class AstToSourceTextConverter(val output: (text: String) -> Unit, val program:
|
||||
output("-> $rts ")
|
||||
}
|
||||
}
|
||||
if(subroutine.asmAddress!=null)
|
||||
outputln("= ${subroutine.asmAddress.toHex()}")
|
||||
else {
|
||||
if (subroutine.asmAddress == null) {
|
||||
outputln("{ ")
|
||||
scopelevel++
|
||||
outputStatements(subroutine.statements.filter { it !is VarDecl || it.origin!=VarDeclOrigin.SUBROUTINEPARAM})
|
||||
|
Loading…
Reference in New Issue
Block a user