This commit is contained in:
Irmen de Jong 2020-08-22 23:39:27 +02:00
parent f1193bb5a0
commit 5075901830
2 changed files with 32 additions and 6 deletions

View File

@ -12,6 +12,30 @@ import prog8.compiler.target.c64.C64MachineDefinition.ESTACK_LO_HEX
import prog8.compiler.toHex
enum class AsmAssignTargetType {
VARIABLE,
ARRAY,
MEMORY,
REGISTER,
STACK
}
internal sealed class AsmAssignTarget(type: AsmAssignTargetType,
astVariable: IdentifierReference?,
astArray: ArrayIndexedExpression?,
astMemory: DirectMemoryWrite?,
register: RegisterOrPair?,
program: Program
)
{
val constMemoryAddress by lazy { astMemory?.addressExpression.constValue(program) }
val constArrayIndexValue by lazy { astArray?.arrayspec.index
init {
astMemory!!.addressExpression.
}
}
internal class AssignmentAsmGen(private val program: Program, private val asmgen: AsmGen) {
private val augmentableAsmGen = AugmentableAssignmentAsmGen(program, this, asmgen)

View File

@ -7,14 +7,16 @@ main {
sub start() {
ubyte a = 1
ubyte b = 2
ubyte c = 20
ubyte d = 4
&ubyte[256] foo= $c000
ubyte[] array=[1,2,3]
str string = "hello"
a = c % 6
string = 3
array = 5
foo = $c100
c64scr.print_uwhex(foo, 1)
c64scr.print_ub(a)
foo[100]=10
}
}