mirror of
https://github.com/irmen/prog8.git
synced 2024-12-28 12:32:34 +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 -> {
|
||||
// via evaluation stack
|
||||
// TODO use 2 temporary variables instead
|
||||
asmgen.translateExpression(first)
|
||||
asmgen.translateExpression(second)
|
||||
val assignFirst = AsmAssignment(
|
||||
|
@ -181,8 +181,8 @@ internal class AugmentableAssignmentAsmGen(private val program: Program,
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
// TODO OTHER EVALUATION HERE
|
||||
asmgen.translateExpression(memory.addressExpression)
|
||||
// TODO OTHER EVALUATION HERE, don't use the estack
|
||||
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
|
||||
when {
|
||||
valueLv != null -> inplaceModification_byte_litval_to_variable("P8ZP_SCRATCH_B1", DataType.UBYTE, operator, valueLv.toInt())
|
||||
|
@ -4,10 +4,12 @@
|
||||
main {
|
||||
sub start() {
|
||||
uword xx=$2000
|
||||
ubyte yy=30
|
||||
ubyte yy=$30
|
||||
ubyte zz=9
|
||||
; 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