mirror of
https://github.com/irmen/prog8.git
synced 2024-12-24 16:29:21 +00:00
fix asmgen for call $3000
This commit is contained in:
parent
1679ca79b4
commit
697d54e10a
@ -74,12 +74,14 @@ class AsmGen6502(val prefixSymbols: Boolean, private val lastGeneratedLabelSeque
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
is PtJump -> {
|
is PtJump -> {
|
||||||
|
if(node.address==null) {
|
||||||
val stNode = st.lookup(node.identifier!!.name) ?: throw AssemblyError("name not found ${node.identifier}")
|
val stNode = st.lookup(node.identifier!!.name) ?: throw AssemblyError("name not found ${node.identifier}")
|
||||||
if(stNode.astNode.definingBlock()?.options?.noSymbolPrefixing!=true) {
|
if (stNode.astNode.definingBlock()?.options?.noSymbolPrefixing != true) {
|
||||||
val index = node.parent.children.indexOf(node)
|
val index = node.parent.children.indexOf(node)
|
||||||
nodesToPrefix += node.parent to index
|
nodesToPrefix += node.parent to index
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
is PtBlock -> prefixNamedNode(node)
|
is PtBlock -> prefixNamedNode(node)
|
||||||
is PtConstant -> prefixNamedNode(node)
|
is PtConstant -> prefixNamedNode(node)
|
||||||
is PtLabel -> prefixNamedNode(node)
|
is PtLabel -> prefixNamedNode(node)
|
||||||
|
@ -364,7 +364,7 @@ class TestScoping: FunSpec({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
compileText(C64Target(), false, text, writeAssembly = false) shouldNotBe null
|
compileText(C64Target(), false, text, writeAssembly = true) shouldNotBe null
|
||||||
}
|
}
|
||||||
|
|
||||||
test("various wrong goto targets") {
|
test("various wrong goto targets") {
|
||||||
|
@ -1001,7 +1001,7 @@ Normally, every subroutine parameter will get its own local variable in the subr
|
|||||||
will be stored when the subroutine is called. In certain situations, this may lead to many variables being allocated.
|
will be stored when the subroutine is called. In certain situations, this may lead to many variables being allocated.
|
||||||
You *can* instruct the compiler to not allocate a new variable, but instead to reuse one of the *virtual registers* R0-R15
|
You *can* instruct the compiler to not allocate a new variable, but instead to reuse one of the *virtual registers* R0-R15
|
||||||
(accessible in the code as ``cx16.r0`` - ``cx16.r15``) for the parameter. This is done by adding a ``@Rx`` tag
|
(accessible in the code as ``cx16.r0`` - ``cx16.r15``) for the parameter. This is done by adding a ``@Rx`` tag
|
||||||
to the parameter. This can only be done for byte and word types.
|
to the parameter. This can only be done for booleans, byte, and word types.
|
||||||
Note: the R0-R15 *virtual registers* are described in more detail below for the Assembly subroutines.
|
Note: the R0-R15 *virtual registers* are described in more detail below for the Assembly subroutines.
|
||||||
Here's an example that reuses the R0 and the R1L (lower byte of R1) virtual registers for the paremeters::
|
Here's an example that reuses the R0 and the R1L (lower byte of R1) virtual registers for the paremeters::
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user