mirror of
https://github.com/irmen/prog8.git
synced 2024-11-20 03:32:05 +00:00
fix pop() name scoping
This commit is contained in:
parent
064d412ec8
commit
e1c77ce236
@ -2874,7 +2874,7 @@ $repeatLabel lda $counterVar
|
||||
}
|
||||
}
|
||||
} else {
|
||||
val tgt = AsmAssignTarget(TargetStorageKind.VARIABLE, program, this, target.datatype, scope, variableAsmName = asmVariableName(target.name))
|
||||
val tgt = AsmAssignTarget(TargetStorageKind.VARIABLE, program, this, target.datatype, scope, variableAsmName = asmVariableName(target.scopedName))
|
||||
if (dt in ByteDatatypes) {
|
||||
out(" pla")
|
||||
assignRegister(RegisterOrPair.A, tgt)
|
||||
|
@ -2,13 +2,30 @@ package prog8tests
|
||||
|
||||
import io.kotest.core.spec.style.FunSpec
|
||||
import io.kotest.matchers.shouldBe
|
||||
import io.kotest.matchers.shouldNotBe
|
||||
import prog8.code.core.DataType
|
||||
import prog8.code.core.NumericDatatypes
|
||||
import prog8.code.core.RegisterOrPair
|
||||
import prog8.code.target.C64Target
|
||||
import prog8.code.target.Cx16Target
|
||||
import prog8.compiler.BuiltinFunctions
|
||||
import prog8tests.helpers.compileText
|
||||
|
||||
class TestBuiltinFunctions: FunSpec({
|
||||
|
||||
test("push pop") {
|
||||
val src="""
|
||||
main {
|
||||
sub start () {
|
||||
pushw(cx16.r0)
|
||||
push(cx16.r1L)
|
||||
pop(cx16.r1L)
|
||||
popw(cx16.r0)
|
||||
}
|
||||
}"""
|
||||
compileText(Cx16Target(), false, src, writeAssembly = true) shouldNotBe null
|
||||
}
|
||||
|
||||
test("pure func with fixed type") {
|
||||
val func = BuiltinFunctions.getValue("sgn")
|
||||
func.name shouldBe "sgn"
|
||||
|
@ -3,7 +3,6 @@ TODO
|
||||
|
||||
For next release
|
||||
^^^^^^^^^^^^^^^^
|
||||
- fix push() pop() of vera registers
|
||||
- if passing a subroutine or label name as an uword argument, without &, add the addressof automatically
|
||||
- convert the sounds in cx16 tehtriz to use the psg module instead
|
||||
- notify petaxian that it could use the psg module too?
|
||||
|
Loading…
Reference in New Issue
Block a user