mirror of
https://github.com/irmen/prog8.git
synced 2024-09-07 03:54:27 +00:00
complex memory assignment also tries to avoid estack evaluation (but not done yet)
This commit is contained in:
parent
1d2d217b94
commit
37a46aa2cf
@ -876,6 +876,7 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
|||||||
}
|
}
|
||||||
DataType.FLOAT -> {
|
DataType.FLOAT -> {
|
||||||
// via evaluation stack
|
// via evaluation stack
|
||||||
|
// TODO use 2 temporary variables instead
|
||||||
asmgen.translateExpression(first)
|
asmgen.translateExpression(first)
|
||||||
asmgen.translateExpression(second)
|
asmgen.translateExpression(second)
|
||||||
val assignFirst = AsmAssignment(
|
val assignFirst = AsmAssignment(
|
||||||
|
@ -181,8 +181,8 @@ internal class AugmentableAssignmentAsmGen(private val program: Program,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
// TODO OTHER EVALUATION HERE
|
// TODO OTHER EVALUATION HERE, don't use the estack
|
||||||
asmgen.translateExpression(memory.addressExpression)
|
asmgen.assignExpressionTo(memory.addressExpression, AsmAssignTarget(TargetStorageKind.STACK, program, asmgen, DataType.UWORD, memory.definingSubroutine))
|
||||||
asmgen.out(" jsr prog8_lib.read_byte_from_address_on_stack | sta P8ZP_SCRATCH_B1") // TODO don't use estack to transfer the address to read from
|
asmgen.out(" jsr prog8_lib.read_byte_from_address_on_stack | sta P8ZP_SCRATCH_B1") // TODO don't use estack to transfer the address to read from
|
||||||
when {
|
when {
|
||||||
valueLv != null -> inplaceModification_byte_litval_to_variable("P8ZP_SCRATCH_B1", DataType.UBYTE, operator, valueLv.toInt())
|
valueLv != null -> inplaceModification_byte_litval_to_variable("P8ZP_SCRATCH_B1", DataType.UBYTE, operator, valueLv.toInt())
|
||||||
|
@ -4,10 +4,12 @@
|
|||||||
main {
|
main {
|
||||||
sub start() {
|
sub start() {
|
||||||
uword xx=$2000
|
uword xx=$2000
|
||||||
ubyte yy=30
|
ubyte yy=$30
|
||||||
ubyte zz=9
|
ubyte zz=9
|
||||||
; sys.memset(xx+200, yy*2, zz+yy)
|
; sys.memset(xx+200, yy*2, zz+yy)
|
||||||
|
|
||||||
@($d020) = (xx+(yy*zz)) as ubyte
|
@($c030) = 10
|
||||||
|
@($c000+yy) *= 2
|
||||||
|
txt.print_ub(@($c030))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user