mirror of
https://github.com/irmen/prog8.git
synced 2024-12-27 20:33:39 +00:00
work
This commit is contained in:
parent
f1193bb5a0
commit
5075901830
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user