mirror of
https://github.com/irmen/prog8.git
synced 2025-01-12 19:29:50 +00:00
fixed some compiler errors
This commit is contained in:
parent
0f91ce6441
commit
309c82fc9e
@ -376,6 +376,8 @@ internal class AstChecker(private val program: Program,
|
||||
}
|
||||
|
||||
override fun visit(assignTarget: AssignTarget) {
|
||||
super.visit(assignTarget)
|
||||
|
||||
val memAddr = assignTarget.memoryAddress?.addressExpression?.constValue(program)?.number?.toInt()
|
||||
if (memAddr != null) {
|
||||
if (memAddr < 0 || memAddr >= 65536)
|
||||
|
@ -172,8 +172,6 @@ interface IAstModifyingVisitor {
|
||||
val ident = arrayIndexedExpression.identifier.accept(this)
|
||||
if(ident is IdentifierReference)
|
||||
arrayIndexedExpression.identifier = ident
|
||||
else
|
||||
throw FatalAstException("can't change class of indexed identifier")
|
||||
arrayIndexedExpression.arrayspec.accept(this)
|
||||
return arrayIndexedExpression
|
||||
}
|
||||
|
@ -1436,7 +1436,12 @@ $endLabel""")
|
||||
if(incr)
|
||||
out(" inc $what | bne + | inc $what+1 |+")
|
||||
else
|
||||
out(" lda $what | bne + | dec $what+1 |+ | dec $what")
|
||||
out("""
|
||||
lda $what
|
||||
bne +
|
||||
dec $what+1
|
||||
+ dec $what
|
||||
""")
|
||||
}
|
||||
DataType.FLOAT -> {
|
||||
out(" lda #<$what | ldy #>$what")
|
||||
|
@ -46,7 +46,7 @@ internal class BuiltinFunctionsAsmGen(private val program: Program,
|
||||
if(arg is NumericLiteralValue)
|
||||
throw AssemblyError("should have been const-folded")
|
||||
if(arg is IdentifierReference) {
|
||||
val sourceName = arg.nameInSource.joinToString(".")
|
||||
val sourceName = asmgen.asmIdentifierName(arg)
|
||||
asmgen.out(" lda $sourceName+1 | sta $ESTACK_LO_HEX,x | dex")
|
||||
} else {
|
||||
asmgen.translateExpression(arg)
|
||||
|
@ -234,8 +234,6 @@ class ConstantFolding(private val program: Program) : IAstModifyingVisitor {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw FatalAstException("can't find function ${functionCall.target}")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ main {
|
||||
Y=100
|
||||
Y++
|
||||
check_ub(Y, 101)
|
||||
check_fl(fl, 100.99) ; @todo CLOBBERS OTHER VARS
|
||||
check_fl(fl, 100.99)
|
||||
check_b(bb, -99)
|
||||
check_uw(uw, 2001)
|
||||
check_w(ww, -999)
|
||||
@ -40,13 +40,12 @@ main {
|
||||
Y=100
|
||||
Y--
|
||||
check_ub(Y, 99)
|
||||
check_fl(fl, 99.99) ; @todo CLOBBERS OTHER VARS
|
||||
check_fl(fl, 99.99)
|
||||
check_b(bb, -100)
|
||||
check_uw(uw, 2000)
|
||||
check_w(ww, -1000)
|
||||
|
||||
@($0400+39) = X
|
||||
;c64.Screen[39] = X ; @todo compiler error
|
||||
}
|
||||
|
||||
sub check_ub(ubyte value, ubyte expected) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user